Skip to content

feat(sync): add prompt status command - #791

Draft
ctawiah wants to merge 1 commit into
ctawiah/AIC-3336/git-repo-identityfrom
ctawiah/AIC-3340/sync-prompt-status
Draft

feat(sync): add prompt status command#791
ctawiah wants to merge 1 commit into
ctawiah/AIC-3336/git-repo-identityfrom
ctawiah/AIC-3340/sync-prompt-status

Conversation

@ctawiah

@ctawiah ctawiah commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Add the initial ldcli sync prompt status flow. The command validates the current Git repository, compiles resources under .launchdarkly, and asks LaunchDarkly for each resource's sync status. This PR only gathers typed status data for later sync decisions; it does not plan, apply, or print resource statuses yet.

Implementation

  • Register the new sync prompt command and its analytics event.
  • Add an internal/sync API client, injected with the existing resource HTTP client. It groups resources by project, sends POST /api/v2/projects/{projectKey}/ai-configs/sync/status, and decodes responses into ResourceStatus values.
  • Send { repoIdentifier, resources } for each project, including each resource's fingerprint, kind, lookup key, and upsert value.
  • Add a temporary --debug flag that writes the HTTP method, endpoint path, and request body to stderr. The behavior is isolated in a transport decorator so it can be removed without changing the sync API client.
  • Keep the access token out of debug output.

Verification

  • go test ./... -count=1
  • Request method, path, body, repository identifier, and project batching are covered by tests.
  • Debug output is covered separately from stdout.
  • Empty resource sets do not make API requests.

Stack

This PR is stacked on #789, which is stacked on #788.

Validate the repository, compile local resources, and check their status per
project through a typed sync API client. Keep request debugging isolated behind
a temporary flag.
@ctawiah
ctawiah added this pull request to stack #790 September 10, 2026 00:08
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.

1 participant