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-4359 Update config compilation pipeline values to add parameters #1052

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

liamclarkedev
Copy link
Contributor

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

=======

  • Update config compilation to include pipeline values and parameters together.

Rationale

=========

Config compilation now accepts pipeline values and parameters in a single map with the expected prefixes.

All standard values are now prefixed with pipeline., and all parameters are prefixed with pipeline.parameters. as described in the Pipeline Values documentation.

https://circleci.com/docs/pipeline-variables/

Considerations

==============

The parameters inside pipeline values are not currently used, there are metrics in place to reach a 100% match before we start relying on the data in a single map.

Although the service is prepared to accept the new prefixed format, should things go wrong, this could impact any command that requires config compilation where the config references a pipeline value or parameter.

Config compilation now accepts pipeline values and parameters in a
single map with the expected prefixes.

All standard values are now prefixed with `pipeline.`, and all
parameters are prefixed with `pipeline.parameters.` as described in the
Pipeline Values documentation.

https://circleci.com/docs/pipeline-variables/
@liamclarkedev liamclarkedev requested a review from a team March 13, 2024 12:35
@liamclarkedev liamclarkedev requested a review from a team as a code owner March 13, 2024 12:35
Copy link

@stig stig left a comment

Choose a reason for hiding this comment

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

Looks legit to me. We are changing pipeline values and parameters to have prefixes.

Copy link
Contributor

@JulesFaucherre JulesFaucherre left a comment

Choose a reason for hiding this comment

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

LGTM

@liamclarkedev
Copy link
Contributor Author

Local CLI validation:

./circleci config process ../.circleci/config.yml --pipeline-parameters="foo: bar" --verbose

Pipeline values are provided with the expected prefix and parameters.

Processing config with following values:
pipeline.git.base_revision: ...
pipeline.git.branch: ...
pipeline.git.revision: ...
pipeline.git.tag:
pipeline.id:       00000000-0000-0000-0000-000000000001
pipeline.number:   1
pipeline.parameters.foo: bar
pipeline.project.git_url: ...
pipeline.project.type: github

Config is compiled successfully with the pipeline values:

version: 2
jobs:
  pipeline-values:
    docker:
    - image: cimg/base:stable
    steps:
    - run:
        name: Validate pipeline values
        command: |
          echo 'pipeline.id is 00000000-0000-0000-0000-000000000001.'
          echo 'pipeline.parameters.foo is bar.'
workflows:
  setup:
    jobs:
    - pipeline-values
  version: 2

# Original config.yml file:
# version: 2.1
#
# parameters:
#   foo:
#     type: string
#     default: \"default\"
#
# jobs:
#   pipeline-values:
#     docker:
#       - image: cimg/base:stable
#     steps:
#       - run:
#           name: Validate pipeline values
#           command: |
#             echo 'pipeline.id is << pipeline.id >>.'
#             echo 'pipeline.parameters.foo is << pipeline.parameters.foo >>.'
#
#
# workflows:
#   setup:
#     jobs:
#       - pipeline-values

@liamclarkedev liamclarkedev merged commit 9d8fccb into develop Mar 13, 2024
1 check passed
@liamclarkedev liamclarkedev deleted the pipe-4359/combine-pipeline-values branch March 13, 2024 15:19
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