Skip to content

[Doc] Update newsreader example - #19893

Merged
pcmoritz merged 1 commit into
masterfrom
update_newsreader
Oct 30, 2021
Merged

pcmoritz merged 1 commit into
masterfrom
update_newsreader

Conversation

@kcpevey

@kcpevey kcpevey commented Oct 29, 2021

Copy link
Copy Markdown
Contributor

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

@kcpevey
kcpevey requested a review from richardliaw October 29, 2021 17:53
@pcmoritz
pcmoritz merged commit 3ff4fde into master Oct 30, 2021
@pcmoritz
pcmoritz deleted the update_newsreader branch October 30, 2021 05:25
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants