Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[eas-cli] Improve unauthorized error for eas deploy --prod #2968

Merged
merged 2 commits into from
Mar 31, 2025

Conversation

sjchmiela
Copy link
Contributor

@sjchmiela sjchmiela commented Mar 28, 2025

Why

When we move Workflows to scoped token which has at most DEVELOPER permission, type: deploy, prod: true jobs will fail with an ominous

You don't have the required permissions to perform this operation.

This can sometimes happen if you are logged in as incorrect user.
Run eas whoami to check the username you are logged in as.
Run eas login to change the account.

Original error message: Entity not authorized: AppDevDomainNameEntity[00000000-0000-0000-0000-000000000000] (viewer = ScopedAccountActorViewerContext[16d62ef3-a219-47ca-936b-89958f6cb1f8], action = CREATE, ruleIndex = -1)
Request ID: 863a1317-882b-4cab-b8f2-c5f5d63b6f29

How

Special-cased the --prod && AppDevDomainEntity && CREATE && UNAUTHORIZED_ERROR error.

Not sure if we should call out "as an app admin" in the error message. Open to suggestions.

Test Plan

Ran eas deploy --prod as a developer-permission-only user. I've updated message in code since taking the screenshot.

Zrzut ekranu 2025-03-28 o 21 21 02

@sjchmiela sjchmiela added the no changelog PR that doesn't require a changelog entry label Mar 28, 2025
@sjchmiela sjchmiela marked this pull request as ready for review March 28, 2025 20:26
@sjchmiela sjchmiela requested a review from kadikraman March 28, 2025 20:27
Copy link

Subscribed to pull request

File Patterns Mentions
**/* @szdziedzic, @khamilowicz, @radoslawkrzemien

Generated by CodeMention

Copy link

github-actions bot commented Mar 28, 2025

Size Change: +2.05 kB (0%)

Total Size: 53.5 MB

Filename Size Change
./packages/eas-cli/dist/eas-linux-x64.tar.gz 53.5 MB +2.05 kB (0%)

compressed-size-action

Copy link

codecov bot commented Mar 28, 2025

Codecov Report

Attention: Patch coverage is 27.77778% with 13 lines in your changes missing coverage. Please review.

Project coverage is 52.59%. Comparing base (2816b43) to head (b3496a9).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/eas-cli/src/commands/deploy/index.ts 25.00% 12 Missing ⚠️
packages/eas-cli/src/build/utils/url.ts 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2968      +/-   ##
==========================================
- Coverage   52.61%   52.59%   -0.01%     
==========================================
  Files         590      590              
  Lines       23340    23356      +16     
  Branches     4644     4651       +7     
==========================================
+ Hits        12277    12281       +4     
- Misses      11029    11041      +12     
  Partials       34       34              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sjchmiela sjchmiela force-pushed the stanley/improve-eas-deploy-prod-unauthorized branch from bf1bfb8 to 37701ce Compare March 31, 2025 11:42
@sjchmiela sjchmiela force-pushed the stanley/improve-eas-deploy-prod-unauthorized branch from 37701ce to b3496a9 Compare March 31, 2025 11:47
@sjchmiela sjchmiela merged commit b473e72 into main Mar 31, 2025
9 checks passed
@sjchmiela sjchmiela deleted the stanley/improve-eas-deploy-prod-unauthorized branch March 31, 2025 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog PR that doesn't require a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants