feat(ci): sync consumes dependency-context drift; lane snaps scope to git-authored changes - #10574
feat(ci): sync consumes dependency-context drift; lane snaps scope to git-authored changes#10574luvkapur wants to merge 14 commits into
Conversation
…s or tags A real scope carries components with tag blockers (circular dependencies on teambit.api-reference). The global verification halted every snap in the repository, while bit snap itself scopes its checks to the snapped components. The verification now fails only on issues in listTagPendingIds; bit ci verify stays global. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PR Summary by Qodofix(ci): scope workspace-status failures to snapped/tagged components
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1.
|
…ification scopes to the snap set Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…detection legacyBitIds bypasses Snapping own local-only filtering; the detector must subtract workspace.filter.byLocalOnly itself or a local-only dev edit gets snapped via snapIds and then fails at export. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds convergeContextDrift on CiMain: tags exactly the drifted set with an explicit id list, patch release, ignoreIssues scoped to blockers already on the recorded heads, then exports. Wired into syncMain between the checkoutByCLIValues step and driftFiles() so the .bitmap/lockfile bump rides the existing commit + bit-sync/main flow. Dry-run detects and reports but tags nothing.
…dry-run summary, tighten e2e convergence assertion convergeContextDrift returns an additive detected flag so callers stop string-matching a summary sentinel across the module boundary, and the tag-returned-null anomaly gets its own distinguishable summary instead of being reported as "no dependency-context drift". syncMain dry-run now returns the would-converge line instead of a contradictory converged summary when driftFiles sees no file diff. The main-convergence e2e cell now asserts the actual convergence bump and the real push summary string, instead of a check that was already true before any run.
…log line The mid-run log for detected drift passes with either summary branch syncMain returns through, so round 1s fix to the actual returned would-converge line had no regression coverage until now.
|
Code review by qodo was updated up to the latest commit ee688fd |
…sync, report auto-snapped drift dependents - add overrides (env-computed dep data) to DRIFT_FIELDS so a real engine bump classifies as drift instead of no-oping the feature; unit case added - recompute drift after syncConfigFromMain and extend snapIds with any newly git-authored ids, so a component the config sync just changed is not missed - report a drifted id that auto-snaps as a dependent of a snapped component, and fix the lane log line's wording to match - fix the detected-but-nothing-taggable dry-run summary, neutral snapIds log wording, and the convergeContextDrift docstring's actual blocker-tolerance behavior - correct the docs' tag message shape and lane auto-snap behavior; add a noop-cell assertion and drop leftover process vocabulary from an e2e comment - trim comment narration added by this branch to ASD-STE100 style Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Code review by qodo was updated up to the latest commit b71df2b |
…DS/extensions rationale - auto-snap runs on a component that depends on a snapped one, not the reverse; fix the docs and the lane-sync-executor comment to say so (ci.main.runtime.ts's comment was already correct) - replace the vacuous DRIFT_FIELDS/extensions rationale with the load-bearing case: bit deps set writes both extensions and overrides, so extensions must stay comparable for that change to classify as git-authored Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Code review by qodo was updated up to the latest commit c5a397e |
… drift checks Qodo review fixes for #10574: export() no longer sweeps every staged component, a file-order-only diff no longer misclassifies as drift, the per-component drift check runs with bounded concurrency, and the new drift-report lines use the shared CLI formatting toolkit. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Code review by qodo was updated up to the latest commit ef7036f |
consumer.isComponentModified aligns these before comparing; normalizePayload must too, or a stale value on an old recorded Version reads as a file change. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
| if (snapIds) { | ||
| const { gitAuthored } = await this.detectContextDrift(); | ||
| const known = new Set(snapIds.map((id) => id.toStringWithoutVersion())); | ||
| const missing = gitAuthored.filter((id) => !known.has(id.toStringWithoutVersion())); |
There was a problem hiding this comment.
2. Stale status scoping 🐞 Bug ◔ Observability
snapPrCommit() scopes workspace-status verification using the initial snapIds, but snapAndExportReusingLane() can later expand snapIds after syncConfigFromMain(). This makes the earlier “issues … do not block” output potentially incorrect and can defer tag-blocker failures to the snap phase unexpectedly.
Agent Prompt
### Issue description
Workspace status verification is performed before lane config sync, using the initial `snapIds`. Later, `snapAndExportReusingLane()` may expand `snapIds` and pass the expanded set into `snapping.snap()`, meaning:
- the earlier status scoping/warning can be misleading (it may claim issues don’t block because they’re “not snapped”, but they later become snapped), and
- failures can shift from the status-check step to the snap step for components added later.
### Issue Context
The PR intentionally expands `snapIds` after `syncConfigFromMain()` because the config sync can make additional components become “git-authored”. That expansion needs to be reflected in any status scoping / messaging.
### Fix Focus Areas
- Re-run (or defer) `verifyWorkspaceStatusInternal()` until after `syncConfigFromMain()` and any `snapIds` expansion is complete, using the final `snapIds` that will be passed to `snapping.snap()`.
- If re-running is too expensive, at least avoid printing the “issues above … do not block” message when `snapIds` is not yet final.
#### Code references
- scopes/git/ci/ci.main.runtime.ts[465-477]
- scopes/git/ci/ci.main.runtime.ts[775-784]
- scopes/git/ci/ci.main.runtime.ts[939-948]
- scopes/git/ci/ci.main.runtime.ts[1064-1071]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
There was a problem hiding this comment.
Fixed in 31ae69b. When the post-config-sync recompute adds ids, the run re-verifies the workspace status scoped to the final snap set before the snap. Zero added ids cost no extra status pass.
|
Code review by qodo was updated up to the latest commit 09dc3a5 |
An id added after syncConfigFromMain never passed the scoped status gate that ran before the expansion; re-run it over the final set. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Code review by qodo was updated up to the latest commit 31ae69b |
A non-blocker issue on an in-set component leaked its name into the ignore union; scope the union to issues where isTagBlocker is true. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Code review by qodo was updated up to the latest commit 62d8e76 |
Problem
A converged mirror workspace shows 26 of 42 components as modified. Git introduces no change. The recorded
VersioncarriesbitVersion: 1.12.61. The mirror runs engine2.0.69. The diff is confined to dependency data:@types/reactmoves from^17.0.8to^19.0.0, for example.Cause
The engine pin in
workspace.jsoncis git state. The core env's dependency templates are a function of that pin. A pin bump moves the template — a real, git-introduced dependency change, not noise. Nothing inbit ci syncconsumed it: a lane run swept it into the dev's snap, and a main run had no step for it.Fix
Three mechanisms:
context-drift-detector.ts): classifies a tag-pending component as drift when its diff against the recordedVersionis confined to dependency fields, including the env-computedoverrideskey.convergeContextDrift): tags exactly the drifted set with a patch bump and exports, riding the existingbit-sync/maincommit flow.lane-sync-executor.ts): a lane run snaps only the git-authored subset and reports the drift; a drifted component that a snapped component depends on may still auto-snap as that dependent.This removes this branch's earlier pending-set verification scoping in favor of the narrower, explicit
snapIdsscoping above.bit ci prandbit ci mergedo not change: neither passessnapIds, so their verification stays global.Tests
tsc --noEmitbit test teambit.git/cici-sync.e2e.tsci-sync-state.e2e.tsci-commands.e2e.tsci-bitmap-auto-sync.e2e.tsoxlint --deny-warnings scopes/git/ci e2e/harmony/ci-sync.e2e.tsprettier --check