Skip to content

Enable Projects and Link Every Fleet Repo to the Fleet Engineering Project - #1601

Merged
ptr727 merged 7 commits into
developfrom
feature/fleet-project-config
Sep 14, 2026
Merged

ptr727 merged 7 commits into
developfrom
feature/fleet-project-config

Conversation

@ptr727

@ptr727 ptr727 commented Sep 14, 2026

Copy link
Copy Markdown
Owner

Settles #1597. The config script flagged a repository that had projects enabled, where the fleet requires the opposite: projects on, and the repository linked to the Fleet Engineering project. #1292 is the rollout that applies this to each repository.

What changed

repo-config/settings.json declares has_projects true, which both checkers read from the payload, so configure.sh check and spec/audit.py pick it up with no change of their own.

repo-config/project.json is new and declares the project by owner, number, and title. The title is declared alongside the number because a project number is unique only per owner and is reusable, and one declared number is applied to every fleet repository, so a deleted and recreated project could otherwise point the whole fleet at a project nobody chose.

configure.sh apply gains a fifth write group. The project is resolved in the pre-flight, beside the payload checks and before the first write, since resolving it at the link would abort with the settings, the Dependabot features, the labels, and both rulesets already applied. The link write itself reads the live link list first and fires the mutation only where the link is absent, so a second apply is a read, and the mutation's response is read back and the repository it names asserted rather than discarded.

configure.sh 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 declares.

scripts/tests/test_configure_project.py is new: 23 tests that lift the script's own lines and stub gh, covering the payload contract, both lookups, the link write, and the call sites the groups hang from.

Prose swept for the same rule: AUDIT.md section 6, docs/repo-config.md, repo-config/README.md (including the settings bullet that said "Projects off"), OPERATIONS.md, and the script's own usage header.

Verification

Every gate run locally: shellcheck, shfmt, ruff check and format, mypy, the full test suite (1508 passed), the prose gate, the repo gate, spec/validate.py, the seven Docker linters, and canonical_review.py check.

configure.sh check was run read-only against four live repositories across both workflow models. It reports the link present on Utilities, ESPHome-Config and HomeAutomation-Config, and absent on ProjectTemplate and LanguageTags, which are the two the rollout has yet to reach.

Sixteen guards and call sites were removed one at a time and the suite fails on each, except the one named under Known open below.

Known open

Three review passes ran locally and their findings were answered in two rounds, which is the whole edit budget the review rules allow before a push. Four items were raised by the third pass, all against text the second round wrote, and they are left for this pull request's own review loop rather than a third local round:

  • scripts/tests/test_configure_project.py WiringCase's docstring counts three call sites and two pre-flight tests, where the class now holds four and three.
  • The extra failure guard in check_project is pinned by no test, so the second commit's message claiming every added guard is covered is wrong by one. A stub emitting a non-JSON body closes it.
  • OPERATIONS.md and docs/repo-config.md do not say that apply now needs project access on the token, which since the pre-flight change aborts the run with nothing written rather than part way through.
  • repo-config/README.md's sentence on why the title is compared before the first link names a contrast that was true of the earlier code too. The guarantee this change actually buys is that a wrong number aborts before any write.

Two follow-ups were filed rather than fixed here: #1599, the pre-existing defects a whole-unit read of AUDIT.md section 6 found, and #1600, whether a read-only project scope satisfies configure.sh check.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AYoF5QrrkhEWt7F7G8RDvB

ptr727 and others added 3 commits September 13, 2026 21:05
…oject

The fleet plans its work in one user-level project, and the config script
flagged a repo that had projects enabled rather than one that did not, so
`settings.json` now declares `has_projects` true and a new `project.json`
declares the project by owner, number, and title.

`configure.sh apply` gains a fifth write group that links the repository to
that project, reading the live link list first and writing only where the
link is absent, so a second apply is a read rather than a repeated write.
The mutation's response is read back and the repository it names asserted,
so a write that returned anything else stops the run instead of reporting a
link that may not exist. The declared title is resolved and compared with
the live project before the first link is written, because a project number
is unique only per owner and is reusable, and one declared number is applied
to every fleet repository.

`configure.sh check` asserts the link and counts the repository's other
project links without judging them, matching how it treats a label the
payload never declares.

`scripts/tests/test_configure_project.py` runs the script's own lines with
`gh` stubbed, covering the payload contract, both lookups, and the link
write, including that an existing link fires no mutation at all.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The payload's integer test compared the parsed double, where the value that
reaches the API is the source literal jq prints, so `1.0` and `1e2` passed
the contract and then reached `gh` in a form it sends to a typed variable as
a string. The test now reads the text jq will print and caps it at nine
digits, which also keeps a number GraphQL's 32-bit Int cannot carry out of
the query.

`repo_projects` now fails at the hundred-project page cap rather than
treating a possibly truncated page as the whole list, matching what
`ruleset_id` already does at the same cap, since past it `check` reports the
fleet link missing and `apply` writes a link that is already there.

The link comment said the settings write above had enabled the project on
the repository, which `repo-config/README.md` contradicts in this same
change and which implies an ordering dependency that does not exist.

`docs/repo-config.md` described the check mode's coverage without the link,
the one paragraph the earlier sweep missed.

In the tests, the `jqr` lift used a greedy pattern under DOTALL and so
lifted every line from `jqr` to the end of `cmd_check`, and three temporary
paths were interpolated into bash source unquoted, which a Windows path or
any path holding a space breaks. Both are fixed, and the suite now pins the
wiring the helpers hang from: that apply pre-flights the payload's existence
and its contract before any write, and that check runs the project group at
all. Each of the ten guards this change adds was removed in turn and the
suite fails on every one.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…the Count

`apply` resolved the project inside the last of its five write groups, so a
number resolving to nothing, or to a project titled otherwise, aborted the
run with the settings, the Dependabot features, the labels, and both
rulesets already written. The resolution is a read, so it moves into the
pre-flight beside the payload checks and the id is passed to the link write.

The page-cap guard compared a captured string in a bash integer test, which
returns false on any non-numeric output and let a truncated list through
rather than failing, and a native Windows jq appends exactly such a
character. The query now asks for `totalCount` and jq compares it with the
page it returned, which also stops a repository with exactly a full page of
links being refused when nothing was truncated.

A failed project read was reported as a missing token scope, though `gh`
exits non-zero on a number that resolves to nothing just as it does on a
token that cannot see projects, so the message named a cause it cannot tell
apart. Both messages now name both causes.

The payload contract's operator-facing message said "a positive integer
number" while the filter also refuses an integer written as `1.0` and
anything of ten digits or more, and the check group counted the
repository's other links in an unguarded substitution where `check_labels`
guards its equivalent.

`OPERATIONS.md` stated what one `apply` run writes and was the surface the
earlier sweep missed. The script's own usage header named three of the five
groups and one of the two access requirements.

In the tests, the write half's call site was the one the wiring case did not
pin, two docstrings described a stubbing and lifting discipline the later
cases do not follow, and two fixtures were labelled as live shapes that the
API does not return at all. Each of the sixteen guards and call sites this
change adds was removed in turn and the suite fails on every one.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI lite review requested due to automatic review settings September 14, 2026 04:31
@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 7999ad59-48a1-4e07-a554-80794e8038b6


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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

A few documentation/test gaps remain in the newly added/updated project-link workflow (including an inaccurate docstring and an unexercised defensive guard path).

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This pull request updates the fleet repository-configuration tooling and documentation so fleet repositories have GitHub Projects enabled and are linked to the single fleet-wide user project ("Fleet Engineering"), with the link managed idempotently via repo-config/configure.sh.

Changes:

  • Enable Projects via repo-config/settings.json and introduce repo-config/project.json to declare the fleet project identity (owner/number/title).
  • Extend repo-config/configure.sh to preflight/resolve the declared project, link repositories to it on apply, and verify the link on check.
  • Add a new Python test suite for the project payload/lookup/link behavior and update related operational/audit documentation.
File summaries
File Description
scripts/tests/test_configure_project.py New tests that execute lifted configure.sh regions to validate project payload, lookups, apply linking, and check wiring.
reports/canonical-review.json Updates canonical-review digest metadata for the AUDIT.md section 6 unit.
repo-config/settings.json Switches has_projects to true to enable Projects on fleet repos.
repo-config/README.md Documents the new project payload and fleet project-link behavior in repo-config.
repo-config/project.json New payload declaring the fleet project (owner/number/title).
repo-config/configure.sh Adds project payload validation, GraphQL lookup helpers, apply linking, and check assertions for the fleet project link.
OPERATIONS.md Updates the operations runbook to include the fleet project link in what apply does.
docs/repo-config.md Updates repo-config documentation to include the new project payload and link behavior.
AUDIT.md Updates section 6 to include the fleet project link in the configure check description and token requirements.
Review details
  • Files reviewed: 9/9 changed files
  • Comments generated: 5
  • Review effort level: Lite

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread scripts/tests/test_configure_project.py Resolved
Comment thread OPERATIONS.md Resolved
Comment thread docs/repo-config.md Resolved
Comment thread repo-config/README.md Resolved
Comment thread scripts/tests/test_configure_project.py Resolved
ptr727 and others added 4 commits September 13, 2026 21:37
…ast Guard

The project link is read and written through GraphQL rather than the REST
endpoints the other four groups use, so both modes need project access on
the token. Since the resolution moved into the pre-flight, a token without
it stops `apply` with nothing written rather than part way through, which is
the operator-visible half. `OPERATIONS.md`, `docs/repo-config.md`, and
`repo-config/README.md` each state it now, the script's own header having
been the only surface carrying it.

`repo-config/README.md`'s sentence on the title comparison drew a contrast
that was true of the earlier code too, since the resolution already ran
immediately before the mutation. What the pre-flight actually buys is that a
number resolving to nothing, or to a project titled otherwise, stops the run
before the first write, so that is what it says.

The check group's count guard was pinned by no test, so removing it left the
suite green. A harness that hands the group an unparseable link list closes
it, and removing the guard now fails.

`WiringCase`'s docstring counted its own cases, which went stale the moment
one was added, twice. It describes the two harness shapes instead and leaves
the count to the class.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…ANDUP.md

The pre-flight resolution is a read and the link is a write, so "nothing
written" held only for a token that cannot read projects at all. One that
can read but not write them passes the pre-flight and reaches the link, the
last of the five groups. The three surfaces stating the guarantee now state
both cases.

STANDUP.md was the fifth surface naming what one apply run writes, and the
sweep did not reach it. A standup run with a token carrying no project
access now fails in a way that step's own list of three conditions does not
name, so it says so.

The new count-guard test named the wrong reason: under the options the
script sets, a failing command substitution ends the group rather than
rendering an empty number, which is what the guard's own comment says.
WiringCase's docstring kept a clause about lifting cmd_apply reaching its
writes, which the case lifting it whole with every command stubbed
disproves.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
"Each command's own error names the scope to grant" was false for a token
that can read projects but not write one. The link write dies under the
shell options the script sets, before the branch that would have said
anything, so the operator gets gh's own error and nothing else. The sentence
now names the scope only where the command actually does.

STANDUP.md carried that block inside the paragraph's two-command
instruction, with a colon whose antecedent covered half of what followed and
an admin requirement the file states nowhere. One sentence saying the run
fails at this step replaces it.

The count-guard docstring pointed at a comment about reporting extra links
rather than at the abort it describes, and WiringCase's clause said a
whole-function test stubs everything beside the group under test where it
stubs that group too. Both now say what the cases do.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…Flight

The environments group's comment said a malformed entry aborts after the
four groups above it have printed, which the project group makes five. The
same file's header already says five for both modes, so the script
contradicted itself.

The two pre-flight harnesses lifted a pattern that could not stop where they
meant it to, since the payload guard's `fi` is followed by a comment rather
than the echo the pattern anchored on. It ran on through the general-settings
preparation, so each harness carried two unstubbed `gh api` reads it never
reached only because both guards abort first. Both now anchor on the
resolution line, as the third harness already did, and the lifted region
holds no live call.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Copilot AI review requested due to automatic review settings September 14, 2026 04:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The project-link behavior is implemented end-to-end (preflight/lookup/link/check) with dedicated tests and the operator-facing documentation updates match the implemented contract.

Review details
  • Files reviewed: 10/10 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@ptr727
ptr727 merged commit 796c32e into develop Sep 14, 2026
8 checks passed
ptr727 added a commit that referenced this pull request Sep 14, 2026
Answers the finding on #1602, the `develop -> main` promotion of #1601.
A promotion-PR finding needs its own feature cycle, so it lands here
first.

`apply_project` ran its `linkProjectV2ToRepository` mutation in a bare
command substitution. Under the options the script sets, a refused write
ended the run with `gh`'s own error and nothing of the script's: no
repository, no project, and no scope to grant. The pre-flight's
resolution does not catch that one, because the pre-flight is a read and
this is the write, so a token holding project read alone reaches the
link with the four earlier write groups already applied and learns none
of that from the output.

The call is guarded now and names the repository, the project, and the
scope, hedged with "may" since every other non-zero exit lands in the
same arm: a rate limit, a network failure, or the project being deleted
between the pre-flight and this write.

A harness whose `gh` refuses the mutation pins it. Reverting to the bare
substitution, and separately keeping the message while dropping the
`exit 1`, each fail the suite.

## Verification

Two local review passes, the second finding only that the guard's
comment named one cause as the cause, which the second commit narrows.
Gates run locally: shellcheck, shfmt, ruff check and format, mypy, 1465
tests, the prose gate, the repo gate, `spec/validate.py`, and the seven
Docker linters.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01AYoF5QrrkhEWt7F7G8RDvB

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
ptr727 added a commit that referenced this pull request Sep 14, 2026
…oject (#1602)

Promotes `develop` to `main`. One commit, #1601.

Closes #1597

## What it carries

The fleet requires projects enabled and every repository linked to the
[Fleet Engineering](https://github.com/users/ptr727/projects/1) project,
where the config script flagged a repository that had projects enabled.
`repo-config/settings.json` now declares `has_projects` true, a new
`repo-config/project.json` declares the project by owner, number, and
title, and `configure.sh` gains a fifth write group that links the
repository to it.

`apply` resolves the project in its pre-flight, before the first of its
five writes, so a number resolving to nothing or to a project titled
otherwise stops the run with nothing applied. The link itself is written
only where the live link list does not already hold it, and the
mutation's response is read back and the repository it names asserted.
`check` asserts the link and counts the repository's other project links
without judging them.

The title is declared beside the number because a project number is
unique only per owner and is reusable, and one declared number is
applied to every fleet repository.

`scripts/tests/test_configure_project.py` is new: 24 tests that lift the
script's own lines with `gh` stubbed, covering the payload contract,
both lookups, the link write, the check group, and the call sites the
groups hang from.

`AUDIT.md`, `docs/repo-config.md`, `repo-config/README.md`,
`OPERATIONS.md`, `STANDUP.md`, and the script's usage header all state
the five groups and the token requirement.

## Verification

Five local review passes ran against the branch, two review rounds
landed on #1601, and every finding was answered and resolved. Each of
the sixteen guards and call sites the change adds was removed in turn
and the suite fails on every one. The full gate set ran locally on each
round: shellcheck, shfmt, ruff, mypy, 1464 tests, the prose gate, the
repo gate, `spec/validate.py`, the seven Docker linters, and the
canonical-content pass over `AUDIT.md` section 6.

`configure.sh check` was run read-only against four live repositories on
both workflow models.

## After merge

Applying this to each repository is #1292 and has not been done. Until
then `check` and `spec/audit.py` report `has_projects` drift, and a
missing link, on every repository the rollout has not reached,
`ProjectTemplate` included.

Two follow-ups were filed rather than fixed here: #1599, the
pre-existing defects a whole-unit read of `AUDIT.md` section 6 found,
and #1600, whether a read-only project scope satisfies `configure.sh
check`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01AYoF5QrrkhEWt7F7G8RDvB
@ptr727
ptr727 deleted the feature/fleet-project-config branch September 14, 2026 13:58
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