build icon indicating copy to clipboard operation
build copied to clipboard

config: Validate value of `runs_before`

Open kevmoo opened this issue 5 years ago • 3 comments

I set a value for runs_before which I thought would work – but didn't.

If an invalid value is provided, please print a warning or fail the build!

kevmoo avatar Apr 01 '19 21:04 kevmoo

Thinking about this there are scenarios where it might not be valid to error here - should it be a requirement that any runs_before builders exist in the build graph? That doesn't allow you to write a builder which must run before some other builder, but only if that builder is present.

jakemac53 avatar Apr 01 '19 21:04 jakemac53

Some thoughts:

  • We could potentially do the validation as a warning but only when it's the root package build.yaml - that way the author sees it but no one else.
  • We could detect the case where the package is present but not the builder. The cases where the builder doesn't exist should always be because the package doesn't exist right?

natebosch avatar Apr 02 '19 21:04 natebosch

We could potentially do the validation as a warning but only when it's the root package build.yaml - that way the author sees it but no one else.

This might be ok - but still would have false positives :/

We could detect the case where the package is present but not the builder. The cases where the builder doesn't exist should always be because the package doesn't exist right?

Specifically the case that kevin ran into was doing runs_before: [_my_private_builder_name]. In that case it was missing the leading | so the package was _my_private_builder_name which wouldn't exist and so we wouldn't catch this.

jakemac53 avatar Apr 02 '19 21:04 jakemac53