Skip to content

The docs job checks out the ctrlrun-docs branch of the same name, or main - #180

Merged
rohanrkamath merged 2 commits into
mainfrom
ci/docs-job-follows-the-branch
Sep 13, 2026
Merged

rohanrkamath merged 2 commits into
mainfrom
ci/docs-job-follows-the-branch

Conversation

@arpanghoshal

@arpanghoshal arpanghoshal commented Sep 13, 2026

Copy link
Copy Markdown
Member

Why every run since #174 has been red

Every ci.yml run since PR #174 merged failed at the same step: render_api.py --check, eleven and then fifteen pages under docs/reference/api differing from the docstrings. The docs job checked out CTRLRun/ctrlrun-docs at main, whatever commit it was checking, and the page for a commit that has not merged cannot be on main yet. So every pull request that touched a docstring or a --help was red until it merged, and ctrlrun-docs PR #14, regenerated against the whole v0.10 stack, was red the other way round because that repository's CI checks pages against this one's main. Each side waited for the other, by construction.

The ruleset does not require docs, so nothing was blocked. badge and notify-docs need it, so the test-count badge stopped moving at item 1 and ctrlrun-docs received no dispatch.

What changes

The docs job asks ctrlrun-docs for a branch named after the one under test (github.head_ref on a pull request, github.ref_name on a push) and checks out that one when it exists, main otherwise. A branch here that changes a signature is accompanied by a branch there of the same name, regenerated against it, and each is checked against the other. main is checked against main, so the pages on main are expected to match this repository's main at all times: the docs branch merges when the kernel branch does, the code first. CONTRIBUTING.md says so in the section that already said the checks read both trees.

The fallback is main and not a skip: a branch that forgot its pages is a red job, not a green one that verified nothing. The branch name reaches the shell through env:, never inline in the script (Scorecard's Dangerous-Workflow check reads for that), and the match is exact and fixed-string because ls-remote matches a pattern against the tail of a ref.

The pair

CTRLRun/ctrlrun-docs#15 is the same-named branch: the mirror-image CI change there, plus the pages regenerated against this repository's main as it stands (v0.10 items 1 to 5), which is what makes this PR's docs job green and will make main's green once both merge. Merge order: this PR, then that one.

Checks

test_repository_signals.py, test_verify_action.py and test_packaging.py pass locally except test_T118, which reads the installed package and fails identically on main in this environment (the venv's editable install points at an older checkout). No test asserts on the step that was added; the ones that read the docs job assert needs:, if: and the write step, none of which moved.

🤖 Generated with Claude Code

…main

Every run of `ci.yml` since PR #174 merged has been red, and every one at the
same step: `render_api.py --check`, eleven and then fifteen pages under
docs/reference/api differing from the docstrings. The pages were regenerated
in CTRLRun/ctrlrun-docs on the day, against the whole v0.10 stack, and that
branch could not merge either: its own CI checks pages against this
repository's `main`, which had two of the five items. Each side was waiting
for the other, by construction, for the length of the release cycle.

The cause is one line: the `docs` job checked out ctrlrun-docs at `main`,
whatever it was checking. A page describes a commit, and the page for a
commit that has not merged cannot be on `main` yet, so every pull request that
touched a docstring or a `--help` was red until it merged, and a check that is
always red is a check nobody reads. The ruleset does not require `docs`, so
nothing was blocked; `badge` and `notify-docs` need it, so the test-count
badge stopped moving at item 1 and ctrlrun-docs received no dispatch.

Now the job asks ctrlrun-docs for a branch named after the one under test
(`github.head_ref` on a pull request, `github.ref_name` on a push) and checks
out that one when it exists, `main` otherwise. A branch here that changes a
signature is accompanied by a branch there of the same name, regenerated
against it, and each is checked against the other; ctrlrun-docs' CI gains the
mirror image in the same-named branch there. `main` is checked against `main`,
so the pages on `main` are expected to match this repository's `main` at all
times: the docs branch merges when the kernel branch does, the code first.

The fallback is `main` and not a skip, for the reason the `continue-on-error`
flags left this job: a branch that forgot its pages is a red job, not a green
one that verified nothing. The branch name reaches the shell through `env:`
and never inline in the script, so a branch called `$(...)` is a string and
not a command, which is also what Scorecard's Dangerous-Workflow check reads
for. The match is exact and fixed-string, because `ls-remote` matches a
pattern against the tail of a ref and `.` in a version is a regex wildcard.

CONTRIBUTING.md says where the pages for a change go, in the section that
already said the checks read both trees.

No test changes: `test_the_badge_job_publishes_the_badge_the_verify_job_produced`
and ctrlrun-docs' `test_ci_publishes_the_test_count_badge_after_the_suite_has_passed` read the
job's `needs:`, its `if:` and its write step, none of which moved.

Signed-off-by: arpan <contact@arpanghoshal.com>
@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 49 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 3b5b9dbe-ddc4-4e3d-ae71-3a1074dd5685

📥 Commits

Reviewing files that changed from the base of the PR and between 277932f and 9d1b77a.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • CONTRIBUTING.md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@rohanrkamath
rohanrkamath merged commit a16db83 into main Sep 13, 2026
16 checks passed
@rohanrkamath
rohanrkamath deleted the ci/docs-job-follows-the-branch branch September 13, 2026 20:21
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