Skip to content

fix: allow brackets in custom pull request title#1445

Merged
gcf-merge-on-green[bot] merged 5 commits intomainfrom
complex-title-pattern
May 24, 2022
Merged

fix: allow brackets in custom pull request title#1445
gcf-merge-on-green[bot] merged 5 commits intomainfrom
complex-title-pattern

Conversation

@chingor13
Copy link
Copy Markdown
Contributor

Fixes #1444

@product-auto-label product-auto-label Bot added the size: s Pull request size is small. label May 23, 2022
@chingor13 chingor13 force-pushed the complex-title-pattern branch from f13d14f to 508a475 Compare May 23, 2022 18:05
@chingor13 chingor13 force-pushed the complex-title-pattern branch from 508a475 to 67fa2ad Compare May 23, 2022 18:08
@chingor13 chingor13 changed the title test: failing test for parsing pull request title with regex characters fix: allow brackets in custom pull request title May 23, 2022
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels May 23, 2022
@chingor13 chingor13 force-pushed the complex-title-pattern branch from 0712856 to 6bc7524 Compare May 23, 2022 18:24
@chingor13 chingor13 marked this pull request as ready for review May 23, 2022 18:41
@chingor13 chingor13 requested review from a team and bcoe May 23, 2022 18:41
Comment thread src/util/pull-request-title.ts Outdated
return new RegExp(
`^${(pullRequestTitlePattern || DEFAULT_PR_TITLE_PATTERN)
.replace('${scope}', '(\\((?<branch>[\\w-.]+)\\))?')
.replace('[', '\\[')
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

perhaps worth pulling in the dep escape-string-regexp, we already rely on it as a deep dep, keep the same tests.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Note: v5 of that library is the only one with types and our current dependencies use v1 and v4. Additionally, I was having issues with ESM using that library. I added a TODO to handle all regex characters.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Note: v5 of that library is the only one with types and our current dependencies use v1 and v4. Additionally, I was having issues with ESM using that library. I added a TODO to handle all regex characters.

@chingor13 chingor13 added the automerge Merge the pull request once unit tests and other checks pass. label May 24, 2022
@gcf-merge-on-green gcf-merge-on-green Bot merged commit 5cdbc5b into main May 24, 2022
@gcf-merge-on-green gcf-merge-on-green Bot deleted the complex-title-pattern branch May 24, 2022 21:22
@gcf-merge-on-green gcf-merge-on-green Bot removed the automerge Merge the pull request once unit tests and other checks pass. label May 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

There are untagged, merged release PRs outstanding - aborting on other branch than default

2 participants