Skip to content

Use onlyIf for build Docker image task execution #54047

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

Merged
merged 1 commit into from
Mar 24, 2020

Conversation

jasontedor
Copy link
Member

This commit switches to using an onlyIf to determine if a build Docker image task execution should occur. This is preferred since it means that the determination is performed at task execution time, rather than during configuration.

Relates #53936

This commit switches to using an onlyIf to determine if a build Docker
image task execution should occur. This is preferred since it means that
the determination is performed at task execution time, rather than
during configuration.
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Build)

@mark-vieira
Copy link
Contributor

This is preferred since it means that the determination is performed at task execution time, rather than during configuration.

For clarity, this is one reason, which in this particular case is somewhat irrelevant since determining the current architecture is neither costly nor likely to change during execution.

To me, the primary reason for using onlyIf to model toggling of tasks is that onlyIf conditions can be composed. That is, if I have multiple plugins that both add an onlyIf condition to a task, the result is the combination of the two (task will execute only if both are true). However, it's very easy for plugins to clobber another plugin's enabled predicate without realizing it.

Just thought I'd provide some more context here for my insistence on preferring onlyIf over enabled. Thank you for your continued cooperation 😉

Copy link
Contributor

@mark-vieira mark-vieira left a comment

Choose a reason for hiding this comment

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

👍

@jasontedor
Copy link
Member Author

Sir, yes sir! Thanks for the explanation @mark-vieira. 🙂

@jasontedor jasontedor merged commit f39aa75 into elastic:master Mar 24, 2020
@jasontedor jasontedor deleted the docker-image-task-only-if branch March 24, 2020 02:53
jasontedor added a commit that referenced this pull request Mar 24, 2020
This commit switches to using an onlyIf to determine if a build Docker
image task execution should occur. This is preferred since it means that
the determination is performed at task execution time, rather than
during configuration.
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Delivery/Build Build or test infrastructure >non-issue Team:Delivery Meta label for Delivery team v7.7.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants