Files
wehub-resource-sync 0d3cb498a3
CI / Shell Format Check (push) Has been cancelled
CI / Check Ruby (3.4) (push) Has been cancelled
CI / CI Config (push) Has been cancelled
CI / Test on Node ${{ matrix.node }} and ${{ matrix.os }}${{ matrix.shard && format(' (shard {0}/3)', matrix.shard) || '' }} (push) Has been cancelled
CI / Build on Node ${{ matrix.node }} (push) Has been cancelled
CI / Style Check (push) Has been cancelled
CI / Generate Assets (push) Has been cancelled
CI / Check Python (3.14) (push) Has been cancelled
CI / Check Python (3.9) (push) Has been cancelled
CI / Build Docs (push) Has been cancelled
CI / Code Scan Action (push) Has been cancelled
CI / Site tests (push) Has been cancelled
CI / webui tests (push) Has been cancelled
CI / Run Integration Tests (push) Has been cancelled
CI / Run Smoke Tests (push) Has been cancelled
CI / Go Tests (push) Has been cancelled
CI / Share Test (push) Has been cancelled
CI / Redteam (Production API) (push) Has been cancelled
CI / Redteam (Staging API) (push) Has been cancelled
CI / GitHub Actions Lint (push) Has been cancelled
CI / Check Ruby (3.0) (push) Has been cancelled
release-please / release-please (push) Has been cancelled
release-please / build (push) Has been cancelled
release-please / publish-npm (push) Has been cancelled
release-please / publish-npm-backfill (push) Has been cancelled
release-please / docker (push) Has been cancelled
release-please / publish-code-scan-action (push) Has been cancelled
release-please / attest-code-scan-action (push) Has been cancelled
Deploy local.promptfoo.app / Deploy to Cloudflare Pages (push) Has been cancelled
Test and Publish Multi-arch Docker Image / test (push) Has been cancelled
Test and Publish Multi-arch Docker Image / build-docker-and-push-digests (map[digest-suffix:linux-amd64 platform:linux/amd64 runner:ubuntu-latest]) (push) Has been cancelled
Test and Publish Multi-arch Docker Image / build-docker-and-push-digests (map[digest-suffix:linux-arm64 platform:linux/arm64 runner:ubuntu-24.04-arm]) (push) Has been cancelled
Test and Publish Multi-arch Docker Image / merge-docker-digests (push) Has been cancelled
Test and Publish Multi-arch Docker Image / Attest Multi-arch Image (push) Has been cancelled
Validate Renovate Config / Validate Renovate Configuration (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:24:08 +08:00

77 lines
3.0 KiB
YAML

name: release-please-sha-drift
# Guards against the failure mode fixed in PR #9517: release-please's
# `last-release-sha` in release-please-config.json is a STATIC pin that floors
# release-please's GraphQL "fetch merge commits" walk. Nobody advances it
# automatically, so the scan window grows every release and eventually the
# GraphQL query times out ("Something went wrong while executing your query"),
# failing the release-please job.
#
# This check measures how far last-release-sha is behind HEAD and fails loudly
# while there is still plenty of headroom, turning a silent release-breaking
# timeout into an early, obvious signal. The fix when it fires is a one-line
# bump of last-release-sha to the OLDEST current package release commit (never
# newer than any package's last release, or that package's unreleased commits
# get dropped).
on:
schedule:
# Mondays 14:00 UTC — proactive, since drift accrues with no config change.
- cron: '0 14 * * 1'
workflow_dispatch:
pull_request:
branches:
- main
paths:
- 'release-please-config.json'
permissions:
contents: read
concurrency:
group: release-please-sha-drift-${{ github.ref }}
cancel-in-progress: true
jobs:
check-drift:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
steps:
- name: Checkout (full history)
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
# Need full history to measure the distance from last-release-sha to HEAD.
fetch-depth: 0
- name: Check last-release-sha drift
env:
# Fail before the GraphQL scan gets near the size that timed out (~468
# commits in the #9517 incident; 144 still scanned fine). 250 leaves
# margin to bump the pin without a fire drill.
MAX_DRIFT: '250'
run: |
set -euo pipefail
sha="$(jq -r '."last-release-sha" // empty' release-please-config.json)"
if [[ -z "$sha" ]]; then
echo "::notice::no last-release-sha configured in release-please-config.json; nothing to check"
exit 0
fi
if ! git cat-file -e "${sha}^{commit}" 2>/dev/null; then
echo "::error file=release-please-config.json::last-release-sha ${sha} is not a reachable commit"
exit 1
fi
behind="$(git rev-list --count "${sha}..HEAD")"
echo "last-release-sha ${sha} is ${behind} commits behind HEAD (threshold ${MAX_DRIFT})"
if (( behind > MAX_DRIFT )); then
echo "::error file=release-please-config.json::release-please last-release-sha is ${behind} commits behind HEAD (> ${MAX_DRIFT}). The release-please merge-commit scan will eventually time out (see PR #9517). Advance last-release-sha to the OLDEST current package release commit — never newer than any package's last release, or that package loses its unreleased commits."
exit 1
fi
echo "::notice::release-please last-release-sha drift OK (${behind} <= ${MAX_DRIFT})"