Skip to content

feat(ci): build preview images for PRs labeled preview - #21250

Open
clouserw wants to merge 1 commit into
mainfrom
clouserw/2026-09-17-preview-image-build
Open

clouserw wants to merge 1 commit into
mainfrom
clouserw/2026-09-17-preview-image-build

Conversation

@clouserw

Copy link
Copy Markdown
Member

Adds a workflow that builds fxa-mono and pushes it to GAR tagged with the first 10 chars of the PR head sha, for pull requests labeled preview. This is the image the MozCloud preview environment ApplicationSet deploys (image.tag = head_sha | trunc 10).

Mirrors the existing docker.yml release build (same pinned actions, WIF auth, and Dockerfile), minus the Docker Hub push and tag verification. Fork PRs are excluded.

One thing to verify on merge: the build environment's protection rules must allow pull_request runs, or the job will hang on approval.

Part of enabling FxA preview environments:

  • chart: mozilla/webservices-infra#12548
  • tenant flag: mozilla/global-platform-admin#7401

Copilot AI balanced review requested due to automatic review settings September 17, 2026 22:06
@clouserw
clouserw requested a review from a team as a code owner September 17, 2026 22:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

PR-controlled code receives production artifact-writer privileges, and unrelated label updates cause redundant builds.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds label-triggered preview image builds for FxA preview environments.

Changes:

  • Builds fxa-mono from labeled PR heads.
  • Pushes SHA-tagged images to GAR.
  • Excludes fork-based PRs.
File summaries
File Description
.github/workflows/docker-preview.yml Defines the preview image workflow.
Review details

Suppressed comments (1)

.github/workflows/docker-preview.yml:26

  • This privileged job executes scripts and a Dockerfile from the PR head while holding id-token: write, so same-repository PR code can request the OIDC token itself and impersonate the production artifact-writer, potentially overwriting release artifacts in fxa-prod. Fork exclusion does not isolate untrusted or compromised collaborator branches. Build the PR image in an unprivileged job, then publish the resulting OCI artifact from a job that never executes PR-controlled code, ideally with a preview-only repository and service account.
      id-token: write
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Balanced (auto)

Note

Copilot is running an experiment and ran this review at Balanced.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +19 to +21
if: >
contains(github.event.pull_request.labels.*.name, 'preview') &&
github.event.pull_request.head.repo.full_name == github.repository
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.

2 participants