Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIPE-2315 - Removes API-Service from config compilation #878

Conversation

elliotforbes
Copy link
Contributor

@elliotforbes elliotforbes commented Mar 21, 2023

A follow-up PR that migrates the config compilation from the unstable GraphQL service and pipes it directly to an internal service.

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have checked for similar issues and haven't found anything relevant.
  • This is not a security issue (which should be reported here: https://circleci.com/security/)
  • I have read Contribution Guidelines.

Internal Checklist

  • I am requesting a review from my own team as well as the owning team
  • I have a plan in place for the monitoring of the changes that I am making (this can include new monitors, logs to be aware of, etc...)

Changes

  • This removes the dependency on the unstable GraphQL api for config compilation and validation.
  • It also adds a number of cucumber tests to exercise this change.

Rationale

We're looking to simplify the way config compilation and validation request flow through our system.

Considerations

We'll be monitoring the rollout of this via metrics to ensure that it has the desired effect. We'll also be communicating to support teams that this is going live and to raise up any CLI related support issues immediately to the Pipeline's team.

Manual Validation

Build Command: make build

[x] - Private orb resolution fails if owner_id not specified -

$ ./build/darwin/amd64/circleci config validate .circleci/config.yml
$ Error: config compilation contains errors: [{Cannot find REDACTED in the orb registry. Check that the namespace, orb name and version are correct.

[x] - Private orb resolution fails if org is specified and no valid token -

$ export CIRCLECI_CLI_TOKEN=
$ ./build/darwin/amd64/circleci config validate .circleci/config.yml --org-slug gh/circleci
$ Error: config compilation contains errors: [{Cannot find REDACTED in the orb registry. Check that the namespace, orb name and version are correct.}]

[x] - Private orb resolution works if token specified with org -

$ ./build/darwin/amd64/circleci config validate .circleci/config.yml --org-slug gh/circleci  --token REDACTED
$ Config file at .circleci/config.yml is valid.

[x] - Private orb resolution works with env variable token -

$ export CIRCLECI_CLI_TOKEN=REDACTED
$ ./build/darwin/amd64/circleci config validate .circleci/config.yml --org-slug gh/circleci 
$ Config file at .circleci/config.yml is valid.

[x] - Normal config validation works as expected -

$ ./build/darwin/amd64/circleci config validate .circleci/config.yml
$ Config file at .circleci/config.yml is valid.

[x] - Config processing works -

$ ./build/darwin/amd64/circleci config process .circleci/config.yml
$ config output

[x] - Config processing works with private orb and token + org combo -

$ ./build/darwin/amd64/circleci config process .circleci/config.yml --org-slug gh/circleci
$ config output

[x] - Config processing fails with token but no org

$ ./build/darwin/amd64/circleci config process .circleci/config.yml
$ Error: config compilation contains errors: [{Cannot find REDACTED in the orb registry. Check that the namespace, orb name and version are correct.}]

@elliotforbes elliotforbes requested a review from a team as a code owner March 21, 2023 10:09
@elliotforbes elliotforbes force-pushed the revert-873-revert-865-PIPE-2315/remove-api-service-from-config-compilation branch from 8c303b9 to e790ce4 Compare March 21, 2023 10:16
@elliotforbes elliotforbes force-pushed the revert-873-revert-865-PIPE-2315/remove-api-service-from-config-compilation branch 2 times, most recently from 1540f56 to 2edf3fb Compare March 21, 2023 14:09
config/config.go Outdated Show resolved Hide resolved
@elliotforbes elliotforbes force-pushed the revert-873-revert-865-PIPE-2315/remove-api-service-from-config-compilation branch from ef23dcb to c4e7392 Compare March 22, 2023 10:19
@elliotforbes elliotforbes merged commit c3e90a1 into develop Mar 22, 2023
@elliotforbes elliotforbes deleted the revert-873-revert-865-PIPE-2315/remove-api-service-from-config-compilation branch March 22, 2023 10:24
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.

4 participants