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][eas-update] Add rollback disambiguation command #2004

Merged
merged 3 commits into from
Aug 15, 2023

Conversation

wschurman
Copy link
Member

@wschurman wschurman commented Aug 14, 2023

Why

As requested by @jonsamp:

i would love (love!) if this command were the same command as rollback/revert/republish, such that you could “go back” to any state that your app has been in.
the naming is hard because taking the embedded update and making it active again is not the same as re publishing an actual update.

but thinking as a developer (introspecting), i don’t think id care that much. i think id care a lot more that i knew a command that worked in all situations rather than using republish all the time then having it not work when trying to re-publish an embedded update, only to then be confused and thinking “what, why can’t I??”

TLDR:

  • i would love one command to rule them all
  • if we need two commands, then we need a message when trying the wrong commands with the wrong updates, saying to use the correct command (but even typing this out it seems needlessly unpleasant)

And after consulting with people in the CLI sync meeting, we decided that it didn't make sense to try to combine the commands since they contain different sets of flags. But, we decided that there could be the best of both worlds:

  • Keep eas update:republish and eas update:roll-back-to-embedded commands for power users and for non-interactive/json output.
  • Add eas update:rollback command for an interactive disambiguation command that routes to one of the other two based on a prompt.

Closes ENG-9420.

How

Add disambiguation command, ability for republish command to be fully interactive (not need to provide any flags).

Test Plan

$ neas update:rollback --private-key-path keys/private-key.pem
✔ Which type of update would you like to roll back to? › Embedded Update
✔ Which branch would you like to use? › main - current update: "Republish "Initial commit

Generated by create-expo-app 2.0.3." - group: bd8a520c-7299-4e57-9268-350294064474" (1 week ago by wschurman)
✔ Provide an update message: … rb
✔ Channel: main pointed at branch: main
🔒 Signing roll back
✔ Published!

Branch             main
Runtime version    1.0.0
Platform           android, ios
Update group ID    c59d7422-0064-4fee-b14e-259517a223f0
Android update ID  123e05e7-9e84-4c85-ae96-cfff5c7aeb48
iOS update ID      2f4b5d7e-23e4-4692-8d8c-57f4aab26709
Message            rb
Commit             dc02dab7a9b0f31788b7298fd1fdb6f50176276e*
Website link       https://expo.dev/accounts/wschurman/projects/watwathuh/updates/c59d7422-0064-4fee-b14e-259517a223f0

$ neas update:rollback --private-key-path keys/private-key.pem
✔ Which type of update would you like to roll back to? › Published Update
✔ Find update by branch or channel? › Branch
✔ Select branch from which to choose update › main
✔ Load more update groups? › [Aug 03 15:49 by wschurman, runtimeVersion: 1.0.0] Republish "Initial commit

Generated by create-expo-app 2.0.3." - group: bd8a520c-7299-4e57-9268-350294064474
✔ The republished update group will appear only on: all
✔ Provide an update message. … Republish "Republish "Initial commit

Generated by create-expo-app 2.0.3." - group: bd8a520c-7299-4e57-9268-350294064474" - group: f9dd2abc-edf8-49c3-b770-a1fdcd0aacc4
✔ The republished update group will be signed
🔒 Signing republished update group
✔ Republished update group

Branch             main
Runtime version    1.0.0
Platform           android, ios
Update group ID    2b32e277-8f00-4c4a-92b9-80dcbd721eaf
Android update ID  64c8a3d0-1ada-4403-9002-28cf552060a7
iOS update ID      34e9f064-5498-41cc-a7c7-04413311faa2
Message            Republish "Republish "Initial commit

Generated by create-expo-app 2.0.3." - group: bd8a520c-7299-4e57-9268-350294064474" - group: f9dd2abc-edf8-49c3-b770-a1fdcd0aacc4
Website link       https://expo.dev/accounts/wschurman/projects/watwathuh/updates/2b32e277-8f00-4c4a-92b9-80dcbd721eaf

@wschurman wschurman requested review from quinlanj and removed request for EvanBacon August 14, 2023 13:39
@linear
Copy link

linear bot commented Aug 14, 2023

@wschurman
Copy link
Member Author

/changelog-entry new-feature Add rollback disambiguation command

@github-actions
Copy link

github-actions bot commented Aug 14, 2023

Size Change: +1.08 kB (0%)

Total Size: 42.3 MB

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

compressed-size-action

@codecov
Copy link

codecov bot commented Aug 14, 2023

Codecov Report

Merging #2004 (54e9ea4) into main (baf94a2) will decrease coverage by 0.02%.
Report is 2 commits behind head on main.
The diff coverage is 46.94%.

@@            Coverage Diff             @@
##             main    #2004      +/-   ##
==========================================
- Coverage   53.05%   53.02%   -0.02%     
==========================================
  Files         507      508       +1     
  Lines       18405    18445      +40     
  Branches     3857     3869      +12     
==========================================
+ Hits         9763     9779      +16     
- Misses       7948     7971      +23     
- Partials      694      695       +1     
Files Changed Coverage Δ
packages/eas-cli/src/commands/update/republish.ts 72.17% <21.43%> (-6.72%) ⬇️
packages/eas-cli/src/commands/update/rollback.ts 44.45% <44.45%> (ø)
packages/eas-cli/src/update/republish.ts 84.00% <70.59%> (-4.88%) ⬇️

... and 3 files with indirect coverage changes

@wschurman
Copy link
Member Author

Note that there is an existing bug where updates of type "roll back to embedded" can be republished, though that seems incorrect. Will fix in a separate PR.

Copy link
Member

@quinlanj quinlanj left a comment

Choose a reason for hiding this comment

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

eas update:rollback is a good idea. part of me wonders if we should just scrap update:republish and provide a flag in update:rollback for the power users to specify a republish or rollback-to-embedded

@wschurman
Copy link
Member Author

Need to hide this for now, until we launch roll-back-to-embedded.

@wschurman wschurman merged commit d6c7623 into main Aug 15, 2023
4 of 5 checks passed
@wschurman wschurman deleted the @wschurman/rollback-command branch August 15, 2023 15:36
@github-actions
Copy link

❌ It looks like a changelog entry is missing for this PR. You have two options: you can add it manually, or you can use the changelog bot to do it for you.
🤖 To use the bot, simply comment on this PR with the command /changelog-entry [breaking-change|new-feature|bug-fix|chore] [message].
⏩ If this PR doesn't require a changelog entry, such as if it's an internal change that doesn't affect the user experience, you can add the "no changelog" label to the PR.

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