Skip to content

Read test mirror tags from mirror.yaml when deleting - #188

Draft
PerfectSlayer wants to merge 1 commit into
masterfrom
fix-delete-test-mirror-variants
Draft

PerfectSlayer wants to merge 1 commit into
masterfrom
fix-delete-test-mirror-variants

Conversation

@PerfectSlayer

Copy link
Copy Markdown
Contributor

What

scripts/delete-test-mirror-entries.sh no longer relies on a hard-coded CI_VARIANTS list. It now finds the {PR_NUMBER}_merge-* group in mirror.yaml, reads its tags from there, and removes that group and the matching mirror.lock.yaml entries.

Why

The Delete test image mirror PR workflow always runs the script from the default branch, while the group being deleted may have been created with a different variant list. Whenever a variant is added or removed (e.g. EA JDK 27 in #168 / #182, EA JDK 28 in #186), deletion fails:

  • groups missing the new variant fail validation (Missing mirror.yaml tag ...:N_merge-28);
  • groups that have an extra variant fail the exact-block removal and leave lock entries behind.

This was raised in the review of #186.

Details

  • The group is matched as a whole: same source_prefix/dest_repo, every tag starting with "N_merge-. The leading quote anchors the prefix, so deleting 12 does not touch 123.
  • The script fails if it finds zero or several matching groups, or if a tag has no mirror.lock.yaml entry. Nothing is modified in that case.
  • With this change, the delete script no longer needs editing at each JDK transition.

Testing

Ran the script locally against sample mirror.yaml / mirror.lock.yaml files:

  • groups with and without a 28 tag, alongside ci-* entries and other PR groups (including 12 vs 123): only the target group and its lock entries are removed;
  • unknown PR number and missing lock entry: fails with an error, files untouched;
  • group at end of file without a trailing newline;
  • group built from the current variant list: output identical to the previous script.

Note: #186 also edits the CI_VARIANTS line in this file, so whichever merges second needs a trivial rebase (drop that line).

🤖 Generated with Claude Code

The delete workflow always runs the script from the default branch, but the
group may have been created with a different variant list (e.g. before or
after an EA JDK was added or removed). Rebuilding the group from the
hard-coded CI_VARIANTS made the deletion fail in that case.

Discover the group's tags from mirror.yaml instead and remove whatever is
there.

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

This branch was previously deployed

1 inactive deployment
ci-build — f19bd69f Deployed Nov 19, 2026 by PerfectSlayer via Build amd64 images (push by digest) #626
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