Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/pr-reviewer-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ Each reviewer's behavior is shaped by a committed file rather than accepted as g
- **CodeRabbit** is configured in `.coderabbit.yaml`, whose [settings reference][coderabbit-config] names each option. Its automatic review is off, since this repository's review policy has `wait` ask CodeRabbit explicitly instead. The file still lists `develop` as a base, the setting that governs where a repository left on automatic review is reviewed. No pause follows five reviewed commits, since a fleet pull request routinely passes five pushes and the pause reads as a reviewer that stopped. A path instruction for Markdown asks for false, stale, unverifiable, or unfollowable claims only. That is because CI lints style and the local review pass reads canonical prose whole. Sequence diagrams, suggested labels and reviewers, and the in-progress fortune are off. The markdownlint, actionlint, shellcheck, and ruff tools are off, since CI runs the same four and fails the pull request on them.
- **Qodo** is configured in `.pr_agent.toml`, whose [configuration reference][qodo-config] names each option. An issues guideline asks for a reproduction with any claimed crash. That guideline came after a claimed `IsADirectoryError` on this repository's build was disproven by running it. A compliance guideline asks for the rule's own sentence and routes a rule against unchanged text to the summary. Informational findings go to the [summary][qodo-verbosity] rather than a thread, since a thread blocks the merge until resolved. Images are off so a finding's title is plain text a matcher can see. Qodo's [review standards][qodo-rules] import from `AGENTS.md`, `CLAUDE.md`, `copilot-instructions.md`, and `SKILL.md` files when changes merge. Each is scoped to its folder at any depth. Only new rules are added, so an edited or deleted rule is changed in its portal instead. This repository sits below Qodo's star gate and gets no automatic Qodo review.
- **Which reviewer runs, and when**, is the repository's review policy, the `review` section of `.github/agent-policy.json`, or the hub default `spec/agent-policy.default.json` where it states none. `scripts/README.md` "`pr_review.py`" describes how `wait` applies it. A bot's own automatic trigger is a setting the policy does not read. `repo-config/configure.sh apply --checkout` derives it from the policy rendered from the registry. That covers Copilot's ruleset rule, CodeRabbit, and Qodo. A repository's `.coderabbit.yaml` replaces CodeRabbit's central and UI settings rather than merging with them, unless it sets `inheritance: true`. So the rendered file sets `auto_pause_after_reviewed_commits` to `0` itself, or CodeRabbit's default pause after five reviewed commits applies. `auto` says only that the bot may start on its own. `explicit` assumes it does not, so turn the bot's own trigger off before moving it to `explicit`. Otherwise it reviews twice. For Copilot, `wait` also notes any request already pending when it starts. That includes one an earlier `wait` sent, so the note points at a trigger left on only where no session sent the request.
- **Central settings**: the account-wide `coderabbit` and `pr-agent-settings` repositories turn automatic review off, and only while every fleet repository carries its own file. [Repository Configuration "Central Bot Settings"][repo-config-central] describes the gate.
- **GitHub Copilot**: the carried `.github/copilot-instructions.md`, which bootstraps the `fleet-code-review` Skill, is the lever this repository uses. GitHub also documents path-scoped `.github/instructions/*.instructions.md` files, unused here.

## Plan and Repository Scope
Expand All @@ -96,6 +97,10 @@ Private repositories remain Copilot-only unless a candidate's approved plan, dat
[pr-892]: https://github.com/ptr727/ProjectTemplate/pull/892
[stall-issue]: https://github.com/ptr727/ProjectTemplate/issues/1741

<!-- Repo -->

[repo-config-central]: repo-config.md#central-bot-settings

<!-- External -->

[coderabbit-auto-review]: https://docs.coderabbit.ai/configuration/auto-review
Expand Down
21 changes: 21 additions & 0 deletions docs/repo-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The hub holds all fleet-wide repository configuration:
- `labels.json` declares the fleet label set.
- `project.json` declares the fleet project every repository is linked to, by owner, number, and title.
- `configure.sh` applies or checks those payloads through the GitHub API.
- `central/` holds the READMEs `scripts/central_config.py` writes into the central bot-settings repositories, per "Central Bot Settings" below.

Downstream repositories carry no `repo-config/` directory. The registry's `workflowModel` selects the `develop` payload, and its `environments` declares the deployment environments the check mode asserts. Both are read from `registry/repos.json` rather than from a payload here. Commands that operate before registry enrollment pass the model explicitly.

Expand All @@ -34,6 +35,26 @@ repo-config/configure.sh apply owner/repo release|operational

Then validate the result with `repo-config/configure.sh check owner/repo release|operational`, run from the same checkout. The command asserts every applied ruleset, setting, label, security feature, and the fleet project link, plus the deployment environments described below. It exits non-zero on drift (the settings checks are driven by the committed payloads, and the ruleset checks by the payloads composed for the repo). Or import each ruleset by hand from the payloads `configure.sh` composes for the repo. Write them with `uv run --no-project --script scripts/agent_policy.py rulesets --registry registry/repos.json --name <repo> --model <release|operational> --out-dir <dir>`. Then run `gh api -X POST repos/<owner>/<repo>/rulesets --input <dir>/<name>.json` for each of `develop` and `main`. `gh ruleset` is read-only, so creation goes through `gh api`. [`repo-config/README.md` "Rulesets"][repo-config-readme-rulesets] says what the composition changes. The required check binds by name and only turns green after the repo's PR workflow runs once. To edit a live ruleset, GET it, change the field, and PUT the whole writable subset back (a partial PUT `422`s).

## Central Bot Settings

CodeRabbit reads a repository named `coderabbit` under the owner as central configuration, and Qodo reads `pr-agent-settings`. Each holds a README and one config file that turns automatic review off account-wide. A repository carrying its own `.coderabbit.yaml` uses that file instead. A repository carrying its own `.pr_agent.toml` overrides each key that file sets.

`scripts/central_config.py` writes both repositories from the hub. The READMEs are hand-authored sources under `repo-config/central/`, and the config text is a constant in the script. Each settings repository has a registry entry with `status: "excluded"`, so the fleet audit expects no baseline from it.

A central file with automatic review off silences the bot on every repository that lacks its own file. So the config file exists only while every live registry repository under the owner carries its own file. Each repository's own file sits on its default branch and sets the same key to a bool. A live repository is any entry that is neither archived nor excluded, and a registry listing none under the owner refuses rather than passing. That key is `reviews.auto_review.enabled` for CodeRabbit and `config.disable_auto_feedback` for Qodo. An earlier central file without this gate silenced CodeRabbit on the repositories that had no file of their own yet.

- `precondition` prints `ok` or `FAIL` per repository. It exits 0 when the gate holds, 1 when it does not, and 2 when a read could not run.
- `write` puts the README, and the config file only while the gate holds, into a checkout. It removes a config file the gate no longer allows and prints a `withheld` line naming the repositories that lack their own file. It never stages or commits, and `--dry-run` writes nothing.
- `check` reads the settings repository at a ref, `main` by default, and reports drift from what `write` produces. A config file present while the gate fails is drift, and one withheld while the gate fails is not.

```sh
uv run --no-project --script scripts/central_config.py precondition --repo ptr727/coderabbit --registry registry/repos.json
uv run --no-project --script scripts/central_config.py write --repo ptr727/coderabbit --registry registry/repos.json --checkout <checkout of ptr727/coderabbit>
uv run --no-project --script scripts/central_config.py check --repo ptr727/pr-agent-settings --registry registry/repos.json --ref main
```

Carrying the result into a settings repository is a pull request there, and it needs the maintainer's go-ahead. `write` reads the gate once, and the file takes effect only when that pull request merges. So run `check` just before the merge and again after it. Run it again whenever a repository joins the registry.

## Deployment Environments

`check` asserts that every environment the registry entry's `environments` declares exists and carries the declared deployment-branch policy, and `apply` writes none. The asymmetry is deliberate. An environment's secrets and variables are credentials that exist nowhere in the hub. So an `apply` could create the environment and set its policy and still leave it unable to publish, while reporting success. Their names are enumerable through the API, and their values in the case of a variable. But no tool here queries those stores. That is a choice about what this script owns rather than a limit the API imposes. The policy is checkable on its own and worth checking, because it decides which refs may deploy at all. On an OIDC publish that is half the gate: a ref the policy excludes mints no token.
Expand Down
12 changes: 12 additions & 0 deletions registry/repos.json
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,18 @@
"url": "https://github.com/ptr727/GoogleTo1Password",
"status": "archived",
"driftNotes": ["Archived on GitHub. Found missing from the registry by the fleet membership check (ptr727/ProjectTemplate#550). No further conformance work is expected while archived."]
},
{
"name": "coderabbit",
"url": "https://github.com/ptr727/coderabbit",
"status": "excluded",
"exclusionReason": "CodeRabbit's central configuration for the owner, not a fleet project. Its whole content is written by scripts/central_config.py, which docs/repo-config.md \"Central Bot Settings\" describes, so it owes no fleet baseline."
},
{
"name": "pr-agent-settings",
"url": "https://github.com/ptr727/pr-agent-settings",
"status": "excluded",
"exclusionReason": "Qodo's central configuration for the owner, not a fleet project. Its whole content is written by scripts/central_config.py, which docs/repo-config.md \"Central Bot Settings\" describes, so it owes no fleet baseline."
}
]
}
2 changes: 2 additions & 0 deletions repo-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Hub-only repository and branch configuration held as committed files, kept out o
- `project.json`: the fleet project every repository is linked to, declared as the project owner, the project number, and the project title. `repo-config/configure.sh apply owner/repo release|operational` resolves the number to a live project and refuses the run when that project's title is not the declared one. It writes the link only when the repository does not already hold it, so a second apply is a read. `check` asserts the link and counts the repository's other project links without judging them, the same way it treats a label the payload never declared.
- `configure.sh`: run from a hub checkout at `main`, per [GOVERNANCE.md "Hub-Hosted Tooling"][governance-hub-hosted-tooling]. It resolves every payload path against the hub's `repo-config/` directory. Name the target repository explicitly, since the command defaults to whichever repository the shell is sitting in. `repo-config/configure.sh apply owner/repo release|operational` creates or updates the settings, Dependabot security features, labels, rulesets, and the fleet project link idempotently. With `--checkout <path>` it also writes the agent policy files into that local checkout. See [Agent Policy][agent-policy]. `repo-config/configure.sh check owner/repo release|operational` is the read-only counterpart and exits non-zero on drift. It is not an exact inverse. It also asserts the agent policy files on the default branch. It asserts that every environment the registry's `environments` declares for the repo exists and carries the declared deployment-branch policy. `apply` writes neither, for the reason [docs/repo-config.md][repo-config-doc] "Deployment Environments" gives. The model defaults to the registry `workflowModel` lookup. Pass it explicitly for a repository outside the registry. Both commands exit early, writing nothing, when the target's registry entry carries `status: "archived"`. GitHub rejects every write to an archived repository, so `apply` could never clear the drift `check` would otherwise report there forever.

- `central/`: the README sources for the owner's central CodeRabbit and Qodo settings repositories, which `scripts/central_config.py` writes. See [docs/repo-config.md][repo-config-doc] "Central Bot Settings".

## Rulesets

Two workflow models share `main.json` but differ on `develop` (registry `workflowModel`, default `release`):
Expand Down
39 changes: 39 additions & 0 deletions repo-config/central/coderabbit/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# coderabbit

CodeRabbit's organization-wide configuration for the `ptr727` repositories.

## Purpose

[CodeRabbit][coderabbit-link] reads a repository named `coderabbit` under an organization or account as that owner's central configuration. A repository that carries no `.coderabbit.yaml` of its own uses the `.coderabbit.yaml` here. A repository that carries one uses its own file instead.

A fleet repository chooses which reviewers run, on which branches, and when, in its own `.github/agent-policy.json`. That file is rendered from the [ProjectTemplate][projecttemplate-link] registry, together with the repository's `.coderabbit.yaml` and `.pr_agent.toml`. So once present, the default here reaches only a repository the registry renders no files for, such as a new one. It turns automatic review off, so it starts no review nobody asked for.

## Status

A central default with automatic review off silences CodeRabbit on every repository that lacks its own file. So `.coderabbit.yaml` is present here only while every fleet repository carries its own `.coderabbit.yaml` on its default branch, setting `reviews.auto_review.enabled`. [`scripts/central_config.py`][central-config-link] `write` adds the file when that holds and removes it when it does not.

## Where the Rules Live

This repository holds configuration only. The rules it serves live in ProjectTemplate:

- [Pull Request Reviewer Reference][reviewer-reference-link] describes each reviewer bot and how its configuration is committed. Its "Review Configuration" section covers the review policy.
- [`spec/agent-policy.schema.json`][agent-policy-schema-link] defines the policy file, and [`spec/agent-policy.default.json`][agent-policy-default-link] is the default a repository inherits where its own file states none.
- [`GOVERNANCE.md`][governance-link] "PR Review Etiquette" governs how a review is requested, triaged, and resolved.
- [Repository Configuration][repo-config-link] describes `repo-config/configure.sh`, which applies each repository's bot settings.

## Changing the Configuration

ProjectTemplate writes this repository with [`scripts/central_config.py`][central-config-link]. Make a change there and carry it here by a pull request. Never edit this repository in place. The [settings reference][coderabbit-config-link] names each option.

<!-- External links -->
[coderabbit-config-link]: https://docs.coderabbit.ai/reference/configuration
[coderabbit-link]: https://www.coderabbit.ai
[projecttemplate-link]: https://github.com/ptr727/ProjectTemplate

<!-- ProjectTemplate links -->
[agent-policy-default-link]: https://github.com/ptr727/ProjectTemplate/blob/main/spec/agent-policy.default.json
[agent-policy-schema-link]: https://github.com/ptr727/ProjectTemplate/blob/main/spec/agent-policy.schema.json
[central-config-link]: https://github.com/ptr727/ProjectTemplate/blob/main/scripts/central_config.py
[governance-link]: https://github.com/ptr727/ProjectTemplate/blob/main/GOVERNANCE.md#pr-review-etiquette
[repo-config-link]: https://github.com/ptr727/ProjectTemplate/blob/main/docs/repo-config.md
[reviewer-reference-link]: https://github.com/ptr727/ProjectTemplate/blob/main/docs/pr-reviewer-reference.md
39 changes: 39 additions & 0 deletions repo-config/central/pr-agent-settings/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# pr-agent-settings

Qodo's organization-wide configuration for the `ptr727` repositories.

## Purpose

[Qodo][qodo-link] reads a repository named `pr-agent-settings` under an organization or account as that owner's central configuration. It reads `.pr_agent.toml` from this repository's default branch for every repository under the owner. A repository carrying its own `.pr_agent.toml` on its default branch overrides each key that file sets, and inherits the rest from here.

A fleet repository chooses which reviewers run, on which branches, and when, in its own `.github/agent-policy.json`. That file is rendered from the [ProjectTemplate][projecttemplate-link] registry, together with the repository's `.coderabbit.yaml` and `.pr_agent.toml`. Every rendered `.pr_agent.toml` sets `config.disable_auto_feedback`. So once present, that key here reaches only a repository the registry renders no files for, such as a new one. It turns automatic feedback off, so it starts no review nobody asked for.

## Status

Qodo reads a repository's own file only from its default branch. So a central default with automatic feedback off silences Qodo wherever a repository's own file has not reached that branch. `.pr_agent.toml` is therefore present here only while every fleet repository carries its own `.pr_agent.toml` on its default branch, setting `config.disable_auto_feedback`. [`scripts/central_config.py`][central-config-link] `write` adds the file when that holds and removes it when it does not.

## Where the Rules Live

This repository holds configuration only. The rules it serves live in ProjectTemplate:

- [Pull Request Reviewer Reference][reviewer-reference-link] describes each reviewer bot and how its configuration is committed. Its "Review Configuration" section covers the review policy.
- [`spec/agent-policy.schema.json`][agent-policy-schema-link] defines the policy file, and [`spec/agent-policy.default.json`][agent-policy-default-link] is the default a repository inherits where its own file states none.
- [`GOVERNANCE.md`][governance-link] "PR Review Etiquette" governs how a review is requested, triaged, and resolved.
- [Repository Configuration][repo-config-link] describes `repo-config/configure.sh`, which applies each repository's bot settings.

## Changing the Configuration

ProjectTemplate writes this repository with [`scripts/central_config.py`][central-config-link]. Make a change there and carry it here by a pull request. Never edit this repository in place. The [configuration reference][qodo-config-link] names each option.

<!-- External links -->
[projecttemplate-link]: https://github.com/ptr727/ProjectTemplate
[qodo-config-link]: https://qodo-merge-docs.qodo.ai/usage-guide/configuration_options/
[qodo-link]: https://www.qodo.ai

<!-- ProjectTemplate links -->
[agent-policy-default-link]: https://github.com/ptr727/ProjectTemplate/blob/main/spec/agent-policy.default.json
[agent-policy-schema-link]: https://github.com/ptr727/ProjectTemplate/blob/main/spec/agent-policy.schema.json
[central-config-link]: https://github.com/ptr727/ProjectTemplate/blob/main/scripts/central_config.py
[governance-link]: https://github.com/ptr727/ProjectTemplate/blob/main/GOVERNANCE.md#pr-review-etiquette
[repo-config-link]: https://github.com/ptr727/ProjectTemplate/blob/main/docs/repo-config.md
[reviewer-reference-link]: https://github.com/ptr727/ProjectTemplate/blob/main/docs/pr-reviewer-reference.md
Loading
Loading