Skip to content

Commit e148644

Browse files
romtsnclaude
andauthored
chore: Add scheduled job to check for retrace spec changes (#90)
## Summary - Adds a daily GHA workflow that checks if the upstream R8 retrace mapping spec (`doc/retrace.md`) has been updated - Mirrors the approach from [sentry-java#5157](getsentry/sentry-java#5157) for the tombstone proto schema - Allows us to react to retrace format changes promptly ## Test plan - [x] Verified the script runs successfully locally and reports "Spec is up to date" 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b2bb6de commit e148644

File tree

5 files changed

+46
-5
lines changed

5 files changed

+46
-5
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Check Retrace Spec
2+
3+
on:
4+
schedule:
5+
- cron: '0 9 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
check:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v6
14+
15+
- name: Check for newer retrace spec
16+
run: ./scripts/check-retrace-spec.sh

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717

1818
steps:
19-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@v6
2020

2121
- run: rustup toolchain install stable --profile minimal --component rustfmt --component clippy --no-self-update
2222
- uses: Swatinem/rust-cache@v2
@@ -35,7 +35,7 @@ jobs:
3535
runs-on: ${{ matrix.os }}
3636

3737
steps:
38-
- uses: actions/checkout@v4
38+
- uses: actions/checkout@v6
3939

4040
- run: rustup toolchain install stable --profile minimal --no-self-update
4141
- uses: Swatinem/rust-cache@v2
@@ -48,7 +48,7 @@ jobs:
4848
runs-on: ubuntu-latest
4949

5050
steps:
51-
- uses: actions/checkout@v4
51+
- uses: actions/checkout@v6
5252

5353
- run: rustup toolchain install stable --profile minimal --component llvm-tools-preview --no-self-update
5454
- uses: Swatinem/rust-cache@v2

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
with:
2323
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
2424
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}
25-
- uses: actions/checkout@v4
25+
- uses: actions/checkout@v6
2626
with:
2727
# Fetch all commits so we can determine previous version
2828
fetch-depth: 0

.github/workflows/weekly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919

2020
steps:
21-
- uses: actions/checkout@v4
21+
- uses: actions/checkout@v6
2222

2323
- run: |
2424
rustup toolchain install ${{ matrix.rust }} --profile minimal --component clippy --no-self-update

scripts/check-retrace-spec.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
TRACKED_COMMIT="e212426be84283876b6bb832630c0de25a2a7bc5"
5+
6+
# tail -n +2 to remove the magic anti-XSSI prefix from the Gitiles JSON response
7+
LATEST_COMMIT=$(curl -sf \
8+
'https://r8.googlesource.com/r8/+log/refs/heads/main/doc/retrace.md?format=JSON' \
9+
| tail -n +2 \
10+
| jq -r '.log[0].commit')
11+
12+
if [ -z "$LATEST_COMMIT" ] || [ "$LATEST_COMMIT" = "null" ]; then
13+
echo "ERROR: Failed to fetch latest commit from Gitiles" >&2
14+
exit 1
15+
fi
16+
17+
echo "Tracked commit: $TRACKED_COMMIT"
18+
echo "Latest commit: $LATEST_COMMIT"
19+
20+
if [ "$LATEST_COMMIT" != "$TRACKED_COMMIT" ]; then
21+
echo "Spec has been updated! Latest: https://r8.googlesource.com/r8/+/${LATEST_COMMIT}/doc/retrace.md"
22+
exit 1
23+
fi
24+
25+
echo "Spec is up to date."

0 commit comments

Comments
 (0)