Skip to content

Remove the redundant update for API endpoint projects/:id/statuses/:sha

Furkan Ayhan requested to merge 326791-removing-redundant-update into master

What does this MR do?

In issue #326791 (closed), we are trying to remove all usages of Ci::ProcessPipelineService#update_retried, but there are still some usages for some pipelines.

When I look at those pipelines, I realized that all of them are triggered via the API endpoint projects/:id/statuses/:sha. Then looked at deeply...

We have an update method in this endpoint, before all processes. This update method aims to assign some optional parameters. However, that update also triggers the after_transition callback of CommitStatus, and this enqueues PipelineProcessWorker.

Why can we just replace "update" with "assign_attributes"?

If those assignments are valid, then they will be saved eventually in enqueue,run,success,drop,cancel events. So, we don't need to update there.

Screenshots (strongly suggested)

Investigation process:

Screen_Shot_2021-05-11_at_13.59.37

Screen_Shot_2021-05-11_at_13.59.55

Screen_Shot_2021-05-11_at_14.00.07

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Furkan Ayhan

Merge request reports