Skip to content

[ci] Split doc CI routing into a docs-owned doc.rules.txt fragment - #65951

Closed
dstrodtman wants to merge 2 commits into
masterfrom
doc-1649-doc-rules-fragment
Closed

dstrodtman wants to merge 2 commits into
masterfrom
doc-1649-doc-rules-fragment

Conversation

@dstrodtman

Copy link
Copy Markdown
Contributor

What

Splits the doc/-scoped change-detection rules out of .buildkite/test.rules.txt into a new .buildkite/doc.rules.txt that @ray-project/ray-docs co-owns.

rayci discovers every .buildkite/*.rules.txt, evaluates each on its own with first-match-wins, and unions the emitted tags across files. So a dedicated doc fragment is picked up with no rayci change — this is a rules-file-only change. It lets the docs team iterate on doc CI routing without a review seat on test.rules.txt/always.rules.txt, which route CI for the whole repo.

How

  • Moved the 15 rules whose paths are entirely under doc/ into doc.rules.txt (the doc_api page block, the autodoc/conf.py infra, doc/redirects, doc/BUILD.bazel, the per-library <lib>_doc routing, _intersphinx, templates, the doc/*.py catch-all).
  • Duplicated 4 shared skip rules that also match non-doc/ paths (the prose/image skip, which also covers repo-root .claude/; the doc/source/llm route; the render-infra rule, which also covers .vale; and the terminal doc/ skip). The full rule stays in test.rules.txt for its non-doc paths; a doc-only copy leads/orders the fragment so doc/ paths resolve the same first-match.
  • Left the rules that touch shared, non-doc/ surfaces in test.rules.txt: the docs deplock (which must win first-match above the general python/deplocks/ rule), .buildkite/doc.rayci.yml, .readthedocs.yaml, and ci/ray_ci/doc/. Those keep repo-wide blast radius.
  • Added a .buildkite/doc.rules.test.txt companion and re-homed the doc cases out of test.rules.test.txt.
  • Added @ray-project/ray-docs co-ownership of the fragment in CODEOWNERS, mirroring the existing .readthedocs.yaml pattern; the repo-wide rule files stay @ray-project/ray-ci.

This is a no-op on what CI runs. It only changes which file the doc routing lives in and who can review a doc-routing edit.

Testing

  • Tag-preservation, repo-wide: using rayci's own union evaluator (loadTagRuleConfigs + tagsForChangedFiles), the emitted tag set is identical before and after the split for all 10,389 tracked files (1,677 under doc/). 0 mismatches.
  • rayci test-rules passes with the new doc.rules.test.txt companion and the trimmed test.rules.test.txt.
  • pre-commit run --files on all changed files passes (trailing-whitespace, end-of-files, large-files; the rest are not-applicable to rules files).

Not a duplicate

No open PR touches doc.rules.txt or splits doc routing. The adjacent open PRs (#65941, #65950) route dependencies.rayci.yml through deplock_check — a different rule and concern.

Note for reviewers

This is an ownership-boundary change on a shared CI surface, so it's up as a draft pending REEf alignment on the boundary before merge. The intent is that docs owns only the doc/-scoped fragment and gains no authority over the repo-wide rule files or the shared dependency/CI surfaces. @elliot-barn — this is the doc-routing-ownership split we discussed; the extraction is verified tag-preserving so the review is about the boundary, not the routing.

AI assistance (Claude) was used to author and verify this change.

The doc/-scoped change-detection rules lived in .buildkite/test.rules.txt,
which routes CI for the whole repo and is owned by @ray-project/ray-ci alone.
That coupled every doc CI routing tweak to a repo-wide-blast-radius file and
required ray-ci review for a doc-only change.

rayci discovers every .buildkite/*.rules.txt, evaluates each on its own with
first-match-wins, and unions the emitted tags across files. This moves the
doc/-scoped routing into a new .buildkite/doc.rules.txt that @ray-project/ray-docs
co-owns, so the docs team can iterate on doc CI routing without a seat on the
repo-wide rule files. No rayci change is needed.

Rules whose paths are entirely under doc/ are moved. Four shared skip rules
that also match non-doc/ paths (the prose/image skip, the doc/source/llm route,
the render-infra rule, and the terminal doc/ skip) are duplicated as doc-only
copies: the full rule stays in test.rules.txt for its non-doc paths, and the
copy reproduces first-match order for doc/ paths. Rules that touch shared,
non-doc/ surfaces (the docs deplock above the general python/deplocks/ rule,
.buildkite/doc.rayci.yml, .readthedocs.yaml, ci/ray_ci/doc/) stay in
test.rules.txt.

Verification: the emitted tag set is identical before and after the split for
every one of the 10,389 tracked files in the repo, computed with rayci's own
union evaluator (loadTagRuleConfigs + tagsForChangedFiles). `rayci test-rules`
passes with the new .buildkite/doc.rules.test.txt companion and the doc cases
re-homed out of test.rules.test.txt.

AI assistance (Claude) was used to author and verify this change.

Signed-off-by: Douglas Strodtman <[email protected]>
Moving the doc_api routing into .buildkite/doc.rules.txt broke
//ci/pipeline:test_doc_api_rules_sync, which read the doc_api rule out of
.buildkite/test.rules.txt alone. The routing still fires in a real build (rayci
unions the two files' tags), but the test looked at one file.

Teach the test to read both rule files and union their tags, which is what rayci
does. It deliberately does not merge them into one TagRuleSet: a skip rule in one
file can't suppress a match in another under rayci's union, but it would in a
single merged first-match-wins pass (test.rules.txt's terminal doc/ skip would
shadow the fragment's routing). Enumeration of doc_api rule dirs is
order-independent, so that path just iterates both files' rules.

Also export doc.rules.txt from //.buildkite and add it to the test's data deps
so it lands in the bazel sandbox.

Verified: `bazel`-free `pytest ci/pipeline/test_doc_api_rules_sync.py` passes;
pre-commit (ruff, buildifier, black, docstyle, import-order) passes.

AI assistance (Claude) was used to author and verify this change.

Signed-off-by: Douglas Strodtman <[email protected]>
@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had
any activity for 14 days. It will be closed in another 14 days if no further activity occurs.
Thank you for your contributions.

You can always ask for help on our discussion forum or Ray's public slack channel.

If you'd like to keep this open, just leave any comment, and the stale label will be removed.

@github-actions github-actions Bot added the stale The issue is stale. It will be closed within 7 days unless there are further conversation label Sep 19, 2026
dstrodtman added a commit that referenced this pull request Sep 23, 2026
#66429)

## Description

The `/doc/` catch-all lists `@ray-project/ray-docs-reviewers` as a
silent fallback (notifications disabled), so docs leads can unblock a
docs-required review when no one else is available. The per-library doc
rules added in #65704 and earlier didn't carry it over.

CODEOWNERS is last-match-wins: the more specific library rule replaces
the catch-all's owners instead of adding to them. So every file under a
library doc directory lost the fallback. That covers all four LLM doc
rules (`llm/`, `serve/llm/`, `data/working-with-llms.rst`,
`data/doc_code/working-with-llms/`) and the other 11 library doc rules
(`cluster/`, `cluster/kubernetes/`, `ray-core/`, `ray-observability/`,
`ray-more-libs/`, `data/`, `rllib/`, `tune/`, `train/`, `ray-air/`,
`serve/`).

This PR adds `@ray-project/ray-docs-reviewers` to each of those 15 rules
and records the invariant in the catch-all comment: every rule that
lists `ray-docs` must also list `ray-ci` or `ray-docs-reviewers`.

The fallback is `ray-docs-reviewers` rather than `ray-ci` because the
team has notifications disabled, so library doc PRs don't page anyone
new. Library teams and `ray-docs` keep exactly the ownership they had.

## Related issues

Follows up on #65704, which introduced the per-library doc rules.

## Additional information

**Verification**

- After the change, `grep` finds no CODEOWNERS rule that lists
`@ray-project/ray-docs` without `ray-ci` or `ray-docs-reviewers`.
- `gh api repos/ray-project/ray/codeowners/errors?ref=<this branch>`
reports no new errors. The only two errors (unknown owner `@jackfrancis`
on the Azure autoscaler lines) exist identically on `master`.
- `ray-docs-reviewers` already appears on `/doc/` and
`/.readthedocs.yaml`, so this introduces no new team reference.

**Not a duplicate:** The only other open PR touching CODEOWNERS is
#65951, which edits the `.buildkite` rules and doesn't overlap these
lines.

**AI assistance:** AI assistance (Claude Code) was used to draft this
change. I reviewed every line and stand behind it.

🤖 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]>
@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown

This pull request has been automatically closed because there has been no more activity in the 14 days
since being marked stale.

Please feel free to reopen or open a new pull request if you'd still like this to be addressed.

Again, you can always ask for help on our discussion forum or Ray's public slack channel.

Thanks again for your contribution!

@github-actions github-actions Bot closed this Oct 3, 2026
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
ray-project#66429)

## Description

The `/doc/` catch-all lists `@ray-project/ray-docs-reviewers` as a
silent fallback (notifications disabled), so docs leads can unblock a
docs-required review when no one else is available. The per-library doc
rules added in ray-project#65704 and earlier didn't carry it over.

CODEOWNERS is last-match-wins: the more specific library rule replaces
the catch-all's owners instead of adding to them. So every file under a
library doc directory lost the fallback. That covers all four LLM doc
rules (`llm/`, `serve/llm/`, `data/working-with-llms.rst`,
`data/doc_code/working-with-llms/`) and the other 11 library doc rules
(`cluster/`, `cluster/kubernetes/`, `ray-core/`, `ray-observability/`,
`ray-more-libs/`, `data/`, `rllib/`, `tune/`, `train/`, `ray-air/`,
`serve/`).

This PR adds `@ray-project/ray-docs-reviewers` to each of those 15 rules
and records the invariant in the catch-all comment: every rule that
lists `ray-docs` must also list `ray-ci` or `ray-docs-reviewers`.

The fallback is `ray-docs-reviewers` rather than `ray-ci` because the
team has notifications disabled, so library doc PRs don't page anyone
new. Library teams and `ray-docs` keep exactly the ownership they had.

## Related issues

Follows up on ray-project#65704, which introduced the per-library doc rules.

## Additional information

**Verification**

- After the change, `grep` finds no CODEOWNERS rule that lists
`@ray-project/ray-docs` without `ray-ci` or `ray-docs-reviewers`.
- `gh api repos/ray-project/ray/codeowners/errors?ref=<this branch>`
reports no new errors. The only two errors (unknown owner `@jackfrancis`
on the Azure autoscaler lines) exist identically on `master`.
- `ray-docs-reviewers` already appears on `/doc/` and
`/.readthedocs.yaml`, so this introduces no new team reference.

**Not a duplicate:** The only other open PR touching CODEOWNERS is
ray-project#65951, which edits the `.buildkite` rules and doesn't overlap these
lines.

**AI assistance:** AI assistance (Claude Code) was used to draft this
change. I reviewed every line and stand behind it.

🤖 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]>
edoakes pushed a commit that referenced this pull request Oct 6, 2026
…landings (#66605)

## Why are these changes needed?

Brings the Ray Core docs paths in line with the rest of the docs tree,
in one path-only change:

1. **Drop the `ray-` prefix:** `doc/source/ray-core/` becomes
`doc/source/core/`.
2. **One landing convention:** every Ray Core section lands on an
`index.md`, matching `scheduling/index.md` and `patterns/index.md`.
3. **Hyphenated slugs:** underscore filenames become hyphens.

Both steps ship together because almost all of this PR's CI cost comes
from shared files (`doc/BUILD.bazel`, the test rules, `conf.py`, and the
`worker.py` docstrings) that fan premerge out to most library suites.
Splitting it would pay that cost twice.

No prose changes. Every file keeps its git history. Against master, git
detects all 222 moved files as renames, with no adds or deletes.

## What changed

The PR has two commits, one per step.

### Commit 1: move `ray-core/` to `core/`

- `git mv doc/source/ray-core doc/source/core`.
- Path references that move with the files: toctrees and nav
(`index.md`, `navbar.yml`, `_templates/index.html`, `apis/index.md`),
and inbound `{doc}`, `button-ref`, and `literalinclude` paths from
`ray-overview/`, `data/`, `ray-observability/`, and `ray-contribute/`.
`conf.py` exclude and API-page lists move too.
- **API reference docstrings:** nine `:doc:` refs to
`/ray-core/patterns/...` in `python/ray/_private/worker.py`. Autodoc
renders them into the `ray.get`, `ray.put`, and `ray.wait` pages, so the
build fails under `fail_on_warning` without them. This file is why
premerge fans out beyond the doc steps.
- **CI and ownership:** `doc/BUILD.bazel` labels and globs (buildifier
re-sorted one label list), `.github/CODEOWNERS`, the doc routing in
`.buildkite/test.rules.txt` with its expectations in
`test.rules.test.txt` and `always.rules.test.txt`, the `doc/Makefile`
clean target, `_ext/api_sidebar.py`, and the API consistency check
config in `ci/ray_ci/doc/cmd_check_api_discrepancy.py`.
- **Not changed:** `ray-core` as a CI image, wheel, or build step name
(`ray-core-build`, `ray-core-py*`, `ci/docker/ray-core.*`), the
`@ray-project/ray-core` team, `.. _ray-core-*` labels, and absolute
`docs.ray.io/.../ray-core/...` URLs in source code and READMEs. The
redirects keep those URLs working.

### Commit 2: landings to `index.md` and hyphenated slugs

| Old path under `core/` | New path |
|---|---|
| `walkthrough.md` | `index.md` |
| `actors.md`, `objects.md`, `tasks.md`, `fault-tolerance.md`,
`internals.md` | `<dir>/index.md` |
| `compiled-graph/ray-compiled-graph.md`,
`direct-transport/direct-transport.md` | `<dir>/index.md` |
| `examples/overview.md` | `examples/index.md` |
| `runtime_env_auth.md` | `runtime-env-auth.md` |
| `actors/async_api.md`, `actors/concurrency_group_api.md` |
`actors/async-api.md`, `actors/concurrency-group-api.md` |
| `tasks/dynamic_generators.md` | `tasks/dynamic-generators.md` |
| `examples/monte_carlo_pi.md` | `examples/monte-carlo-pi.md` |
| `fault_tolerance/` (5 pages) | `fault-tolerance/` |

Hub pages that moved one level deeper get their relative toctree
entries, `doc_code/` includes, and `{doc}` links rebased, for example
`actors/named-actors` becoming `named-actors`. Inbound references move
to the new landings. Out of scope: notebook slugs and the `api/` pages.

## Redirects

`doc/redirects/current.yaml`. Page rules fire only on a 404, and
`/en/latest/` keeps serving `ray-core/` until the next release promotes
this change. The rules are written so both versions resolve correctly in
the meantime:

- **Renamed pages get single-hop rules.** Every old
`/ray-core/<page>.html` and `/core/<page>.html` of a page renamed in
commit 2 has its own rule to the final `/core/` path, plus
`fault_tolerance/*` wildcards.
- **Catch-all:** `/ray-core/*` to `/core/:splat` for everything else. It
sits after all the specific `/ray-core/` rules.
- **Trailing catch-alls:** the two existing ones become
`/core/examples/*` and `/core/api/*`. Left as `/ray-core/...`, they
would send moved pages to a landing page before the splat could run.
- **Repointed:** the one master-pinned rule, `/placement-group.html`,
now targets `/en/master/core/...`.
- **Intentionally not repointed, now or later:** older rules whose
target is a `/ray-core/...` page, such as `/tutorial.html` to
`/ray-core/walkthrough.html`. Older releases still serve `ray-core/`, so
those rules keep resolving there directly. On versions with the move,
they reach the right page in a second hop through `/ray-core/*`.
Repointing them to `/core/...` would send readers of every older release
to a page their version doesn't have. They account for the new `chain`
warnings from `rtd-redirects validate`, which reports 0 errors. `apply
--strict` blocks only on errors, so these warnings don't stop the
postmerge apply.

## Duplicate check

No open PR moves or renames these paths. Searched open `ray-project/ray`
PRs for `ray-core`, `walkthrough`, `fault_tolerance`, and `async_api` in
titles, plus my own open PRs. Overlapping surface: #65951 moves doc
routing out of `test.rules.txt` into a docs-owned fragment. Whichever PR
lands second needs a rebase on the routing lines.

## Testing

- **Docs build:** `make -C doc rtd-build`, the RtD-faithful clean build
on Python 3.11 with `doc/requirements-doc.lock.txt`. Ran on each commit.
Both passed with `build succeeded.` and exit 0 under `-W`, so zero
Sphinx warnings.
- **Test rules:** rayci `test-rules` (v0.48.0 from `.rayciversion`,
built locally) passed all 166 expectations on each commit. A
deliberately broken expectation failed as expected, so the check is
live.
- **Tag routing:** a dry run with
`ci/pipeline/determine_tests_to_run.py` shows all 222 moved files emit
the same tags at their new paths, against the new rules, as at their old
paths against master's rules.
- **API rules sync:** `pytest ci/pipeline/test_doc_api_rules_sync.py`
gave 2 passed.
- **Redirect validation:** `rtd-redirects validate
doc/redirects/current.yaml` reports 0 errors.
- **Redirect simulation:** a local simulator of RtD resolution replayed
484 old URLs against master's rules and pages, then against this PR's,
on `/en/master/`, on `/en/latest/` (Ray 2.58.0 pages), and on two older
releases. It modeled first-match order, fire-only-on-404, wildcards and
`:splat`, `exact` rules, and version-pinned targets. Results:
  - 0 URLs that resolved before and don't now.
  - 0 URLs that land on a different page than the moved original.
- Every old URL of a page renamed in commit 2 reaches its new page in
one hop on master.
- On older releases (`releases-2.40.0` and `releases-2.20.0` pages), 0
of 391 URLs change or break. Repointing the existing `/ray-core/`
targets instead would break 48 on each.
- Checked against the live site for master's rules, the simulator
matched docs.ray.io on all 62 sampled URLs whose pages are in git,
including hop counts. The other 34 sampled URLs were build-generated
`/_collections/` pages, which the simulator's page sets don't include.
- The simulator's master page set matched the built HTML exactly, and
every redirect target under `/core/` exists in the build.
- **pre-commit:** passed.
- **Not run locally:** the Bazel doctest targets for `core/`. Premerge
`core_doc` and `ml_doc` cover them.

Prepared with AI assistance (Claude Code). Draft until the submitter has
reviewed every changed line.

🤖 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

stale The issue is stale. It will be closed within 7 days unless there are further conversation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant