From 8a9790b0db723db32f8dff511ee032e5e8e3b583 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 16 Aug 2022 18:12:52 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .../components/ci_admin_variables.vue | 101 ++++++++++ .../components/ci_environments_dropdown.vue | 6 +- .../components/ci_variable_modal.vue | 15 +- .../components/ci_variable_settings.vue | 10 +- .../javascripts/ci_variable_list/constants.js | 7 + .../fragments/ci_variable.fragment.graphql | 7 + .../admin_add_variable.mutation.graphql | 16 ++ .../admin_delete_variable.mutation.graphql | 16 ++ .../admin_update_variable.mutation.graphql | 16 ++ .../graphql/queries/variables.query.graphql | 13 ++ .../ci_variable_list/graphql/resolvers.js | 67 +++++++ .../javascripts/ci_variable_list/index.js | 24 ++- .../javascripts/ci_variable_list/utils.js | 15 +- .../javascripts/persistent_user_callout.js | 4 +- .../admin/application_settings_controller.rb | 4 + .../users/namespace_callouts_controller.rb | 17 ++ app/graphql/types/work_item_type.rb | 6 + app/models/event.rb | 7 +- .../dismiss_namespace_callout_service.rb | 11 ++ app/views/ci/variables/_index.html.haml | 7 +- app/views/dashboard/_groups_head.html.haml | 2 +- app/views/devise/passwords/new.html.haml | 2 +- .../groups/settings/ci_cd/show.html.haml | 2 +- .../projects/settings/ci_cd/show.html.haml | 2 +- ...devops_implicitly_enabled_banner.html.haml | 2 +- app/views/shared/_clone_panel.html.haml | 2 +- .../shared/_new_project_item_select.html.haml | 4 +- app/views/shared/_ref_switcher.html.haml | 4 +- .../_remote_mirror_update_button.html.haml | 2 +- .../shared/_sidebar_toggle_button.html.haml | 2 +- .../shared/access_tokens/_table.html.haml | 2 +- .../shared/empty_states/_labels.html.haml | 4 +- .../empty_states/_priority_labels.html.haml | 2 +- .../shared/empty_states/_topics.html.haml | 2 +- .../shared/empty_states/_wikis.html.haml | 2 +- .../empty_states/_wikis_layout.html.haml | 2 +- .../shared/groups/_search_form.html.haml | 2 +- .../shared/issuable/_label_dropdown.html.haml | 4 +- .../issuable/_milestone_dropdown.html.haml | 4 +- app/views/shared/issuable/_sidebar.html.haml | 4 +- .../shared/issuable/form/_metadata.html.haml | 2 +- .../_metadata_issuable_assignee.html.haml | 2 +- .../shared/issuable/form/_title.html.haml | 2 +- app/views/shared/labels/_form.html.haml | 8 +- app/views/shared/labels/_nav.html.haml | 4 +- .../shared/projects/_search_form.html.haml | 2 +- .../_update_protected_branch.html.haml | 2 +- .../development/searchable_fork_targets.yml | 2 +- .../ops/report_jemalloc_stats.yml | 2 +- .../ops/skip_rugged_auto_detect.yml | 2 +- config/metrics/aggregates/code_review.yml | 12 ++ config/routes/project.rb | 1 + config/routes/user.rb | 1 + doc/administration/audit_event_streaming.md | 8 +- doc/administration/gitaly/index.md | 8 +- doc/administration/nfs.md | 17 +- .../gitlab_rails_cheat_sheet.md | 10 - doc/api/graphql/reference/index.md | 3 + doc/ci/pipelines/multi_project_pipelines.md | 13 +- doc/ci/runners/configure_runners.md | 3 + .../variables/where_variables_can_be_used.md | 14 +- doc/ci/yaml/index.md | 2 + .../avoiding_downtime_in_migrations.md | 10 +- doc/development/documentation/structure.md | 1 + .../documentation/styleguide/index.md | 7 + doc/development/documentation/testing.md | 25 ++- doc/user/clusters/agent/ci_cd_workflow.md | 2 +- doc/user/project/issue_board.md | 17 ++ .../issues/img/related_issue_block_v12_8.png | Bin 35817 -> 0 bytes .../issues/img/related_issue_block_v15_3.png | Bin 0 -> 28910 bytes .../issues/img/related_issues_add_v12_8.png | Bin 32939 -> 0 bytes .../issues/img/related_issues_add_v15_3.png | Bin 0 -> 24947 bytes .../img/related_issues_remove_v12_8.png | Bin 10708 -> 0 bytes .../img/related_issues_remove_v15_3.png | Bin 0 -> 12113 bytes doc/user/project/issues/related_issues.md | 6 +- doc/user/usage_quotas.md | 34 ++-- lib/gitlab/event_store.rb | 1 + .../known_events/code_review_events.yml | 25 +++ .../merge_request_widget_extension_counter.rb | 2 +- locale/gitlab.pot | 27 ++- qa/qa/page/alert/auto_devops_alert.rb | 2 +- qa/qa/page/component/access_tokens.rb | 4 + qa/qa/page/component/groups_filter.rb | 4 +- qa/qa/page/component/issuable/sidebar.rb | 4 +- qa/qa/page/dashboard/groups.rb | 9 +- qa/qa/page/dashboard/projects.rb | 6 +- qa/qa/page/issuable/new.rb | 19 +- qa/qa/page/label/index.rb | 10 +- qa/qa/page/label/new.rb | 12 +- .../project/settings/protected_branches.rb | 4 - qa/qa/page/project/show.rb | 6 +- spec/features/admin_variables_spec.rb | 34 ++++ .../issues/user_creates_issue_spec.rb | 6 +- .../features/projects/blobs/blob_show_spec.rb | 2 +- .../components/ci_admin_variables_spec.js | 178 ++++++++++++++++++ .../components/ci_variable_modal_spec.js | 37 ++-- .../components/ci_variable_settings_spec.js | 13 +- .../components/ci_variable_table_spec.js | 3 +- spec/frontend/ci_variable_list/mocks.js | 61 +++--- spec/frontend/ci_variable_list/utils_spec.js | 16 +- spec/graphql/types/work_item_type_spec.rb | 3 + spec/models/event_spec.rb | 24 +++ .../requests/users/namespace_callouts_spec.rb | 57 ++++++ .../dismiss_namespace_callout_service_spec.rb | 24 +++ .../features/variable_list_shared_examples.rb | 10 +- .../invalidate_domain_cache_worker_spec.rb | 10 + 106 files changed, 1018 insertions(+), 238 deletions(-) create mode 100644 app/assets/javascripts/ci_variable_list/components/ci_admin_variables.vue create mode 100644 app/assets/javascripts/ci_variable_list/graphql/fragments/ci_variable.fragment.graphql create mode 100644 app/assets/javascripts/ci_variable_list/graphql/mutations/admin_add_variable.mutation.graphql create mode 100644 app/assets/javascripts/ci_variable_list/graphql/mutations/admin_delete_variable.mutation.graphql create mode 100644 app/assets/javascripts/ci_variable_list/graphql/mutations/admin_update_variable.mutation.graphql create mode 100644 app/assets/javascripts/ci_variable_list/graphql/queries/variables.query.graphql create mode 100644 app/assets/javascripts/ci_variable_list/graphql/resolvers.js create mode 100644 app/controllers/users/namespace_callouts_controller.rb create mode 100644 app/services/users/dismiss_namespace_callout_service.rb delete mode 100644 doc/user/project/issues/img/related_issue_block_v12_8.png create mode 100644 doc/user/project/issues/img/related_issue_block_v15_3.png delete mode 100644 doc/user/project/issues/img/related_issues_add_v12_8.png create mode 100644 doc/user/project/issues/img/related_issues_add_v15_3.png delete mode 100644 doc/user/project/issues/img/related_issues_remove_v12_8.png create mode 100644 doc/user/project/issues/img/related_issues_remove_v15_3.png create mode 100644 spec/features/admin_variables_spec.rb create mode 100644 spec/frontend/ci_variable_list/components/ci_admin_variables_spec.js create mode 100644 spec/requests/users/namespace_callouts_spec.rb create mode 100644 spec/services/users/dismiss_namespace_callout_service_spec.rb 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 new file mode 100644 index 00000000000..83bad9eb518 --- /dev/null +++ b/app/assets/javascripts/ci_variable_list/components/ci_admin_variables.vue @@ -0,0 +1,101 @@ + + + diff --git a/app/assets/javascripts/ci_variable_list/components/ci_environments_dropdown.vue b/app/assets/javascripts/ci_variable_list/components/ci_environments_dropdown.vue index 8ee7132bb25..c9002edc1ab 100644 --- a/app/assets/javascripts/ci_variable_list/components/ci_environments_dropdown.vue +++ b/app/assets/javascripts/ci_variable_list/components/ci_environments_dropdown.vue @@ -33,9 +33,9 @@ export default { }, filteredEnvironments() { const lowerCasedSearchTerm = this.searchTerm.toLowerCase(); - return this.environments.filter((resultString) => - resultString.toLowerCase().includes(lowerCasedSearchTerm), - ); + return this.environments.filter((environment) => { + return environment.toLowerCase().includes(lowerCasedSearchTerm); + }); }, shouldRenderCreateButton() { return this.searchTerm && !this.environments.includes(this.searchTerm); diff --git a/app/assets/javascripts/ci_variable_list/components/ci_variable_modal.vue b/app/assets/javascripts/ci_variable_list/components/ci_variable_modal.vue index dc57f3fe4ce..5ba63de8c96 100644 --- a/app/assets/javascripts/ci_variable_list/components/ci_variable_modal.vue +++ b/app/assets/javascripts/ci_variable_list/components/ci_variable_modal.vue @@ -33,7 +33,7 @@ import { VARIABLE_ACTIONS, variableOptions, } from '../constants'; - +import { createJoinedEnvironments } from '../utils'; import CiEnvironmentsDropdown from './ci_environments_dropdown.vue'; import { awsTokens, awsTokenList } from './ci_variable_autocomplete_tokens'; @@ -98,9 +98,15 @@ export default { required: false, default: () => {}, }, + variables: { + type: Array, + required: false, + default: () => [], + }, }, data() { return { + newEnvironments: [], isTipDismissed: getCookie(AWS_TIP_DISMISSED_COOKIE_NAME) === 'true', typeOptions: variableOptions, validationErrorEventProperty: '', @@ -128,6 +134,9 @@ export default { isTipVisible() { return !this.isTipDismissed && AWS_TOKEN_CONSTANTS.includes(this.variable.key); }, + joinedEnvironments() { + return createJoinedEnvironments(this.variables, this.environments, this.newEnvironments); + }, maskedFeedback() { return this.displayMaskedError ? __('This variable can not be masked.') : ''; }, @@ -176,7 +185,7 @@ export default { this.$emit('add-variable', this.variable); }, createEnvironmentScope(env) { - this.$emit('create-environment-scope', env); + this.newEnvironments.push(env); }, deleteVariable() { this.$emit('delete-variable', this.variable); @@ -314,7 +323,7 @@ export default { v-if="areScopedVariablesAvailable" class="gl-w-full" :selected-environment-scope="variable.environmentScope" - :environments="environments" + :environments="joinedEnvironments" @select-environment="setEnvironmentScope" @create-environment-scope="createEnvironmentScope" /> diff --git a/app/assets/javascripts/ci_variable_list/components/ci_variable_settings.vue b/app/assets/javascripts/ci_variable_list/components/ci_variable_settings.vue index 29578c6f710..81e3a983ea3 100644 --- a/app/assets/javascripts/ci_variable_list/components/ci_variable_settings.vue +++ b/app/assets/javascripts/ci_variable_list/components/ci_variable_settings.vue @@ -1,6 +1,5 @@