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

Refactor CircleCI config to define proper commands for reused fragments #14507

Merged
merged 7 commits into from
Aug 22, 2023

Conversation

cameel
Copy link
Member

@cameel cameel commented Aug 21, 2023

This is a quick refactor I did recently for #14478 when I wanted to parameterize our run_build step. This would allow me to parameterize it with the number of CPUs. In the end I chose a different approach and did not need it, but I think we should still merge it. It's something I wanted to clean up for quite a while but never had a good reason to actually do it.

Until now we've been YAML fragments under the defaults key to define sequences of steps or lists of artifacts. The downside of that mechanism is that it's pretty crude and requires workarounds to compose well in some situations (e.g. we need to wrap a list of steps in a condition if we're appending to another list rather than replacing it whole). Reusable commands are a way to do that with fewer quirks. They also have parameters, which will make them easier to extend in the future.

I recommend viewing the diff with whitespace ignored and preferably looking at individual commits. The changes are pretty straightforward, there's just quite a few of them, and this should make it more apparent.

@cameel cameel requested a review from r0qs August 21, 2023 12:05
@cameel cameel self-assigned this Aug 21, 2023
Copy link
Member

@r0qs r0qs left a comment

Choose a reason for hiding this comment

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

Nice! I just have some comments :)

.circleci/config.yml Outdated Show resolved Hide resolved
.circleci/config.yml Outdated Show resolved Hide resolved
@cameel cameel requested a review from r0qs August 22, 2023 10:27
@cameel cameel merged commit 60b18a1 into develop Aug 22, 2023
1 check passed
@cameel cameel deleted the circleci-config-commands branch August 22, 2023 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants