Mount the merge request Pipelines tab with initVueApp

What does this MR do and why?

This MR mounts the Pipelines tab of the merge request page with initVueApp, in place of new Vue(...).$mount(). It tears the app down with unmountVueApp, in place of $destroy().

This prepares !266580, which mounts a second initVueApp root on the same element for the new merge request page:

  • unmountVueApp tears down an initVueApp root on Vue 2 and on Vue 3.
  • On Vue 3, unmountVueApp does nothing for a new Vue root. A review on !266580 found that mixing both kinds of root would leave the table running after you leave the tab.
  • With this MR, both roots share one teardown path.

initVueApp replaces its element, so the app mounts on a child of #commit-pipeline-table-view. The update-pipelines-count listener on that element stays in the document.

No behaviour change is intended:

  • The mr_pipelines_graphql flag still picks the GraphQL or the legacy table wrapper. Both load lazily, through defineAsyncComponent.
  • The provide values and the props are the same.

Screenshots or screen recordings

No visual change is intended. Each screenshot shows the Pipelines tab after this path: Pipelines, Overview, Pipelines, Pipelines again. The table renders once, and #commit-pipeline-table-view has one child.

Before (79caff74) After (40a19c64)
before_light after_light
before_dark after_dark
How the screenshots were taken
  • A temporary local feature spec ran in GDK. It is not committed.
  • Before: merge-base 79caff74. After: MR head 40a19c64.
  • Full page, light and dark mode.

How to set up and validate locally

  1. Open the Pipelines tab of a merge request that has pipelines. The table renders.
  2. Select another tab, then Pipelines again. The table renders once.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Local verification
  • merge_request_tabs_spec.js passes in the Vue 2 and Vue 3 Jest lanes. It covers:
    • the mount element and the props from mrWidgetData
    • teardown with unmountVueApp when you leave the tab
  • ESLint and Prettier pass.

References

  • Found in the review of !266580
  • Prepares the flag removal for #419726
  • The flag removal drops the same conversion: !266232
Edited by Miguel Rincon

Merge request reports

Loading
Loading