Skip to content

Commit b2247d8

Browse files
committed
docs: describe the current pin behavior, and warn on a backwards ref
1 parent e4a893a commit b2247d8

2 files changed

Lines changed: 39 additions & 9 deletions

File tree

‎.agents/upstream-tracking.md‎

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -253,17 +253,29 @@ markdown links, which is why there is no submodule to hold the pin.
253253

254254
### How the pin moves
255255

256-
The workflow runs weekly, resolves the latest release tag, and opens a bump PR
257-
for every release the pin does not already contain. Two shapes come out of it:
256+
The workflow runs weekly and resolves the latest release tag. What comes out of
257+
it depends on what the release carries:
258258

259-
- **Pages changed.** The usual case: review the diff.
260-
- **Nothing under `docs/` changed.** The pages are byte-identical and the only
261-
diff is `source_ref` on each of them, but the PR still opens, because that is
262-
what moves the pin off a commit and onto a release tag. Skipping these would
259+
- **Pages changed.** A PR to review the diff. The usual case.
260+
- **Nothing under `docs/` changed, and the pin is a commit.** A PR whose only
261+
diff is the pin and the `source_ref` each page records. It opens because that
262+
is what moves the pin off a commit and onto a release tag; skipping it would
263263
strand a temporary commit pin for good.
264-
265-
The PR body says which of the two it is. The recipe version readers type is a
266-
separate axis, covered by the `static-site` entry under `watched`.
264+
- **Nothing under `docs/` changed, and the pin is a tag.** Nothing. A PR would
265+
carry an empty page diff for someone to review and merge. The pin then lags
266+
the latest release and stays accurate, since it records the ref this copy came
267+
from and the copy still matches it, and the release is not missed, because the
268+
recipe that deploys this canister releases in lockstep and is tracked under
269+
`watched`.
270+
271+
The PR body says which of the first two it is.
272+
273+
To sync a ref rather than a release, dispatch the workflow with `ref`: a sha,
274+
tag, or branch. That is for a docs fix that has shipped upstream but is not in a
275+
release, and it leaves the pin on a commit until the next release moves it onto
276+
a tag. The release checks do not apply to a dispatched ref, so it can also move
277+
the pin backwards, which a rollback wants and a mistyped sha does not: the run
278+
says so and the PR body repeats it.
267279

268280
To sync by hand, or to trial a ref before pinning it:
269281

‎.github/workflows/sync-static-site.yml‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,16 @@ jobs:
7676
echo "needed=false" >> $GITHUB_OUTPUT
7777
exit 0
7878
fi
79+
80+
# A ref the pin already contains moves the pin backwards. That is
81+
# what a rollback is, so it runs, but it is also what a mistyped sha
82+
# looks like, so it is not silent: the run warns and the PR body
83+
# says so, which is the difference between the two.
84+
if git -C /tmp/certified-assets merge-base --is-ancestor \
85+
"$REF_COMMIT" "$PIN_COMMIT"; then
86+
echo "::warning::$INPUT_REF is behind the pin $PIN. This will move the pin backwards."
87+
echo "backwards=true" >> $GITHUB_OUTPUT
88+
fi
7989
else
8090
# Stable releases only, the same pattern the upstream.json watcher uses.
8191
# `^v[0-9]` would accept v0.4.0-rc.1 and publish docs for a prerelease.
@@ -221,6 +231,13 @@ jobs:
221231
echo "**Ref:** \`$TAG\` (pinned from \`$PIN\`), dispatched by hand as \`$INPUT_REF\`."
222232
echo "A ref is synced by hand when a docs fix has shipped upstream but not"
223233
echo "been released; the next release moves the pin back onto a tag."
234+
if [ "$BACKWARDS" = "true" ]; then
235+
echo ""
236+
echo "> [!WARNING]"
237+
echo "> This ref is **behind** the pin, so the pin moves backwards and any"
238+
echo "> page below is reverted to the older text. Intended for a rollback."
239+
echo "> If you meant to move forward, close this and dispatch the right ref."
240+
fi
224241
else
225242
echo "**Release:** \`$TAG\` (pinned from \`$PIN\`)"
226243
fi
@@ -258,3 +275,4 @@ jobs:
258275
CHANGED: ${{ steps.check.outputs.changed_files }}
259276
PIN_ONLY: ${{ steps.check.outputs.pin_only }}
260277
INPUT_REF: ${{ inputs.ref }}
278+
BACKWARDS: ${{ steps.check.outputs.backwards }}

0 commit comments

Comments
 (0)