Staged 2c3b33832330 1780719283#692
Conversation
…apply() tests (549c)
test_apply_honours_suppress_pair_drops_subsequent_inbound{,_via_computed_form}
called applier.apply() without stubbing the lazy module loaders, so apply()
loaded the real acli-integration.py whose 'from dso_reconciler.adf import ...'
is unresolvable under this file's spec_from_file_location scheme (modules live
under plugins.dso.scripts.dso_reconciler, not a bare dso_reconciler package) —
raising ModuleNotFoundError before any inbound dispatch. Mirror test_e2e_dedup_pass:
add _patch_apply_deps() stubbing _load_acli (offline client) and _load_concurrency
(no git in tmp_path). The suppress_pair LOGIC was already correct — file now 24/24.
A test-harness gap, not the inbound-dispatch defect originally suspected.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…re (1577) The snapshot differ stands down for an already-bound issue by recognising its dso-id:<local_id> label (bug 4354) — the primary production dedup. This adds a cheap applier-level safety net for the narrow transient where the fetched snapshot predates the label write-back but bindings.json already holds the binding: the differ then mis-emits an inbound CREATE that would materialise a phantom local ticket. _apply_inbound_create now consults binding_store (reverse-index get_local_id(target), no Jira round-trip); on a hit it writes the mapping and returns dedup_skipped without materialising. binding_store is threaded through _apply_typed (both apply() call sites); leaves opt in by declaring the param, so other leaves are unaffected. RED->GREEN test added; inbound_leaf_bodies 25/25, differ/dedup/comment-bootstrap suites green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…7af) e2e_field_validation_probe.sh run_reconciler used mktemp -t recon-probe.XXXXXX.log; the -t flag has divergent macOS/GNU semantics and is prohibited by CLAUDE.md rule:mktemp-tmp. Switch to the template form mktemp "/tmp/recon-probe.XXXXXX.log" (production/orchestrator context — no per-test TMPDIR isolation contract). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
staged: fix/reconciler-followups-20260606 -> staged-2c3b33832330-1780719283
|
Worried about impact? Review this PR in Change Stack to explore blast radius before you approve or request changes. Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
WalkthroughThis PR extends the DSO reconciler's applier to deduplicate inbound Jira CREATE mutations by consulting a binding store before materializing local tickets. The typed dispatcher was enhanced to inspect handler signatures and selectively pass context parameters, and the deduplication behavior is validated by new tests and regression coverage. ChangesInbound CREATE deduplication via binding_store
Shell test infrastructure mktemp fix
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Pull request overview
This PR adds a defense-in-depth deduplication guard for inbound Jira CREATE mutations when the Jira key is already bound in bindings.json, preventing accidental duplicate local ticket materialization during a narrow snapshot/label write-back transient. It also updates unit tests to run applier.apply() in offline/all-inbound contexts by stubbing lazy loaders, and improves mktemp portability in an e2e probe script.
Changes:
- Plumb
binding_storethrough typed-mutation dispatch and add an inbound-create early-exit that recordsmapping.jsonand skips local materialization when the Jira key is already bound. - Add unit coverage for the bound-key inbound CREATE dedup behavior and patch unit tests to stub
_load_acli()/_load_concurrency()for offline typed-inbound apply runs. - Replace
mktemp -tusage with an explicit/tmp/...XXXXXX...template to avoid macOS/GNU semantic divergence.
Security overlay: Not warranted by this diff (no new auth/trust-boundary changes; mostly local state writes).
Performance overlay: Not warranted by this diff (adds a single local binding-store lookup and an atomic mapping write on an early-return path).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/unit/dso_reconciler/test_inbound_leaf_bodies.py | Adds offline stubs for apply() dependencies and new test asserting inbound CREATE dedups when binding exists. |
| plugins/dso/scripts/dso_reconciler/e2e_field_validation_probe.sh | Updates mktemp invocation to a portable template form. |
| plugins/dso/scripts/dso_reconciler/applier.py | Adds binding-store-aware inbound CREATE dedup guard and threads binding_store through typed dispatch/apply. |
Summary by CodeRabbit
New Features
Bug Fixes
Tests