Repository navigation
ci: validate release pins without historical false positives #476
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
base: main
Are you sure you want to change the base?
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 |
|---|---|---|
|
|
@@ -244,16 +244,40 @@ jobs: | |
| PREV="$(printf '%s' "$VER" | awk -F. '{printf "%s.%s.0", $1, $2-1}')" | ||
| echo "stale pin to look for: $PREV" | ||
| # crates.io legitimately lags: lines that name crates.io may state the | ||
| # older version, so exclude them explicitly. | ||
| MATCHES="$(grep -rn "$PREV" README.md docs/ --include='*.md' \ | ||
| # older version, so exclude them explicitly. ROADMAP also records | ||
| # shipped milestones and prior tags; those historical mentions are not | ||
| # current release pins. Keep the exclusion limited to those markers so | ||
| # a stale current-release statement elsewhere in ROADMAP still fails. | ||
| MATCHES="$(grep -rn "$PREV" README.md ROADMAP.md docs/ --include='*.md' \ | ||
| | grep -v '^docs/releases/' \ | ||
| | grep -vi 'crates.io\|published\|--version \|lacks\|predates\|older v' || true)" | ||
| | grep -vi 'crates.io\|published\|--version \|lacks\|predates\|older v' \ | ||
| | grep -viE '^ROADMAP\.md:[0-9]+:.*(Shipped in|shipped \(|Prior tagged releases:)' || true)" | ||
| if [[ -n "$MATCHES" ]]; then | ||
| echo "::error::stale $PREV reference(s) in current documentation:" | ||
| echo "$MATCHES" | ||
| exit 1 | ||
| fi | ||
| echo "OK: no stale $PREV pins outside crates.io notes and release history" | ||
|
|
||
| # The composite Action is an installable artifact whose default must | ||
| # name a real release tag. Its version pin lives in YAML, not Markdown. | ||
| ACTION_DEFAULT="$(awk ' | ||
| /^ sdkt-version:/ { in_input=1; next } | ||
| in_input && /^ [A-Za-z0-9_-]+:/ { exit } | ||
| in_input && /^[[:space:]]+default:/ { print NR ":" $2; exit } | ||
| ' .github/actions/sdkt/action.yml)" | ||
| if [[ -z "$ACTION_DEFAULT" ]]; then | ||
| echo "::error::.github/actions/sdkt/action.yml: missing default for sdkt-version input" | ||
| exit 1 | ||
| fi | ||
| ACTION_LINE="${ACTION_DEFAULT%%:*}" | ||
| ACTION_VERSION="${ACTION_DEFAULT#*:}" | ||
| ACTION_VERSION="$(printf '%s' "$ACTION_VERSION" | sed "s/[\"']//g")" | ||
| if ! git ls-remote --exit-code --tags origin "refs/tags/$ACTION_VERSION" >/dev/null; then | ||
|
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. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Require an exact tag for If the Action default is 🧰 Tools🪛 zizmor (1.30.1)[warning] 1-281: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block (excessive-permissions) [warning] 148-193: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block (excessive-permissions) 🤖 Prompt for AI Agents |
||
| echo "::error::.github/actions/sdkt/action.yml:$ACTION_LINE: sdkt-version default '$ACTION_VERSION' is not a tag on origin" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "OK: no stale $PREV pins outside crates.io notes and release history; Action default $ACTION_VERSION exists" | ||
|
|
||
| onboarding-smoke: | ||
| name: offline onboarding smoke test | ||
|
|
@@ -342,4 +366,4 @@ jobs: | |
| cmp website/playground/wasm/sdkt_playground.js \ | ||
| "$PLAYGROUND_WASM_OUT/sdkt_playground.js" | ||
|
|
||
| echo "Playground WASM artifacts are up to date." | ||
| echo "Playground WASM artifacts are up to date." | ||
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.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Keep the current-release value in the stale-pin check.
ROADMAP.mdputs**Current release:**andPrior tagged releases:on the same line. If the current-release value becomes$PREV, this filter removes the entire line and CI passes. Check the text beforePrior tagged releases:separately, then exclude the historical list. The PR objective requires current-release pins inROADMAP.mdto remain detectable.🤖 Prompt for AI Agents