Uh oh!
There was an error while loading. Please reload this page.
Fix commit-title-prefix being stripped by git am - #2337
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agentic Changeset Generator triggered by this pull request. |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug where commit title prefixes in bracketed format (e.g., [skip-ci]) were being stripped by git am during patch application. The issue occurred because git am removes all [PATCH <anything>] patterns from Subject lines, inadvertently removing user-specified prefixes like [skip-ci] along with the [PATCH] marker.
Key Changes:
- Added prefix normalization logic to convert bracketed prefixes (e.g.,
[skip-ci]) to colon format (e.g.,skip-ci:) before applying patches - Implemented comprehensive test coverage with 5 test cases covering various edge cases
- Updated all workflow lock files to use the normalized prefix format
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/js/push_to_pull_request_branch.cjs | Implements the core normalization logic that converts bracketed prefixes to colon format |
| pkg/workflow/js/push_to_pull_request_branch.test.cjs | Adds 5 comprehensive test cases covering different prefix formats and edge cases |
| .github/workflows/tidy.lock.yml | Updates workflow to use normalized prefix logic and pins action versions to specific commits |
| .github/workflows/poem-bot.lock.yml | Updates workflow to use normalized prefix logic and pins action versions to specific commits |
| .github/workflows/mergefest.lock.yml | Updates workflow to use normalized prefix logic and pins action versions to specific commits |
| .github/workflows/changeset-generator.firewall.lock.yml | Updates workflow to use normalized prefix logic |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
The
commit-title-prefixconfiguration insafe-outputs.push-to-pull-request-branchwas not appearing in final commit messages. Git am strips all bracketed prefixes matching[PATCH <anything>]from Subject lines, so[skip-ci]was being removed along with[PATCH].Changes
Normalize bracketed prefixes to colon format before applying patches
[skip-ci]→skip-ci:[bot]→bot:chore:pass through unchangedAdd comprehensive test coverage with 5 test cases for edge cases
Implementation
Result:
Subject: [PATCH] skip-ci: Add changeset...→ git am →skip-ci: Add changeset...✓Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.