flowey: add publish and side_effect shortcuts to PipelineJob#3318
Draft
jstarks wants to merge 1 commit intomicrosoft:mainfrom
Draft
flowey: add publish and side_effect shortcuts to PipelineJob#3318jstarks wants to merge 1 commit intomicrosoft:mainfrom
jstarks wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Building up a pipeline job involves a lot of boilerplate where the caller reaches into `dep_on(|ctx| ...)` purely to thread a single `WriteVar` — either from `publish_typed_artifact` for jobs that produce an artifact, or from `new_done_handle` for jobs run only for their side effect — into a request. The pattern is so uniform that the closure ends up being a one-liner whose only content is the plumbing itself, which obscures the actual intent of the call site. This adds two convenience methods on `PipelineJob`. `publish(artifact, f)` wraps the publish-typed-artifact pattern, and `side_effect(f)` wraps the new-done-handle pattern. Both delegate to `dep_on` under the hood, so there is no new behavior — just a clearer surface for the two most common shapes. The accompanying sweep through the OpenVMM pipelines (checkin_gates, build_docs, vmm_tests_run) converts every eligible call site to use the new shortcuts. Sites where the closure also threads additional state (e.g. building IGVM, restoring packages) are intentionally left alone: the shortcuts are designed for the single-handle case, and forcing them on mixed-ctx jobs would just reintroduce boilerplate in a different shape. The generated pipeline YAMLs are unchanged.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces boilerplate in Flowey pipeline definitions by adding two convenience methods to PipelineJob for the two most common dep_on(|ctx| ...) patterns (publishing a typed artifact and running a node purely for side effects), then refactors existing OpenVMM pipelines to use these shortcuts.
Changes:
- Add
PipelineJob::publish(artifact, f)as a shortcut fordep_on+ctx.publish_typed_artifact(...). - Add
PipelineJob::side_effect(f)as a shortcut fordep_on+ctx.new_done_handle(). - Update eligible call sites across
checkin_gates,build_docs, andvmm_tests_runpipelines to use the new methods.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| flowey/flowey_core/src/pipeline.rs | Adds publish and side_effect convenience methods on PipelineJob that wrap common dep_on plumbing. |
| flowey/flowey_hvlite/src/pipelines/checkin_gates.rs | Refactors many job steps to use .publish(...) and .side_effect(...) for clearer intent and less boilerplate. |
| flowey/flowey_hvlite/src/pipelines/build_docs.rs | Replaces dep_on plumbing with .publish(...) / .side_effect(...) in docs pipeline jobs. |
| flowey/flowey_hvlite/src/pipelines/vmm_tests_run.rs | Converts a side-effect-only job step to use .side_effect(...). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Building up a pipeline job involves a lot of boilerplate where the caller reaches into
dep_on(|ctx| ...)purely to thread a singleWriteVar— either frompublish_typed_artifactfor jobs that produce an artifact, or fromnew_done_handlefor jobs run only for their side effect — into a request. The pattern is so uniform that the closure ends up being a one-liner whose only content is the plumbing itself, which obscures the actual intent of the call site.This adds two convenience methods on
PipelineJob.publish(artifact, f)wraps the publish-typed-artifact pattern, andside_effect(f)wraps the new-done-handle pattern. Both delegate todep_onunder the hood, so there is no new behavior — just a clearer surface for the two most common shapes.The accompanying sweep through the OpenVMM pipelines (checkin_gates, build_docs, vmm_tests_run) converts every eligible call site to use the new shortcuts. Sites where the closure also threads additional state (e.g. building IGVM, restoring packages) are intentionally left alone: the shortcuts are designed for the single-handle case, and forcing them on mixed-ctx jobs would just reintroduce boilerplate in a different shape. The generated pipeline YAMLs are unchanged.