Skip to content
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

Only add project-metadata source of type "project" when present #1285

Merged
merged 1 commit into from
Sep 15, 2021

Conversation

jromero
Copy link
Member

@jromero jromero commented Sep 14, 2021

Summary

pack will no longer produce project metadata source of type project when project descriptor is not present.

Additionally, this PR makes this feature as a whole experimental. Primarily because we are still missing the other types per #1139.

Output

Before

❯ ls ~/dev/buildpacks/samples/apps/bash-script/
README.md             app.sh                bash-script-buildpack

❯ pack-dev build -B cnbs/sample-builder:bionic -p ~/dev/buildpacks/samples/apps/bash-script/ bash-app
...

❯ docker inspect bash-app | jq -r
[
  {
...
     "Labels": {
        "io.buildpacks.project.metadata": "{\"source\":{\"type\":\"project\",\"version\":{\"declared\":\"\"},\"metadata\":{\"url\":\"\"}}}",
...

After

❯ ls ~/dev/buildpacks/samples/apps/bash-script/
README.md             app.sh                bash-script-buildpack

❯ pack-dev build -B cnbs/sample-builder:bionic -p ~/dev/buildpacks/samples/apps/bash-script/ bash-app
...

❯ docker inspect bash-app | jq -r
[
  {
...
     "Labels": {
        "io.buildpacks.project.metadata": "{}",
...
❯ cat ~/dev/buildpacks/samples/apps/bash-script/project.toml
[project]
id = "io.buildpacks.bash-script"
name = "Bash Script"
version = "1.0.0"

[build]
exclude = [
    "README.md",
    "bash-script-buildpack"
]

[[build.buildpacks]]
uri = "bash-script-buildpack/"


❯ pack-dev build -B cnbs/sample-builder:bionic -p ~/dev/buildpacks/samples/apps/bash-script/ bash-app
...

❯ docker inspect bash-app | jq -r
[
  {
...
     "Labels": {
        "io.buildpacks.project.metadata": "{\"source\":{\"type\":\"project\",\"version\":{\"declared\":\"1.0.0\"},\"metadata\":{\"url\":\"\"}}}",
...

Documentation

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

Related

Related to #1138

Also, make it experimental

Signed-off-by: Javier Romero <rjavier@vmware.com>
@jromero jromero requested a review from a team as a code owner September 14, 2021 19:47
@github-actions github-actions bot added this to the 0.22.0 milestone Sep 14, 2021
@github-actions github-actions bot added type/chore Issue that requests non-user facing changes. type/enhancement Issue that requests a new feature or improvement. labels Sep 14, 2021
@jromero jromero modified the milestones: 0.22.0, 0.21.0 Sep 14, 2021
@jromero jromero added type/bug Issue that reports an unexpected behaviour. and removed type/enhancement Issue that requests a new feature or improvement. type/chore Issue that requests non-user facing changes. labels Sep 14, 2021
@codecov
Copy link

codecov bot commented Sep 14, 2021

Codecov Report

Merging #1285 (38d6ad1) into release/0.21.0 (a7487c9) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@                Coverage Diff                 @@
##           release/0.21.0    #1285      +/-   ##
==================================================
+ Coverage           81.08%   81.09%   +0.01%     
==================================================
  Files                 143      143              
  Lines                8757     8761       +4     
==================================================
+ Hits                 7100     7104       +4     
  Misses               1218     1218              
  Partials              439      439              
Flag Coverage Δ
os_linux 79.71% <100.00%> (+0.01%) ⬆️
os_macos 76.93% <100.00%> (-0.02%) ⬇️
os_windows 80.99% <100.00%> (+0.01%) ⬆️
unit 81.09% <100.00%> (+0.01%) ⬆️

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

@jromero jromero merged commit a9c294a into release/0.21.0 Sep 15, 2021
@jromero jromero deleted the fix/project-metadata branch September 15, 2021 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Issue that reports an unexpected behaviour.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants