Skip to content

Conversation

robvanderleek
Copy link
Owner

No description provided.

@create-issue-branch create-issue-branch bot changed the title fix: 🐛 Do not allow replacement of arbitrary characters in prefix fix: 🐛 gitReplaceChars should only apply to issue title, not branch prefix Aug 27, 2025
@robvanderleek robvanderleek requested a review from Copilot August 27, 2025 11:52
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug where gitReplaceChars configuration was incorrectly being applied to branch prefixes in addition to issue titles. The fix ensures that custom character replacement only affects the issue title portion of branch names, while preserving forward slashes and other characters in branch prefixes like "bug/" or "feature/".

  • Removed replaceChars parameter from makePrefixGitSafe function to prevent character replacement in branch prefixes
  • Updated getBranchName function to only apply gitReplaceChars to the issue title portion via makeGitSafe
  • Added regression test case to verify the fix works correctly

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.

File Description
src/utils.ts Simplified makePrefixGitSafe to remove custom character replacement, consolidated logic in makeGitSafe
src/github.ts Updated getBranchName to only apply gitReplaceChars to issue title, not branch prefix
tests/utils.test.ts Updated test expectations to reflect that prefixes no longer have custom character replacement
tests/github.test.ts Added regression test for the reported bug to ensure fix works correctly

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

CodeLimit Report

Overview

Language Files Functions Lines of Code
TypeScript 24 117 1297 3 0
JavaScript 1 1 8 0 0
Totals 25 118 1305 3 0

Summary

Easy / Verbose Hard-to-maintain ⚠ Unmaintainable ⛌
91% 9% 0%

✅ 91% of the functions are maintainable, no refactoring necessary.

Findings

Function Length File
setupEventHandlers 54 src/probot.ts
getConventionalPrTitlePrefix 32 src/config.ts
getConventionalLabelMapping 31 src/config.ts

Generated by CodeLimit

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.28%. Comparing base (aeb86fc) to head (3a8d888).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1073      +/-   ##
==========================================
- Coverage   79.30%   79.28%   -0.02%     
==========================================
  Files          19       19              
  Lines        1039     1038       -1     
  Branches      213      213              
==========================================
- Hits          824      823       -1     
  Misses        202      202              
  Partials       13       13              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@robvanderleek robvanderleek merged commit 1aa6de3 into main Aug 27, 2025
4 checks passed
@robvanderleek robvanderleek deleted the issue-1072-gitReplaceChars_should_only_apply_to_issue_title_not_branch_prefix branch August 27, 2025 12:25
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.

2 participants