Skip to content

[worktree-20260605-175523] fix(acli): explicit client-cred access in verify-created-issue (PR #685 review)#686

Merged
JoeOakhartNava merged 5 commits into
mainfrom
staged-1c0e0555f268-1780712508
Jun 6, 2026
Merged

[worktree-20260605-175523] fix(acli): explicit client-cred access in verify-created-issue (PR #685 review)#686
JoeOakhartNava merged 5 commits into
mainfrom
staged-1c0e0555f268-1780712508

Conversation

@joeoakhart

@joeoakhart joeoakhart commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

Commits

  • fix(acli): verify-created-issue uses client creds, not ambient env (7689)
  • test(reconciler): align dedup-pass test with 4354 differ stand-down (a666/b38a/38fd/4cc1)
  • test(reconciler): isolate alert_store seam to fix order-dependent fetcher dedup test (4cc1)
  • chore: bump version to v1.17.140
  • fix(acli): explicit client-cred access in verify-created-issue (PR staged: worktree-20260605-175523 -> staged-1c0e0555f268-1780712508 #685 review)

Auto-generated by merge-to-main-pr.sh from git log --no-merges origin/main..HEAD.

Summary by CodeRabbit

  • Chores

    • Updated DSO workflow infrastructure plugin to version 1.17.140.
  • Bug Fixes

    • Improved credential handling in issue creation verification to use explicit client credentials instead of relying on environment variables, ensuring more reliable and consistent verification workflows.

Test and others added 5 commits June 5, 2026 19:58
…689)

_verify_created_issue read JIRA_URL/JIRA_USER/JIRA_API_TOKEN from os.environ,
so create-path tests that mocked only subprocess.run silently switched to the
urllib REST GET whenever ambient Jira credentials were present in the dev/CI
process. Pin the credential source to the explicit AcliClient: read
client.jira_url/user/api_token (None-safe), drop the os.environ read, and fall
back to the subprocess get_issue path when no client is supplied. Thread client
through create_issue -> _create_issue_from_json -> _verify_created_issue so the
priority (--from-json) path is covered too. Production behaviour is preserved
(AcliClient.create_issue forwards client=self, whose creds come from the env at
construction). Adds two RED->GREEN tests; no regression (31 pass).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…a666/b38a/38fd/4cc1)

test_e2e_dedup_pass::test_pre_existing_dso_id_produces_zero_creates asserted an
obsolete pre-4354 contract: it wired an *inbound* create yet expected *outbound*
applier-dedup artifacts (mapping.json + a dedup-create-skipped manifest event).
That applier guard never existed on the inbound-create path, and the
get_comments AttributeError the tickets cited was a caught symptom, not the
cause. Since commit 1f0032d (bug 4354), dedup of already-bound issues is the
snapshot differ's job: it recognises the dso-id:<local_id> label and stands
down (no inbound CREATE, no phantom local ticket, no ghost label write-back).
Rewrite the test to that production-correct end-to-end contract (label-bound
issue -> zero creates via differ stand-down -> apply() no-op) plus a regression
guard that genuinely-unbound issues still create. No production change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…cher dedup test (4cc1)

test_fetcher_dedup_observable::test_dedup_suppression_emits_alert passed alone
but failed in the full suite: it patched
plugins.dso.scripts.dso_reconciler.alert_store.append directly, while
fetcher._load_alert_store() resolves that same dotted sys.modules key at call
time. test_bridge_alerts_surface registers a DIFFERENT module object under the
key, so when it ran first the patched object and the object the fetcher used
diverged and the patch was silently missed (captured []). Patch the
_load_alert_store SEAM instead (order-independent), and add an autouse fixture
that snapshots/clears the shared dotted key around each test. Closes the second
half of 4cc1 (the first half is the dedup-pass test rewrite).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
DSO-Story: worktree-20260605-175523
… review)

Address PR #685 llm-review finding 1: replace getattr(client, attr, '') or ''
with direct client.<attr> access (guarded by 'if client is not None'). AcliClient
always sets jira_url/user/api_token in __init__, so direct access is safe and
surfaces a malformed (non-None but partial) client as an explicit AttributeError
rather than silently degrading to the subprocess path with a half-populated
credential set. No behavioural change for the supported callers (AcliClient or
None); 31 acli tests still pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown

Complex PR? Review this PR in Change Stack to move by importance, not file order.

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 75d07eb9-1239-4fec-95e6-447ab9469942

📥 Commits

Reviewing files that changed from the base of the PR and between e858dd5 and cb97d83.

📒 Files selected for processing (5)
  • plugins/dso/.claude-plugin/plugin.json
  • plugins/dso/scripts/acli-integration.py
  • tests/scripts/test_acli_integration.py
  • tests/unit/dso_reconciler/test_e2e_dedup_pass.py
  • tests/unit/dso_reconciler/test_fetcher_dedup_observable.py

Walkthrough

This PR coordinates credential sourcing improvements in ACLI integration with test enhancements across the DSO workflow reconciliation pipeline. The core change pins REST verification credentials to explicit client objects rather than ambient environment variables, adds test coverage validating this behavior, refactors dedup validation to focus on differ-level semantics, hardens alert observability tests with module isolation, and increments the plugin version.

Changes

DSO Workflow Credential Pinning and Dedup Test Improvements

Layer / File(s) Summary
ACLI credential-pinned verification implementation and tests
plugins/dso/scripts/acli-integration.py, tests/scripts/test_acli_integration.py
_verify_created_issue accepts an optional client parameter and sources REST credentials from that client instead of environment variables. Two new test cases validate that verification without a client uses subprocess determinism, and with a client uses pinned REST credentials.
E2E dedup test refactoring for differ-level validation
tests/unit/dso_reconciler/test_e2e_dedup_pass.py
Refactored test_pre_existing_dso_id_produces_zero_creates to assert dedup for already-bound Jira issues happens at the differ level by checking that no inbound create mutations are produced for issues labeled with dso-id:<local_id>. Removes prior assertions on mapping.json output and manifest events.
Dedup observability test module isolation and refactoring
tests/unit/dso_reconciler/test_fetcher_dedup_observable.py
Adds an autouse fixture isolating alert_store in sys.modules to prevent test order dependence. Refactors alert capture by patching fetcher._load_alert_store with a stub object, making interception independent of module state.
Plugin manifest version increment
plugins/dso/.claude-plugin/plugin.json
Plugin version incremented from 1.17.139 to 1.17.140.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 64.71% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title directly references the main change: fixing acli's verify-created-issue to use explicit client credentials instead of ambient environment variables. It accurately captures the primary objective of the changeset.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch staged-1c0e0555f268-1780712508

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@joeoakhart joeoakhart enabled auto-merge (rebase) June 6, 2026 03:00
@JoeOakhartNava JoeOakhartNava disabled auto-merge June 6, 2026 03:01
@JoeOakhartNava JoeOakhartNava merged commit efe667c into main Jun 6, 2026
23 of 24 checks passed
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