Repository navigation
fix(ci): keep CalVer releases and the sync push gate correct on edge cases #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,23 @@ | ||
| # shellcheck shell=bash | ||
| # decide <digest> <today YYYY.MDD> reads "<tag> <digest>" lines of the | ||
| # existing version tags on stdin. It prints "released <tag>" when a | ||
| # tag already points at <digest>, otherwise "next <YYYY.MDD.N>". | ||
| # tag already points at <digest>, otherwise "next <YYYY.MDD.N>", where N is one | ||
| # more than the largest suffix of today (a count would reuse a taken N when a | ||
| # tag is missing from the sequence). | ||
| decide() { | ||
| local digest="$1" today="$2" tag tagdigest n=0 | ||
| local digest="$1" today="$2" tag tagdigest n=0 suffix | ||
| while read -r tag tagdigest; do | ||
| [ -n "$tag" ] || continue | ||
| if [ "$tagdigest" = "$digest" ]; then | ||
| echo "released $tag" | ||
| return 0 | ||
| fi | ||
| case "$tag" in "$today".*) n=$((n + 1)) ;; esac | ||
| case "$tag" in | ||
| "$today".*) | ||
| suffix="${tag#"$today".}" | ||
| if [ "$suffix" -ge "$n" ]; then n=$((suffix + 1)); fi | ||
| ;; | ||
| esac | ||
| done | ||
| echo "next $today.$n" | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,6 +79,10 @@ jobs: | |
| id: verify | ||
| if: steps.tag.outputs.up_to_date == 'false' && steps.merge.outputs.conflict == 'false' | ||
| continue-on-error: true | ||
| # Shorter than the job's timeout: a hung test then fails this step, | ||
| # which still lets publish open the draft pull request. The job timeout | ||
| # would cancel the job and skip publish. | ||
| timeout-minutes: 45 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reserve time for the step timeout before the job timeout. If earlier steps take 20 minutes, the 60-minute job timeout cancels a hung verification after 40 minutes, before this 45-minute timeout fires. Publish then skips the draft PR. (docs.github.com) Reserve a bounded verification and cleanup budget, or move verification to a separately budgeted job. The PR objective requires hung tests to reach the draft-PR path.
|
||
| run: mise run github:workflows:trogonstack-sync:verify | ||
|
|
||
| # The only job that can read the Barnacle key: the environment admits it | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Convert suffixes explicitly to decimal.
If today’s tags include
2026.1124.08for another digest, the caller accepts that suffix. However,suffix + 1interprets08as octal and fails. The release task then exits before tagging. This input did not cause an arithmetic failure before this change. (raw.githubusercontent.com)Use
n=$((10#$suffix + 1)). This also preserves decimal interpretation for ordinary suffixes. (gnu.org)