Skip to content

fix: return error when ValidateJiraToken receives malformed URL#1186

Merged
mergify[bot] merged 1 commit intomainfrom
fix/jira-malformed-url-validation
Apr 8, 2026
Merged

fix: return error when ValidateJiraToken receives malformed URL#1186
mergify[bot] merged 1 commit intomainfrom
fix/jira-malformed-url-validation

Conversation

@ambient-code
Copy link
Copy Markdown
Contributor

@ambient-code ambient-code bot commented Apr 3, 2026

Summary

  • Fix ValidateJiraToken silently returning true, nil when all Jira API URL candidates fail request construction (e.g. malformed URL)
  • Add lastReqErr variable to capture request-construction errors and check it in the fallthrough path
  • Add regression test that passes a malformed URL (://not-a-url) and asserts valid == false and err != nil

Closes #1079

Test plan

  • New test: returns false with error for a malformed URL — passes malformed URL, asserts valid == false and err != nil
  • All 445 existing unit tests pass (go test -tags test ./handlers/)

🤖 Generated with Claude Code

When http.NewRequestWithContext fails for all Jira API URL candidates
(e.g. malformed URL), the loop silently swallowed every error via
continue. Because sawHTTPResponse and lastNetErr were never set, the
function fell through to return true, nil — falsely reporting a broken
Jira URL as a valid connection.

Capture the request-construction error in lastReqErr and check it in
the fallthrough path so malformed URLs correctly return false + error.

Closes #1079

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ambient-code ambient-code bot added this to the Review Queue milestone Apr 3, 2026
@ambient-code ambient-code bot removed this from the Review Queue milestone Apr 6, 2026
@Gkrumbach07 Gkrumbach07 added the ambient-code:managed PR managed by AI automation label Apr 6, 2026
@ambient-code ambient-code bot added this to the Review Queue milestone Apr 7, 2026
@ambient-code ambient-code bot added ambient-code:needs-human AI circuit breaker fired, needs human attention and removed ambient-code:managed PR managed by AI automation labels Apr 7, 2026
@ambient-code
Copy link
Copy Markdown
Contributor Author

ambient-code bot commented Apr 7, 2026

Circuit breaker triggered (retry_count=3)

This PR has been checked 3 times with no issues found — CI is passing, no merge conflicts, and no review comments to address. However, it remains in BLOCKED mergeStateStatus (likely awaiting required approvals).

Current state:

  • CI: All checks passing
  • Merge conflicts: None
  • Review comments: None
  • Mergeable: Yes (pending required approvals)

Handing off to a human reviewer. Please review and approve when ready.

@mergify mergify bot added the queued label Apr 8, 2026
@mergify
Copy link
Copy Markdown

mergify bot commented Apr 8, 2026

Merge Queue Status

This pull request spent 35 seconds in the queue, including 5 seconds running CI.

Required conditions to merge

mergify bot added a commit that referenced this pull request Apr 8, 2026
@mergify mergify bot merged commit 68d8306 into main Apr 8, 2026
62 of 63 checks passed
@mergify mergify bot deleted the fix/jira-malformed-url-validation branch April 8, 2026 19:52
@mergify mergify bot removed the queued label Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ambient-code:needs-human AI circuit breaker fired, needs human attention

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ValidateJiraToken: malformed URL silently reports valid connection

1 participant