Skip to content

release: v3.3.0 - add compute-highest-commit-type foundation action (v4… - #19

Merged
Shinrai merged 7 commits into
masterfrom
feat/v4-foundation-actions
May 21, 2026
Merged

Shinrai merged 7 commits into
masterfrom
feat/v4-foundation-actions

Conversation

@cldmv-bot

@cldmv-bot cldmv-bot Bot commented May 21, 2026 •

Copy link
Copy Markdown
Contributor

🚀 What's Changed

💥 Breaking Changes

No breaking changes

✨ Features

  • feat(actions): add merge-master-into-branch foundation action (v4 §11 PR 1) (9947bb5)
  • feat(actions): add force-reset-branch foundation action (v4 §11 PR 1) (886de12)
  • feat(actions): add redirect-hotfix-pr foundation action (v4 §11 PR 1) (35d23d0)
  • feat(actions): add normalize-pr-title foundation action (v4 §11 PR 1) (d33142c)
  • feat(actions): add compute-highest-commit-type foundation action (v4 §11 PR 1) (60ac8c3)

🐛 Bug Fixes

No bug fixes

🔧 Other Changes

  • docs(v4): de-link PR references in release-flow-v4.md (6533059)
👥 Contributors

@cldmv-bot cldmv-bot Bot added release Marks a pull request as a pending release — merge to publish a new version semver: minor This release adds new functionality in a backwards-compatible way area: core and removed type: config labels May 21, 2026
@Shinrai
Shinrai force-pushed the feat/v4-foundation-actions branch from 8f10c09 to af2a16e Compare May 21, 2026 21:40
@cldmv-bot cldmv-bot Bot added area: core and removed area: core labels May 21, 2026
@Shinrai
Shinrai force-pushed the feat/v4-foundation-actions branch from 0146ce6 to 2b5e2ac Compare May 21, 2026 21:44
@cldmv-bot cldmv-bot Bot added type: documentation Relates to docs, README updates, guides, or inline code comments area: core and removed type: documentation Relates to docs, README updates, guides, or inline code comments type: config labels May 21, 2026
Shinrai added 6 commits May 21, 2026 15:11
…§11 PR 1)

Pure-logic action: parse a JSON array of conventional commits and emit
the highest-priority type plus implied semver bump.

Composite action that runs a single Node step against action.mjs.
Action.mjs exports parseCommit/computeHighest/bumpFor/TYPE_PRIORITY so
the sibling test.mjs can exercise the pure logic without spinning up
an Actions runner. 30 test assertions cover:
  - subject parsing (plain / scoped / breaking-mark / breaking-footer)
  - bump derivation per type
  - priority ranking (feat > fix > perf > ... > chore > unknown)
  - edge cases (empty list, all non-conventional, unknown types)

Run: `cd .github/actions/git/steps/compute-highest-commit-type && node test.mjs`

Not wired into any workflow yet; consumed in subsequent PRs by
normalize-pr-title (§6.4) and check-release-commit refactor.
Composite action implementing §6.4 of the v4 design. Skips bot-authored
PRs, the long-running release PRs (next/hotfix → master), and titles
starting with 'release:' (the v3 escape-hatch carries forward).

action.mjs imports compute-highest-commit-type's pure logic
(parseCommit / TYPE_PRIORITY / computeHighest) so it doesn't
re-implement the parser. Exports the pure logic for test.mjs:
  - extractTitleParts: regex parse of a current title
  - shouldSkip: pre-API skip decision
  - titleConforms: 'title is acceptable given required type+breaking'
  - buildNewTitle: type/scope/breaking/summary → new title
  - summaryFromSubject: strip conventional prefix to get bare summary
  - findRepresentativeCommit: pick chronologically-oldest matching commit
    using findLast (matches the v3.2.x title-suffix logic)

Side-effecting main() does: fetch PR + commits → compute highest →
gate via shouldSkip/titleConforms → PATCH title → sentinel-deduped
comment via COMMENT_SENTINEL.

Not wired into any workflow yet; consumed by local-pr-title-normalizer.yml
in a later PR.
Implements §6.5 of the v4 design. When a contributor opens a PR with a
head branch matching ^(hotfix|security)/, retarget its base from the
default ('next' under v4) to 'hotfix'. Idempotent — skips bot-created
PRs, non-matching head refs, and PRs already on the target base.

action.mjs exports the pure logic for test.mjs:
  - compilePattern: regex source → RegExp (with default fallback)
  - shouldSkip: gating decision combining user-type, head-match,
    base-already-target
  - buildCommentBody: explanatory comment template using the sentinel

Sentinel COMMENT_SENTINEL = '_Auto-redirected PR base:_' (different
from normalize-pr-title's sentinel so the two actions can both post
to the same PR without interfering).

Side-effecting main(): fetch PR (fill missing refs/user-type) →
gate → PATCH base → sentinel-deduped comment.

Not wired into any workflow yet.
Implements §6.3 / §7 of the v4 design — force-push a source ref onto a
target branch via 'git push --force-with-lease' with bounded retry on
lease failure. Used by local-next-reset.yml and local-hotfix-reset.yml
to bring next/hotfix back to master HEAD after a release lands.

action.mjs exports pure helpers for test.mjs:
  - buildPushArgs: { remote, sourceRef, targetBranch } → argv
  - isLeaseFailure: stderr classifier — matches 'stale info',
    'rejected.*force-with-lease', 'fetch first' but NOT auth / missing
    repo errors (those should propagate, not retry)
  - parseLsRemoteSha: 'git ls-remote' line → SHA for a given ref

Side-effecting main():
  1. git push --force-with-lease master:refs/heads/<target>
  2. On lease failure, fetch + retry up to max-retries times
  3. Confirm via ls-remote, emit reset-sha + retries-used outputs

Not wired into any workflow yet.
… PR 1)

Implements §7.2 of the v4 design — API-driven merge of master into a
target branch via POST /repos/{owner}/{repo}/merges. Used after a
hotfix lands on master to bring next's feature work back in sync
without losing the accumulated work that a force-reset would discard.

action.mjs exports pure helpers for test.mjs:
  - buildMergePayload: { targetBranch, sourceRef, commitMessage } →
    Merges API body. Falls back to a sensible default message when
    commit-message is empty / whitespace.
  - interpretMergeResponse: classify response into
    { performed, sha, conflict, error }. Handles 201/204/409 and any
    other status as an error with the original status preserved.

Side-effecting main() does a raw fetch (not the shared api() helper)
because that helper throws on any non-2xx — and 204 'already up-to-
date' is a legitimate success case here, while 409 'merge conflict'
needs a structured failure (sets had-conflict=true output AND exits 1).

Not wired into any workflow yet.
GitHub auto-links a hash followed by a number (in commit messages,
PR/issue bodies, and comments) to the issue/PR with that number. The
design doc used 'PR #N'-style references for the §11 migration sequence
plus one observed-bug reference, which would create spurious
cross-links. Rewrite them to the hashless form ('PR 1', 'PRs 3 through
5', 'bug 1').

The §11 table already used the bare '| N |' cell format, so only prose
references needed changing. No semantic change.
@Shinrai
Shinrai force-pushed the feat/v4-foundation-actions branch from 64f28c6 to 6533059 Compare May 21, 2026 22:11
@cldmv-bot cldmv-bot Bot removed type: documentation Relates to docs, README updates, guides, or inline code comments type: config labels May 21, 2026
@cldmv-bot cldmv-bot Bot added area: core type: documentation Relates to docs, README updates, guides, or inline code comments and removed area: core labels May 21, 2026
@Shinrai
Shinrai merged commit 3e46a6c into master May 21, 2026
7 checks passed
@cldmv-bot
cldmv-bot Bot deleted the feat/v4-foundation-actions branch May 21, 2026 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release Marks a pull request as a pending release — merge to publish a new version semver: minor This release adds new functionality in a backwards-compatible way type: documentation Relates to docs, README updates, guides, or inline code comments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant