AINFRA-2806: Make localization downloads reviewable - #4909
Conversation
|
Claude finished @iangmaia's task in 2m 50s —— View job PR Review: Make localization downloads reviewableI reviewed the new Overall: Clean, well-scoped change that follows existing patterns closely. The pipeline YAML mirrors Suggestions1. PR-creation failure is silent (medium) — pr_url = find_or_create_pull_request(...)
buildkite_annotate(..., message: "Translations and metadata PR: #{pr_url || 'Error creating PR'}") if is_ciIf UI.user_error!('Failed to create the translations and metadata PR') if pr_url.nil?2. Re-run behavior when the phase branch already exists on remote (low) — 3. Minor / nits
Things that look good
|
There was a problem hiding this comment.
Pull request overview
This PR splits GlotPress translation and App Store metadata downloads out of the existing beta/release lanes and into a dedicated Fastlane lane plus Buildkite pipeline, so that localization updates land via a separate, reviewable PR against the active release/* branch.
Changes:
- Removes automatic GlotPress download steps from
new_beta_releaseandfinalize_release, leaving these lanes to lint reviewed localization content (and upload reviewed metadata during finalization). - Adds a new
download_translations_and_metadatalane that creates a dedicatedtranslations/release-...branch, downloads updates, lints them, and opens/updates a PR. - Introduces a new Buildkite pipeline to run the new lane as part of ReleasesV2 scenarios.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| fastlane/Fastfile | Adds a dedicated lane to download/lint translations & metadata and open a PR; removes download from beta/finalize lanes. |
| .buildkite/release-pipelines/download-translations-and-metadata.yml | New Buildkite pipeline step to invoke the new Fastlane lane during ReleasesV2. |
4fe4c47 to
282da4e
Compare
599cc7c to
1590854
Compare
|
I'll analyze this and get back to you. |
|
Claude finished @iangmaia's task in 4m 13s —— View job PR Review: Make localization downloads reviewable
Re-reviewed after What got fixed since my last pass: the branch lifecycle is now correct. Replacing Findings1. Merge-order dependency on This pipeline is now the only one calling the CI toolkit function; Also note the local script handles a case the toolkit version needs to cover too: 2. Failed PR creation still exits 0 (medium) — Unchanged from my first review. If UI.user_error!("Failed to create the translations and metadata PR for `#{pr_branch}`") if pr_url.nil?That also lets the 3.
Since deletion is best-effort cosmetics (the PR is empty either way), tolerating failure seems right: sh('git', 'push', 'origin', '--delete', pr_branch) do |status, _, cmd|
UI.important("`#{cmd}` failed (#{status.exitstatus}); the branch may already be gone.") unless status.success?
end4. Every rerun dismisses review state, even when nothing changed (low-medium) — The branch is recreated and re-committed on each run, so Cheap guard — skip the push when the content matches what's already up there: if remote_branch_exists
sh('git', 'fetch', 'origin', pr_branch)
unchanged = sh('git', 'diff', '--quiet', 'FETCH_HEAD', 'HEAD') { |status, _, _| status.success? }
endand short-circuit to the existing-PR annotation when 5.
ensure_git_branch(branch: "^#{Regexp.escape(base_branch)}$")This also covers an explicit Nits
Verified good
|
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
7fea737 to
4571676
Compare
|
Claude finished @iangmaia's task in 5m 13s —— View job PR Review: Make localization downloads reviewable
Re-reviewed after What's resolved since my last pass: the toolkit checkout is now consistent with its siblings ( Findings1. Remote state is sampled before the download and trusted after it (low-medium) —
The realistic trigger is benign and human: a reviewer merges the localization PR while this job is downloading, and GitHub's auto-delete-on-merge removes the head branch. Cheapest fix is to move the sample to where it's used — # after lint_localizations
remote_branch_exists = Fastlane::Helper::GitHelper.branch_exists_on_remote?(branch_name: pr_branch)and make the delete best-effort, since it's cosmetic either way (the PR is empty regardless): sh('git', 'push', 'origin', '--delete', pr_branch) do |status, _, cmd|
UI.important("`#{cmd}` failed (#{status.exitstatus}); the branch may already be gone.") unless status.success?
end2. With the download gone, if Fastlane::Helper::GitHelper.branch_exists_on_remote?(branch_name: "translations/release-#{release_version_current}")
UI.user_error!("`translations/release-#{release_version_current}` still exists on the remote — merge (or close) the localization PR before finalizing.")
endCaveat: that false-positives if the repo doesn't auto-delete merged head branches, in which case querying for an open PR with that head is the accurate signal. If you'd rather keep the lane dumb, a line in the release runbook covers it — but right now nothing does. 3. Tree comparison via two Fastlane's remote_branch_matches_downloads = sh('git', 'diff', '--quiet', 'FETCH_HEAD', 'HEAD') { |status, _, _| status.success? }4. No-op message reads oddly when a PR was just closed (nit) —
Verified good
|
Co-Authored-By: Claude <noreply@anthropic.com>
|
Claude finished @iangmaia's task in 3m 33s —— View job PR Review: Make localization downloads reviewable
Re-reviewed after Resolved since my last pass: Findings1. The guard puts an unverified toolkit API on the critical release path (medium) —
That last one is worth singling out because the find path has never been exercised on CI: build 17222 created PR #4919 fresh. A rerun against an existing open PR would validate both 2. The guard catches an open PR, not a skipped download (medium) — If the download job never ran for this release — pipeline not wired into the scenario, job failed with retry disabled, someone triggered finalization early — there's no PR to find, the guard passes, and 3. Every rerun force-pushes, even when the downloaded content is identical (low-medium) —
I flagged this before and the simplification was deliberate, so this is a tradeoff note rather than a request — reruns should be rare, and the previous version cost ~10 lines and two 4.
sh('git', 'push', 'origin', '--delete', pr_branch) do |status, _, cmd|
UI.important("`#{cmd}` failed (#{status.exitstatus}); the branch may already be gone.") unless status.success?
end5. Beta prep now lints whatever strings are on the branch with no download in front of it, so an unmerged localization PR means the beta ships without the latest translations. Less severe than pushing stale App Store metadata (no external artifact to correct), but it's the same class of mistake, and the beta is where translators would normally catch problems. Worth deciding explicitly whether beta prep should warn (not necessarily fail). Nits
Verified good
|
There was a problem hiding this comment.
I think the Claude review comments are a bit over the board, like the one about a possible error in Releases V2. Or maybe not over the board, but something that we might want to address later in a hardening pass of the whole flow instead?
Some of the nits, however, might be worth applying. Example:
fastlane/Fastfile:509 — release_version is introduced but release_version_current is still called at :530, :531, :533. Half-migrated; either thread the local through or leave it out.
|
Claude finished @iangmaia's task in 2m 39s —— View job PR Review: Make localization downloads reviewable
Re-reviewed after What One thing to confirm before mergeThe no-op path's correctness now rests on 14.11.3 having fixed This is mokagio's earlier finding in mirror image. In 14.11.2 the two predicates disagreed on source of truth: If 14.11.3 didn't change that helper, the failure is quiet rather than loud, which is worse than the raise it replaced:
The version bump landing in the same commit reads like 14.11.3 was cut precisely for this, and if so everything above is moot — but I can't confirm it: the gem isn't installed in this environment and I have no network access, so Related: Nits
Still open by choiceNoting these only so the tradeoffs are on the record — I'm not asking for changes:
Verified good
|
|
Claude finished @iangmaia's task in 3m 4s —— View job PR Review: Make localization downloads reviewable
Re-reviewed after One thing to confirm before mergeThe localization branch silently renamed from def translations_and_metadata_branch_name(version)
"translations/#{release_branch_name(version)}"
endComposing on Mechanically the new name is fine — I checked the ref-layout worry and there's no directory/file conflict, because a hotfix version nests no deeper than its base ( The part that does matter is merge timing. Any
Your own test PR #4919 is on the old naming (against def translations_and_metadata_branch_name(version)
"translations/release-#{version}"
endSecondary effect either way: the create path was exercised on build 17222 under the old name, so the name the code now produces hasn't run. Low risk — it's a string — but it's no longer the tested value. Nits
Verified good in this commit
Still open by choiceRecording only, not asking for changes — mokagio's call that these belong in a hardening pass reads right to me:
|

Fixes AINFRA-2806
Releases V2 PR: https://github.a8c.com/Automattic/wpcom/pull/232628
Splits app translation and iOS/tvOS App Store metadata downloads out of beta preparation and release finalization.
A dedicated Fastlane lane and Buildkite pipeline now download the localized content into a phase-specific branch, lint it, and create one reviewable PR against the active release branch when changes exist.
Release finalization still checks translation progress, lints the reviewed files, and uploads iOS/tvOS metadata after the separate localization PR has been merged.
Testing
release/0.0)0.0#4919Checklist
CHANGELOG.mdif necessary.