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] [ENG-7536] Stop app config error repeating #2020

Conversation

radoslawkrzemien
Copy link
Contributor

Why

https://linear.app/expo/issue/ENG-7536/make-app-config-error-on-credentials-command-not-repeat-indefinitely

How

If app config error is thrown it is re-thrown with modified message instead of printing it to the as a "cryptic error" and repeating with 0% chances of success (since the config is incorrect)

Test Plan

Added automated test

Tested manually:
Screenshot 2023-08-25 at 16 54 36

The link from the message leads to the docs:
Screenshot 2023-08-25 at 16 54 57

If app config error is thrown it is re-thrown with modified message instead of printing it to the as a "cryptic error" and repeating with 0% chances of success (since the config is incorrect)

See: https://linear.app/expo/issue/ENG-7536/make-app-config-error-on-credentials-command-not-repeat-indefinitely
@linear
Copy link

linear bot commented Aug 25, 2023

ENG-7536 Make app config error on credentials command not repeat indefinitely

image.png

Can only get out of it with CTRL+C, pressing a key just shows the error again.

Bonus points for linking to something more relevant, like the app.config.js schema docs, instead of saying we thing our error is cryptic :)

@github-actions
Copy link

github-actions bot commented Aug 25, 2023

Size Change: -437 B (0%)

Total Size: 42.2 MB

Filename Size Change
./packages/eas-cli/dist/eas-linux-x64.tar.gz 42.2 MB -437 B (0%)

compressed-size-action

@codecov
Copy link

codecov bot commented Aug 25, 2023

Codecov Report

Merging #2020 (4fae2d7) into main (324dce8) will increase coverage by 0.22%.
The diff coverage is 88.89%.

@@            Coverage Diff             @@
##             main    #2020      +/-   ##
==========================================
+ Coverage   53.32%   53.53%   +0.22%     
==========================================
  Files         508      508              
  Lines       18530    18538       +8     
  Branches     3889     3891       +2     
==========================================
+ Hits         9879     9923      +44     
+ Misses       8632     8596      -36     
  Partials       19       19              
Files Changed Coverage Δ
...edentials/android/actions/BuildCredentialsUtils.ts 86.57% <50.00%> (+0.21%) ⬆️
packages/eas-cli/src/credentials/errors.ts 83.34% <100.00%> (+5.56%) ⬆️
...s/eas-cli/src/credentials/manager/ManageAndroid.ts 41.87% <100.00%> (+19.47%) ⬆️

... and 2 files with indirect coverage changes

Comment on lines 136 to 140
err instanceof Error &&
err.message ===
`Specify "android.package" in ${getProjectConfigDescription(
ctx.projectDir
)} and run this command again.`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any better way to determine if this is this specific error (not relying on a message)? 🤔 Ideally, it would be good to use an error code or sth like this.

What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought about it, I can make a custom error class for that, probably the best option

Replaced generic error with specific message with a custom error class, which allows for not relying on a message to be exactly as expected

See: https://linear.app/expo/issue/ENG-7536/make-app-config-error-on-credentials-command-not-repeat-indefinitely
@radoslawkrzemien
Copy link
Contributor Author

/changelog-entry bug-fix Make app config error not repeat indefinitely

@github-actions
Copy link

✅ Thank you for adding the changelog entry!

@radoslawkrzemien radoslawkrzemien merged commit 9ff47af into main Aug 30, 2023
9 checks passed
@radoslawkrzemien radoslawkrzemien deleted the @radoslawkrzemien/ENG-7536-make-app-config-error-not-repeat branch August 30, 2023 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants