Skip to content

[eas-cli] add support for non-interactive update:rollback#3825

Open
quinlanj wants to merge 2 commits into
mainfrom
update-rollback-non-interactive
Open

[eas-cli] add support for non-interactive update:rollback#3825
quinlanj wants to merge 2 commits into
mainfrom
update-rollback-non-interactive

Conversation

@quinlanj

@quinlanj quinlanj commented Jun 6, 2026

Copy link
Copy Markdown
Member

Why

Slack context: https://exponent-internal.slack.com/archives/C083Q88U4M8/p1780603389422949

eas update:rollback used to be interactive only: it prompts whether to republish a previous update or roll back to the embedded bundle, then delegates to eas update:republish / eas update:roll-back-to-embedded. Teams building rollback pipelines (e.g. with access controls around who can change prod) want a single non-interactive command that "just rolls back the specified update" without having to know which of the two underlying commands to run. Motivated by a customer request.

Manual testing

Published regular update (eas update --branch main)

Screenshot 2026-06-05 at 10 16 34 PM

Rollback with only 1 update group published for runtime/branch pair

Screenshot 2026-06-05 at 10 17 27 PM

Rollback when update group is not latest for runtime/branch pair

Screenshot 2026-06-05 at 10 17 36 PM

Rollback with multiple update groups published for runtime/branch pair

Screenshot 2026-06-05 at 10 18 15 PM

Rollback with invalid group id

Screenshot 2026-06-05 at 10 18 22 PM

How

Adds an optional positional GROUP_ID argument to eas update:rollback:

  • Looks up the group and derives its branch + runtime version.
  • Requires the group to be the latest (live) update for that branch + runtime version. Clients on a given runtime version are served the most recent update group, so a rollback only makes sense for the live one. If the passed group is not the latest, the command errors and names the actual latest group — a stale/wrong ID, or a newer update published in between, halts the pipeline rather than silently reverting the wrong thing.
  • Republishes the update group published immediately before it; if there is none, publishes a roll back to the embedded update.
  • Delegates to the existing eas update:republish / eas update:roll-back-to-embedded commands, reusing all of their validation and publish logic. --message (with sensible defaults), --platform, --private-key-path, and --json are forwarded.

With no GROUP_ID, the existing interactive behavior is unchanged; in --non-interactive mode the argument is required.

The latest/previous lookup uses the modern updateGroupsPaginated Relay connection (UpdatesFilterV2), fetching just the top two groups for the runtime version.

Test Plan

  • New unit tests in rollback.test.ts (7 cases): republish previous group, roll back to embedded when there is no previous group, not-latest → error, missing group ID in --non-interactive → error, and --message / --platform / --private-key-path / --json forwarding on both delegated paths.
  • yarn test src/commands/update — all update-command suites pass.
  • yarn typecheck, yarn lint, and yarn fmt:check are clean.
  • yarn verify-graphql-code confirms the generated GraphQL is in sync.

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown

✅ Thank you for adding the changelog entry!

@codecov

codecov Bot commented Jun 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.35849% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.08%. Comparing base (58982ee) to head (9a42f50).

Files with missing lines Patch % Lines
packages/eas-cli/src/commands/update/rollback.ts 87.24% 6 Missing ⚠️
...ackages/eas-cli/src/graphql/queries/UpdateQuery.ts 0.00% 5 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3825      +/-   ##
==========================================
+ Coverage   58.04%   58.08%   +0.05%     
==========================================
  Files         917      917              
  Lines       39767    39812      +45     
  Branches     8329     8342      +13     
==========================================
+ Hits        23079    23122      +43     
- Misses      15237    15238       +1     
- Partials     1451     1452       +1     

☔ View full report in Codecov by Harness.
📢 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.

@quinlanj quinlanj requested a review from wschurman June 6, 2026 05:27
@quinlanj quinlanj marked this pull request as ready for review June 6, 2026 05:27
@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown

Subscribed to pull request

File Patterns Mentions
**/* @douglowder
packages/eas-cli/src/commands/update/** @wschurman

Generated by CodeMention

@quinlanj quinlanj requested a review from gwdp June 11, 2026 21:20
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.

1 participant