Repository navigation
feat: give every Refs-optional commit type an issue-less branch form - #1790
Merged
Merged
Conversation
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.
Description
Generalises the hardcoded
chore/<summary>branch clause: every commit type in the resolved Refs-optional set now also gets an issue-less<type>/<summary>branch form. WithDEVKIT_REFS_OPTIONAL_TYPES=chore,docs,docs/<summary>is accepted next todocs/<issue>-<summary>, in both the local guard and CI.There is no new key. The branch set is derived from the Refs set, so a branch may skip the issue only where its commits may. Derivation (same in all three renderers):
choreis a floor. The sync-main-to-dev and devkit-upgrade bot branches arechore/<slug>, so no policy (not evenrequired) may drop them.nonesentinel is dropped.Default and
DEVKIT_REFS_POLICY=requiredresolve to plainchore, so the rendered pattern is byte-identical to today's.Type of Change
feat-- New featureChanges Made
assets/init-workspace.sh: newrender_issueless_branch_types, unconditional and idempotent ([BUG] Clearing a scaffold knob leaves the previous render in the preserved .pre-commit-config.yaml #1640). It uses a generic anchor ((?!^(…)/[a-z0-9]) that is distinct fromrender_branch_types')/[0-9].render_branch_guard_model's gitflow re-insert now anchors on the bare(?!^(prefix, not on the(chore)literal. Before this, a trunk → gitflow switch with a custom set would silently not restore(?!dev$).nix/hooks.nix:branchNamePatternFortakes the issue-less set, and the newissuelessBranchTypesForderives it fromrefsOptionalTypesFor. ThemkProjectShellwiring is unchanged:refsOptionalTypes/refsPolicy/commitTypesare already forwarded, so there is no templateflake.nixport.resolve-toolchain: newissueless-branch-typesoutput.ci.ymlre-exports it, and the branch-name gate uses it in place of the literalchorealternative..vig-ostemplate comments, the MIGRATION key table, COMMIT_MESSAGE_STANDARD, the branch-naming skill and both hook-config comments.Changelog Entry
Added
(#1767)
DEVKIT_REFS_OPTIONAL_TYPESset now gets a<type>/<summary>branch form, aschorealready did. WithDEVKIT_REFS_OPTIONAL_TYPES=chore,docs,docs/<summary>is accepted nextto
docs/<issue>-<summary>. There is no new key: a branch may skip theissue only where its commits may
branch-name gate (new
issueless-branch-typesoutput ofresolve-toolchain).chore/<summary>stays allowed under every policy,requiredincluded, so the default pattern is unchangedDEVKIT_REFS_POLICY=optionalexempt every approved type, soevery type now gets the issue-less form (e.g.
feat/<summary>)Testing
tests/test_ci_runner.py: 80 passedtests/test_flake_hooks.py: 82 passedtests/bats/init-workspace.bats: 312/312just precommit(full suite) is green.New tests: CI mapping (default, named, chore floor, dedup,
required,optional, invalid-list fallback), gate semantics, scaffold render, clear-restores-template, trunk → gitflow round trip with a custom set, and the flake surface.Checklist
CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
The one behaviour change for existing consumers is under
DEVKIT_REFS_POLICY=optional: every approved type gains<type>/<summary>. That relaxes the guard, which is consistent with the rule the issue asks for ("each type in the resolved Refs-optional set").Refs: #1767