Wire the shared commit-convention gate - #135
Closed
magicsunday wants to merge 2 commits into
Closed
Conversation
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.
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Owner
Author
|
Superseded by #138. This branch was cut from a stale local |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.ymlalready 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-chartalready uses. Nothing repo-specific.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 keepscontents: read+pull-requests: readin effect for the reusable workflow.editedand the concurrency group are a package: the gate judges the pull-request title, and withoutediteda title broken after a green run would never be re-judged;cancel-in-progressthen removes the race where an older green run overwrites a newer red one.Note
The check is advisory until the context
commit-convention / Commit conventionis added to this repository's branch protection — that step is not part of this pull request.