Repository navigation
ci(docs): dispatch docs-updated to the rossoctl site; add the publish denylist - #881
Conversation
ingpaolodettori-dev
left a comment
There was a problem hiding this comment.
Review at aebd504
Summary
Adds the moca side of the docs-site migration: docs-dispatch sends docs-updated to rossoctl/.github on a push under docs/** to main (warning + exit 0 when SITE_DISPATCH_TOKEN is unset), and docs/.publish-denylist feeds the site's publish guard. CI is 16/16 green. No .claude//.vscode/ changes and no injection attempts in the title, body, diff or commit; the workflow uses no third-party actions and declares permissions: contents: read.
Verified against rossoctl/.github#227 @ e999447 (open): deploy.yaml already has the repository_dispatch: types: [docs-updated] trigger and the 06:17 UTC fallback; sync-docs.sh step 4 strips comment/blank lines from this denylist, deletes the file from the staged tree, and skips the whole Moca section on any grep -rIlE -f hit. docs/index.md exists, so the section is not silently skipped.
Context, not a finding: 26 files under docs/ currently match SBX[0-9], and several are publishable (docs/index.md, docs/reference/configuration.md, docs/api/*), not only the excluded design directories. That matches #227's stated design (merging it publishes nothing until the pages are scrubbed), but it is worth knowing before the site PR lands.
Three inline items: one suggestion (validate the denylist's EREs, because the site's guard hides a grep exit 2 behind || true), two nits.
Author: pdettori (MEMBER — maintainer)
Areas reviewed: GitHub Actions workflow, docs config
Agent/IDE config (.claude/.vscode): none
Commits: 1 commit, signed-off: yes
CI status: passing (16/16)
Base: 6db4171c, behind main (2eb02195); mergeable, blocked pending review
Drafted by an AI reviewer and approved by a human before posting.
| # section on any match, listing the files. specs/, notes/, plans/, archive/, | ||
| # demos/, adrs/ and REORG-PLAN.md are not published, so they are not checked. | ||
| # | ||
| # One extended regular expression (grep -E) per line; blank lines and lines |
There was a problem hiding this comment.
suggestion: Consider validating these patterns in moca's docs CI. The site's guard runs leaks="$(grep -rIlE -f "$patterns" "$MOCA_STAGE" | ... || true)" (sync-docs.sh:177). If any line here is not a valid extended regex, grep exits 2 with no matches, || true swallows it, the leak list comes out empty and the whole Moca section publishes with the guard silently bypassed — precisely the failure this file exists to prevent. Matching the site's own filter keeps the two in step, e.g. in the docs job of ci.yml:
grep -vE '^[[:space:]]*(#|$)' docs/.publish-denylist | while IFS= read -r re; do
rc=0; grep -qE -- "$re" /dev/null || rc=$?
[ "$rc" -le 1 ] || { echo "invalid denylist regex: $re" >&2; exit 1; }
doneThe two current patterns are valid; this is about future edits.
| # One extended regular expression (grep -E) per line; blank lines and lines | ||
| # starting with # are ignored. SBX[0-9] is also built into the site's check. | ||
| SBX[0-9] | ||
| [Ii]nternal cohort |
There was a problem hiding this comment.
nit: grep -E is case-sensitive, so this matches "internal cohort" and "Internal cohort" but not "Internal Cohort". Every current hit in a publishable file uses a lowercase "cohort", so nothing leaks today, but the phrase is often capitalised in prose and headings. [Ii]nternal [Cc]ohorts? would be robust to that without widening the match.
| echo "Sent \`docs-updated\` to rossoctl/.github. The site rebuilds" | ||
| echo "\`/moca/*\` from this commit, if it passes the publish guard." | ||
| else | ||
| echo "\`SITE_DISPATCH_TOKEN\` is not set, so the site was not notified." |
There was a problem hiding this comment.
nit: This else branch also runs when the dispatch itself failed — e.g. SITE_DISPATCH_TOKEN is set but expired, or lacks Contents: read/write on rossoctl/.github. steps.dispatch.outputs.notified is only written in the missing-token branch (line 57) or after a successful gh api (line 78), so a 403/404 leaves it empty and the summary reports "SITE_DISPATCH_TOKEN is not set", which is the wrong diagnosis. Setting notified=false before the token check, or wording this branch as "was not notified — see the dispatch step", keeps the summary truthful. The sibling workflow in rossoctl/rossoctl has the same shape, so this is a shared nit rather than something specific to this PR.
… denylist rossoctl.dev gains a Moca section (/moca/*) synced from this repository's docs/ (rossoctl/.github#227). This adds the moca side: - .github/workflows/docs-dispatch.yaml sends the docs-updated repository_dispatch to rossoctl/.github on a push to docs/** on main, as rossoctl/rossoctl does, so a docs merge reaches the site within minutes rather than at the daily resync. It needs the SITE_DISPATCH_TOKEN secret; without it the job warns and exits 0. - docs/.publish-denylist lists what must never appear on the public site: the names of internal deployments (SBX0, SBX1, ...) and their cohorts. The site skips the whole Moca section while any published file matches, so nothing is published until the pages are clean. Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Paolo Dettori <[email protected]>
aebd504 to
c4ece01
Compare
Summary
This PR is the moca side of step 1 of the docs migration. The rossoctl website is getting a Moca section at
/moca/*, synced from this repository'sdocs/(rossoctl/.github#227). This PR adds the two moca pieces that section needs..github/workflows/docs-dispatch.yamlsends thedocs-updatedrepository_dispatchtorossoctl/.githubon a push todocs/**onmain, the same wayrossoctl/rossoctldoes. A docs merge then reaches the site within minutes instead of waiting for the daily 06:17 UTC resync.docs/.publish-denylistlists what must never appear on the public site: the names of internal deployments (SBX[0-9]) and their cohorts. The site's sync step checks every file it would publish against this list. On any match it skips the whole Moca section and lists the matching files.What this changes for readers
Nothing yet. Today's
docs/matches the denylist in 9 files (docs/index.md,docs/sbx/*,docs/api/*,docs/reference/configuration.md), so the site keeps skipping Moca. The section goes live with the follow-up content PR, which brings:downcontradictions;specs/,notes/,plans/,archive/,demos/,adrs/andREORG-PLAN.mdaren't published, so the guard doesn't check them.Setup needed (maintainer)
Create the
SITE_DISPATCH_TOKENsecret, a fine-grained token with Contents read/write onrossoctl/.githubonly:Until the secret exists, the workflow warns and exits 0, so it never fails a merge.
Testing
[email protected] --check: clean.main, the Moca section is skipped and the 9 files are listed;Assisted-By: Claude Code