New merge request page: Pipelines tab badge count can differ from the pipelines list
Problem
On the new merge request page, the Pipelines tab badge and the pipelines list can show different counts.
- The server renders the badge from
Ci::PipelinesForMergeRequestFinder, inset_pipeline_variables. It counts the pipelines of every commit in the new merge request. - After !266261 (closed), the list shows the pipelines of the source branch head commit only.
- The list updates the badge with the
update-pipelines-countevent, but only after the user opens the tab.
Examples
- The source branch has two commits, and each commit has a pipeline. The badge shows
2. When the user opens the tab, the list shows one pipeline and the badge changes to1. - The head commit has no pipeline yet, and older commits have three. The badge shows
3over the empty state. The badge does not change, for two reasons:- The
pipelines.countwatcher incommit_pipelines_list.vuedoes not fire when the count stays at0. initPipelineCountListenerignores a count of0.
- The
Possible fixes
- Count only the head commit pipelines on the server for the new merge request page, so the badge matches the list.
- Or list the pipelines of the source branch (
ref), so the list is closer to the server count.
Decide this after the mr_pipelines_graphql flag removal is done.
References
- Found while reviewing !266261 (closed)
- Flag removal: !266232
- Rollout issue: #419726