Fix invalidating Project build status cache to often
What does this MR do?
In this merge request we only update the cached status if the pipeline is running for the sha that matches the HEAD of the project.
This invalidation now happens in the state machine instead of the update_status
method.
Ci::PipelineStatus
was renamed to Ci::ProjectStatus
Why was this MR needed?
Before we were invalidating the project build status cache every time a pipeline was created, or a status was updated. Even if this was not for the HEAD
of a project (FE: master).
As @ayufan mentioned in !9903 (merged).
Does this MR meet the acceptance criteria?
- Tests
-
Added for this feature/bug -
All builds are passing
-