GeezerVison is showing github.com — fix(git): allow an explicitly empty commit type by Purv-Kabaria · Pull Request #11459 · updatecli/updatecli
Conversation
Fix #10995
An explicit commitmessage.type: "" now omits the conventional commit type: Bump dependency, or deps: Bump dependency with scope: deps. Leaving type unset still produces chore: Bump dependency (or chore(deps): ...), preserving existing manifests.
Commit.Type is a pointer so validation can distinguish omitted and empty values. Rendering and the 72-character title budget handle both forms, and the field's Go documentation describes the option. Tests cover YAML and mapstructure decoding, YAML round trips used by autodiscovery, repeated validation, and title boundaries for all six type/scope combinations.
Test
go test ./pkg/plugins/scms/git/commit and go vet ./pkg/plugins/scms/git/commit pass on Go 1.27.4 / Windows.
- All 15 SCM packages pass under
go test -short ./pkg/plugins/scms/... ./pkg/plugins/autodiscovery/...; the combined command fails in autodiscovery fixtures that assume Unix path separators or filenames. The argocd path assertion and maven template-filename failure reproduce on unchanged main in a separate worktree.
- The new configuration tests fail against the unchanged commit implementation for explicit empty types, with and without a scope.
go test -race cannot build here because the installed C compiler lacks 64-bit support.
Additional Information
- Updated parameter documentation in the
Commit.Type Go comment (generated docs).
- Separate website documentation PR (parameter documentation is generated from this repository).
- Full CLI smoke test with a custom build (unit/configuration tests above).
Tradeoff
The YAML format and default behavior stay compatible. Go callers that construct commit.Commit with a Type literal must now supply a string pointer; in-repository callers are updated.
Prepared with Codex assistance.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Nov 21, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

Important
Review skipped
Review was skipped as selected files did not have any reviewable changes.
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
41d445f5-6479-4fa4-8f62-856e05b6858d
Commits
-
Reviewing files that changed from the base of the PR and between 8b8c87e and 8de0ee0.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review.
Walkthrough
-
Commit configuration now distinguishes an unset type from an explicitly empty type. Unset types default to chore; empty types are omitted from generated titles. Title-length accounting and tests cover both forms.
Changes: Commit type configuration and formatting
| Layer / File(s) |
Summary |
Commit type configuration pkg/plugins/scms/git/commit/main.go |
Commit.Type changes from string to *string. Validation defaults the type to chore only when it is nil. |
Title generation and validation pkg/plugins/scms/git/commit/main.go, pkg/plugins/scms/git/commit/main_test.go, pkg/plugins/scms/git/commit/type_test.go |
The template omits an empty type prefix and retains a scope followed by a colon when present. Title-length accounting excludes an empty type. Tests cover unset, empty, and explicit types, including title-length boundaries. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Feature · Severity of issue fixed: Low
Suggested reviewers: olblak, macedogm
Merge Risk: Minimal · previous review 8b8c8
-
An explicitly empty commit type now omits the type prefix, while an unset type keeps the chore default. No merge-blocking risk is evident. Go callers constructing Commit literals must now supply a string pointer.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title "fix(git): allow an explicitly empty commit type" names the main change. The PR lets an explicit empty commitmessage.type omit the conventional commit type prefix. The change makes Commit.Ty… |
| Linked Issues check |
 |
Issue #10995 asks that an intentionally empty commitmessage.type not default to chore. The PR implements this. Commit.Type is now *string (pkg/plugins/scms/git/commit/main.go). Validate() assigns the … |
| Out of Scope Changes check |
 |
All changes relate to the requested behavior. main.go changes alter the type field to a pointer, the template, title-length accounting, and the Validate default. main_test.go changes update existing f… |
| Description check |
 |
The description states the change (an explicit empty commitmessage.type omits the conventional commit type, with or without scope), links issue #10995, and describes the pointer-based Commit.Type desi… |
Full details: Title check
-
Explanation
The title "fix(git): allow an explicitly empty commit type" names the main change. The PR lets an explicit empty commitmessage.type omit the conventional commit type prefix. The change makes Commit.Type a pointer so validation can tell an omitted value from an empty one. The title is specific and matches the changeset and linked issue #10995.
Full details: Linked Issues check
-
Explanation
Issue #10995 asks that an intentionally empty commitmessage.type not default to chore. The PR implements this. Commit.Type is now *string (pkg/plugins/scms/git/commit/main.go). Validate() assigns the chore default only when the pointer is nil, so an explicit "" is preserved. The commitTpl template renders the title without a type prefix when Type is empty, and renders "scope: title" when a scope is set. ParseMessage counts the type prefix only when the pointer is non-nil and non-empty, so the 72-character title budget matches each rendered form. The issue's alternative type: none is not implemented. The issue presents it as optional ('could be another way'), so its absence does not fail the requirement. Test coverage in type_test.go (TestCommitTypeConfiguration) covers YAML/mapstructure decoding and title boundaries. I did not run the tests. The assessment relies on the diff and the reported results.
Full details: Out of Scope Changes check
-
Explanation
All changes relate to the requested behavior. main.go changes alter the type field to a pointer, the template, title-length accounting, and the Validate default. main_test.go changes update existing fixtures to the pointer type and add a stringPointer helper, which is required by the type change. type_test.go adds tests for the new empty-type behavior. The Generate change passes the dereferenced type to the template through an embedded struct, which supports the same behavior. The Go doc comment update documents the new option. No unrelated behavior change was found in the reviewed diff.
Full details: Description check
-
Explanation
The description states the change (an explicit empty commitmessage.type omits the conventional commit type, with or without scope), links issue #10995, and describes the pointer-based Commit.Type design, the tradeoff for Go callers, and the tests run. It follows the template's main sections (Fix reference, description, Test, Additional Information with Checklist, Tradeoff). Gaps: the Test section gives Go commands rather than the template's cd-and-go-test form, which is acceptable since the template is a guide. The Potential improvement section is absent. Two checklist items are unchecked, and the website documentation PR is marked as not yet opened. The description is mostly complete, so the check passes.
Finishing Touches
-
Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
-
Recent review info
-
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
8141b094-5be7-4432-8c88-84958d1e573d
Commits
-
Reviewing files that changed from the base of the PR and between 1e08823 and 8b8c87e.
Files selected for processing: 3
-
pkg/plugins/scms/git/commit/main.go
pkg/plugins/scms/git/commit/main_test.go
pkg/plugins/scms/git/commit/type_test.go
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.
|