From ef1f98e770bdfa5b53d4a50e5edbf31cd5bc6f2c Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 18 Jul 2024 12:26:26 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .rubocop_todo/rspec/feature_category.yml | 1 - .../broadcast_messages/components/base.vue | 2 +- .../manual_variables/empty_state.vue | 38 +++++ .../get_manual_variables.query.graphql | 17 ++ .../manual_variables/manual_variables.vue | 51 ++++++ .../manual_variables/variable_table.vue | 90 ++++++++++ .../components/pipelines_manual_actions.vue | 20 +-- .../issues/show/components/description.vue | 4 +- .../components/create_work_item.vue | 5 +- .../components/create_work_item_modal.vue | 5 +- .../components/work_item_actions.vue | 4 +- .../work_item_attributes_wrapper.vue | 11 +- .../components/work_item_detail.vue | 12 ++ .../work_item_links/work_item_links_form.vue | 5 +- .../work_item_projects_listbox.vue | 7 +- .../work_item_links/work_item_tree.vue | 28 ++- .../work_items/graphql/cache_utils.js | 9 + ...up_projects_for_links_widget.query.graphql | 18 -- ...ce_projects_for_links_widget.query.graphql | 18 ++ ...> namespace_work_item_types.query.graphql} | 4 +- .../project_work_item_types.query.graphql | 12 -- ...ed_projects_for_links_widget.query.graphql | 21 --- app/views/ci/variables/_header.html.haml | 10 -- .../groups/settings/ci_cd/show.html.haml | 68 ++++---- app/views/projects/pipelines/show.html.haml | 2 +- .../projects/settings/ci_cd/show.html.haml | 160 ++++++++---------- config/gitlab_loose_foreign_keys.yml | 4 + ...pproval_group_rules_protected_branches.yml | 1 + ...roup_rules_protected_branches_group_id.yml | 9 + db/docs/sbom_sources.yml | 3 +- ...180831_add_organization_to_sbom_sources.rb | 32 ++++ ...72004_replace_sbom_sources_unique_index.rb | 20 +++ .../20240712172736_update_sbom_sources.rb | 21 +++ ...approval_group_rules_protected_branches.rb | 9 + ...up_rules_protected_branches_on_group_id.rb | 16 ++ ...up_rules_protected_branches_group_id_fk.rb | 17 ++ ...les_protected_branches_group_id_trigger.rb | 25 +++ ...group_rules_protected_branches_group_id.rb | 40 +++++ ...zations_sbom_sources_organization_id_fk.rb | 21 +++ ..._stages_on_partition_id_and_pipeline_id.rb | 52 ++++++ ...ci_pipelines_p_ci_stages_on_pipeline_id.rb | 38 +++++ ..._pipelines_from_p_ci_pipeline_variables.rb | 52 ++++++ ..._p_ci_pipeline_variables_on_pipeline_id.rb | 38 +++++ db/schema_migrations/20240705180831 | 1 + db/schema_migrations/20240708172004 | 1 + db/schema_migrations/20240712172736 | 1 + db/schema_migrations/20240716135028 | 1 + db/schema_migrations/20240716135029 | 1 + db/schema_migrations/20240716135030 | 1 + db/schema_migrations/20240716135031 | 1 + db/schema_migrations/20240716135032 | 1 + db/schema_migrations/20240716190533 | 1 + db/schema_migrations/20240717121911 | 1 + db/schema_migrations/20240717121912 | 1 + db/schema_migrations/20240717122153 | 1 + db/schema_migrations/20240717122154 | 1 + db/structure.sql | 43 +++-- doc/administration/auth/oidc.md | 20 ++- doc/ci/yaml/index.md | 2 + .../documentation/styleguide/index.md | 12 +- .../documentation/styleguide/word_list.md | 11 ++ doc/integration/azure.md | 9 + doc/topics/git/branch.md | 13 ++ .../policies/pipeline_execution_policies.md | 2 +- ...group_rules_protected_branches_group_id.rb | 10 ++ lib/sidebars/admin/menus/messages_menu.rb | 2 +- locale/gitlab.pot | 9 + package.json | 2 +- spec/db/schema_spec.rb | 2 + spec/features/runners_spec.rb | 44 ++++- .../manual_variables/empty_state_spec.js | 23 +++ .../manual_variables/manual_variables_spec.js | 67 ++++++++ .../manual_variables/mock_data.js | 26 +++ .../manual_variables/variable_table_spec.js | 113 +++++++++++++ .../pipelines_manual_actions_spec.js | 36 ++-- spec/frontend/fixtures/work_items.rb | 16 +- .../show/components/description_spec.js | 8 +- .../components/create_work_item_modal_spec.js | 36 +--- .../components/create_work_item_spec.js | 51 ++---- .../components/work_item_actions_spec.js | 8 +- .../work_item_links_form_spec.js | 36 ++-- .../work_item_projects_listbox_spec.js | 50 +++--- .../work_item_links/work_item_tree_spec.js | 35 +++- .../work_item_notifications_widget_spec.js | 8 +- spec/frontend/work_items/mock_data.js | 59 ++----- ..._rules_protected_branches_group_id_spec.rb | 15 ++ .../admin/menus/messages_menu_spec.rb | 2 +- ..._rules_protected_branches_group_id_spec.rb | 33 ++++ .../projects/pipelines/show.html.haml_spec.rb | 4 +- yarn.lock | 8 +- 90 files changed, 1384 insertions(+), 464 deletions(-) create mode 100644 app/assets/javascripts/ci/pipeline_details/manual_variables/empty_state.vue create mode 100644 app/assets/javascripts/ci/pipeline_details/manual_variables/graphql/queries/get_manual_variables.query.graphql create mode 100644 app/assets/javascripts/ci/pipeline_details/manual_variables/manual_variables.vue create mode 100644 app/assets/javascripts/ci/pipeline_details/manual_variables/variable_table.vue delete mode 100644 app/assets/javascripts/work_items/graphql/group_projects_for_links_widget.query.graphql create mode 100644 app/assets/javascripts/work_items/graphql/namespace_projects_for_links_widget.query.graphql rename app/assets/javascripts/work_items/graphql/{group_work_item_types.query.graphql => namespace_work_item_types.query.graphql} (61%) delete mode 100644 app/assets/javascripts/work_items/graphql/project_work_item_types.query.graphql delete mode 100644 app/assets/javascripts/work_items/graphql/related_projects_for_links_widget.query.graphql delete mode 100644 app/views/ci/variables/_header.html.haml create mode 100644 db/docs/batched_background_migrations/backfill_approval_group_rules_protected_branches_group_id.yml create mode 100644 db/migrate/20240705180831_add_organization_to_sbom_sources.rb create mode 100644 db/migrate/20240708172004_replace_sbom_sources_unique_index.rb create mode 100644 db/migrate/20240712172736_update_sbom_sources.rb create mode 100644 db/migrate/20240716135028_add_group_id_to_approval_group_rules_protected_branches.rb create mode 100644 db/post_migrate/20240716135029_index_approval_group_rules_protected_branches_on_group_id.rb create mode 100644 db/post_migrate/20240716135030_add_approval_group_rules_protected_branches_group_id_fk.rb create mode 100644 db/post_migrate/20240716135031_add_approval_group_rules_protected_branches_group_id_trigger.rb create mode 100644 db/post_migrate/20240716135032_queue_backfill_approval_group_rules_protected_branches_group_id.rb create mode 100644 db/post_migrate/20240716190533_remove_organizations_sbom_sources_organization_id_fk.rb create mode 100644 db/post_migrate/20240717121911_partitioned_fk_to_ci_pipelines_from_p_ci_stages_on_partition_id_and_pipeline_id.rb create mode 100644 db/post_migrate/20240717121912_remove_fk_to_ci_pipelines_p_ci_stages_on_pipeline_id.rb create mode 100644 db/post_migrate/20240717122153_partitioned_fk_to_ci_pipelines_from_p_ci_pipeline_variables.rb create mode 100644 db/post_migrate/20240717122154_remove_fk_to_ci_pipelines_p_ci_pipeline_variables_on_pipeline_id.rb create mode 100644 db/schema_migrations/20240705180831 create mode 100644 db/schema_migrations/20240708172004 create mode 100644 db/schema_migrations/20240712172736 create mode 100644 db/schema_migrations/20240716135028 create mode 100644 db/schema_migrations/20240716135029 create mode 100644 db/schema_migrations/20240716135030 create mode 100644 db/schema_migrations/20240716135031 create mode 100644 db/schema_migrations/20240716135032 create mode 100644 db/schema_migrations/20240716190533 create mode 100644 db/schema_migrations/20240717121911 create mode 100644 db/schema_migrations/20240717121912 create mode 100644 db/schema_migrations/20240717122153 create mode 100644 db/schema_migrations/20240717122154 create mode 100644 lib/gitlab/background_migration/backfill_approval_group_rules_protected_branches_group_id.rb create mode 100644 spec/frontend/ci/pipeline_details/manual_variables/empty_state_spec.js create mode 100644 spec/frontend/ci/pipeline_details/manual_variables/manual_variables_spec.js create mode 100644 spec/frontend/ci/pipeline_details/manual_variables/mock_data.js create mode 100644 spec/frontend/ci/pipeline_details/manual_variables/variable_table_spec.js create mode 100644 spec/lib/gitlab/background_migration/backfill_approval_group_rules_protected_branches_group_id_spec.rb create mode 100644 spec/migrations/20240716135032_queue_backfill_approval_group_rules_protected_branches_group_id_spec.rb diff --git a/.rubocop_todo/rspec/feature_category.yml b/.rubocop_todo/rspec/feature_category.yml index f0d250bf9ef..12d4765463c 100644 --- a/.rubocop_todo/rspec/feature_category.yml +++ b/.rubocop_todo/rspec/feature_category.yml @@ -1130,7 +1130,6 @@ RSpec/FeatureCategory: - 'ee/spec/views/admin/users/index.html.haml_spec.rb' - 'ee/spec/views/clusters/clusters/show.html.haml_spec.rb' - 'ee/spec/views/compliance_management/compliance_framework/_compliance_frameworks_info.html.haml_spec.rb' - - 'ee/spec/views/devise/sessions/new.html.haml_spec.rb' - 'ee/spec/views/groups/hook_logs/show.html.haml_spec.rb' - 'ee/spec/views/groups/hooks/edit.html.haml_spec.rb' - 'ee/spec/views/groups/security/discover/show.html.haml_spec.rb' diff --git a/app/assets/javascripts/admin/broadcast_messages/components/base.vue b/app/assets/javascripts/admin/broadcast_messages/components/base.vue index 6426ec70781..bc2a411fb94 100644 --- a/app/assets/javascripts/admin/broadcast_messages/components/base.vue +++ b/app/assets/javascripts/admin/broadcast_messages/components/base.vue @@ -119,7 +119,7 @@ export default { diff --git a/app/assets/javascripts/ci/pipeline_details/manual_variables/empty_state.vue b/app/assets/javascripts/ci/pipeline_details/manual_variables/empty_state.vue new file mode 100644 index 00000000000..1ea007d5c2a --- /dev/null +++ b/app/assets/javascripts/ci/pipeline_details/manual_variables/empty_state.vue @@ -0,0 +1,38 @@ + + + diff --git a/app/assets/javascripts/ci/pipeline_details/manual_variables/graphql/queries/get_manual_variables.query.graphql b/app/assets/javascripts/ci/pipeline_details/manual_variables/graphql/queries/get_manual_variables.query.graphql new file mode 100644 index 00000000000..200a75c634f --- /dev/null +++ b/app/assets/javascripts/ci/pipeline_details/manual_variables/graphql/queries/get_manual_variables.query.graphql @@ -0,0 +1,17 @@ +query getManualVariables($projectPath: ID!, $iid: ID!) { + project(fullPath: $projectPath) { + __typename + id + pipeline(iid: $iid) { + id + manualVariables { + __typename + nodes { + id + key + value + } + } + } + } +} diff --git a/app/assets/javascripts/ci/pipeline_details/manual_variables/manual_variables.vue b/app/assets/javascripts/ci/pipeline_details/manual_variables/manual_variables.vue new file mode 100644 index 00000000000..c2288b62eb9 --- /dev/null +++ b/app/assets/javascripts/ci/pipeline_details/manual_variables/manual_variables.vue @@ -0,0 +1,51 @@ + + + diff --git a/app/assets/javascripts/ci/pipeline_details/manual_variables/variable_table.vue b/app/assets/javascripts/ci/pipeline_details/manual_variables/variable_table.vue new file mode 100644 index 00000000000..3eceb12554e --- /dev/null +++ b/app/assets/javascripts/ci/pipeline_details/manual_variables/variable_table.vue @@ -0,0 +1,90 @@ + + + diff --git a/app/assets/javascripts/ci/pipelines_page/components/pipelines_manual_actions.vue b/app/assets/javascripts/ci/pipelines_page/components/pipelines_manual_actions.vue index 991be645d8b..ce4e33233c5 100644 --- a/app/assets/javascripts/ci/pipelines_page/components/pipelines_manual_actions.vue +++ b/app/assets/javascripts/ci/pipelines_page/components/pipelines_manual_actions.vue @@ -7,7 +7,6 @@ import { GlTooltipDirective, } from '@gitlab/ui'; import { createAlert } from '~/alert'; -import axios from '~/lib/utils/axios_utils'; import { confirmAction } from '~/lib/utils/confirm_via_gl_modal/confirm_via_gl_modal'; import { s__, __, sprintf } from '~/locale'; import Tracking from '~/tracking'; @@ -15,6 +14,7 @@ import GlCountdown from '~/vue_shared/components/gl_countdown.vue'; import { confirmJobConfirmationMessage } from '~/ci/pipeline_details/graph/utils'; import { TRACKING_CATEGORIES } from '../../constants'; import getPipelineActionsQuery from '../graphql/queries/get_pipeline_actions.query.graphql'; +import jobPlayMutation from '../../jobs_page/graphql/mutations/job_play.mutation.graphql'; export default { name: 'PipelinesManualActions', @@ -96,17 +96,13 @@ export default { } } this.isLoading = true; - - /** - * Ideally, the component would not make an api call directly. - * However, in order to use the eventhub and know when to - * toggle back the `isLoading` property we'd need an ID - * to track the request with a watcher - since this component - * is rendered at least 20 times in the same page, moving the - * api call directly here is the most performant solution - */ - axios - .post(`${action.playPath}.json`) + this.$apollo + .mutate({ + mutation: jobPlayMutation, + variables: { + id: action.id, + }, + }) .then(() => { this.isLoading = false; this.$emit('refresh-pipeline-table'); diff --git a/app/assets/javascripts/issues/show/components/description.vue b/app/assets/javascripts/issues/show/components/description.vue index 7a9ae81bd16..99847ee9232 100644 --- a/app/assets/javascripts/issues/show/components/description.vue +++ b/app/assets/javascripts/issues/show/components/description.vue @@ -15,7 +15,7 @@ import TaskList from '~/task_list'; import { addHierarchyChild, removeHierarchyChild } from '~/work_items/graphql/cache_utils'; import createWorkItemMutation from '~/work_items/graphql/create_work_item.mutation.graphql'; import deleteWorkItemMutation from '~/work_items/graphql/delete_work_item.mutation.graphql'; -import projectWorkItemTypesQuery from '~/work_items/graphql/project_work_item_types.query.graphql'; +import namespaceWorkItemTypesQuery from '~/work_items/graphql/namespace_work_item_types.query.graphql'; import { sprintfWorkItem, I18N_WORK_ITEM_ERROR_CREATING, @@ -110,7 +110,7 @@ export default { }, }, workItemTypes: { - query: projectWorkItemTypesQuery, + query: namespaceWorkItemTypesQuery, variables() { return { fullPath: this.fullPath, diff --git a/app/assets/javascripts/work_items/components/create_work_item.vue b/app/assets/javascripts/work_items/components/create_work_item.vue index b61bfe10786..f0796fee337 100644 --- a/app/assets/javascripts/work_items/components/create_work_item.vue +++ b/app/assets/javascripts/work_items/components/create_work_item.vue @@ -32,8 +32,7 @@ import { WIDGET_TYPE_ROLLEDUP_DATES, } from '../constants'; import createWorkItemMutation from '../graphql/create_work_item.mutation.graphql'; -import groupWorkItemTypesQuery from '../graphql/group_work_item_types.query.graphql'; -import projectWorkItemTypesQuery from '../graphql/project_work_item_types.query.graphql'; +import namespaceWorkItemTypesQuery from '../graphql/namespace_work_item_types.query.graphql'; import groupWorkItemByIidQuery from '../graphql/group_work_item_by_iid.query.graphql'; import workItemByIidQuery from '../graphql/work_item_by_iid.query.graphql'; import updateNewWorkItemMutation from '../graphql/update_new_work_item.mutation.graphql'; @@ -110,7 +109,7 @@ export default { }, workItemTypes: { query() { - return this.isGroup ? groupWorkItemTypesQuery : projectWorkItemTypesQuery; + return namespaceWorkItemTypesQuery; }, fetchPolicy() { return this.workItemTypeName ? fetchPolicies.CACHE_ONLY : fetchPolicies.CACHE_FIRST; diff --git a/app/assets/javascripts/work_items/components/create_work_item_modal.vue b/app/assets/javascripts/work_items/components/create_work_item_modal.vue index ca22c2a52b5..0e742696163 100644 --- a/app/assets/javascripts/work_items/components/create_work_item_modal.vue +++ b/app/assets/javascripts/work_items/components/create_work_item_modal.vue @@ -10,8 +10,7 @@ import { sprintfWorkItem, I18N_WORK_ITEM_ERROR_FETCHING_TYPES, } from '../constants'; -import projectWorkItemTypesQuery from '../graphql/project_work_item_types.query.graphql'; -import groupWorkItemTypesQuery from '../graphql/group_work_item_types.query.graphql'; +import namespaceWorkItemTypesQuery from '../graphql/namespace_work_item_types.query.graphql'; import CreateWorkItem from './create_work_item.vue'; export default { @@ -43,7 +42,7 @@ export default { apollo: { workItemTypes: { query() { - return this.isGroup ? groupWorkItemTypesQuery : projectWorkItemTypesQuery; + return namespaceWorkItemTypesQuery; }, variables() { return { diff --git a/app/assets/javascripts/work_items/components/work_item_actions.vue b/app/assets/javascripts/work_items/components/work_item_actions.vue index e50ce175782..11070c9d4b8 100644 --- a/app/assets/javascripts/work_items/components/work_item_actions.vue +++ b/app/assets/javascripts/work_items/components/work_item_actions.vue @@ -41,7 +41,7 @@ import { import updateWorkItemMutation from '../graphql/update_work_item.mutation.graphql'; import updateWorkItemNotificationsMutation from '../graphql/update_work_item_notifications.mutation.graphql'; import convertWorkItemMutation from '../graphql/work_item_convert.mutation.graphql'; -import projectWorkItemTypesQuery from '../graphql/project_work_item_types.query.graphql'; +import namespaceWorkItemTypesQuery from '../graphql/namespace_work_item_types.query.graphql'; import WorkItemStateToggle from './work_item_state_toggle.vue'; export default { @@ -173,7 +173,7 @@ export default { }, apollo: { workItemTypes: { - query: projectWorkItemTypesQuery, + query: namespaceWorkItemTypesQuery, variables() { return { fullPath: this.fullPath, diff --git a/app/assets/javascripts/work_items/components/work_item_attributes_wrapper.vue b/app/assets/javascripts/work_items/components/work_item_attributes_wrapper.vue index cae5a904666..dc81c55975e 100644 --- a/app/assets/javascripts/work_items/components/work_item_attributes_wrapper.vue +++ b/app/assets/javascripts/work_items/components/work_item_attributes_wrapper.vue @@ -87,11 +87,10 @@ export default { return this.isWidgetPresent(WIDGET_TYPE_ROLLEDUP_DATES); }, workItemWeight() { - /** TODO remove this check after https://gitlab.com/gitlab-org/gitlab/-/merge_requests/158021 is merged */ - if (this.workItemType !== WORK_ITEM_TYPE_VALUE_EPIC) { - return this.isWidgetPresent(WIDGET_TYPE_WEIGHT); - } - return false; + return this.isWidgetPresent(WIDGET_TYPE_WEIGHT); + }, + isWorkItemWeightEditable() { + return this.workItemWeight?.widgetDefinition?.editable; }, workItemParticipants() { return this.isWidgetPresent(WIDGET_TYPE_PARTICIPANTS); @@ -178,7 +177,7 @@ export default { @labelsUpdated="$emit('attributesUpdated', { type: $options.ListType.label, ids: $event })" /> -