Skip to content

Wire the shared commit-convention gate - #135

Closed
magicsunday wants to merge 2 commits into
mainfrom
wire-commit-convention-gate
Closed

Wire the shared commit-convention gate#135
magicsunday wants to merge 2 commits into
mainfrom
wire-commit-convention-gate

Conversation

@magicsunday

Copy link
Copy Markdown
Owner

Wires the shared commit-convention gate into this repository.

Why

The commit-subject rule lived here as documented prose with nothing executing it, so it could only drift — which is how the same rule came to be stated in several different ways across the sibling repositories. magicsunday/.github/.github/workflows/commit-convention.yml already holds the normative definition and self-tests its own decision table on every run, so calling it makes the rule enforced rather than merely written down.

What

One workflow file, byte-identical to the caller webtrees-fan-chart already uses. Nothing repo-specific.

  • The calling job declares no permissions: of its own on purpose: a job-level block would replace the top-level grant rather than merge with it, so leaving it off is what keeps contents: read + pull-requests: read in effect for the reusable workflow.
  • edited and the concurrency group are a package: the gate judges the pull-request title, and without edited a title broken after a green run would never be re-judged; cancel-in-progress then removes the race where an older green run overwrites a newer red one.

Note

The check is advisory until the context commit-convention / Commit convention is added to this repository's branch protection — that step is not part of this pull request.

The commit-subject rule was documented prose here with nothing executing it, so
it could only drift — which is how the same block came to be stated three
different ways across the sibling repositories. Call the shared reusable workflow
that already holds the normative definition and self-tests its own decision table
on every run, byte-identical to the caller webtrees-fan-chart uses.

The caller declares no job-level permissions on purpose: a job-level block would
replace the top-level grant rather than merge with it. Note that the check is
advisory until the context is added to branch protection.
UnknownPropertyCollector promises to preserve unmapped payload keys, but stored
the CONVERTED name: with the camelCase converter active, an unknown
`favourite_colour` was preserved as `favouriteColour`. The value was kept raw,
the key was not - so the collected map was not the faithful copy of the unmapped
payload the feature exists to provide, and a consumer re-serialising it silently
emitted a key the sender never sent.

Applying a property-name converter to a key that by definition matches no
property is what made this wrong. The two questions are now separated: whether a
key is UNKNOWN is still decided on the converted name - `full_name` that
camelises onto a declared `fullName` is mapped, not collected - while the key it
is STORED under is the original payload spelling. Only the stored key changed;
which keys count as unknown did not.

This was never covered because every payload in the collector's test file used
camelCase keys, so the conversion was a no-op in all of them while the suite runs
with the converter enabled. Two tests now pin both halves: a snake_case unknown
key survives verbatim, and a snake_case key that converts onto a declared
property is still mapped rather than collected.

Behavioural change for a consumer that relied on the converted key. The attribute
docblock, AGENTS.md and docs/recipes/using-attributes.md described the old
behaviour and now describe this one.

Verified: composer ci:test green (507 tests, 1484 assertions), exit code 0.
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@magicsunday

Copy link
Copy Markdown
Owner Author

Superseded by #138. This branch was cut from a stale local main, so it carried unrelated older commits alongside the workflow file. The replacement is branched from origin/main and contains only .github/workflows/commit-lint.yml.

@magicsunday
magicsunday deleted the wire-commit-convention-gate branch July 28, 2026 07:18
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.

1 participant