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

Add --dry-run option to pack commands #681

Open
1 task
simonjjones opened this issue Jun 9, 2020 · 8 comments
Open
1 task

Add --dry-run option to pack commands #681

simonjjones opened this issue Jun 9, 2020 · 8 comments
Labels
help wanted Need some extra hands to get this done. status/blocked Issue or PR that is blocked. See comments. status/ready Issue ready to be worked on. type/enhancement Issue that requests a new feature or improvement.

Comments

@simonjjones
Copy link
Member

Description

I would like to validate the configuration and intended outcome of a command I plan to run without incurring the cost of executing against real code and resources

Proposed solution

Each pack command can be invoked with a --dry-run argument which:

  • validates the configuration
  • outputs any pack generated logs that would occur during a real execution
  • describes interactions that would happen with dependencies outside of pack (e.g. Invoke this lifecycle phase with these arguments)
  • exits with the exit code that would occur during a real execution (assuming interactions with external dependencies are successful)
  • outputs any other useful information depending on the subcommand being invoked

Describe alternatives you've considered

  • Consumers can currently parse help text to ensure particular commands and arguments or available in their version of pack, and assume their configuration will be successful
  • App developers with large apps, who might incur long waits for commands to run may use a smaller test app to validate commands

Additional context

  • This feature should be documented somewhere
@simonjjones simonjjones added type/enhancement Issue that requests a new feature or improvement. status/triage Issue or PR that requires contributor attention. labels Jun 9, 2020
@dfreilich
Copy link
Member

Should this be supported for all commands, or only for some? For instance, pack version --dry-run wouldn't seem to add much value, while obviously pack build --dry-run or pack rebase --dry-run would.

@jromero
Copy link
Member

jromero commented Jun 10, 2020

Could you elaborate on "outputs any pack generated logs that would occur during a real execution"?

Thinking about something like pack build how would the output be generated if it's mostly output of executed buildpacks and from my understanding the buildpack's build binary wouldn't actually execute.

@yaelharel
Copy link
Contributor

This is a really good idea!
I agree with @dfreilich (#681 (comment)) that it's probably not necessary for all of the pack commands.
Maybe it's worth being more specific and specifying the expected output of each command (AC with examples of each relevant command).

@simonjjones
Copy link
Member Author

I think the stateless commands should still run, the solution would still be valid as there are no interactions with external dependencies in those cases.

@dfreilich dfreilich added status/ready Issue ready to be worked on. and removed status/triage Issue or PR that requires contributor attention. labels Jun 15, 2020
@josegonzalez
Copy link

A pack detect or similar command (with optional json output?) would be pretty neat so that we can report to users what their apps look like before actually building it (useful for platform onboarding).

@aemengo
Copy link
Contributor

aemengo commented Jul 22, 2021

@josegonzalez Agreed. This is an underlying premise with pack-interact-mode.

@aemengo
Copy link
Contributor

aemengo commented Jul 28, 2021

@simonjjones @jromero @dfreilich Can we have a little more detail about what the original intent of --dry-run was?

@haliliceylan and I were following the thread and are lost. In the pack build case for example:

  • Does dry-run simply mean run the detect phase?
  • Just about every phase requires creating an ephemeral builder on the daemon, so does that count as "incurring the cost of executing against real code and resources"?
  • How we "exits with the exit code that would occur during a real execution"? Without actually executing?

@natalieparellano natalieparellano added the help wanted Need some extra hands to get this done. label Aug 18, 2023
@natalieparellano
Copy link
Member

Blocked (or perhaps more accurately, superseded) by buildpacks/rfcs#308

@natalieparellano natalieparellano added the status/blocked Issue or PR that is blocked. See comments. label Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Need some extra hands to get this done. status/blocked Issue or PR that is blocked. See comments. status/ready Issue ready to be worked on. type/enhancement Issue that requests a new feature or improvement.
Projects
None yet
Development

No branches or pull requests

7 participants