Skip to content

add Extensions and Detection Order (Extensions)#1581

Merged
dfreilich merged 11 commits into
buildpacks:mainfrom
harikannan512:enhancement-1488
Jan 9, 2023
Merged

add Extensions and Detection Order (Extensions)#1581
dfreilich merged 11 commits into
buildpacks:mainfrom
harikannan512:enhancement-1488

Conversation

@harikannan512
Copy link
Copy Markdown
Contributor

@harikannan512 harikannan512 commented Dec 23, 2022

Summary

Adding Extensions section to the output of pack builder inspect

Output

Before

(picked from Unit test output to confirm output format)

REMOTE:

Description: Some remote description

Created By:
  Name: Pack CLI
  Version: 1.2.3

Trusted: No

Stack:
  ID: test.stack.id

Lifecycle:
  Version: 6.7.8
  Buildpack APIs:
    Deprecated: (none)
    Supported: 1.2, 2.3
  Platform APIs:
    Deprecated: 0.1, 1.2
    Supported: 4.5

Run Images:
  first/local     (user-configured)
  second/local    (user-configured)
  some/run-image
  first/default
  second/default

Buildpacks:
  ID                     NAME        VERSION                        HOMEPAGE
  test.top.nested        -           test.top.nested.version        -
  test.nested            -                                          http://geocities.com/top-bp
  test.bp.one            -           test.bp.one.version            http://geocities.com/cool-bp
  test.bp.two            -           test.bp.two.version            -
  test.bp.three          -           test.bp.three.version          -

Detection Order:
 ├ Group #1:
 │  ├ test.top.nested@test.top.nested.version
 │  │  └ Group #1:
 │  │     ├ test.nested
 │  │     │  └ Group #1:
 │  │     │     └ test.bp.one@test.bp.one.version      (optional)
 │  │     ├ test.bp.three@test.bp.three.version        (optional)
 │  │     └ test.nested.two@test.nested.two.version
 │  │        └ Group #2:
 │  │           └ test.bp.one@test.bp.one.version    (optional)[cyclic]
 │  └ test.bp.two@test.bp.two.version                (optional)
 └ test.bp.three@test.bp.three.version

After

(picked from Unit test output to confirm output format)

REMOTE:

Description: Some remote description

Created By:
  Name: Pack CLI
  Version: 1.2.3

Trusted: No

Stack:
  ID: test.stack.id

Lifecycle:
  Version: 6.7.8
  Buildpack APIs:
    Deprecated: (none)
    Supported: 1.2, 2.3
  Platform APIs:
    Deprecated: 0.1, 1.2
    Supported: 4.5

Run Images:
  first/local     (user-configured)
  second/local    (user-configured)
  some/run-image
  first/default
  second/default

Buildpacks:
  ID                     NAME        VERSION                        HOMEPAGE
  test.top.nested        -           test.top.nested.version        -
  test.nested            -                                          http://geocities.com/top-bp
  test.bp.one            -           test.bp.one.version            http://geocities.com/cool-bp
  test.bp.two            -           test.bp.two.version            -
  test.bp.three          -           test.bp.three.version          -

Detection Order:
 ├ Group #1:
 │  ├ test.top.nested@test.top.nested.version
 │  │  └ Group #1:
 │  │     ├ test.nested
 │  │     │  └ Group #1:
 │  │     │     └ test.bp.one@test.bp.one.version      (optional)
 │  │     ├ test.bp.three@test.bp.three.version        (optional)
 │  │     └ test.nested.two@test.nested.two.version
 │  │        └ Group #2:
 │  │           └ test.bp.one@test.bp.one.version    (optional)[cyclic]
 │  └ test.bp.two@test.bp.two.version                (optional)
 └ test.bp.three@test.bp.three.version

Extensions:
  ID                     NAME        VERSION                        HOMEPAGE
  test.top.nested        -           test.top.nested.version        -
  test.nested            -                                          http://geocities.com/top-bp
  test.bp.one            -           test.bp.one.version            http://geocities.com/cool-bp
  test.bp.two            -           test.bp.two.version            -
  test.bp.three          -           test.bp.three.version          -

Detection Order (Extensions):
 ├ Group #1:
 │  ├ test.top.nested@test.top.nested.version
 │  │  └ Group #1:
 │  │     ├ test.nested
 │  │     │  └ Group #1:
 │  │     │     └ test.bp.one@test.bp.one.version      (optional)
 │  │     ├ test.bp.three@test.bp.three.version        (optional)
 │  │     └ test.nested.two@test.nested.two.version
 │  │        └ Group #2:
 │  │           └ test.bp.one@test.bp.one.version    (optional)[cyclic]
 │  └ test.bp.two@test.bp.two.version                (optional)
 └ test.bp.three@test.bp.three.version

Documentation

Related

#1488
#1478

Resolves #1488

Signed-off-by: harikannan512 <harikannan512@gmail.com>
@harikannan512 harikannan512 requested review from a team as code owners December 23, 2022 02:11
@github-actions github-actions Bot added this to the 0.28.0 milestone Dec 23, 2022
@github-actions github-actions Bot added the type/enhancement Issue that requests a new feature or improvement. label Dec 23, 2022
@harikannan512 harikannan512 deleted the enhancement-1488 branch December 23, 2022 02:13
@harikannan512 harikannan512 restored the enhancement-1488 branch December 23, 2022 02:13
@harikannan512 harikannan512 reopened this Dec 23, 2022
Signed-off-by: harikannan512 <harikannan512@gmail.com>
Signed-off-by: harikannan512 <harikannan512@gmail.com>
Signed-off-by: harikannan512 <harikannan512@gmail.com>
Signed-off-by: harikannan512 <harikannan512@gmail.com>
@harikannan512 harikannan512 changed the title add Extensions (no DetectionOrder yet) add Extensions and Detection Order (Extensions) Dec 24, 2022
@harikannan512 harikannan512 marked this pull request as draft December 28, 2022 00:48
@harikannan512
Copy link
Copy Markdown
Contributor Author

@natalieparellano can I get some information on how acceptance tests are set up and how can they be accommodated for changes? It would be great if I can get an example PR or some documentation of some sort. Apologies, It's my first time contributing to open source. Thanks a lot.

@natalieparellano
Copy link
Copy Markdown
Member

@harikannan512 thanks for the PR! I see that it's currently in draft - are you looking for any feedback at this stage?

@harikannan512
Copy link
Copy Markdown
Contributor Author

@natalieparellano yes. The reason its in the draft is I am trying to understand acceptance tests to add to it, but I am afraid I can't really understand where to begin. Thanks!

Signed-off-by: harikannan512 <harikannan512@gmail.com>
@github-actions github-actions Bot added the type/chore Issue that requests non-user facing changes. label Jan 5, 2023
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 5, 2023

Codecov Report

Merging #1581 (59685b5) into main (434437a) will decrease coverage by 0.04%.
The diff coverage is 80.19%.

❗ Current head 59685b5 differs from pull request most recent head 54a04e2. Consider uploading reports for the commit 54a04e2 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1581      +/-   ##
==========================================
- Coverage   81.14%   81.10%   -0.03%     
==========================================
  Files         156      156              
  Lines       10362    10455      +93     
==========================================
+ Hits         8407     8479      +72     
- Misses       1458     1472      +14     
- Partials      497      504       +7     
Flag Coverage Δ
os_linux 79.88% <80.19%> (-0.05%) ⬇️
os_macos 77.42% <80.19%> (-0.02%) ⬇️
os_windows 80.96% <80.19%> (-0.06%) ⬇️
unit 81.10% <80.19%> (-0.03%) ⬇️

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

Signed-off-by: harikannan <hariprasad.kannan@wexinc,com>
@harikannan512 harikannan512 marked this pull request as ready for review January 5, 2023 23:24
Copy link
Copy Markdown
Member

@natalieparellano natalieparellano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@harikannan512 thanks so much for the PR, these changes look really great!

Regarding the acceptance test, you could update this test with an assertion around the output of pack builder inspect. Something like output = pack.RunSuccessfully("builder", "inspect", builderName) and then asserting on the output.

We should also try passing --output json (or something other than human-readable) as I don't believe your changes yet cover that case, but it should be a simple change to this file to get it working.

Comment thread pkg/client/inspect_builder.go Outdated
Comment thread pkg/client/inspect_builder.go Outdated
Comment thread internal/builder/writer/human_readable_test.go Outdated
Comment thread internal/builder/writer/human_readable_test.go Outdated
Comment thread internal/builder/writer/human_readable_test.go Outdated
Comment thread internal/builder/writer/human_readable_test.go Outdated
Comment thread internal/builder/inspect.go Outdated
…t left)

Signed-off-by: harikannan <hariprasad.kannan@wexinc,com>
Signed-off-by: harikannan512 <harikannan512@gmail.com>
@dfreilich dfreilich modified the milestones: 0.28.0, 0.29.0 Jan 8, 2023
Signed-off-by: harikannan512 <harikannan512@gmail.com>
@natalieparellano
Copy link
Copy Markdown
Member

We may need to pull in #1589 to get the Windows tests passing

Signed-off-by: harikannan512 <harikannan512@gmail.com>
Copy link
Copy Markdown
Member

@natalieparellano natalieparellano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work @harikannan512! This looks good to me... @buildpacks/toc could we please get a review?

Copy link
Copy Markdown
Member

@dfreilich dfreilich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unbelievable work! Thanks so much for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/chore Issue that requests non-user facing changes. type/enhancement Issue that requests a new feature or improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pack builder inspect should show extensions if they are present

3 participants