You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The three built-in subject patterns in COMMON_SUBJECT_PATTERNS are all anchored to the start of the subject line, so teams that follow Conventional Commits — where the identifier appears after the type and scope — get no issue linked:
feat(routing)[ENG-123]: add stop reordering ← not matched
fix[ENG-123]: handle empty payload ← not matched
This adds a --issue-pattern flag that accepts a regex where group 1 captures the issue identifier. It's applied to the commit subject anywhere (not just the start), additive to the existing patterns:
args.ts — new --issue-pattern flag, validated and returned as issuePattern: string | null
extractors.ts — matchCustomSubjectPattern() applies the user regex globally to the subject, validates group 1 captures through the existing matchAllIdentifiers path; wired into extractLinearIssueIdentifiersForCommit via an optional second argument
scan.ts — issuePattern added to ScanOptions, compiled once before the commit loop, threaded into the extractor
index.ts — destructured from parsed args, passed to scanCommits, added to help text
Tried this branch against a real repo (GitLab CI + semantic-release, Conventional Commits) — --issue-pattern "([A-Za-z]{2,}-[0-9]+)" resolved every ticket the built-in leading-key patterns miss: mid-subject feat(api): asp-621 … and parenthesised (ASP-603) alike. Exactly the gap from #106. 🙌
One thing to fix before it's usable for live syncs: the actual releaseSyncByAccessKey mutation fails with
Field "issuePattern" is not defined by type "ReleaseDebugSinkInput"
because issuePattern is added to DebugSink, which is sent in the mutation input (--dry-run hides it since it skips the mutation). Opened a small PR against this branch that strips it from the payload while keeping it in the local sink for --verbose: MatthewCline-git#1. With that applied, live sync created real releases with all issues attached.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Summary
Closes #106.
The three built-in subject patterns in
COMMON_SUBJECT_PATTERNSare all anchored to the start of the subject line, so teams that follow Conventional Commits — where the identifier appears after the type and scope — get no issue linked:This adds a
--issue-patternflag that accepts a regex where group 1 captures the issue identifier. It's applied to the commit subject anywhere (not just the start), additive to the existing patterns:The pattern is validated as a legal regex at CLI entry. Invalid patterns produce a clear error:
Changes
args.ts— new--issue-patternflag, validated and returned asissuePattern: string | nullextractors.ts—matchCustomSubjectPattern()applies the user regex globally to the subject, validates group 1 captures through the existingmatchAllIdentifierspath; wired intoextractLinearIssueIdentifiersForCommitvia an optional second argumentscan.ts—issuePatternadded toScanOptions, compiled once before the commit loop, threaded into the extractorindex.ts— destructured from parsed args, passed toscanCommits, added to help text