Skip to content

Extract pipeline run creation logic into reusable method#149

Open
Mbeaulne wants to merge 1 commit into03-11-adds_bulk_pipeline_submissionfrom
03-11-abstract_logic_from_create_and_bulk_create
Open

Extract pipeline run creation logic into reusable method#149
Mbeaulne wants to merge 1 commit into03-11-adds_bulk_pipeline_submissionfrom
03-11-abstract_logic_from_create_and_bulk_create

Conversation

@Mbeaulne
Copy link
Collaborator

@Mbeaulne Mbeaulne commented Mar 11, 2026

TL;DR

Extracted pipeline run creation logic into a reusable private method to eliminate code duplication between single and batch creation operations.

What changed?

Created a new _build_pipeline_run method that encapsulates the pipeline run creation process, including building the execution tree, creating the PipelineRun record, flushing to obtain the server-generated ID, and mirroring system annotations. Both the create and create_batch methods now call this shared method instead of duplicating the same logic.

How to test?

Test both single pipeline run creation via the create method and batch pipeline run creation via the create_batch method to ensure they continue to work as expected. Verify that pipeline runs are created with proper execution trees, annotations, and system metadata in both scenarios.

Why make this change?

This refactoring eliminates code duplication between the single and batch creation methods, making the codebase more maintainable. Any future changes to the pipeline run creation logic only need to be made in one place, reducing the risk of inconsistencies and bugs.

Copy link
Collaborator Author

Mbeaulne commented Mar 11, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Mbeaulne Mbeaulne changed the title Abstract logic from create and bulk create Extract pipeline run creation logic into reusable method Mar 11, 2026
@Mbeaulne Mbeaulne marked this pull request as ready for review March 11, 2026 20:39
@Mbeaulne Mbeaulne requested a review from Ark-kun as a code owner March 11, 2026 20:39
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.

1 participant