Fix spec violations for internal_ids cross-modification
What does this MR do and why?
At present all the spec violations we found are false positives caused
by the fact that ensure_project_iid!
is not called on the pipeline
before saving. We can remove many of them by just doing this in the
after(:build)
for the ci_pipeline
factory. Others we need to change how the object is constructed in the test setup.
There are still a couple in atomic_internal_id_shared_examples
but
these are specs that are explicitly trying to do things in transactions
and rolling things back so they aren't really representative of real
application code so it seemed easier to just wrap these in allow_...
for now and extract an issue if we ever want to actually refactor these
tests. It may be tricky to refactor them because they are used for other
models where these transaction behaviours being tested do indeed matter.
Screenshots or screen recordings
These are strongly recommended to assist reviewers and reduce the time to merge your change.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #335814 (closed)