Repository navigation
feat(sync): integrate repository sources with planning and link - #995
Conversation
3fdb247 to
ff510c9
Compare
ff510c9 to
ccc230e
Compare
ccc230e to
498b3bc
Compare
498b3bc to
57e4d36
Compare
57e4d36 to
987f4ff
Compare
| assert.Len(t, directions, syncSettingsPageLimit) | ||
| require.Len(t, transport.Requests, 2, "a full page without a total count is followed by a request for the next page") | ||
| assert.Equal(t, []string{"100"}, transport.Requests[1].Query["offset"]) | ||
| } |
There was a problem hiding this comment.
When a single GET to the sync settings endpoint asks for both a variation and a tool, we return a '400 unsupported resource kind' and the whole call fails, variation included. The test below is currently failing.
Should we even be supporting both tools and skills here, or should the client only send variations? If this is intended behavior lmk and I can stamp!
| } | |
| } | |
| func TestSyncDirectionsAsksOnlyForVariationSettings(t *testing.T) { | |
| transport := &recordingClient{Responses: [][]byte{[]byte(`{"items": [ | |
| {"resourceKind":"variation","resourceLookupKey":"support/default","direction":"both"} | |
| ]}`)}} | |
| client := NewClient(transport, "token", "https://example.com") | |
| variation := syncdomain.VariationID("project", "support", "default") | |
| tool := syncdomain.ResourceID{Kind: syncdomain.KindTool, ProjectKey: "project", LookupKey: "search"} | |
| _, err := client.SyncDirections("project", []syncdomain.ResourceID{variation, tool}) | |
| require.NoError(t, err) | |
| require.Len(t, transport.Requests, 1) | |
| for _, resource := range transport.Requests[0].Query["resources"] { | |
| assert.True(t, strings.HasPrefix(resource, "variation:"), "gonfalon answers 400 unsupported resource kind to %q", resource) | |
| } | |
| } |
There was a problem hiding this comment.
Thank you, that was a real failure: one 400 for the tool took the variations down with it. SyncDirections now asks for each resource kind in a request of its own, so a variation request never carries a tool or a skill. A kind that LaunchDarkly answers with 400 unsupported resource kind has no settings, and any other 400 still fails the call. A linked tool or skill without a setting then gets the existing sync_setting_unavailable problem, which says that LaunchDarkly does not provide that setting yet and suggests detach, so the variations of a plan sync and the tool or skill is blocked rather than guessed. That keeps the client ready for the day the endpoint supports tools and skills, and the acceptance tests that fake those settings still hold. TestSyncDirectionsAsksForEachKindAlone and TestSyncDirectionsTreatsAnUnsupportedKindAsHavingNoSetting cover it. One open question for you: do you want a linked tool or skill to sync as both until LaunchDarkly has a setting for it, instead of the block? That is a one-line change in applySourceDirections and I will make it if you prefer it.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 00ffbf4. Configure here.
Plan descriptor-backed variations, tools, and skills with the same three-way comparison as managed files. Convert each source prompt to the mode of its config once. Enforce the LaunchDarkly sync setting of every linked resource. Run the link workflow: preview the descriptor and the plan, write the descriptor after the review, and sync the resource. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

Context
The planner must compare repository projections with LaunchDarkly and the baseline, enforce the sync setting of each resource, and run the link workflow.
What changes
Design notes
Review focus
Verification
make buildgo test ./...golangci-lint run ./...Related changes
🤖 Generated with Claude Code
Note
Overview
Adds LaunchDarkly sync settings lookup (
SyncDirectionson the API client) and threads code/server-canonical direction through planning so linked variations, tools, and skills use projection-based three-way comparison instead of whole-file fingerprints.Introduces
SourceLinkActionto create.ref.yamldescriptors and run a scoped sync: validate the mapping, preview the plan (with confirmation /--yes), write the descriptor after review, then reconcile while keeping user source files in place.Execution is reworked for descriptor-backed resources: pulls edit sources via atomic document groups (
ReplaceSources, shared-file grouping, pre-write validation), pushes merge mapped fields onto the latest LaunchDarkly copy with post-review drift checks, handle read-only mapped fields and indexed selection changes, and coordinate linked tool/skill rows with sync settings during variation pushes and conflict resolution.Plan/outcome JSON now includes source metadata and structured problem codes; manifest/lock recording stores adapter behavior, mapping digests, and projection fingerprints.
Reviewed by Cursor Bugbot for commit 6fbb1e0. Bugbot is set up for automated code reviews on this repo. Configure here.