Loading
Fetch work item linked resources in their own query
What does this MR do and why?
This MR splits the loading of linkedResources widget from main work items query (i.e. namespaceWorkItem) into its own query that loads separate from base query, allowing us to bring down the query complexity of base query.
Implementation notes
Here's a high level summary of what this MR does:
- We've split the
linkedResourceswidget from base work item query to its own query and subscription. - When page loads,
namespaceWorkItemwould fetch onlytypefor this widget, which is returned only if widget is supported on a given work item type, this also controls widget visibility like it used to inmaster. - The
work_items/components/work_item_linked_resources.vuecomponent now owns its query & subscription to fetch available linked resources, as well as observes work item for updates (eg; usage of/zoomand/remove_zoomquick actions).- Having a subscription ensures that real-time behaviour or component remains intact even after query has split.
- If you enabled
work_item_features_fieldflag globally on GDK and access any work item anonymously, you'd still see the errorWork Item not foundas this MR alone won't solve that issue, it is part of a series of MRs where we're splitting widgets into their own queries.linkedResources- This MRcurrentUserTodos- !252573 (merged)crmContacts- !252569 (merged)- Only after all 3 MRs get merged is when we'll be able to access work items anonymously with FF enabled globally, assuming something else isn't added to main query again to breach complexity.
😬
- I haven't attached any recordings to MR description as behaviour is same as what you'd notice in
master, except that there's only one extra query, a dedicatedworkItemLinkedResourcesto fetch any attached Zoom links.
References
- Migrate work_item_linked_resources.vue to use w... (#590644 - closed)
- Work item feature - Update each widget to use f... (#587970 - closed)
- Work item features - Rollout `work_item_feature... (#587972)
- Change work item widgets queries to use `workIt... (&20609)
Note that this MR depends on !252530 (merged), so it cannot be merged until that merges.
Screenshots or screen recordings
NA, no visual change. The widget renders and behaves the same, it just gets its data from its own query.
How to set up and validate locally
- Enable the flag with
Feature.enable(:work_item_features_field). - Open a work item and add a Zoom link with
/zoom https://zoom.us/j/123456789. - Confirm the Resources card appears with the link.
- In the network tab, confirm
workItemLinkedResourcesfires exactly once andnamespaceWorkItemfires once. - Open a work item without a Zoom link and confirm the Resources card doesn't show.
- Remove the link with
/remove_zoomand confirm the card disappears. - Repeat with the flag disabled to check the
widgetspath.
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.
Edited by Kushal Pandya