mirror of
https://github.com/devvmhq/devvm.git
synced 2026-12-01 06:23:17 -10:00
When a shared tool's newest version, newer than tests/e2e-mise.lock's, has no download for a platform yet (mise lock stopping on a 404, as for Node 24.23.0's linux-arm64-musl build, a lock entry without a checksummed download, or a dotnet SDK without its archive), e2e-tools names the tool, version and platform. --check reports it as waiting for upstream and goes on, so the weekly Pins workflow passes; applying prints mise's output, stops, to try again later, and writes no lock. After a 404 wait, --check holds that tool back in its copy of mise.toml (at the e2e lock's version, or left out when the lock has none) and runs mise lock again, so the other tools are still reported and their failures still stop the run. A tool is held back once at most: its 404 again fails the run, so the loop ends. The Pins workflow's issue lists the waiting lines in their own Waiting for upstream section and stays open while any is there, and maintaining.md says to look at a wait that lasts two weeks, and to bump the other pins by name meanwhile, since a plain run stops at e2e-tools. Real failures still stop the run: a 404 or missing download for a version the lock already has, a checksum mismatch, any other mise lock error, an unfetchable releases.json, and a dotnet entry its downloads can't go into. A 404 counts as unpublished only when it's mise's only ERROR line, apart from its Version: and Run with --verbose trailer, and never a WARN, so a checksum mismatch beside a 404 fails. dotnet's downloads go only after the specifiers line of dotnet's own entry, which ends at the next [ header, and only dotnet_downloads' own wait (dotnet_waited) skips dotnet's checksum check. It waits rather than stepping back as devvm does for users: a step back in bash would copy internal/tools' stepBack, and the next run retries. New in scripts/bump.sh: newer, not_yet, unpublished, hold_back, the waiting and dotnet_waited flags. bump.txtar covers the musl 404 with the rest still reported (the tool left out, and held at the lock's version), a held tool's 404 again, the lock-version 404, a checksum mismatch alone, beside a 404 ERROR and beside a WARN-level .sig 404, a WARN-level 404 alone, a 404 whose URL holds two tools' versions, mise's output on the apply path, dotnet waiting (reported once, for its own platform) and its control, an unfetchable releases.json against the older lock, a tool missing checksums reported once with the rest still reported, a dotnet entry missing a checksum while another tool waits, and a dotnet entry without specifiers before another tool's. Co-Authored-By: Claude Opus 5.5 <[email protected]>
107 lines
4.7 KiB
YAML
107 lines
4.7 KiB
YAML
name: Pins
|
|
|
|
# scripts/bump.sh --check once a week: the pins with a newer upstream, and
|
|
# the shared tools e2e-tools waits for, go in one open issue, which closes
|
|
# when none is left. It reports and never bumps.
|
|
on:
|
|
schedule:
|
|
- cron: "47 6 * * 1"
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: pins
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
check:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
permissions:
|
|
contents: read
|
|
issues: write
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
# mise for the dev tools' newest versions; no tools, as nothing builds.
|
|
- uses: jdx/mise-action@924e7c586e33d7d4bae9c14e26c5d22e2beb6e78 # v5.3.0
|
|
with:
|
|
version: 2026.11.14
|
|
install: false
|
|
cache: false
|
|
- name: Check the pins
|
|
# The token is for gh api, which reads the actions' releases, mise,
|
|
# which reads GitHub's for the dev tools, and bump.sh's own calls to
|
|
# GitHub's API.
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
run: |
|
|
set -euo pipefail
|
|
scripts/bump.sh --check | tee "$RUNNER_TEMP/check.txt"
|
|
# bump.sh's output is upstream's text: it goes through files, never into
|
|
# a script.
|
|
- name: Open, update or close the issue
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
GH_REPO: ${{ github.repository }}
|
|
run: |
|
|
set -euo pipefail
|
|
title="Pinned versions to bump"
|
|
# Only the characters --check's lines use, so no upstream text can
|
|
# end the issue's code fence (a backtick) or add markup; \047 is
|
|
# the apostrophe, \133 and \135 the brackets, written so no tr
|
|
# reads them as a class.
|
|
keep='0-9A-Za-z.+~_ ()>:/,\047\133\135\n-'
|
|
# Each outdated pin, under its group's [header].
|
|
awk '/^\[/ { g = $0; next } index($0, " -> ") { if (g != "") print g; g = ""; print }' \
|
|
"$RUNNER_TEMP/check.txt" | LC_ALL=C tr -cd "$keep" > "$RUNNER_TEMP/outdated.txt"
|
|
# Each shared tool whose newest release e2e-tools waits for.
|
|
awk 'index($0, " waiting for upstream: ")' "$RUNNER_TEMP/check.txt" |
|
|
LC_ALL=C tr -cd "$keep" > "$RUNNER_TEMP/waiting.txt"
|
|
number=$(gh issue list --state open --search "in:title \"$title\"" --json number,title \
|
|
--jq "map(select(.title == \"$title\")) | .[0].number // empty")
|
|
if [[ ! -s $RUNNER_TEMP/outdated.txt && ! -s $RUNNER_TEMP/waiting.txt ]]; then
|
|
if [[ -n $number ]]; then
|
|
gh issue close "$number" --comment "Every pin is up to date: scripts/bump.sh --check lists nothing to bump."
|
|
fi
|
|
exit 0
|
|
fi
|
|
{
|
|
if [[ -s $RUNNER_TEMP/outdated.txt ]]; then
|
|
echo "scripts/bump.sh --check found pins with a newer upstream version:"
|
|
echo
|
|
# Four backticks: a line from upstream can't end the block early.
|
|
echo '````'
|
|
cat "$RUNNER_TEMP/outdated.txt"
|
|
echo '````'
|
|
echo
|
|
echo "Bump them with \`scripts/bump.sh\`, which applies every patch and minor, or \`scripts/bump.sh TOOL…\`;"
|
|
echo "its header says which tool moves each pin, and a line marked by hand or only when named says how."
|
|
echo "Pin bumps change images, so run the \`--from\` tier of the end-to-end tests before merging:"
|
|
echo "see [Updating pinned versions](https://devvm.dev/docs/contributing/maintaining/#updating-pinned-versions)."
|
|
fi
|
|
if [[ -s $RUNNER_TEMP/waiting.txt ]]; then
|
|
[[ ! -s $RUNNER_TEMP/outdated.txt ]] || echo
|
|
echo "## Waiting for upstream"
|
|
echo
|
|
echo "These shared tools' newest releases aren't published for every platform yet, so \`e2e-tools\` waits for them:"
|
|
echo
|
|
echo '````'
|
|
cat "$RUNNER_TEMP/waiting.txt"
|
|
echo '````'
|
|
echo
|
|
echo "While a tool waits, a plain \`scripts/bump.sh\` stops at \`e2e-tools\`, so bump the others by name."
|
|
echo "A wait usually ends within a few days. One still here after two weeks needs a look:"
|
|
echo "see [Updating pinned versions](https://devvm.dev/docs/contributing/maintaining/#updating-pinned-versions)."
|
|
fi
|
|
} > "$RUNNER_TEMP/body.md"
|
|
if [[ -n $number ]]; then
|
|
gh issue edit "$number" --body-file "$RUNNER_TEMP/body.md"
|
|
else
|
|
gh issue create --title "$title" --label enhancement --body-file "$RUNNER_TEMP/body.md"
|
|
fi
|