Skip to content

feat: add commit-msg hook and simplify session-commit#10

Open
Cragsmann wants to merge 2 commits into
openshift:masterfrom
Cragsmann:SRVOCF-950--commit-msg-hook-and-slash-commands
Open

feat: add commit-msg hook and simplify session-commit#10
Cragsmann wants to merge 2 commits into
openshift:masterfrom
Cragsmann:SRVOCF-950--commit-msg-hook-and-slash-commands

Conversation

@Cragsmann

@Cragsmann Cragsmann commented Jun 24, 2026

Copy link
Copy Markdown

Summary

  • Add Husky pre-commit (lint) and commit-msg hooks
  • commit-msg hook validates: conventional commit type prefix, authorship trailer (Co-Authored-By or Signed-off-by), no em dashes
  • Merge, fixup, and squash commits are exempt
  • Simplify session-commit: remove progress log and blocker migration steps, add hook failure handling
  • Remove redundant commit-user command

Test plan

  • Verify tandem commit (with Co-Authored-By) passes the hook
  • Verify autonomous commit (with Signed-off-by) passes the hook
  • Verify commit without authorship trailer is rejected
  • Verify commit without conventional type prefix is rejected
  • Verify commit with em dash is rejected
  • Verify merge commits bypass the hook
  • Run /session-commit and confirm it produces a valid commit

Add Husky pre-commit (lint) and commit-msg hooks. The commit-msg
hook validates conventional commit type prefix, authorship trailer
(Co-Authored-By or Signed-off-by), and rejects em dashes. Merge,
fixup, and squash commits are exempt.

Simplify session-commit: remove progress log and blocker migration
steps, add hook failure handling. Remove redundant commit-user
command.

Co-Authored-By: Claude <noreply@anthropic.com>
@openshift-ci openshift-ci Bot requested review from TheRealJon and jhadvig June 24, 2026 08:02
@openshift-ci

openshift-ci Bot commented Jun 24, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Cragsmann

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 24, 2026
## Steps

1. **Assess changes** run these in parallel:
1. **Assess changes** -- run these in parallel:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it em dash vs. double dash styling per chat bot instance? :)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Today he has some double dash mood

@dsimansk

Copy link
Copy Markdown

infra issue
/retest

Comment thread .husky/commit-msg Outdated
Comment thread .husky/pre-commit
@@ -0,0 +1,12 @@
#!/usr/bin/env sh

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same reason as the above comment

Suggested change
#!/usr/bin/env sh
#!/usr/bin/env bash

Co-authored-by: David Simansky <dsimansk@redhat.com>
@openshift-ci

openshift-ci Bot commented Jun 24, 2026

Copy link
Copy Markdown

@Cragsmann: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/images 8f684b8 link true /test images

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@matejvasek

Copy link
Copy Markdown

Does this complements or supersedes the other hook PR?

@Cragsmann

Copy link
Copy Markdown
Author

Does this complements or supersedes the other hook PR?

It complements #6. I took the Husky setup commit from that PR to avoid duplicating the configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants