Skip to content

feat: give every Refs-optional commit type an issue-less branch form - #1790

Merged
c-vigo merged 3 commits into
devfrom
feature/1767-issueless-branch-types
Sep 30, 2026
Merged

c-vigo merged 3 commits into
devfrom
feature/1767-issueless-branch-types

Conversation

@c-vigo

@c-vigo c-vigo commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

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. With DEVKIT_REFS_OPTIONAL_TYPES=chore,docs, docs/<summary> is accepted next to docs/<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):

  • chore is a floor. The sync-main-to-dev and devkit-upgrade bot branches are chore/<slug>, so no policy (not even required) may drop them.
  • Every other resolved Refs-optional type is appended, in order, and the none sentinel is dropped.

Default and DEVKIT_REFS_POLICY=required resolve to plain chore, so the rendered pattern is byte-identical to today's.

Type of Change

  • feat -- New feature

Changes Made

  • assets/init-workspace.sh: new render_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 from render_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: branchNamePatternFor takes the issue-less set, and the new issuelessBranchTypesFor derives it from refsOptionalTypesFor. The mkProjectShell wiring is unchanged: refsOptionalTypes/refsPolicy/commitTypes are already forwarded, so there is no template flake.nix port.
  • resolve-toolchain: new issueless-branch-types output. ci.yml re-exports it, and the branch-name gate uses it in place of the literal chore alternative.
  • Docs: the .vig-os template comments, the MIGRATION key table, COMMIT_MESSAGE_STANDARD, the branch-naming skill and both hook-config comments.

Changelog Entry

Added

  • Issue-less branch form for every Refs-optional commit type
    (#1767)
    • Every type in the resolved DEVKIT_REFS_OPTIONAL_TYPES set now gets a
      <type>/<summary> branch form, as chore already did. With
      DEVKIT_REFS_OPTIONAL_TYPES=chore,docs, docs/<summary> is accepted next
      to docs/<issue>-<summary>. There is no new key: a branch may skip the
      issue only where its commits may
    • Applies to the scaffolded branch guard, the flake-generated guard and CI's
      branch-name gate (new issueless-branch-types output of
      resolve-toolchain). chore/<summary> stays allowed under every policy,
      required included, so the default pattern is unchanged
    • Consumers on DEVKIT_REFS_POLICY=optional exempt every approved type, so
      every type now gets the issue-less form (e.g. feat/<summary>)

Testing

  • Tests pass locally
    • tests/test_ci_runner.py: 80 passed
    • tests/test_flake_hooks.py: 82 passed
    • tests/bats/init-workspace.bats: 312/312
    • Broad pytest, excluding image/integration: all green. The first run had 2 failures from my own mid-run edits (a stale per-run tree cache and an unsynced changelog mirror); both pass on re-run.
  • just 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

  • I have performed a self-review of my code
  • I have updated the documentation accordingly
  • I have updated CHANGELOG.md in the [Unreleased] section (and pasted the entry above)
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

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

@c-vigo
c-vigo merged commit 4c49e41 into dev Sep 30, 2026
17 checks passed
@c-vigo
c-vigo deleted the feature/1767-issueless-branch-types branch September 30, 2026 17:39
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