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

Allow the build to proceed with /cnb/lifecycle/creator when the order contains extensions #1983

Merged
merged 4 commits into from
Dec 20, 2023

Conversation

natalieparellano
Copy link
Member

(Note that this will have no effect until there is a lifecycle 0.19.0 - but, we can prepare for it now)

The creator will error if the detected group contains extensions, but if no extensions detect then the build can proceed and potentially succeed.

This avoids end-user headaches when popular builders contain extensions (see buildpacks/community#244) but the extensions don't detect by default (and hence using the creator is just fine).

Related lifecycle PR: buildpacks/lifecycle#1246

… contains extensions

The creator will error if the detected group contains extensions,
but if no extensions detect then the build can proceed and potentially succeed.

This avoids end-user headaches when popular builders contain extensions (see buildpacks/community#244)
but the extensions don't detect by default (and hence using the creator is just fine).

Signed-off-by: Natalie Arellano <narellano@vmware.com>
@github-actions github-actions bot added this to the 0.33.0 milestone Nov 17, 2023
@github-actions github-actions bot added the type/enhancement Issue that requests a new feature or improvement. label Nov 17, 2023
@@ -281,7 +281,7 @@ func (l *LifecycleExecution) Run(ctx context.Context, phaseFactoryCreator PhaseF
return l.Export(ctx, buildCache, launchCache, kanikoCache, phaseFactory)
}

if l.platformAPI.AtLeast("0.10") && l.hasExtensions() {
if l.platformAPI.AtLeast("0.10") && l.hasExtensions() && !l.opts.UseCreatorWithExtensions {
return errors.New("builder has an order for extensions which is not supported when using the creator")
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we can improve the error message to give some guidance to end-users on what's going on or what they can do to fix it.. maybe a link to some documentation?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the suggestion - I updated the error message in c351409

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.

LGTM

Signed-off-by: Natalie Arellano <narellano@vmware.com>
Copy link

codecov bot commented Dec 11, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (18cdd3d) 79.51% compared to head (8fb9749) 79.52%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1983      +/-   ##
==========================================
+ Coverage   79.51%   79.52%   +0.01%     
==========================================
  Files         174      174              
  Lines       13074    13077       +3     
==========================================
+ Hits        10395    10398       +3     
  Misses       2016     2016              
  Partials      663      663              
Flag Coverage Δ
os_linux 78.43% <100.00%> (+0.01%) ⬆️
os_macos 76.24% <100.00%> (+0.01%) ⬆️
os_windows 78.90% <100.00%> (+0.01%) ⬆️
unit 79.52% <100.00%> (+0.01%) ⬆️

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

jjbustamante and others added 2 commits December 20, 2023 16:27
Signed-off-by: Juan Bustamante <juan.bustamante@broadcom.com>
Signed-off-by: Juan Bustamante <jbustamante@vmware.com>
@jjbustamante jjbustamante merged commit c08b289 into main Dec 20, 2023
18 checks passed
@jjbustamante jjbustamante deleted the fix/builder-with-extensions-fails-creator branch December 20, 2023 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Issue that requests a new feature or improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants