From 8367298fe93059886b3702833bba46f136dfa518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Caplette?= Date: Wed, 7 Sep 2022 13:31:34 -0400 Subject: [PATCH 1/3] Add batch loading to CI/CD variables In the context of the CI/CD refactor, we did not take into account that graphQL queries limit is 100 ms. Therefore, this commit adds batch loading to the list of variables for project and group. Instance variables have a hard limit at 25, but can be changed so there is also batch loading there. --- .../components/ci_admin_variables.vue | 49 +++++++- .../components/ci_group_variables.vue | 54 ++++++++- .../components/ci_project_variables.vue | 68 +++++++++-- .../components/ci_variable_table.vue | 3 +- .../javascripts/ci_variable_list/constants.js | 2 +- .../queries/group_variables.query.graphql | 8 +- .../queries/project_variables.query.graphql | 8 +- .../graphql/queries/variables.query.graphql | 8 +- .../graphql/{resolvers.js => settings.js} | 113 ++++++++++++++++-- .../javascripts/ci_variable_list/index.js | 4 +- .../javascripts/ci_variable_list/utils.js | 10 ++ locale/gitlab.pot | 3 + .../components/ci_admin_variables_spec.js | 2 +- .../components/ci_group_variables_spec.js | 2 +- .../components/ci_project_variables_spec.js | 2 +- spec/frontend/ci_variable_list/mocks.js | 6 + 16 files changed, 308 insertions(+), 34 deletions(-) rename app/assets/javascripts/ci_variable_list/graphql/{resolvers.js => settings.js} (66%) diff --git a/app/assets/javascripts/ci_variable_list/components/ci_admin_variables.vue b/app/assets/javascripts/ci_variable_list/components/ci_admin_variables.vue index 59ddf4b19d8f46..06688bdaa7bdd1 100644 --- a/app/assets/javascripts/ci_variable_list/components/ci_admin_variables.vue +++ b/app/assets/javascripts/ci_variable_list/components/ci_admin_variables.vue @@ -1,5 +1,7 @@