Skip to content

Clarify Ci::Sources::Pipeline partition id specs

What does this MR do and why?

This MR rewrites the specs for the partition_id and source_partition_id on the Ci::Sources::Pipeline model.

Previously, the spec wasn't actually articulating anything about the upstream pipeline or source job, which is how the model actually populates the id values.

I've removed the stubbing to make sure we're actually passing the values we intend, and also changed the context to use an explicit upstream pipeline that we can assert partition_id equivalence to.

With the upstream pipeline able to be directly referenced from the spec, I also added a context with two new specs that explain the difference in partition ids when the upstream pipeline is from a different partition than the new downstream.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

The specs still pass, so the real difference is reading the old version and the new version to understand the different cases and how the partition ids get set up. These specs should be more explanatory of the behavior.

Edited by drew stachon

Merge request reports

Loading