-
Notifications
You must be signed in to change notification settings - Fork 286
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
Validate mixins during create-builder
and build
#179
Comments
Note, needs to be updated for stage-specific mixins: |
Current WIP on branch |
create-builder
and build
Generated error statement is slightly inconsistent with story acceptance criteria. We have:
we want:
|
Should we be validating run image mixins during |
The error messaging is OK. The original was written without regards to extra context. For validating run image mixins, this will be covered by a separate story (https://github.com/orgs/buildpacks/projects/1#card-28467986) |
During
then, once I add mixinX to the run image:
It occurs that all of this validation could have happened during create-builder, and when using e.g. a local buildpack with a builder the validation phase should catch all validation failures and report back to the user. Perhaps this is more in line with further improvements that could be spun out into a different issue? @ameyer-pivotal I see your comment - I guess the trouble with waiting for that story is that we appear to be doing some validation of the run image, during some actions, however, it's a less than ideal experience right now. |
@simonjjones I agree that it's less than ideal. The complication is that even if we validate the build/run image mixins at On the other topic of aggregate vs fail fast errors, I agree that this is an improvement that would give a better user experience. It would take some rework, so would opt to put it as part of a separate story. Unless we want to either reject this and hold the release or remove the validation to continue with the release. |
When validating the use case that
An interesting note is the |
Interesting. Pack usually interprets it as this when there is no registry specified. However, I do not usually see it printed out. It wouldn't be a difficult fix, but seems minor at the moment. Perhaps we file an issue to track it and continue? |
I agree with regards the validity, but given that we do some validation at |
It's not clear that the following acceptance criteria is a valid one. If any buildpacks require our builder image to include common mixins, then
|
Aside from aforementioned suggestions for future improvements we have validated the scenarios detailed in the story. |
@simonjjones This may be a slightly outdated AC. A decision was made during the story that the run image could contain a superset of the build image mixins (with regards to the common ones). So really, the scenario outlined by the Note was:
To summarize:
This is the related code, for the curious:
@sclevine feel free to fact check me on the superset decision |
@ameyer-pivotal I believe that this scenario was validated. I've moved this to Ready to Release given that there are no false failures where everything is configured correctly, yet validation fails. |
create-builder
Adds buildpack mixins to builder layers label
Given I have a
buildpack.toml
with the following section:When I run
pack create-builder
against the buildpack and stacksome.stack.id
Then The builder contains the buildpack mixins in its
io.buildpacks.buildpack.layers
label:Validates buildpack mixins against build image mixins
Mixins satisfied
Given I have a build image with a
io.buildpacks.stack.mixins
label:And I have a buildpack that requires mixins:
mixinA
,build:mixinB
,run:mixinD
When I run
pack create-builder
against the build image and buildpackThen the command succeeds
Mixins unsatisfied
Given I have a build image
some/build
with aio.buildpacks.stack.mixins
label:And I have a buildpack that requires mixins:
mixinX
,mixinY
,build:mixinB
,run:mixinD
When I run
pack create-builder
against the build image and buildpackThen the command fails with error similar to:
build
Validates stack image mixins against each other
Mixins match
Given I have a builder image with a
io.buildpacks.stack.mixins
label:And the builder's corresponding run image has a
io.buildpacks.stack.mixins
label:When I run
pack build
against the builderThen the command succeeds
Missing one or more common mixins
Given I have a builder image with a
io.buildpacks.stack.mixins
label:And the builder's corresponding run image has a
io.buildpacks.stack.mixins
label:When I run
pack build
against the builderThen the command fails with error similar to:
Invalid mixin
Given I have a builder image with a
io.buildpacks.stack.mixins
label:When I run
pack build
against the builderThen the command fails with error similar to:
Validates buildpack mixins against stack image mixins
Mixins satisfied
Given I have a builder image with a
io.buildpacks.stack.mixins
label:And the builder's corresponding run image has a
io.buildpacks.stack.mixins
label:And I have a buildpack that requires mixins:
mixinA
,build:mixinB
,run:mixinD
When I run
pack build
against the builder image and buildpackThen the command succeeds
Mixins unsatisfied
Given I have a builder image
some/builder
with aio.buildpacks.stack.mixins
label:And the builder's corresponding run image
some/run
has aio.buildpacks.stack.mixins
label:And I have a buildpack that requires mixins:
mixinA
,build:mixinB
,mixinC
,run:mixinD
When I run
pack build
against the builder image and buildpackThen the command fails with error similar to:
The text was updated successfully, but these errors were encountered: