Pass an Apollo provider to the milestone time tracker
What does this MR do and why?
The milestone sidebar mounts IssuableTimeTracker (time_tracker.vue) as its own Vue app. That component has an apollo query, but the milestone mount had no Vue.use(VueApollo) and no apolloProvider. On milestone pages the query is skipped, because the time tracking values come in as props. So the page worked, but only because the component read $apollo with optional chaining. That guard was added in 2021 to stop a console error on the milestone page.
This MR:
- installs VueApollo at module scope in
mount_milestone_sidebar.jsand passes anapolloProvider, the same way the issue and merge request sidebar does inmount_sidebar.js; - removes the optional chaining from
isTimeTrackingInfoLoading. Both places that render the component now give it a provider, so$apollo.queries.issuableTimeTrackingalways exists.
Why now: on Vue 3, the check in !260635 (merged) fails any component with an apollo option when Vue.use(VueApollo) did not run. The stress pipeline in !255334 (closed) showed this component failing spec/features/projects/milestones/milestone_spec.rb for that reason, once the super sidebar no longer installed VueApollo for the whole page.
There is no visible change. On milestones the query is still skipped.
References
- Found by the stress pipeline https://gitlab.com/gitlab-org/gitlab/-/pipelines/2926428135 of !255334 (closed)
- Check that reports it: !260635 (merged)
- Same bug class as !259575 (merged)
Screenshots or screen recordings
None. There is no visible change.
How to set up and validate locally
- Open a project milestone that has time tracking data, for example
/<project>/-/milestones/1. - Confirm the time tracking section in the sidebar shows the estimate and the time spent.
- Confirm the browser console has no errors from the time tracker.
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.