heroku / libcnb.rs

A framework for writing Cloud Native Buildpacks in Rust
BSD 3-Clause "New" or "Revised" License
34 stars 6 forks source link

Allows buildpack output to stream commands #787

Closed schneems closed 2 months ago

schneems commented 6 months ago

The start_stream interface only returns a single writer. The Command expects two writers: stdout and stderr. There's currently no good way for a buildpack author to stream a running Command, to the point that there are no examples of it in the documentation.

This PR introduces a mechanism to do this and adds a doc that executes a command streaming to the build output.

edmorley commented 6 months ago

Why no changelog entry?

Good spot. I suspect it's because when this PR was opened, the build_output module had not been released, so this PR would have been covered by the existing "add a new build_output module" changelog entry, and that Richard forgot to account for the release of libcnb 0.19.0.

I've removed the skip changelog label now.

schneems commented 6 months ago

Integration tests are failing. They're also failing for me on main locally https://github.com/heroku/libcnb.rs/issues/802

edmorley commented 6 months ago

Ah the Unexpected Docker volumes left behind! is an intermittent failure that happens occasionally - I don't know why (since image cleanup works most of the time). I'd like to track it down, but I probably won't have time to do so for a few months.

I've retriggered the CI job now.

schneems commented 6 months ago

Thankfully a restart fixed the issue. Changelog is added. Tests are passing.

schneems commented 5 months ago

I'm going to rebase this and then I want to merge it in. If there's a refactor needed or some changes needed, then I'll own it. If it's not up to standards or quality, then we need to figure out additional ways to scale out standard and quality measures.

schneems commented 2 months ago

Think we can close in favor of using https://crates.io/crates/bullet_stream