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

Separate suggested builders from default trusted builders #2043

Conversation

colincasey
Copy link
Contributor

@colincasey colincasey commented Jan 30, 2024

Summary

This PR replaces the SuggestedBuilder struct with a KnownBuilder struct that contains the same details + the following boolean flags:

  • Suggested
  • Trusted

These flags can be set on a KnownBuilder to control if it should be displayed as a suggested builder and/or be added as a default trusted builder.

With these changes, heroku/builder:20 has also been removed from the suggested list but remains as a default trusted builder.

Output

pack builder suggest

Before

Suggested builders:
        Google:                gcr.io/buildpacks/builder:v1                            Ubuntu 18 base image with buildpacks for .NET, Go, Java, Node.js, and Python                                                                                     
        Heroku:                heroku/builder:20                                       Heroku-20 (Ubuntu 20.04) base image with buildpacks for Go, Java, Node.js, PHP, Python, Ruby & Scala.                                                            
        Heroku:                heroku/builder:22                                       Heroku-22 (Ubuntu 22.04) base image with buildpacks for Go, Java, Node.js, PHP, Python, Ruby & Scala.                                                            
        Paketo Buildpacks:     paketobuildpacks/builder-jammy-base                     Ubuntu 22.04 Jammy Jellyfish base image with buildpacks for Java, Go, .NET Core, Node.js, Python, Apache HTTPD, NGINX and Procfile                               
        Paketo Buildpacks:     paketobuildpacks/builder-jammy-buildpackless-static     Static base image (Ubuntu Jammy Jellyfish build image, distroless-like run image) with no buildpacks included. To use, specify buildpacks at build time.         
        Paketo Buildpacks:     paketobuildpacks/builder-jammy-full                     Ubuntu 22.04 Jammy Jellyfish full image with buildpacks for Apache HTTPD, Go, Java, Java Native Image, .NET, NGINX, Node.js, PHP, Procfile, Python, and Ruby     
        Paketo Buildpacks:     paketobuildpacks/builder-jammy-tiny                     Tiny base image (Ubuntu Jammy Jellyfish build image, distroless-like run image) with buildpacks for Java, Java Native Image and Go                               

Tip: Learn more about a specific builder with:
        pack builder inspect <builder-image>

After

Suggested builders:
        Google:                gcr.io/buildpacks/builder:v1                            Ubuntu 18 base image with buildpacks for .NET, Go, Java, Node.js, and Python                                                                                     
        Heroku:                heroku/builder:22                                       Heroku-22 (Ubuntu 22.04) base image with buildpacks for Go, Java, Node.js, PHP, Python, Ruby & Scala.                                                            
        Paketo Buildpacks:     paketobuildpacks/builder-jammy-base                     Ubuntu 22.04 Jammy Jellyfish base image with buildpacks for Java, Go, .NET Core, Node.js, Python, Apache HTTPD, NGINX and Procfile                               
        Paketo Buildpacks:     paketobuildpacks/builder-jammy-buildpackless-static     Static base image (Ubuntu Jammy Jellyfish build image, distroless-like run image) with no buildpacks included. To use, specify buildpacks at build time.         
        Paketo Buildpacks:     paketobuildpacks/builder-jammy-full                     Ubuntu 22.04 Jammy Jellyfish full image with buildpacks for Apache HTTPD, Go, Java, Java Native Image, .NET, NGINX, Node.js, PHP, Procfile, Python, and Ruby     
        Paketo Buildpacks:     paketobuildpacks/builder-jammy-tiny                     Tiny base image (Ubuntu Jammy Jellyfish build image, distroless-like run image) with buildpacks for Java, Java Native Image and Go                               

Tip: Learn more about a specific builder with:
        pack builder inspect <builder-image>

pack config trusted-builders list (no difference since the default list is still all trusted)

Before

Trusted Builders:
  gcr.io/buildpacks/builder:v1
  heroku/builder:22
  heroku/buildpacks:20
  paketobuildpacks/builder-jammy-base
  paketobuildpacks/builder-jammy-buildpackless-static
  paketobuildpacks/builder-jammy-full
  paketobuildpacks/builder-jammy-tiny

After

Trusted Builders:
  gcr.io/buildpacks/builder:v1
  heroku/builder:20
  heroku/builder:22
  paketobuildpacks/builder-jammy-base
  paketobuildpacks/builder-jammy-buildpackless-static
  paketobuildpacks/builder-jammy-full
  paketobuildpacks/builder-jammy-tiny

Documentation

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

Related

Resolves #1500

Signed-off-by: Colin Casey <casey.colin@gmail.com>
@colincasey colincasey requested review from a team as code owners January 30, 2024 19:24
@github-actions github-actions bot added this to the 0.33.0 milestone Jan 30, 2024
@github-actions github-actions bot added the type/enhancement Issue that requests a new feature or improvement. label Jan 30, 2024
Copy link

codecov bot commented Jan 30, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (c45c3cf) 79.63% compared to head (bdaaead) 79.64%.
Report is 6 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2043      +/-   ##
==========================================
+ Coverage   79.63%   79.64%   +0.01%     
==========================================
  Files         176      176              
  Lines       13214    13220       +6     
==========================================
+ Hits        10522    10528       +6     
  Misses       2022     2022              
  Partials      670      670              
Flag Coverage Δ
os_linux 78.57% <94.74%> (+0.01%) ⬆️
os_macos 76.40% <94.74%> (+0.02%) ⬆️
os_windows 79.03% <94.74%> (+0.01%) ⬆️
unit 79.64% <94.74%> (+0.01%) ⬆️

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

@jjbustamante jjbustamante modified the milestones: 0.33.0, 0.34.0 Feb 1, 2024
Signed-off-by: Colin Casey <casey.colin@gmail.com>
@github-actions github-actions bot added the type/chore Issue that requests non-user facing changes. label Feb 2, 2024
Copy link
Member

@jjbustamante jjbustamante left a comment

Choose a reason for hiding this comment

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

Awesome!

Thanks @colincasey

@jjbustamante jjbustamante merged commit cc4647d into buildpacks:main Feb 7, 2024
18 checks passed
@colincasey colincasey deleted the 1500_separate_suggested_and_trusted_builders branch February 8, 2024 12:55
colincasey added a commit to colincasey/pack that referenced this pull request Jul 4, 2024
…ed builders and trusted builders, there were several places that still had logic referencing suggested builders in the trusted context. This PR updates those code paths to only consider trusted builders and extracts out a shared function `IsKnownTrustedBuilder` that can be used for "is this a trusted builder" checks.

Fixes buildpacks#2198

Signed-off-by: Colin Casey <casey.colin@gmail.com>
@colincasey colincasey mentioned this pull request Jul 4, 2024
2 tasks
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.

Separate suggested builders from trusted default builders
3 participants