Repository: refined-github/refined-github
Pull request #8297 (2025-02-20 18:12:12)

`conventional-commits` - Fix grouping on commits with parens
The problem:

![image](https://github.com/user-attachments/assets/97c0605b-194f-4f9f-9913-55db8da30e9f)

Before fix: https://regex101.com/r/XZIg7M/1
After fix: https://regex101.com/r/j85oEo/1

## Test URLs

https://github.com/renovatebot/renovate/commits/4214048e713096f58005658e104c09e881d4b933/

## Screenshot


Patch:
diff --git a/source/features/netiquette.tsx b/source/features/netiquette.tsx
index 5510fd42..26c54c23 100644
--- a/source/features/netiquette.tsx
+++ b/source/features/netiquette.tsx
@@ -62,10 +62,13 @@ export function getResolvedText(): JSX.Element {
 }
 
 function addResolvedBanner(newCommentField: HTMLElement): void {
+	if (elementExists('.rgh-resolved-banner'))
+		return;
+
 	const reactWrapper = newCommentField.closest('[class^="InlineAutocomplete"]');
 	const banner = createBanner({
 		icon: <InfoIcon className="m-0" />,
-		classes: 'p-2 text-small color-fg-muted border-0 rounded-0'.split(' '),
+		classes: 'p-2 text-small color-fg-muted border-0 rounded-0 rgh-resolved-banner'.split(' '),
 		text: getResolvedText(),
 	});
 
diff --git a/source/features/update-pr-from-base-branch.tsx b/source/features/update-pr-from-base-branch.tsx
index 4e72cfd8..65801e97 100644
--- a/source/features/update-pr-from-base-branch.tsx
+++ b/source/features/update-pr-from-base-branch.tsx
@@ -15,7 +15,10 @@ import {getConversationNumber} from '../github-helpers/index.js';
 import createMergeabilityRow from '../github-widgets/mergeability-row.js';
 import {expectToken} from '../github-helpers/github-token.js';
 
-const canNativelyUpdate = '.js-update-branch-form';
+const canNativelyUpdate = [
+	'.js-update-branch-form', // Old view - TODO: Remove in July 2025
+	'[aria-label="Update branch options"]',
+];
 
 async function mergeBranches(): Promise<AnyObject> {
 	return api.v3(`pulls/${getConversationNumber()!}/update-branch`, {
diff --git a/source/helpers/conventional-commits.ts b/source/helpers/conventional-commits.ts
index 4cb683af..ac78102c 100644
--- a/source/helpers/conventional-commits.ts
+++ b/source/helpers/conventional-commits.ts
@@ -1,5 +1,5 @@
 // Using https://www.conventionalcommits.org/ as a reference.
-export const conventionalCommitRegex = /^(?<type>\w+)(?:\((?<scope>.+)\))?(?<major>!)?: */;
+export const conventionalCommitRegex = /^(?<type>\w+)(?:\((?<scope>.+?)\))?(?<major>!)?: */;
 
 // Do not send PRs for types not listed here: https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional#rules
 // No more types will be added nor do we accept options.


Test patch:
diff --git a/source/helpers/conventional-commits.test.ts b/source/helpers/conventional-commits.test.ts
index 4267986c..1d7a3ef7 100644
--- a/source/helpers/conventional-commits.test.ts
+++ b/source/helpers/conventional-commits.test.ts
@@ -43,6 +43,14 @@ test('parseConventionalCommit', () => {
 		  "type": "Feature!",
 		}
 	`);
+	expect(parseConventionalCommit('revert(scope): Revert "feat(scope): Commit message"')).toMatchInlineSnapshot(`
+		{
+		  "raw": "revert(scope): ",
+		  "rawType": "revert",
+		  "scope": "scope: ",
+		  "type": "Revert",
+		}
+	`);
 	expect(parseConventionalCommit('feat(sco pe): Commit message')).toMatchInlineSnapshot(`
 		{
 		  "raw": "feat(sco pe): ",