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
Pack silently fails to use project.toml
if the schema-version
is not specified
#1922
Comments
I think that either Pack should either:
If the decision is made to allow implicit Lastly, wrt schema validation, IMO Pack should either:
|
In fact, the spec states:
(https://github.com/buildpacks/spec/blob/main/extensions/project-descriptor.md#_) So I guess option (1) above is the right choice here. The docs here also need fixing, since they say the |
This caused confusion for another user recently in: |
- Fails with error if project.toml does not contain an `_.schema-version` key (required as per the spec) - Warns if there are keys present in project.toml which are not supported by the targeted schema Fixes buildpacks#1922 Signed-off-by: Colin Casey <casey.colin@gmail.com>
- also notifies when the schema version is missing and defaults to `0.1` Fixes buildpacks#1922 Signed-off-by: Colin Casey <casey.colin@gmail.com>
- also notifies when the schema version is missing and defaults to `0.1` Fixes buildpacks#1922 Signed-off-by: Colin Casey <casey.colin@gmail.com> Signed-off-by: Pratham Agarwal <agarwalpratham1812@gmail.com>
Summary
If a
project.toml
file does not contain an appropriately setschema-version
, Pack silently ignores values set in theproject.toml
file, leading to a frustrating to debug experience.Reproduction
Steps
mkdir testcase && cd $_
echo -e "[io.buildpacks]\nbuilder = \"some-builder\"" > project.toml
pack build testcase
Current behavior
The
pack build
tries to perform a build using whatever is set as the default builder.The cause of this is that the
builder
property is only supported as ofproject.toml
schema version 0.2, but Pack CLI silently defaults to v0.1 if no schema version was specified, and ignores knowns keys rather than failing with a schema validation error.If I add this, then the expected behaviour occurs:
Expected behavior
For either:
schema-version
specified, defaulting to schema v0.1", along with perhaps a schema v0.1 validation error about thebuilder
property not being recognised.Environment
pack info
The text was updated successfully, but these errors were encountered: