v2 review fixes for Pipe/runner branch#63
Conversation
There was a problem hiding this comment.
Pull request overview
This PR ports review-driven fixes onto the Pipe / runner / Config branch, tightening lifecycle cleanup and making stream-requirement negotiation and related error reporting more robust and user-facing.
Changes:
- Ensure pipeline context is canceled on pre-start failures and include stage names in invalid stream requirement errors.
- Make
Output()close any previously configuredWithStdoutCloserdestination before swapping stdout to an internal capture buffer. - Expose
WithStdinRequirement/WithStdoutRequirementforFunctionstages, and document a known stdin limitation for non-file readers feeding command stages.
Show a summary per file
| File | Description |
|---|---|
| pipe/runner.go | Closes any previously configured stdout closer before capturing output into a buffer. |
| pipe/pipeline.go | Adds a lifecycle guard to prevent calling Output() after the pipeline has started. |
| pipe/pipeline_test.go | Adds/updates tests for stdout-closer behavior, function stream requirements, and improved invalid-requirement error messages. |
| pipe/pipe.go | Cancels derived context on startup failures and improves invalid stream requirement errors with stage names. |
| pipe/options.go | Documents a known limitation when using borrowed non-file stdin readers with command stages. |
| pipe/function.go | Exposes function-stage stream requirement options and reuses them in forbid helpers. |
| pipe/event_error.go | Minor control-flow cleanup in Error() formatting. |
| pipe/config.go | Fixes option-slice append logic to preserve Config immutability. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 8/8 changed files
- Comments generated: 0
6b26212 to
ca18da9
Compare
d5db061 to
d0af7c3
Compare
|
Thanks for rebasing your fixes on top of #61 ✨ Before I saw this, I addressed the linter problems and massaged those fixes into the #61 branch. My fixes were the same as yours, except that I added a user of I also rebased the #61 branch on top of the current Then I rebased this branch on top of the new #61 branch (minus the now-redundant linter fixes commit). The following two commits seemed uncontroversial, so I fast-forwarded them in to the #61 branch already:
Now I'm reviewing the remaining two commits. I hope that you don't mind that I manhandled your PR a bit! |
Release any previously configured stdout stream before replacing it with the buffer used by Output, preserving ownership of WithStdoutCloser. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
d0af7c3 to
56a58d8
Compare
|
I've adopted "Cancel failed pipeline starts" into #61, but split into two separate commits:
I also added more systematic assertions of whether stages and The remaining commit is rebased on top of the current state of #61. I'll have to continue tomorrow, but my comment here also applies to this commit, so let me know if you have thoughts about that topic. |
|
Regarding stdin or stdout being set redundantly, I decided after all to orient the behavior based on |
|
everything here is reflected now in #61 |
This is a rebased version of #62 targeted at #61: Fixes issues discovered doing a review of the latest stage-v2-clean state.
/cc @mhagger
Copilot Summary
This PR ports the v2 review-fix commits onto PR #61's
Pipe/runner/Configbranch:Pipecontext on pre-start failures and include the offending stage name in invalid stream requirement errors.Output()replaces stdout with its capture buffer, adapted torunner.output()/Pipeline.Output().WithStdinRequirementandWithStdoutRequirementsoFunctionstages can participate in stream requirement negotiation without reimplementingStage.