SMOODEV-2720: th jira sync safe-by-default — reconcile only; --pull/--push opt-in; --dry-run#250
Merged
Merged
Conversation
…-push opt-in; --dry-run The old sync unconditionally created a pearl for every untracked open Jira ticket AND a Jira ticket for every open pearl without a SMOODEV- prefix, and it reconciled against PearlQuery::new()'s default (100 rows, no status filter) — a random slice including closed pearls. Running it on a real project would have exploded both trackers. Now the default run only reconciles: closes active pearls whose every referenced issue key is Done in Jira, and transitions Jira tickets to Done once every referencing pearl is closed. Mass-creation is opt-in via --pull / --push, --dry-run previews the plan, pearls load with with_limit(0), and key extraction requires digits + a word boundary so SMOODEV-XXX placeholders never match. Planner is a pure function in smooth-diver::jira with unit tests. Dogfooded against the live smooai pearls + SMOODEV project. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0166oMz2kqo7J8e7TFxdYytY
🦋 Changeset detectedLatest commit: 034b18c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
brentrager
enabled auto-merge (squash)
July 23, 2026 23:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
th jira syncwas dangerous to run and broken at scale:SMOODEV-title prefix (hundreds) — running it once would have exploded both trackers.PearlQuery::new(), whose default is 100 rows with no status filter — a random slice that includes closed pearls, so the pull phase's already-tracked check missed nearly everything.title.starts_with("SMOODEV-")/title.contains(key), which treats placeholders likeSMOODEV-XXXas keys and misses keys mid-title.Solution
--pull/--pushgate the old creation behaviors (Jira→pearls, pearls→Jira). The summary always reports how many candidates each flag would act on.--dry-runprints the full plan and changes nothing.with_limit(0); a pure planner (smooth_diver::jira::plan_sync+extract_keys) computes the plan from all pearls + all Jira issues, with proper key extraction (digits required, word boundary, multiple keys per title, dedup).JiraClient::list_project_issues()paginates the full project with statuses.Verification
cargo test -p smooai-smooth-diver jira: 8 passed).--dry-runpreviewed correctly, real run closed 6 pearls whose Jira went Done, 0 spurious creations; 154 would-pull / 242 would-push correctly held back behind flags.Jira: SMOODEV-2720 · Pearl: th-7db3c2
🤖 Generated with Claude Code
https://claude.ai/code/session_0166oMz2kqo7J8e7TFxdYytY