Skip to content

feat(projects): remove default config-repo fetch from CLI (CLI-22)#458

Draft
fhacloid wants to merge 5 commits into
developfrom
fhacloid-cli-22-remove-default-config-repo-fetch-login-from-the-cli
Draft

feat(projects): remove default config-repo fetch from CLI (CLI-22)#458
fhacloid wants to merge 5 commits into
developfrom
fhacloid-cli-22-remove-default-config-repo-fetch-login-from-the-cli

Conversation

@fhacloid

Copy link
Copy Markdown
Contributor

Summary

  • Removes GetDefaultConfigRepository from internal/cyargs/ — the helper fetched the org's default config repo via the API when --config-repository was omitted
  • Replaces both callers (project create, project update) with GetConfigRepository (flag-only read, returns empty string when unset)
  • Cleans up now-unused imports (fmt, slices, client/models) from cyargs
  • Updates --config-repository flag description and removes stale comment

Why draft / blocked

Blocked on BE-807Make the createProject route use the default catalog if catalogRepository is empty

BE-807 is still Backlog. Until it lands, passing an empty configRepository to the backend will fail. This PR must not be merged until BE-807 is done and deployed.

Once BE-807 is merged: remove the draft status, verify e2e project create without --config-repository works, then merge.

Test plan

  • go build ./... green in worktree
  • go vet ./... clean
  • go test ./cmd/cycloid/middleware/offline/... green
  • e2e cy project create without --config-repositoryunblock after BE-807

Closes CLI-22 (after BE-807)

🤖 Generated with Claude Code

fhacloid and others added 5 commits June 11, 2026 20:11
… (CLI-124)

The CLI omitted the ?service_catalog_source_version_id query param when
fetching component config, causing the API to return a stale version.
Auto-resolve the latest version by fetching the component's stack ref
and calling resolveStackVersion with empty hints (matching console
behavior). An explicit --service-catalog-source-version-id flag is also
added to config_get for version pinning. create/update callers now also
pass the resolved latest version when pre-loading current config.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…CLI-124)

Replace the internal uint32 --service-catalog-source-version-id flag with the
standard --stack-version flag (tag/branch/sha/id) using the same
cyargs.AddStackVersionFlags + ResolveStackVersionArg pattern as other stack
commands. Internally the middleware still resolves via resolveStackVersion to
service_catalog_source_version_id before the config GET. Default (no flag)
auto-resolves the catalog branch head, matching console behavior.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…get (CLI-124)

--stack-version=version:<id> bypasses stack ref resolution and passes the
catalog source version ID directly to the config GET, useful for debugging
by known ID. Other --stack-version forms (tag:/branch:/sha:) and the
default auto-resolve-latest path are unchanged. ResolveStackVersionArg
returns an informative error if version:<id> is used with commands that
cannot accept a raw ID.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…to package (CLI-124)

- cyargs.GetStackVersionID parses --stack-version=version:<id> so consumers
  do not inline flag reading
- config_get.go uses GetStackVersionID; drops fmt/strconv/strings imports
- verbose WHAT comment removed from GetComponentConfig
- ComponentConfigServer moved to offline/mockserver package with exported
  constants; component_config_test.go references them

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The CLI was fetching the org's default config repository when
--config-repository was omitted (GetDefaultConfigRepository). This
logic is pushed to the backend via BE-807; once that lands, passing
an empty canonical lets the API default it automatically.

Replaces GetDefaultConfigRepository calls with GetConfigRepository
(flag-only read) in project create and update, and removes the now-
dead helper and its unused imports.

DRAFT: blocked on BE-807 (backend not yet merged).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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