Repository navigation
GHA-349 Dedup shared Jira helpers into shared/jira_common.py + Golden Architecture - #168
Conversation
…cture - Add shared/jira_common.py with eprint, get_jira_instance, CUSTOM_FIELDS - Add shared/test_jira_common.py (5 tests covering all shared helpers) - Migrate all 7 Jira scripts to import from shared/ via sys.path.insert - Remove per-action copies of eprint/get_jira_instance/CUSTOM_FIELDS - Remove per-action auth tests now covered by shared/test_jira_common.py - Standardize JIRA_URL ternary to one canonical expression in all action.yml - Update CLAUDE.md: point CUSTOM_FIELDS at shared/, add Golden Architecture section documenting load-bearing constraints (vault blocks, injection guards, fan-outs) that must stay per-action, plus conventions for new actions All 98 tests pass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All action.yml files previously embedded the full URL ternary:
JIRA_URL: "https://sonarsource${{ ... }}.atlassian.net/"
Now they pass --use-sandbox="$USE_SANDBOX" and let shared/jira_common.py
resolve the URL via get_jira_url() / get_jira_instance(use_sandbox).
JIRA_URL_PROD and JIRA_URL_SANDBOX constants are the single source of truth.
A domain change is now one edit in shared/jira_common.py, not seven.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
98e2952 to
1b3fb22
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Code Review ✅ Approved 1 resolved / 1 findingsConsolidates Jira helpers into shared/jira_common.py and standardizes JIRA_URL constants across all actions, resolving duplication in jira_client.py. No issues found. ✅ 1 resolved✅ Quality: JIRA URL constants duplicated in test-fixtures/jira/jira_client.py
OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |



Summary
shared/jira_common.py: single source of truth foreprint,get_jira_instance, andCUSTOM_FIELDS— previously copy-pasted across 7 scriptsshared/viasys.path.insert(no install step needed —@v1checks out the whole repo so../sharedis on disk at runtime)shared/test_jira_common.py; 98 business-logic tests remain greenaction.ymlfiles (was 3 different spellings across 7 files)Net change: -548 lines / +193 lines
What was NOT changed
Vault credential blocks,
inputs.x || env.Xguards, orchestrator fan-outs, and setup-python preamble are all intentionally left per-action — see the Golden Architecture section in CLAUDE.md for why each is load-bearing.Test plan
python3 -m pytest shared/test_jira_common.py— 5 tests (new shared helpers)python3 -m pytest create-jira-version/test_create_jira_version.py— 13 testspython3 -m pytest create-jira-release-ticket/test_create_release_ticket.py— passespython3 -m pytest release-jira-version/test_release_jira_version.py— passespython3 -m pytest get-jira-release-notes/test_get_jira_release_notes.py— passespython3 -m pytest create-integration-ticket/test_create_integration_ticket.py— passespython3 -m pytest update-release-ticket-status/test_update_release_ticket.py— passespython3 -m pytest resolve-ktlo-epic/test_resolve_ktlo_epic.py— passes🤖 Generated with Claude Code