Skip to content

Implement config validate/process/pack#1302

Open
z00b wants to merge 1 commit into
nextfrom
z00b/next/config
Open

Implement config validate/process/pack#1302
z00b wants to merge 1 commit into
nextfrom
z00b/next/config

Conversation

@z00b
Copy link
Copy Markdown
Contributor

@z00b z00b commented May 13, 2026

Adds circleci config validate, config process, and config pack.

Deliberate scope decisions:

  • v2 REST only (/compile-config-with-defaults); v1 GraphQL fallback dropped
  • --org-slug/--org-id carried forward for private orb resolution
  • --json on validate only; pack/process output YAML as primary data
  • Deprecated-image check omitted; API surfaces these natively
  • config generate deferred (external dependency); config migrate dropped (legacy 2.0 migration command)

Also fixes a flag-shadowing bug: root's --config/-c (CLI settings path) and validate's local --config/-c (pipeline YAML path) have the same name. PersistentPreRunE now reads from cmd.Root().PersistentFlags() to avoid picking up the child command's local value.

}

// GetCollaborations returns all orgs the authenticated user is a member of.
func (c *Client) GetCollaborations(ctx context.Context) ([]Collaboration, error) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty surprised it needs this! :D

Comment thread acceptance/config_test.go
"github.com/CircleCI-Public/circleci-cli/internal/testing/fakes"
)

const testConfigYAML = "version: \"2.1\"\njobs:\n build:\n docker:\n - image: cimg/base:stable\n steps:\n - checkout\n"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would recommend a multi line string for readability

Also good to add //language=YAML comment to help IDEs.

@z00b z00b force-pushed the z00b/next/config branch from 4629065 to 8f3befc Compare May 13, 2026 20:55
@z00b z00b force-pushed the z00b/next/config branch from 8f3befc to 0891119 Compare May 24, 2026 17:54
Adds `circleci config validate`, `config process`, and `config pack`.

Deliberate scope decisions:
- v2 REST only (`/compile-config-with-defaults`); v1 GraphQL fallback dropped
- `--org-slug`/`--org-id` carried forward for private orb resolution
- `--json` on validate only; pack/process output YAML as primary data
- Deprecated-image check omitted; API surfaces these natively
- `config generate` deferred (external dependency); `config migrate` dropped (legacy 2.0 migration command)

Also fixes a flag-shadowing bug: root's `--config/-c` (CLI settings path)
and `validate`'s local `--config/-c` (pipeline YAML path) have the same
name. `PersistentPreRunE` now reads from `cmd.Root().PersistentFlags()`
to avoid picking up the child command's local value.

Consolidates packing logic from `orb pack`.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

fix(test): make TestCertificateList_NoOrgIDOutsideGit git-version-agnostic

Git's "not a git repository" error message differs across versions:
older git omits "Stopping at filesystem boundary..." that newer git
appends. Replace the golden file comparison with targeted assertions
on the parts the CLI owns (the error code and the --org-id suggestion).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@z00b z00b force-pushed the z00b/next/config branch from 0891119 to 9dd75a2 Compare May 24, 2026 19:12
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.

2 participants