Skip to content

flowey: add publish and side_effect shortcuts to PipelineJob#3318

Draft
jstarks wants to merge 1 commit intomicrosoft:mainfrom
jstarks:flowey_publish
Draft

flowey: add publish and side_effect shortcuts to PipelineJob#3318
jstarks wants to merge 1 commit intomicrosoft:mainfrom
jstarks:flowey_publish

Conversation

@jstarks
Copy link
Copy Markdown
Member

@jstarks jstarks commented Apr 17, 2026

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.

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.
Copilot AI review requested due to automatic review settings April 17, 2026 17:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 for dep_on + ctx.publish_typed_artifact(...).
  • Add PipelineJob::side_effect(f) as a shortcut for dep_on + ctx.new_done_handle().
  • Update eligible call sites across checkin_gates, build_docs, and vmm_tests_run pipelines 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(...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants