Skip to content

[ci] Deploy worker previews from PRs and use them on staging - #4493

Open
szdziedzic wants to merge 3 commits into
mainfrom
szdziedzic-claude/canary-worker-branch-deploy-ff4381
Open

szdziedzic wants to merge 3 commits into
mainfrom
szdziedzic-claude/canary-worker-branch-deploy-ff4381

Conversation

@szdziedzic

@szdziedzic szdziedzic commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Why

Right now the only way to try a worker change on staging is to promote it over the shared staging tarball. This gives each PR its own worker that a single staging job can opt into.

How

  • Add the preview label to a PR. CI builds the worker from the PR head and uploads worker-{android,ios}-preview-pr-<number>.tar.gz. New pushes upload it again. Removing the label or closing the PR deletes it.
  • To use it on staging, set __EAS_WORKER_PREVIEW=pr-<number> in the build profile or workflow job env, or run eas simulator:start --worker-preview pr-<number> (hidden flag).
  • build-and-deploy-worker.yml gets an optional ref input so it builds the PR head and not the merge commit.
  • generated.ts is edited by hand. Regenerate after expo/universe#31641 is deployed.

Needs expo/workflow-orchestration#1035 and expo/universe#31641 on staging. The preview label doesn't exist yet.

Test Plan

  • actionlint, tests for the new flag, typecheck and lint pass.
  • After the drone change is on staging: label a PR, check the tarballs land in gs://eas-build-worker-tarballs/, run a staging build with the env var, then remove the label and check the tarballs are gone.

🤖 Generated with Claude Code

szdziedzic and others added 2 commits September 29, 2026 19:36
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@szdziedzic szdziedzic added the no changelog PR that doesn't require a changelog entry label Sep 29, 2026
@github-actions

Copy link
Copy Markdown

Subscribed to pull request

File Patterns Mentions
packages/eas-cli/** @douglowder

Generated by CodeMention

Warning: The preamble and epilogue options in commentConfiguration are deprecated. Use template instead.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devin Review found 3 potential issues.

Devin Review

Comment on lines +12 to +14
concurrency:
group: worker-preview-${{ github.event.pull_request.number }}
cancel-in-progress: true

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 Unrelated labels cancel preview deployment

Changing another label while a preview deploys makes cancel-in-progress cancel the deploy. The replacement run skips both jobs, leaving the preview missing or outdated.

Learn more

The workflow subscribes to all label changes, but deploy-worker-preview runs only when the preview label is added and remove-worker-preview runs only when it is removed. Concurrency applies before those job conditions, so an unrelated label change cancels a running deployment without replacing it. The same issue affects cleanup: closing a PR immediately after removing preview cancels the removal run, while the close run sees no preview label and skips removal.

Example: Add preview to PR 123 and, while its worker builds, add needs-review. The second run cancels the build, skips both jobs, and leaves pr-123 without its new worker.

Recommended fix: Ensure irrelevant label events cannot enter the preview's canceling concurrency group. For example, handle deployment and cleanup in separate workflows or concurrency groups with event-specific admission, and let a close event repeat cleanup even if preview was already removed.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.


on:
pull_request:
types: [labeled, unlabeled, synchronize, closed]

@devin-ai-integration devin-ai-integration Bot Sep 29, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Reopened PR keeps a missing preview

Reopening a closed PR with the preview label does not trigger deployment because reopened is absent. Closing deleted its tarballs, so the labeled PR has no preview until another push or relabel.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +146 to +150
'worker-preview': Flags.string({
description:
'Run the session on a worker preview built from an expo/eas-cli pull request, e.g. "pr-1234". Only supported on staging.',
hidden: true,
}),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔍 Check changelog exemption for new flag

The new simulator flag has no changelog entry, although CONTRIBUTING.md requests one for every PR. Confirm whether the changelog exemption applies.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

⏩ The changelog entry check has been skipped since the "no changelog" label is present.

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.

1 participant