pack icon indicating copy to clipboard operation
pack copied to clipboard

Fix project.toml build env to match spec

Open jkutner opened this issue 2 years ago • 6 comments

Summary

Change the parsing of project.toml's io.buildpack.build.env to match the project descriptor spec

https://cloud-native.slack.com/archives/C033DV9EBDF/p1657116095577129

Output

Before

[[io.buildpacks.env.build]]
name = "JAVA_OPTS"
value = "-Xmx300m"

After

[[io.buildpacks.build.env]]
name = "JAVA_OPTS"
value = "-Xmx300m"

Documentation

  • Should this change be documented?
    • [ ] Yes, see #___
    • [x] No

jkutner avatar Jul 06 '22 15:07 jkutner

Although I agree with this change, this may be considered a breaking change. I'd want to take a deeper look into the reasoning for the change, it's potential impact and mitigation strategies.

jromero avatar Jul 06 '22 16:07 jromero

As discussed in the WG we cannot make this change directly since this is an end-user breaking change and the current implementation is mimicked by other platforms like kpack as well. If we do change it, we should support both the current and the future version of this key.

sambhav avatar Aug 03 '22 15:08 sambhav

@jkutner Can you update this PR with backward compatibility support?

I would envision that we would warn about the misuse of the invalid namespace and that the support may be removed at any point in the future.

@samj1912 was there a timeframe for support of the invalid key?

jromero avatar Aug 03 '22 19:08 jromero

@jromero I would prefer if we soften that warning. Since this is an end user change that we inadvertently implemented in both pack and kpack I would prefer we keep this key around at least until project descriptor 0.3.

It would be a disservice if we broke users without warning between different versions of pack without a proper migration plan. If we do plan on emitting a deprecation warning, we should also include the pack version where it will be deprecated. I do think however we are in a tricky situation because we implemented a version of the project descriptor 0.2 in the state that it was in Summer 2021 and this spec change was not made until March 2022. In the future I believe we should have a strict policy about not implementing spec related changes before they are released.

sambhav avatar Aug 03 '22 21:08 sambhav

Codecov Report

Merging #1479 (71021c7) into main (6575218) will decrease coverage by 0.04%. The diff coverage is 0.00%.

:exclamation: Current head 71021c7 differs from pull request most recent head 1c1eb83. Consider uploading reports for the commit 1c1eb83 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1479      +/-   ##
==========================================
- Coverage   81.29%   81.26%   -0.03%     
==========================================
  Files         154      154              
  Lines       10014    10018       +4     
==========================================
  Hits         8140     8140              
- Misses       1393     1397       +4     
  Partials      481      481              
Flag Coverage Δ
os_linux 80.01% <0.00%> (-0.01%) :arrow_down:
os_macos 77.44% <0.00%> (-0.06%) :arrow_down:
os_windows 81.14% <0.00%> (-0.03%) :arrow_down:
unit 81.26% <0.00%> (-0.03%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

codecov[bot] avatar Aug 12 '22 18:08 codecov[bot]

@jromero @samj1912 i've updated this to include backwards compat

jkutner avatar Aug 12 '22 18:08 jkutner

@jromero can you give this a look-see?

jkutner avatar Aug 24 '22 13:08 jkutner