Skip to content

Push image versions in deterministic order to fix Docker Hub display#505

Merged
bschwedler merged 6 commits into
mainfrom
feature/ordered-push
May 12, 2026
Merged

Push image versions in deterministic order to fix Docker Hub display#505
bschwedler merged 6 commits into
mainfrom
feature/ordered-push

Conversation

@ianpittwood
Copy link
Copy Markdown
Contributor

Summary

  • Adds ImageTarget.push_sort_key, a sort tuple driving Docker Hub display order: (image_name, is_latest, ParsedVersion key, primary_score, version.name, variant.name, os.name). Latest pushes last; ties broken by primary OS+variant; multi-image runs grouped per image.
  • Sorts targets at the top of OrasPlugin.execute and emits log.info("ORAS merge order: ...") so CI logs make the chosen order observable.
  • Collapses the bakery-build-native.yml merge matrix into a single ordered job; drops the now-unused versions-matrix output and the Images by Version step. Build/test fan-out is unchanged.

Closes #484.

Dependencies

Builds on (must land first or merge together):

Both are merged into this branch already, so the diff against main will collapse to just the ordered-push commits once they land.

Trade-off

Wall-time on the merge job grows because pushes are now sequential rather than parallel:

Workflow Old New Δ
Connect production (~5 versions) ~2 min ~4–5 min +2–3 min
connect-content matrix (~12 combos × variants) ~2 min ~7–10 min +5–8 min
PR builds (push: false, dry-run) ~2 min ~2 min negligible

Total runner-minutes drop because per-runner setup (Docker, buildx, ORAS) only runs once.

Test plan

  • just test — 1487 passed, 0 failures, 84% coverage
  • TestPushSortKey (7 new tests): latest-last, primary-within-version, version ordering, semver §11 prerelease (daily < dev < release), matrix non-latest tiebreakers, matrix latest sorts last, multi-image grouping
  • OrasPlugin.execute ordering test: scrambled input → sorted output, exactly one ORAS merge order: log line
  • pre-commit actionlint hook on bakery-build-native.yml — clean
  • First post-merge production run: confirm ORAS merge order: line in CI log shows the expected sequence
  • First post-merge production run: visit hub.docker.com/r/posit/connect and confirm the latest-aliased tag is the most-recent push
  • Same check for posit/connect-content after the next content workflow run (uses Implement latest tag for image matrix builds #501's latest_combination)

@ianpittwood ianpittwood force-pushed the feature/ordered-push branch from cba8966 to d53badd Compare April 29, 2026 20:25
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 29, 2026

Test Results

1 547 tests  +8   1 547 ✅ +8   8m 15s ⏱️ -25s
    1 suites ±0       0 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit 4af94c3. ± Comparison against base commit ece0519.

♻️ This comment has been updated with latest results.

@ianpittwood ianpittwood force-pushed the feature/ordered-push branch from d53badd to bc0fca7 Compare May 11, 2026 16:27
@ianpittwood ianpittwood marked this pull request as ready for review May 11, 2026 16:28
@ianpittwood ianpittwood requested a review from bschwedler as a code owner May 11, 2026 16:28
Comment thread posit-bakery/posit_bakery/image/image_target.py Outdated
Comment thread .github/workflows/bakery-build-native.yml
@ianpittwood ianpittwood requested a review from bschwedler May 12, 2026 14:30
@ianpittwood ianpittwood force-pushed the feature/ordered-push branch from 3248065 to 18e777d Compare May 12, 2026 15:39
ianpittwood and others added 6 commits May 12, 2026 09:39
Fix import ordering in image_target.py (parsed_version after build_secret),
hoist ParsedVersion import to top of test file per CLAUDE.md policy, and
remove dead isMatrixVersion assignment on mock that had no effect on tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move `import logging` from inside the test method to the top-level
stdlib imports block, following the project's import policy.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ianpittwood ianpittwood force-pushed the feature/ordered-push branch from 18e777d to 4af94c3 Compare May 12, 2026 15:39
@bschwedler bschwedler added this pull request to the merge queue May 12, 2026
Merged via the queue into main with commit a63ffd5 May 12, 2026
23 checks passed
@bschwedler bschwedler deleted the feature/ordered-push branch May 12, 2026 16:32
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.

Push image versions in reverse order

2 participants