Skip to content

Part 1 - Add evaluateModuleFromSource for gql known op plugin

What does this MR do and why?

This MR updates a script we use to pull known GraphQL operation names during the webpack build.

Previously we regex'd code to determine the operation name (not great). Now we actually evaluate the module export to determine the operation name.

How to set up and validate locally

  1. Run yarn webpack
  2. Read public/assets/webpack/graphql_known_operations.yml
  3. Be sure to rm -rf public/assets/webpack afterwards since this will prevent the webpack dev server from serving local file changes.

Diff'ing the result on master and this MR, we're actually fixing some cases where we erroneously matched some fragment names as operation names:

Screen_Shot_2022-09-11_at_11.27.27_PM

Full diff
--- old.yml	2022-09-11 23:25:53.000000000 -0500
+++ new.yml	2022-09-11 23:24:44.000000000 -0500
@@ -46,9 +46,6 @@
 - CanCreatePersonalSnippet
 - CanCreateProjectSnippet
 - childItems
-- CiBuildNeedFields
-- CiJobNeedFields
-- CiNeeds
 - clusterAgents
 - commitCIFile
 - configureContainerScanning
@@ -168,7 +165,6 @@
 - epicDueDate
 - epicLabels
 - EpicMoveList
-- EpicNode
 - epicParticipants
 - epicReference
 - epicReorder
@@ -322,7 +318,6 @@
 - goBack
 - goFirstStep
 - goForward
-- Group
 - group_boards
 - group_recent_boards
 - GroupBoard
@@ -390,7 +385,6 @@
 - jiraGetProjects
 - jiraIssues
 - jiraSearchProjectMembers
-- LinkedPipelineData
 - linkSecurityPolicyProject
 - lintCI
 - ListIssues
@@ -427,7 +421,6 @@
 - orderPreview
 - organizations
 - organizationsCountByState
-- PageInfo
 - parsePayloadFields
 - pathLastCommit
 - permissions
@@ -467,7 +460,6 @@
 - promoteToEpic
 - readyToMergeEE
 - rebaseQuery
-- RelatedTreeBaseEpic
 - removeProjectCIJobTokenScope
 - removeState
 - removeToolbarItems
@@ -541,7 +533,6 @@
 - toggleResolveDiscussion
 - toggleSidebarStatus
 - ToolbarItems
-- TreeEntry
 - unlockState
 - unscheduleJob
 - updateActiveDiscussion

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #349546 (closed)

Edited by Paul Slaughter

Merge request reports

Loading