Skip to content

fix(jira-integration): Harden Jira URL matching in “Closes …” lists - #89

Merged
marek-saji merged 4 commits into
v1from
fix/jira-integration-url-matching
Jul 15, 2026
Merged

fix(jira-integration): Harden Jira URL matching in “Closes …” lists#89
marek-saji merged 4 commits into
v1from
fix/jira-integration-url-matching

Conversation

@marek-saji

@marek-saji marek-saji commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Why?

The jira-integration action’s “Closes …” URL matching had three gaps: Markdown autolink form (<URL>) was not matched, case-variant Jira URLs crashed the action on null.map(), and unescaped dots in the configured Jira origin acted as regexp wildcards, letting look-alike hosts match.

What?

  • Match angle-bracket-wrapped (<URL>) Jira URLs in “Closes …” lists, for every item including the first; issue keys are still extracted only via the strict key pattern.
  • Use the i flag in the per-match URL extraction as well, so case-variant hosts or issue keys no longer make it return null and crash.
  • Escape the configured Jira origin with RegExp.escape() (built in since Node 24, which this action already runs on) before embedding it in the URL regexp.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Reviewed-by: Claude Fable 5 <noreply@anthropic.com>
Reviewed-by: CodeRabbit 0.6.5 <noreply@coderabbit.ai>
Reviewed-by: CodeRabbit <136622811+coderabbitai[bot]@users.noreply.github.com>
Reviewed-by: Codex gpt-5.5 <codex@openai.com>
Reviewed-by: Gemini gemini-2.5-pro <gemini-code-assist@google.com>

@marek-saji

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: dfa2f30a-dde9-437c-9c5b-16e1682b3caa

📥 Commits

Reviewing files that changed from the base of the PR and between 5dd12e0 and e4ff700.

📒 Files selected for processing (2)
  • .nvmrc
  • jira-integration/.nvmrc
💤 Files with no reviewable changes (1)
  • jira-integration/.nvmrc

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved detection of Jira issue references in “closes” messages.
    • More reliably matches Jira URLs and extracted issue keys across varying letter casing.
  • Chores
    • Updated the project’s Node.js version to v24.18.0.

Walkthrough

The root Node.js version is pinned to v24.18.0, the integration-specific version pin is removed, and Jira resolved-issue extraction now escapes the Jira origin, adjusts “closes” matching, and handles URL matches case-insensitively.

Changes

Jira extraction and runtime

Layer / File(s) Summary
URL matching and key extraction
jira-integration/index.mjs
extractResolvedIssueKeys uses escaped Jira URL origins, an updated “closes” pattern, and case-insensitive URL and issue-key matching.
Node.js runtime version
.nvmrc, jira-integration/.nvmrc
The root Node.js version is set to v24.18.0, and the integration-specific version pin is removed.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

A rabbit checks the Jira trail,
With safer regex ears held well.
URLs hop through brackets bright,
Keys emerge in matching light.
“Closes!” sings the bunny—done!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the Jira URL matching hardening and matches the main change in the PR.
Description check ✅ Passed The description is directly related to the changes and explains the Jira matching fixes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/jira-integration-url-matching

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot]

This comment was marked as resolved.

marek-saji added a commit that referenced this pull request Jul 15, 2026
Fixup-for: dba8129
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Reviewed-by: Claude Fable 5 <noreply@anthropic.com>
Reviewed-by: Gemini gemini-2.5-pro <gemini-code-assist@google.com>
Resolves: #89 (comment)
marek-saji and others added 3 commits July 15, 2026 13:49
Support the Markdown autolink form (<URL>) in “Closes …” lists, for
every item in the list including the first one. Brackets are optional
on either side; issue keys are still extracted only via the strict
key pattern, so nothing new can reach the JQL queries.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Reviewed-by: Claude Fable 5 <noreply@anthropic.com>
Reviewed-by: CodeRabbit 0.6.5 <noreply@coderabbit.ai>
Reviewed-by: CodeRabbit <136622811+coderabbitai[bot]@users.noreply.github.com>
Reviewed-by: Codex gpt-5.5 <codex@openai.com>
Reviewed-by: Gemini gemini-2.5-pro <gemini-code-assist@google.com>
The “Closes …” list is matched case-insensitively, but the per-match
URL extraction was case-sensitive, so e.g. an uppercase host or
a lowercase issue key made it return null and the action crashed on
null.map(). Use the i flag in both extraction steps as well.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Reviewed-by: Claude Fable 5 <noreply@anthropic.com>
Reviewed-by: CodeRabbit 0.6.5 <noreply@coderabbit.ai>
Reviewed-by: CodeRabbit <136622811+coderabbitai[bot]@users.noreply.github.com>
Reviewed-by: Codex gpt-5.5 <codex@openai.com>
Reviewed-by: Gemini gemini-2.5-pro <gemini-code-assist@google.com>
Unescaped dots in the configured origin acted as wildcards, so
look-alike hosts could match. RegExp.escape() is built in since
Node 24, which this action already runs on.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Reviewed-by: Claude Fable 5 <noreply@anthropic.com>
Reviewed-by: CodeRabbit 0.6.5 <noreply@coderabbit.ai>
Reviewed-by: CodeRabbit <136622811+coderabbitai[bot]@users.noreply.github.com>
Reviewed-by: Codex gpt-5.5 <codex@openai.com>
Reviewed-by: Gemini gemini-2.5-pro <gemini-code-assist@google.com>
@marek-saji
marek-saji force-pushed the fix/jira-integration-url-matching branch from 746279e to 5dd12e0 Compare July 15, 2026 11:50
@marek-saji
marek-saji marked this pull request as ready for review July 15, 2026 11:51
@marek-saji
marek-saji enabled auto-merge July 15, 2026 11:55
coderabbitai[bot]

This comment was marked as resolved.

jira-integration now uses RegExp.escape, which needs Node 24. The action
already runs on node24 (action.yaml), but the pinned .nvmrc kept local
runs on Node 20, where the documented debugging flow (node index.mjs)
would throw. One repo-root .nvmrc keeps all workspaces on the same
version.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Reviewed-by: Codex gpt-5.5 <codex@openai.com>
Reviewed-by: Gemini gemini-2.5-pro <gemini-code-assist@google.com>
@marek-saji
marek-saji force-pushed the fix/jira-integration-url-matching branch from 5dd12e0 to e4ff700 Compare July 15, 2026 12:00
@marek-saji
marek-saji merged commit 9c5de0a into v1 Jul 15, 2026
2 checks passed
@marek-saji
marek-saji deleted the fix/jira-integration-url-matching branch July 15, 2026 12:35
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