Skip to content

fix(docs): send scopes with the flag the CLI documents - #12455

Merged
mergify[bot] merged 2 commits into
mainfrom
devs/jd/jd/mrgfy-8721-docs-repo-internal-leak-scan-misses-bare-ticket-refs-and/send-scopes-flag-cli-documents--7691b715
Aug 21, 2026
Merged

fix(docs): send scopes with the flag the CLI documents#12455
mergify[bot] merged 2 commits into
mainfrom
devs/jd/jd/mrgfy-8721-docs-repo-internal-leak-scan-misses-bare-ticket-refs-and/send-scopes-flag-cli-documents--7691b715

Conversation

@jd

@jd jd commented Aug 19, 2026

Copy link
Copy Markdown
Member

The "Any CI (Mergify CLI)" block on the four monorepo scopes pages ends in
mergify ci scopes-send --file scopes.json. --file is a deprecated alias, kept
hidden from --help and from public/cli-schema.json since the CLI was ported
to Rust: it still works, and prints Warning: --file is deprecated, use --scopes-json instead. on every run. So a reader copying the block gets a
deprecation warning for a flag they cannot look up.

--scopes-json is the right one, not --scopes-file: it reads the
{"scopes": [...]} object, which is exactly the shape every page's jq filter
writes, while --scopes-file expects one scope per line. Confirmed against the
CLI's own reader — it deserializes scopes plus an optional all_scopes, so the
examples need no change, and --all documented on the scopes page stays
consistent with it.

While in the block, the base and head refs now come from --format json piped
through jq instead of awk '/^Base:/ {print $2}' on the default output. The
text format is the human one with no stability promise; json and shell are
the two contracts meant for scripts. jq is already required by all four pages,
so this adds no dependency, and the variables the pages interpolate ($BASE,
$HEAD) are unchanged.

Checked the rest of the corpus: no other page repeats --file, and the scopes
page already documents --scopes-json. Nothing outside this repository generates
the snippet — the dashboard and the engine never emit this command.

Reported as Mergifyio/ci-bot#371.

MRGFY-8721

Depends-On: #12454

@jd

jd commented Aug 19, 2026

Copy link
Copy Markdown
Member Author

This pull request is part of a Mergify stack:

# Pull Request Link
1 fix(safety): catch bare tracker ticket refs in the internal-leak scan #12454
2 fix(docs): send scopes with the flag the CLI documents #12455 👈

@mergify
mergify Bot had a problem deploying to Mergify Merge Protections August 19, 2026 18:21 Failure
@mergify

mergify Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 All 7 merge protections satisfied — ready to merge.

Show 7 satisfied protections

🟢 ⛓️ Depends-On Requirements

Requirement based on the presence of Depends-On in the body of the pull request

🟢 🤖 Continuous Integration

  • all of:
    • check-success = build
    • check-success = lint
    • check-success = test
    • any of:
      • check-success = test-broken-links
      • label = ignore-broken-links
    • any of:
      • check-success=Cloudflare Pages
      • -head-repo-full-name~=^Mergifyio/

🟢 👀 Review Requirements

  • any of:
    • #approved-reviews-by >= 2
    • author = dependabot[bot]
    • all of:
      • author = mergify-ci-bot
      • -head ~= ^docs-agent/

🟢 Enforce conventional commit

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|internal|docs|style|refactor|perf|test|build|ci|chore|revert|ui)(?:\(.+\))?!?:

🟢 🔎 Reviews

  • #changes-requested-reviews-by = 0
  • #review-requested = 0
  • #review-threads-unresolved = 0

🟢 📕 PR description

  • body ~= (?ms:.{48,})

🟢 🚦 Auto-queue

When all merge protections are satisfied, this pull request will be queued automatically.

@jd

jd commented Aug 19, 2026

Copy link
Copy Markdown
Member Author

Two notes that belong with this stack rather than in either commit.

The MRGFY-1234 this removes was already published. git log -S puts it in src/content/docs/ since 6767e5d (2026-05-29, #11681), carried through #11758, on a public repo — so it was live on the site and in public git history for about two and a half months. The base commit takes it off the page; it does not undo that. It is a bare tracker key with no customer or incident detail around it, so my read is low harm and not worth a history rewrite, but AGENTS.md says a value that was pushed gets stated plainly instead of quietly amended, so: stated.

One thing I found on the way is out of scope here and is not filed as an issue. The four judgment proofreaders only ever review changed lines, so an old violation survives indefinitely — which is exactly why the em dash in that --reason string sat there since May with no run able to catch it. The leak scan has always swept the whole corpus and now catches the bare-key class too, but there is no equivalent one-off sweep for style, consistency, structure or technical drift. This stack fixes the one instance, not the class. It is written up in projects/docs-agent/resume.md to be picked up as its own piece of work.

@mergify
mergify Bot requested a review from a team August 19, 2026 18:23
@jd
jd marked this pull request as ready for review August 20, 2026 11:52
Copilot AI lite review requested due to automatic review settings August 20, 2026 11:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the shared “Any CI (Mergify CLI)” snippet used by the monorepo scopes docs pages so it matches the current CLI contract (no deprecated flags) and uses a stable, script-friendly output format for git refs.

Changes:

  • Switch mergify ci scopes-send from deprecated --file to --scopes-json.
  • Parse base/head refs from mergify ci git-refs --format json via jq instead of scraping the human text output.
  • Document the rationale for --scopes-json vs --scopes-file and for preferring --format json.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/components/ScopesDetection.astro Outdated
jd added 2 commits August 20, 2026 14:03
`pnpm check:internal-leaks` only ever saw a ticket as a *link*: its
`internal-tracker` rule matches tracker hosts. A bare issue key in prose, in a
code block or in an example value passed cleanly — and one did. The
`mergify tests quarantines add` example on the quarantine page shipped with a
`--reason` string naming an internal ticket, so it has been live on
docs.mergify.com since #11681 and sits in this repository's public history. The
scan reported that exact file clean, before and after.

A bare key is also the case a reviewer is least likely to stop on: inside an
example value it reads as a plausible sample rather than as a leak.

What changed:

- A `ticket-ref` rule for bare issue keys — the two live prefixes, plus the
  lowercase form a branch name carries.
- Prefixes are listed explicitly instead of matching a generic `[A-Z]{3,}-\d+`.
  The generic shape fires on `AES-256`, `WCAG-2` and on a reader's own issue keys
  in a sample config, and that cost lands on every docs contributor; the miss
  cost of an explicit list falls only on a prefix somebody introduces
  deliberately, which is a deliberate act.
- The allow directive now accepts several rule ids. One line can trip two rules
  — a tracker URL carries the key inside it — and such a line previously could
  not be allowed at all.
- The corpus is swept: across the 143 scanned pages that example was the only
  occurrence. Its reason string is now "flaky under load, fix in progress", the
  same wording #12411 uses for the same line, so the two changes do not fight.
  That also removes the prose em dash the example carried inside a CLI string.
- `AGENTS.md` and the `proofread-leaks` skill now list bare keys as well. The
  judgment layer had the same blind spot as the regex, which is why the line
  survived review too.

Verified: the scan exits 1 against the pre-fix file and 0 against the tree,
the full `pnpm test` suite and `pnpm check` are green, and the commit is green
on its own as well as on top of the stack.

One decision is deliberately left open: whether the already-published value
needs scrubbing beyond this branch. It is a ticket prefix rather than a
credential, and it is in the git history of a public repository as well as on
the site, so removing it from the page is all this change claims to do.

Reported as Mergifyio/ci-bot#368.

MRGFY-8721

Change-Id: I847b80676f560fb73f319e2524be6d94207591e8
The "Any CI (Mergify CLI)" block on the four monorepo scopes pages ends in
`mergify ci scopes-send --file scopes.json`. `--file` is a deprecated alias, kept
hidden from `--help` and from `public/cli-schema.json` since the CLI was ported
to Rust: it still works, and prints `Warning: --file is deprecated, use
--scopes-json instead.` on every run. So a reader copying the block gets a
deprecation warning for a flag they cannot look up.

`--scopes-json` is the right one, not `--scopes-file`: it reads the
`{"scopes": [...]}` object, which is exactly the shape every page's `jq` filter
writes, while `--scopes-file` expects one scope per line. Confirmed against the
CLI's own reader — it deserializes `scopes` plus an optional `all_scopes`, so the
examples need no change, and `--all` documented on the scopes page stays
consistent with it.

While in the block, the base and head refs now come from `--format json` piped
through `jq` instead of `awk '/^Base:/ {print $2}'` on the default output. The
text format is the human one with no stability promise; `json` and `shell` are
the two contracts meant for scripts. `jq` is already required by all four pages,
so this adds no dependency, and the variables the pages interpolate (`$BASE`,
`$HEAD`) are unchanged.

Checked the rest of the corpus: no other page repeats `--file`, and the scopes
page already documents `--scopes-json`. Nothing outside this repository generates
the snippet — the dashboard and the engine never emit this command.

Reported as Mergifyio/ci-bot#371.

MRGFY-8721

Change-Id: I7691b7156a88b4c43487a2b41f61216c92b5a6a5
@jd
jd force-pushed the devs/jd/jd/mrgfy-8721-docs-repo-internal-leak-scan-misses-bare-ticket-refs-and/send-scopes-flag-cli-documents--7691b715 branch from ccec4b4 to f67a34b Compare August 20, 2026 12:03
@jd

jd commented Aug 20, 2026

Copy link
Copy Markdown
Member Author

Revision history

# Type Changes Reason Date
1 initial ccec4b4 2026-08-20 12:03 UTC
2 content ccec4b4 → f67a34b review: quote the jq filters and pipe with printf instead of echo, per the ScopesDetection thread 2026-08-20 12:03 UTC

@mergify
mergify Bot deployed to Mergify Merge Protections August 20, 2026 12:03 Active
@jd

jd commented Aug 20, 2026

Copy link
Copy Markdown
Member Author

Re-pushed to address the review thread on ScopesDetection.astromergify stack push amends, so the diff moved without a new commit appearing.

What changed: the two jq filters in the shared snippet are now single-quoted, and the JSON is piped with printf '%s' instead of echo. Nothing else — same flags, same four pages.

ccec4b4c → f67a34b: https://github.com/Mergifyio/docs/compare/ccec4b4c1968646f2bbabc018e0c188e05de6477..f67a34b2e66a887d16538cb13865227f1b5e1b16

The base #12454 also has a new head (3caaf1e → dd28773) — that one is only the rebase onto main the push does, its content is untouched.

Both PRs are green and the stack has no open threads.

Base automatically changed from devs/jd/jd/mrgfy-8721-docs-repo-internal-leak-scan-misses-bare-ticket-refs-and/catch-bare-tracker-ticket-refs-internal-leak-scan--847b8067 to main August 20, 2026 13:56
@mergify
mergify Bot requested a review from a team August 20, 2026 14:10
@mergify

mergify Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 3 minutes 34 seconds in the queue, including 2 minutes 42 seconds running CI.

Required conditions to merge

@mergify mergify Bot added the queued label Aug 21, 2026
@mergify
mergify Bot merged commit eb19c66 into main Aug 21, 2026
10 of 17 checks passed
@mergify
mergify Bot deleted the devs/jd/jd/mrgfy-8721-docs-repo-internal-leak-scan-misses-bare-ticket-refs-and/send-scopes-flag-cli-documents--7691b715 branch August 21, 2026 12:58
@mergify mergify Bot removed the queued label Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants