GRM-52: Fix badge generation to reflect actual state after release #66

Merged
emil merged 1 commits from GRM-52-fix-badge-generation into master 2026-06-22 06:15:33 +00:00
Owner

Summary

The badges on the README were outdated — the version badge showed the pre-release version instead of the actual current version.

Root Cause

The badges job in post-merge.yml was running in parallel with the release job (both only depended on detect-type). This meant:

  1. generate_badges.py read __version__ from the checkout, which was the pre-release version
  2. The release job bumped the version in parallel, but badges were already generated with the old version
  3. Even if badges ran after release, the checkout used the trigger commit SHA, not the latest master (which includes the release commit)

Fix

Three changes ensure badges always reflect the actual state:

  1. badges now depends on [detect-type, release] — runs after release has pushed any version bump
  2. if: always() — badges run even if release fails or is skipped (badges should always reflect current state)
  3. push_badges.py fetches latest master and hard-resets before generating badges — belt-and-suspenders to pick up release commits

The checkout also uses ref: master with an explicit git fetch origin master && git reset --hard origin/master step.

Testing

  • 770 tests pass with 100% branch coverage
  • All lint checks pass (ruff, pyright, bandit, ansible-lint, actionlint)
  • make workflow-check passes (actionlint + act_runner dry-run)

Closes GRM-52

## Summary The badges on the README were outdated — the version badge showed the pre-release version instead of the actual current version. ## Root Cause The `badges` job in `post-merge.yml` was running **in parallel** with the `release` job (both only depended on `detect-type`). This meant: 1. `generate_badges.py` read `__version__` from the checkout, which was the **pre-release** version 2. The release job bumped the version in parallel, but badges were already generated with the old version 3. Even if badges ran after release, the checkout used the trigger commit SHA, not the latest master (which includes the release commit) ## Fix Three changes ensure badges always reflect the actual state: 1. **`badges` now depends on `[detect-type, release]`** — runs after release has pushed any version bump 2. **`if: always()`** — badges run even if release fails or is skipped (badges should always reflect current state) 3. **`push_badges.py` fetches latest master** and hard-resets before generating badges — belt-and-suspenders to pick up release commits The checkout also uses `ref: master` with an explicit `git fetch origin master && git reset --hard origin/master` step. ## Testing - 770 tests pass with 100% branch coverage - All lint checks pass (ruff, pyright, bandit, ansible-lint, actionlint) - `make workflow-check` passes (actionlint + act_runner dry-run) Closes GRM-52
emil added 1 commit 2026-06-22 06:11:14 +00:00
fix: badges job runs after release to reflect actual state
CI / detect-changes (pull_request) Successful in 1m11s
CI / discover-runners (pull_request) Has been skipped
CI / pr-review (pull_request) Successful in 1m24s
CI / quality (pull_request) Successful in 1m30s
CI / release-dry-run (pull_request) Has been skipped
CI / molecule-tests (1) (pull_request) Has been skipped
CI / molecule-tests (2) (pull_request) Has been skipped
CI / molecule-tests (3) (pull_request) Has been skipped
Auto-merge / merge (pull_request) Successful in 7s
cecc40ae18
The badges job in post-merge.yml was running in parallel with the
release job, causing the version badge to always show the pre-release
version. Three changes fix this:

1. badges now depends on [detect-type, release] instead of just
   [detect-type], so it runs after release has pushed any version bump
2. badges uses `if: always()` so it runs even if release fails or is
   skipped — badges should always reflect the current repo state
3. push_badges.py now fetches latest master and hard-resets before
   generating badges, ensuring the checkout includes any release
   commits that were pushed moments before

The checkout also uses `ref: master` instead of the trigger commit SHA,
with an explicit `git fetch origin master && git reset --hard origin/master`
step as a belt-and-suspenders approach.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
emil reviewed 2026-06-22 06:12:40 +00:00
emil left a comment
Author
Owner

Automated PR Review

  • Architecture compliance: OK
  • Best practices: OK
  • Security: OK
  • Documentation: OK
  • Tests: OK
  • Commit conventions: OK

No issues found by automated checks.


Manual review required: Before approving, review every category in
REVIEW_CHECKLIST.md and confirm with:

python3 scripts/ci/review_pr.py <PR> <owner/repo> \
  --event APPROVE --checklist-confirmed \
  --body "<substantive review summary>"
## Automated PR Review - Architecture compliance: OK - Best practices: OK - Security: OK - Documentation: OK - Tests: OK - Commit conventions: OK No issues found by automated checks. --- **Manual review required:** Before approving, review every category in [REVIEW_CHECKLIST.md](REVIEW_CHECKLIST.md) and confirm with: ```bash python3 scripts/ci/review_pr.py <PR> <owner/repo> \ --event APPROVE --checklist-confirmed \ --body "<substantive review summary>" ```
emil added the ready-to-merge label 2026-06-22 06:15:24 +00:00
emil merged commit e05cf20daa into master 2026-06-22 06:15:33 +00:00
emil deleted branch GRM-52-fix-badge-generation 2026-06-22 06:15:34 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: oblachno-oss/grm#66