Repository navigation
[Doc] Update newsreader example - #19893
Merged
Merged
Conversation
pcmoritz
approved these changes
Oct 30, 2021
dstrodtman
added a commit
that referenced
this pull request
Sep 24, 2026
…66427) ## Why are these changes needed? The postmerge `doc: apply redirects` step, enabled in #66024, has failed on every run since it was turned on, and it never applied a redirect change. The one change that merged since then, the `/data/dataset.html` target updated in #66024 itself, didn't reach Read the Docs until a maintainer applied it by hand. There are two problems, and both come from the `HEAD~1..HEAD` gate at the top of the step: 1. **The gate checks the wrong range.** The step isn't scheduled on every master merge. In the postmerge builds since 2026-09-18, it appears only in the full builds that release automation triggers, a few times a day, and not in the per-merge builds. A `git diff HEAD~1 HEAD -- doc/redirects/` check sees only the single commit that build is on, so a redirect merge that isn't that commit is never applied. 2. **The skip path reports failure.** All 12 runs from [postmerge #19792](https://buildkite.com/ray-project/postmerge/builds/19792) through [#19893](https://buildkite.com/ray-project/postmerge/builds/19893) logged `no doc/redirects/ change in this merge; nothing to apply`, then `logout`, then `The command exited with status 1`. The command runs under `bash -elic`, so the `exit 0` likely goes through login-shell logout handling. I inferred that cause from the log and couldn't reproduce it locally. This PR replaces the gate with two changes: - **Converge on every run.** `rtd-redirects apply` already converges: when the live project matches `current.yaml`, it makes only read calls, prints `apply: no changes`, and exits 0 (`cli.py` in anyscale-rtd-redirects 0.2.0). A redirect merge now goes live on the next postmerge run of the step, not only when it happens to be that build's commit. - **Guard against stale checkouts.** Release automation triggers postmerge with its own branch and commit (`.buildkite/release-automation/pre_release.rayci.yml`). In September, 18 of the 88 full postmerge builds ran on `releases/*`. Because `apply` deletes live redirects that aren't in the file, applying an older `current.yaml` would roll back newer redirects. The step now applies only on a `master` build whose `doc/redirects/` matches the freshly fetched `origin/master`. Otherwise it logs why it skipped and passes. It skips the same way if the fetch fails. Cursor Bugbot flagged this on the first revision. The skip path no longer calls `exit`, and the token is fetched only when the step applies. The step comment and `doc/redirects/README.md` are updated to match. The step is still `skip-on-premerge` and still reads the dedicated `oss-ci/rtd-api-token` secret. ## Related PRs - #66024 enabled the step. - #65866 added it, disabled. - Duplicate check: no open PR touches this step. I searched open PRs for "redirect apply" and reviewed the open redirect PR #66027, which stages release-gated redirects and doesn't change the apply gate. ## Testing - `pre-commit run --files .buildkite/doc.rayci.yml doc/redirects/README.md`: passes. - Parsed `.buildkite/doc.rayci.yml` with `yaml.safe_load` and confirmed the `doc_redirects_apply` commands are the file guard, the pinned install, and the guarded apply block. - Extracted the guarded block, with the token fetch and `apply` replaced by fakes, and ran it with `bash -e` in a scratch git repo against a local bare `origin`: - `master` at the tip: applies. - Older `master` SHA with the same `doc/redirects/`: applies. - `releases/2.50.0`: skips, exit 0. - Older `master` SHA whose `doc/redirects/` has since changed: skips, exit 0. - Fetch fails: skips with its own message, exit 0. The fetch runs only on `master` builds, and a missed apply converges on the next run. - `rtd-redirects plan --project anyscale-ray --file doc/redirects/current.yaml --strict` with 0.2.0 against the live project showed the one missed update. `apply --strict --yes` applied it (`1 updated`), and a follow-up `plan` reports `0 add, 0 update, 0 delete, 0 reorder`. `https://docs.ray.io/en/latest/data/dataset.html` now 301s to `/en/latest/data/api/dataset.html`. - The step runs only on postmerge, so this PR's CI doesn't exercise it. The check is the first postmerge run after merge: it should log `apply: no changes` and pass. ## AI assistance This PR was prepared with AI assistance (Claude Code). I reviewed every changed line and the Buildkite evidence above. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
nadongjun
pushed a commit
to nadongjun/ray
that referenced
this pull request
Oct 6, 2026
…ay-project#66427) ## Why are these changes needed? The postmerge `doc: apply redirects` step, enabled in ray-project#66024, has failed on every run since it was turned on, and it never applied a redirect change. The one change that merged since then, the `/data/dataset.html` target updated in ray-project#66024 itself, didn't reach Read the Docs until a maintainer applied it by hand. There are two problems, and both come from the `HEAD~1..HEAD` gate at the top of the step: 1. **The gate checks the wrong range.** The step isn't scheduled on every master merge. In the postmerge builds since 2026-09-18, it appears only in the full builds that release automation triggers, a few times a day, and not in the per-merge builds. A `git diff HEAD~1 HEAD -- doc/redirects/` check sees only the single commit that build is on, so a redirect merge that isn't that commit is never applied. 2. **The skip path reports failure.** All 12 runs from [postmerge ray-project#19792](https://buildkite.com/ray-project/postmerge/builds/19792) through [ray-project#19893](https://buildkite.com/ray-project/postmerge/builds/19893) logged `no doc/redirects/ change in this merge; nothing to apply`, then `logout`, then `The command exited with status 1`. The command runs under `bash -elic`, so the `exit 0` likely goes through login-shell logout handling. I inferred that cause from the log and couldn't reproduce it locally. This PR replaces the gate with two changes: - **Converge on every run.** `rtd-redirects apply` already converges: when the live project matches `current.yaml`, it makes only read calls, prints `apply: no changes`, and exits 0 (`cli.py` in anyscale-rtd-redirects 0.2.0). A redirect merge now goes live on the next postmerge run of the step, not only when it happens to be that build's commit. - **Guard against stale checkouts.** Release automation triggers postmerge with its own branch and commit (`.buildkite/release-automation/pre_release.rayci.yml`). In September, 18 of the 88 full postmerge builds ran on `releases/*`. Because `apply` deletes live redirects that aren't in the file, applying an older `current.yaml` would roll back newer redirects. The step now applies only on a `master` build whose `doc/redirects/` matches the freshly fetched `origin/master`. Otherwise it logs why it skipped and passes. It skips the same way if the fetch fails. Cursor Bugbot flagged this on the first revision. The skip path no longer calls `exit`, and the token is fetched only when the step applies. The step comment and `doc/redirects/README.md` are updated to match. The step is still `skip-on-premerge` and still reads the dedicated `oss-ci/rtd-api-token` secret. ## Related PRs - ray-project#66024 enabled the step. - ray-project#65866 added it, disabled. - Duplicate check: no open PR touches this step. I searched open PRs for "redirect apply" and reviewed the open redirect PR ray-project#66027, which stages release-gated redirects and doesn't change the apply gate. ## Testing - `pre-commit run --files .buildkite/doc.rayci.yml doc/redirects/README.md`: passes. - Parsed `.buildkite/doc.rayci.yml` with `yaml.safe_load` and confirmed the `doc_redirects_apply` commands are the file guard, the pinned install, and the guarded apply block. - Extracted the guarded block, with the token fetch and `apply` replaced by fakes, and ran it with `bash -e` in a scratch git repo against a local bare `origin`: - `master` at the tip: applies. - Older `master` SHA with the same `doc/redirects/`: applies. - `releases/2.50.0`: skips, exit 0. - Older `master` SHA whose `doc/redirects/` has since changed: skips, exit 0. - Fetch fails: skips with its own message, exit 0. The fetch runs only on `master` builds, and a missed apply converges on the next run. - `rtd-redirects plan --project anyscale-ray --file doc/redirects/current.yaml --strict` with 0.2.0 against the live project showed the one missed update. `apply --strict --yes` applied it (`1 updated`), and a follow-up `plan` reports `0 add, 0 update, 0 delete, 0 reorder`. `https://docs.ray.io/en/latest/data/dataset.html` now 301s to `/en/latest/data/api/dataset.html`. - The step runs only on postmerge, so this PR's CI doesn't exercise it. The check is the first postmerge run after merge: it should log `apply: no changes` and pass. ## AI assistance This PR was prepared with AI assistance (Claude Code). I reviewed every changed line and the Buildkite evidence above. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Douglas Strodtman <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are these changes needed?
The newsreader example was lacking in text and had a very different feel from the other examples. I've converted the format from a bullet point list of tasks to a more conversational format like the others. I've also added a little bit of extra text to ensure that users don't get off course.
I still think this example lacks some contextual explanations - i.e. what is Ray providing here? What is happening behind the scenes. But I'm not familiar enough to be the one to provide it :)
Related issue number
None
Checks
scripts/format.shto lint the changes in this PR.