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.js and passes an apolloProvider, the same way the issue and merge request sidebar does in mount_sidebar.js;
  • removes the optional chaining from isTimeTrackingInfoLoading. Both places that render the component now give it a provider, so $apollo.queries.issuableTimeTracking always 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

Screenshots or screen recordings

None. There is no visible change.

How to set up and validate locally

  1. Open a project milestone that has time tracking data, for example /<project>/-/milestones/1.
  2. Confirm the time tracking section in the sidebar shows the estimate and the time spent.
  3. 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.

🤖 Generated with Claude Code

Edited by Miguel Rincon

Merge request reports

Loading
Loading