Repository navigation
fix(repository): name a contradictory private/visibility pair and a null security_and_analysis in a check-time note - #603
Conversation
…ull security_and_analysis in a check-time note A `repository:` section that declares `private` beside a `visibility` that contradicts it (true with public; false with private or internal), or `security_and_analysis: null`, parsed and ran with nothing but a drift line that names neither the cause nor the fix. The plan now adds one note for each, built from the declaration alone and carried on the path the phantom-key note already uses. Each note names the key or the pair and the fix: remove one of the two keys, or write each feature's status instead of null. The drift lines are unchanged and nothing new is refused, so no settings file that ran before stops running. Both inputs complete their apply today, so the parse refusals wait for the next major: two COMPAT(v4) markers in the section's schema name the refusal that replaces each note. Each note states its consequence conditionally, because the PATCH's descriptor says neither which of the two fields wins nor what a null does to the mapping.
File size check0 over a hard cap (fails), 6 warning(s).
Split the file, wrap the line, shorten or exempt the comment, or list the path in 5 managed file(s) skipped; repo-platform owns them. |
Member shape check16 finding(s).
Add the blank lines, make the comment one line directly above the item, comment every field or none, or list the path in 4 generated file(s) skipped. |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified in the repository-setting informational-note changes.
No open issues 🎉
What changed in this PR
Adds informational repository-setting notes to help users resolve contradictory private/visibility values and security_and_analysis: null. Existing input acceptance, drift reporting, and apply behavior remain unchanged.
Changes:
- Adds declaration-based notes that identify the problematic settings and explain how to fix them.
- Covers contradictory pairs, null security settings, and valid controls with unit tests and check-mode scenarios.
- Documents the notes and adds comment-only
COMPAT(v4)markers for future validation changes.
| File | Description |
|---|---|
test/sections/repository/scenarios/repository-private-visibility-contradiction-note.yml |
Adds a check-mode scenario verifying the pair note and unchanged drift. |
test/sections/repository/scenarios/repository-null-security-and-analysis-note.yml |
Adds a check-mode scenario verifying the null note and unchanged drift. |
test/sections/repository/repository.test.ts |
Tests note text, drift, and valid controls. |
src/sections/repository/schema.ts |
Adds comments describing validation changes deferred to v4. |
src/sections/repository/index.ts |
Generates declaration-based notes and includes them in repository plans. |
docs/sections/repository.docs.yml |
Documents both notes in coverage and schema descriptions. |
docs/reference/coverage.md |
Updates generated coverage documentation with both notes. |
Review effort: Balanced
The pair note led with the section key, which the engine already prefixes to every line a section prints, so a run printed `repository: repository: private: true contradicts ...`. The note now leads with the key's path, as the security_and_analysis note and the drift lines do: `repository.private: true contradicts repository.visibility: "public", ...`. The four sentences in the section's docs said check adds the note. A plan's notes print in apply too, so they now say a run adds it, and the coverage page is regenerated from them.
The engine now leaves alone a section line that already leads with its key, so a run prints `::notice::repository.private: ...` where it printed `::notice::repository: repository.private: ...`. The scenario pinned the old line and failed on the merged tree. It now pins the line as a run prints it, and the note's own text is unchanged.
COMPAT(v4)markers. Taking them before the next major is the owner's decision.Before
After
How
declarationNotesseedsplan.notes, the path the phantom-key note uses.private: false, and private and internal meantrue. Any other visibility draws nothing.src/engine/diff.ts. No helper words a declaration-only note.Proof
bun test test/sections/repository/ends124 pass,0 fail. The four new note rows fail onmain.bun test/e2e/run.ts --sections repositoryends48/48 passed. Both new scenarios fail onmain.Technical details
mainwith the two new scenario files copied in, where both scenarios fail onstdout missing.::notice::.repository.with no second key.main(exit 0,result: applied, PATCH 200), so each ran before.parseScenarioandrunScenario, in check mode and in apply mode withfixpoint: converges.security_and_analysisnullable: trueand documents no rule betweenprivateandvisibility.privateis "trueto make the repository private orfalseto make it public".private: true:classifyVisibilityinsrc/github/repo-visibility.tsand its test hold that reading.test/sections/repository/mock.tsstores the PATCH body verbatim, so the check after an apply readscleanthere on both revisions.cleanand the note still prints, since the note reads the declaration alone.skippedline when the token is denied the write.privatebyvisibilitycombinations of the table's three visibilities, plus null and a declared mapping.COMPAT(v4)onvisibility: refuse the pair inRepositoryConfig's check, then delete the pair note.COMPAT(v4)onsecurity_and_analysis: drop.nullable()so the validator's null rule refuses it, then delete the null note.visibilityandsecurity_and_analysisnow state the notes.docs/sections/repository.docs.ymlstates both notes, anddocs/reference/coverage.mdis regenerated from it.visibility: internalfails the harness's contract validator, since the pinned descriptor's PATCH enum omitsinternal.typecheck,lint,lint:arch,knip,check:compat, andbuild:checkexit 0.src/sections/repository/{index.ts,schema.ts},test/sections/repository/repository.test.ts,test/sections/repository/scenarios/{repository-private-visibility-contradiction-note.yml,repository-null-security-and-analysis-note.yml},docs/sections/repository.docs.yml,docs/reference/coverage.md.