Skip to content

fix(jira): replace fragile key/username heuristic in Server/DC user lookup#999

Merged
sooperset merged 1 commit into
mainfrom
fix/pr998-followup-cleanup
Feb 25, 2026
Merged

fix(jira): replace fragile key/username heuristic in Server/DC user lookup#999
sooperset merged 1 commit into
mainfrom
fix/pr998-followup-cleanup

Conversation

@sooperset
Copy link
Copy Markdown
Owner

@sooperset sooperset commented Feb 25, 2026

Summary

Follow-up to #998. Replaces the fragile key/username heuristic that misclassifies usernames like j-smith2 as Jira keys.

  • Add _resolve_server_dc_user_params() that preserves whether the search API returned a name or key field, returning the correct API param dict directly
  • Remove the "-" in resolved and any(c.isdigit() for c in resolved) heuristic from both the email-resolution and direct-identifier paths
  • For non-email identifiers, use username= as the safe default (works on Jira Server/DC 7.x+)
  • Guard against empty name/key values with truthiness checks

Test plan

  • New tests for _resolve_server_dc_user_params (username, key, no match, empty name, error)
  • Updated existing tests to mock new method
  • Added test verifying non-email identifiers always use username=
  • All 49 tests pass, pre-commit clean

Mintlify

0 threads from 0 users in Mintlify

  • No unresolved comments

Open in Mintlify Editor

…ookup

The heuristic `"-" in resolved and any(c.isdigit() for c in resolved)`
misclassifies usernames like `j-smith2` as Jira keys. Replace it with
`_resolve_server_dc_user_params()` which preserves whether the search
API returned a `name` or `key` field, eliminating the guesswork.

For non-email identifiers, use `username=` as the safe default since
Jira Server/DC 7.x+ resolves both usernames and keys via this param.

Github-Issue:#998
@sooperset sooperset merged commit ec4f026 into main Feb 25, 2026
6 checks passed
@sooperset sooperset deleted the fix/pr998-followup-cleanup branch February 25, 2026 12:12
sooperset added a commit that referenced this pull request Feb 25, 2026
Cover new tools and bugfixes from PRs #991, #992, #994, #999, #1001:
- Image tools: jira_get_issue_images, confluence_get_page_images (DC+Cloud)
- ac:image → markdown conversion verification
- ADF write round-trip (Cloud only): bold, italic, lists, code, headings, links
- DC user email→username resolution and assignment

Extends DC conftest with admin_email, image upload helpers, and
module-scoped fixtures. Extends Cloud conftest with same pattern.
sooperset added a commit that referenced this pull request Feb 25, 2026
* test(e2e): add 24 E2E tests for v0.18.0 features

Cover new tools and bugfixes from PRs #991, #992, #994, #999, #1001:
- Image tools: jira_get_issue_images, confluence_get_page_images (DC+Cloud)
- ac:image → markdown conversion verification
- ADF write round-trip (Cloud only): bold, italic, lists, code, headings, links
- DC user email→username resolution and assignment

Extends DC conftest with admin_email, image upload helpers, and
module-scoped fixtures. Extends Cloud conftest with same pattern.

* refactor(test): remove dead _cleanup_*_keys fields from E2E conftest dataclasses

The _cleanup_issue_keys and _cleanup_page_ids fields on DCInstanceInfo
and CloudInstanceInfo were appended to but never read. Cleanup is
handled by module-scoped fixture teardown, making these lists dead code.
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.

1 participant