-
Notifications
You must be signed in to change notification settings - Fork 10
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
Use unified Heroku buildpack output style #745
base: main
Are you sure you want to change the base?
Conversation
fd1dfb3
to
cdddeec
Compare
Not a blocker, but would help for QA-ing the output as a whole to print the getting started guide in CI. https://github.com/heroku/buildpacks-ruby/blob/187770e700a433cf9e6af678cb3eb5735b89eec5/.github/workflows/ci.yml#L62-L97 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please merge #761, put this back in draft state and make changes until you're happy with the output (removal of newlines, using the correct style for a "value" etc.) Then we can iterate on the output style. Happy to iterate/pair too.
@runesoerensen I told him to do it. I opened heroku-buildpacks/bullet_stream#23 to bring that to the larger group. |
Here's my take on this PR. It's implemented on top of this branch. #767 ![]() Take anything that's useful...drop anything that's not. Doing that helped me find some missing changes such as left-over |
Uses the newly defined `output` interface that Manuel introduced for the JVM buildpack in #745 instead of the legacy libherokubuildpack::log::log_error. For all buildpacks except for jvm-function-invoker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are things need to be done to migrate onto the new output format, there might be more, but all of these recommendations come from having implemented the migration twice already. These almost exclusively come from specific commits on this ready-to-merge PR #769:
- Remove
libherokubuildpack::log
references and the feature from:- Gradle (https://github.com/heroku/buildpacks-jvm/pull/769/files#diff-07f05f536de71a214fed08fa6be322b2bc41fde291d9be0cf668c2e3440638ddR13)
- JVM (https://github.com/heroku/buildpacks-jvm/pull/769/files#diff-e3cbda9372a9cc72f97e8c9e2513c7836a912b2e722864536a8e1997a18ee46aR14)
- Shared (https://github.com/heroku/buildpacks-jvm/pull/769/files#diff-401919e5af595c40b1359c42a25b4c698681b191f33b5b0ceba9ab87d40ce022R12)
- Maybe JVM function invoker (Your call)
- Fix tests after removing references to
libherokubuildpack::log
- Make Buildpack name an H2 (https://github.com/heroku/buildpacks-jvm/pull/769/files#diff-899c56e56432daa5771452ed91965be83b0ee62a30145bed0702b4c77a761a59R8)
- Add a "this buildpack finished" output for all buildpacks, examples:
- Quiet/remove any accidental printing to stdout/stderr cdb3e51
- Fix gradle "-x check" command execution format dfd5504
Double check
While iterating, I originally made changes and looked at the print output and kept going. The above 🆙 list is based on the second time I implemented the build output for buildpacks-jvm and is more focused, however, it's important that the output be used while iterating or you might introduce different problems. Basically "it's not done until it looks okay."
- Timing information isn't being emitted at the same time as commands are streaming
- Command execution indentation and formatting is correct
- Commands "Running:
<cmd>
" should be indented under an appropriate header - The "print" CI task's output looks okay in all three guides
Edit: Remove commenatary
To round back on the h2 issue, I went to send a PR to the dotnet buildpack and it looks like it is already using them https://github.com/heroku/buildpacks-dotnet/blame/f11d9b15c3ae79a2d364a68b42f4973b05ee90e8/buildpacks/dotnet/src/main.rs#L68. |
8580f7b
to
3950aa1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm that the specific fixes I requested have been implemented. After reviewing the printed buildpack output, I found some issues, which are detailed below.
Required fixes
- Maven dependency list is not indented,
- Running `./mvnw dependency:list` quietly
- Done (4.0s)
- Done (finished in 10.7s)
should be
- Running `./mvnw dependency:list` quietly
- Done (4.0s)
- Done (finished in 10.7s)
Edit: Removed more detailed request
- Gradle daemon command output needs to be formatted or hidden
## Heroku Gradle Buildpack
- Running Gradle build
- Starting Gradle daemon
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
Downloading https://services.gradle.org/distributions/gradle-8.12-bin.zip
.............10%.............20%.............30%.............40%.............50%.............60%.............70%.............80%.............90%.............100%
Starting a Gradle Daemon (subsequent builds will be faster)
> Task :heroku_buildpack_start_daemon UP-TO-DATE
BUILD SUCCESSFUL in 31s
- Done (31.6s)
- Querying tasks
- Done (1.4s)
- Querying dependency report
- Done (4.0s)
Given that it takes so long (31s), I recommend streaming it as a normal Running <cmd>
output. That's different from what you're currently doing but less confusing. If you were using bullet_stream,
I would suggest background dots here as an alternative, i.e., "Starting Gradle daemon ... "
- Missing "done" timing on the command execution:
- Running Gradle build
- Running `./gradlew build -x check`
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
> Task :compileJava
> Task :processResources
> Task :classes
> Task :resolveMainClassName
> Task :bootJar
> Task :jar
> Task :assemble
> Task :build
BUILD SUCCESSFUL in 6s
5 actionable tasks: 5 executed
- Done (finished in 44.5s)
Should be:
BUILD SUCCESSFUL in 6s
5 actionable tasks: 5 executed
- Done (2s)
- Done (finished in 44.5s)
From an interface perspective, every time you need to run a streaming command, you also need to remember to emit "Done" with timing. My suggestion is to couple that behavior with your implementation. i.e. have run_command
emit it by default so you don't forget it.
Edit: Removed commentary
The Maven output seems fine to me in the context of this PR. Let's stick to moving the output style to the new one before making fixes to the output/UX in general. Indentation also seems correct to me on CI. I left this as-is. The other issues I have fixed. I found another one with duplicated Gradle headings that I've fixed too. Everything optional I left out to be either broken out or discussed separately. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated:
Re-requesting indenting this line:
- Running `./mvnw dependency:list` quietly
I see that I wasn't clear with what I was asking before.
), | ||
})?; | ||
|
||
output::print_section(BuildpackOutputText::new(vec![ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update output according to style guide please https://github.com/heroku-buildpacks/bullet_stream/blob/c24396edfa449e21c5ed9c4f36b618502887c8b5/examples/style_guide.rs#L22-L25
output::print_section(BuildpackOutputText::new(vec![ | |
output::print_subsection(BuildpackOutputText::new(vec![ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved after bullet -> sub-bullet suggestion is accepted.
This PR introduces a new shared library for all JVM buildpacks that implements the unified Heroku buildpack output style. All buildpacks in the repository have been modified to use this new shared library over the
log
module fromlibherokubuildpack
.In some cases, the buildpacks changes their output a little bit more to output more detailed information about the process. For example, the
jvm
buildpack now tells the user where the OpenJDK version is defined.Example
Closes:
W-17215812
W-17215820
W-17215822
W-17215818