• Dylan Griffith's avatar
    Ensure ci_pipelines.iid set before transaction in commit status API · c2dde812
    Dylan Griffith authored
    Prior to this we were using `create!` which triggered the
    `ensure_project_iid!` in a callback. This causes a
    `CrossDatabaseModificationAcrossUnsupportedTablesError`. To avoid this
    we will create the `iid` before saving. This is consistent with all
    other places we create pipelines.
    
    This change still doesn't allow us to remove
    `spec/requests/api/commit_statuses_spec.rb` from the allowlist as there
    are other calls to `project.ci_pipelines.create!` in this file.
    
    We need a more holistic solution for that which is being discussed in
    https://gitlab.com/gitlab-org/gitlab/-/merge_requests/75316 .
    c2dde812
commit_statuses_spec.rb 16.9 KB