Repository navigation
84 lines (70 loc) · 3.8 KB
/
Copy pathmaintenance-queue.yml
File metadata and controls
84 lines (70 loc) · 3.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Maintenance issue queue
on:
schedule:
- cron: "17 3 * * *"
workflow_dispatch:
permissions:
contents: read
issues: write
jobs:
rust-release-queue:
runs-on: ubuntu-26.04
timeout-minutes: 10
steps:
- name: Detect current stable Rust and queue a full review
env:
GH_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
shell: bash
run: |
set -euo pipefail
curl -fsSL https://static.rust-lang.org/dist/channel-rust-stable.toml -o /tmp/rust-stable.toml
read -r VERSION RELEASE_DATE ELIGIBLE < <(python3 - <<'PY'
import datetime as dt
import tomllib
with open("/tmp/rust-stable.toml", "rb") as f:
data = tomllib.load(f)
version = data["pkg"]["rust"]["version"].split()[0]
release_date = dt.date.fromisoformat(data["date"])
# The manifest has date precision only. Waiting until UTC midnight
# four dates later guarantees at least 72 hours even if publication
# happened at the very end of the release date.
eligible_at = dt.datetime.combine(
release_date + dt.timedelta(days=4),
dt.time.min,
tzinfo=dt.timezone.utc,
)
eligible = dt.datetime.now(dt.timezone.utc) >= eligible_at
print(version, release_date.isoformat(), "yes" if eligible else "no")
PY
)
test -n "$VERSION"
echo "Current stable Rust: $VERSION (release date $RELEASE_DATE)"
if [[ "$ELIGIBLE" != "yes" ]]; then
echo "Rust $VERSION is still inside the 72-hour release quarantine"
exit 0
fi
gh label create "automation:rust-release" --repo "$REPO" --color "8250df" --description "Queued automatically when stable Rust changes" --force
marker="rust-stable-${VERSION}"
existing="$(gh issue list --repo "$REPO" --state all --limit 200 --search "${marker} in:body" --json number --jq '.[0].number // empty')"
if [[ -n "$existing" ]]; then
echo "Rust $VERSION review already exists as issue #$existing"
exit 0
fi
export marker dep details log stat update_log VERSION
body="$(python3 .github/scripts/render-maintenance-template.py <<'EOF'
<!-- ${marker} -->
<!-- automation-queue:rust-release -->
Rust **${VERSION}** is now the stable toolchain.
Do a complete repository refresh against this release rather than only replacing the toolchain version:
- Read the official Rust ${VERSION} announcement and detailed release notes/changelog.
- Review relevant language, standard-library, rustc, Cargo, Clippy, rustfmt, target/platform, and tooling changes.
- Review all Rust code, `Cargo.toml`/`Cargo.lock`, CI, Docker/build tooling, `SKILL.md`, README/docs, examples, lints, and project conventions for newly preferable patterns or obsolete workarounds.
- Adopt useful newly-stable features and current best practices where they improve the project; remove workarounds that the new stable release makes unnecessary.
- Update the current-stable CI/toolchain references while preserving the intentional MSRV contract unless there is a separately justified reason to raise it.
- Run the full CI-equivalent test matrix and fix fallout.
- If the release genuinely requires no changes beyond what is already present, document what was reviewed and close this issue as a no-op.
This issue is generated automatically. A ChatGPT maintenance automation is expected to implement it.
EOF
)"
gh issue create --repo "$REPO" --title "Rust ${VERSION}: full best-practices refresh" --label "automation:rust-release" --body "$body"