summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Gemfile2
-rw-r--r--Gemfile.lock17
-rw-r--r--app/assets/javascripts/boards/components/board_column.vue17
-rw-r--r--app/assets/javascripts/boards/components/board_column_new.vue9
-rw-r--r--app/assets/javascripts/boards/components/board_content.vue9
-rw-r--r--app/assets/javascripts/boards/components/board_list_header.vue7
-rw-r--r--app/assets/javascripts/boards/components/board_list_header_new.vue7
-rw-r--r--app/assets/javascripts/boards/components/board_promotion_state.js1
-rw-r--r--app/assets/javascripts/boards/constants.js1
-rw-r--r--app/assets/javascripts/boards/ee_functions.js2
-rw-r--r--app/assets/javascripts/boards/index.js3
-rw-r--r--app/assets/javascripts/boards/stores/actions.js2
-rw-r--r--app/assets/stylesheets/page_bundles/boards.scss7
-rw-r--r--app/finders/ci/pipelines_for_merge_request_finder.rb29
-rw-r--r--app/graphql/mutations/container_repositories/destroy.rb13
-rw-r--r--app/graphql/mutations/container_repositories/destroy_base.rb18
-rw-r--r--app/graphql/mutations/container_repositories/destroy_tags.rb50
-rw-r--r--app/graphql/resolvers/user_discussions_count_resolver.rb25
-rw-r--r--app/graphql/resolvers/user_notes_count_resolver.rb25
-rw-r--r--app/graphql/types/issue_type.rb26
-rw-r--r--app/graphql/types/mutation_type.rb1
-rw-r--r--app/helpers/projects/alert_management_helper.rb2
-rw-r--r--app/models/ci/pipeline.rb8
-rw-r--r--app/models/concerns/enums/ci/pipeline.rb4
-rw-r--r--app/views/shared/boards/_show.html.haml1
-rw-r--r--changelogs/unreleased/10io-graphql-mutation-delete-container-tags.yml5
-rw-r--r--changelogs/unreleased/239177_scope_remediations_to_projects.yml6
-rw-r--r--changelogs/unreleased/260439-remove-boards-upsell-list.yml5
-rw-r--r--changelogs/unreleased/276491-follow-up-from-add-userdiscussionscount-to-issues-and-merge-reques.yml5
-rw-r--r--changelogs/unreleased/sh-update-fog-google.yml5
-rw-r--r--changelogs/unreleased/sy-ensure-alerts-viewable-if-present.yml6
-rw-r--r--config/feature_flags/development/ci_pipelines_for_merge_request_finder_new_cte.yml8
-rw-r--r--db/migrate/20201204085522_add_project_id_into_vulnerability_remediations.rb19
-rw-r--r--db/migrate/20201204090855_add_compound_index_to_vulnerability_remediations_table.rb28
-rw-r--r--db/schema_migrations/202012040855221
-rw-r--r--db/schema_migrations/202012040908551
-rw-r--r--db/structure.sql6
-rw-r--r--doc/administration/auth/ldap/google_secure_ldap.md2
-rw-r--r--doc/administration/geo/disaster_recovery/runbooks/planned_failover_multi_node.md2
-rw-r--r--doc/administration/geo/disaster_recovery/runbooks/planned_failover_single_node.md2
-rw-r--r--doc/administration/geo/replication/troubleshooting.md2
-rw-r--r--doc/administration/incoming_email.md2
-rw-r--r--doc/administration/issue_closing_pattern.md2
-rw-r--r--doc/administration/packages/container_registry.md4
-rw-r--r--doc/administration/reference_architectures/10k_users.md2
-rw-r--r--doc/administration/reference_architectures/25k_users.md2
-rw-r--r--doc/administration/reference_architectures/3k_users.md2
-rw-r--r--doc/administration/reference_architectures/50k_users.md2
-rw-r--r--doc/administration/reference_architectures/5k_users.md2
-rw-r--r--doc/administration/troubleshooting/postgresql.md2
-rw-r--r--doc/api/branches.md1
-rw-r--r--doc/api/graphql/reference/gitlab_schema.graphql41
-rw-r--r--doc/api/graphql/reference/gitlab_schema.json163
-rw-r--r--doc/api/graphql/reference/index.md10
-rw-r--r--doc/ci/README.md2
-rw-r--r--doc/ci/caching/index.md4
-rw-r--r--doc/ci/docker/using_docker_build.md2
-rw-r--r--doc/ci/introduction/index.md2
-rw-r--r--doc/ci/pipelines/index.md2
-rw-r--r--doc/ci/ssh_keys/README.md2
-rw-r--r--doc/ci/yaml/README.md4
-rw-r--r--doc/development/adding_service_component.md4
-rw-r--r--doc/development/agent/local.md60
-rw-r--r--doc/development/api_graphql_styleguide.md4
-rw-r--r--doc/development/distributed_tracing.md2
-rw-r--r--doc/development/documentation/index.md2
-rw-r--r--doc/development/documentation/site_architecture/release_process.md4
-rw-r--r--doc/development/documentation/workflow.md2
-rw-r--r--doc/development/fe_guide/performance.md2
-rw-r--r--doc/development/fe_guide/style/javascript.md2
-rw-r--r--doc/development/feature_flags/development.md4
-rw-r--r--doc/development/i18n/externalization.md2
-rw-r--r--doc/development/redis.md2
-rw-r--r--doc/development/shell_scripting_guide/index.md4
-rw-r--r--doc/development/testing_guide/end_to_end/beginners_guide.md2
-rw-r--r--doc/gitlab-basics/create-project.md2
-rw-r--r--doc/gitlab-basics/start-using-git.md4
-rw-r--r--doc/install/aws/index.md2
-rw-r--r--doc/integration/elasticsearch.md6
-rw-r--r--doc/integration/jira_development_panel.md2
-rw-r--r--doc/operations/incident_management/alert_integrations.md2
-rw-r--r--doc/operations/incident_management/alerts.md4
-rw-r--r--doc/operations/incident_management/incidents.md2
-rw-r--r--doc/push_rules/push_rules.md2
-rw-r--r--doc/ssh/README.md2
-rw-r--r--doc/subscriptions/gitlab_com/index.md6
-rw-r--r--doc/subscriptions/self_managed/index.md8
-rw-r--r--doc/topics/autodevops/customize.md10
-rw-r--r--doc/topics/autodevops/index.md4
-rw-r--r--doc/topics/autodevops/quick_start_guide.md4
-rw-r--r--doc/topics/autodevops/stages.md2
-rw-r--r--doc/topics/autodevops/upgrading_postgresql.md4
-rw-r--r--doc/topics/git/git_rebase.md2
-rw-r--r--doc/topics/web_application_firewall/quick_start_guide.md2
-rw-r--r--doc/user/admin_area/activating_deactivating_users.md2
-rw-r--r--doc/user/admin_area/broadcast_messages.md2
-rw-r--r--doc/user/clusters/applications.md2
-rw-r--r--doc/user/discussions/index.md2
-rw-r--r--doc/user/group/epics/index.md27
-rw-r--r--doc/user/group/index.md2
-rw-r--r--doc/user/group/saml_sso/scim_setup.md2
-rw-r--r--doc/user/markdown.md2
-rw-r--r--doc/user/packages/container_registry/index.md2
-rw-r--r--doc/user/packages/maven_repository/index.md2
-rw-r--r--doc/user/permissions.md2
-rw-r--r--doc/user/profile/account/two_factor_authentication.md2
-rw-r--r--doc/user/profile/index.md2
-rw-r--r--doc/user/project/clusters/add_remove_clusters.md2
-rw-r--r--doc/user/project/description_templates.md4
-rw-r--r--doc/user/project/issues/confidential_issues.md2
-rw-r--r--doc/user/project/issues/issue_data_and_actions.md8
-rw-r--r--doc/user/project/issues/related_issues.md2
-rw-r--r--doc/user/project/merge_requests/code_quality.md2
-rw-r--r--doc/user/project/merge_requests/creating_merge_requests.md2
-rw-r--r--doc/user/project/merge_requests/reviewing_and_managing_merge_requests.md2
-rw-r--r--doc/user/project/pages/lets_encrypt_for_gitlab_pages.md2
-rw-r--r--doc/user/project/repository/file_finder.md2
-rw-r--r--lib/gitlab/cycle_analytics/builds_event_helper.rb4
-rw-r--r--lib/gitlab/cycle_analytics/code_event_fetcher.rb4
-rw-r--r--lib/gitlab/cycle_analytics/issue_event_fetcher.rb4
-rw-r--r--lib/gitlab/cycle_analytics/permissions.rb4
-rw-r--r--lib/gitlab/cycle_analytics/plan_event_fetcher.rb4
-rw-r--r--lib/gitlab/cycle_analytics/production_event_fetcher.rb4
-rw-r--r--lib/gitlab/cycle_analytics/review_event_fetcher.rb4
-rw-r--r--lib/gitlab/cycle_analytics/updater.rb4
-rw-r--r--locale/gitlab.pot21
-rw-r--r--spec/features/alert_management/alert_management_list_spec.rb54
-rw-r--r--spec/finders/ci/pipelines_for_merge_request_finder_spec.rb18
-rw-r--r--spec/frontend/boards/components/board_content_spec.js3
-rw-r--r--spec/frontend/boards/components/board_list_header_new_spec.js2
-rw-r--r--spec/frontend/boards/components/board_list_header_spec.js2
-rw-r--r--spec/graphql/mutations/container_repositories/destroy_tags_spec.rb92
-rw-r--r--spec/graphql/resolvers/user_discussions_count_resolver_spec.rb54
-rw-r--r--spec/graphql/resolvers/user_notes_count_resolver_spec.rb54
-rw-r--r--spec/helpers/projects/alert_management_helper_spec.rb32
-rw-r--r--spec/lib/gitlab/import_export/all_models.yml1
-rw-r--r--spec/models/ci/pipeline_spec.rb41
-rw-r--r--spec/requests/api/graphql/mutations/container_repository/destroy_spec.rb2
-rw-r--r--spec/requests/api/graphql/mutations/container_repository/destroy_tags_spec.rb120
139 files changed, 1050 insertions, 365 deletions
diff --git a/Gemfile b/Gemfile
index 56878747cd8..1ee384bfb91 100644
--- a/Gemfile
+++ b/Gemfile
@@ -119,7 +119,7 @@ gem 'fog-aws', '~> 3.7'
# Locked until fog-google resolves https://github.com/fog/fog-google/issues/421.
# Also see config/initializers/fog_core_patch.rb.
gem 'fog-core', '= 2.1.0'
-gem 'fog-google', '~> 1.11'
+gem 'fog-google', '~> 1.12'
gem 'fog-local', '~> 0.6'
gem 'fog-openstack', '~> 1.0'
gem 'fog-rackspace', '~> 0.1.1'
diff --git a/Gemfile.lock b/Gemfile.lock
index 0ef0c03f08c..d66929d16af 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -222,7 +222,7 @@ GEM
debugger-ruby_core_source (1.3.8)
deckar01-task_list (2.3.1)
html-pipeline
- declarative (0.0.10)
+ declarative (0.0.20)
declarative-option (0.1.0)
default_value_for (3.3.0)
activerecord (>= 3.2.0, < 6.1)
@@ -373,11 +373,11 @@ GEM
excon (~> 0.58)
formatador (~> 0.2)
mime-types
- fog-google (1.11.0)
+ fog-google (1.12.0)
fog-core (<= 2.1.0)
fog-json (~> 1.2)
fog-xml (~> 0.1.0)
- google-api-client (>= 0.32, < 0.34)
+ google-api-client (>= 0.44.2, < 0.51)
google-cloud-env (~> 1.2)
fog-json (1.2.0)
fog-core
@@ -473,20 +473,21 @@ GEM
actionpack (>= 3.0)
multi_json
request_store (>= 1.0)
- google-api-client (0.33.2)
+ google-api-client (0.50.0)
addressable (~> 2.5, >= 2.5.1)
googleauth (~> 0.9)
httpclient (>= 2.8.1, < 3.0)
mini_mime (~> 1.0)
representable (~> 3.0)
retriable (>= 2.0, < 4.0)
+ rexml
signet (~> 0.12)
google-cloud-env (1.4.0)
faraday (>= 0.17.3, < 2.0)
google-protobuf (3.12.4)
googleapis-common-protos-types (1.0.5)
google-protobuf (~> 3.11)
- googleauth (0.12.0)
+ googleauth (0.14.0)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
@@ -696,7 +697,7 @@ GEM
marginalia (1.9.0)
actionpack (>= 2.3)
activerecord (>= 2.3)
- memoist (0.16.0)
+ memoist (0.16.2)
memoizable (0.4.2)
thread_safe (~> 0.3, >= 0.3.1)
memory_profiler (0.9.14)
@@ -837,7 +838,7 @@ GEM
org-ruby (0.9.12)
rubypants (~> 0.2)
orm_adapter (0.5.0)
- os (1.0.0)
+ os (1.1.1)
parallel (1.19.2)
parser (2.7.2.0)
ast (~> 2.4.1)
@@ -1338,7 +1339,7 @@ DEPENDENCIES
fog-aliyun (~> 0.3)
fog-aws (~> 3.7)
fog-core (= 2.1.0)
- fog-google (~> 1.11)
+ fog-google (~> 1.12)
fog-local (~> 0.6)
fog-openstack (~> 1.0)
fog-rackspace (~> 0.1.1)
diff --git a/app/assets/javascripts/boards/components/board_column.vue b/app/assets/javascripts/boards/components/board_column.vue
index cb93340bcf8..753e6941c43 100644
--- a/app/assets/javascripts/boards/components/board_column.vue
+++ b/app/assets/javascripts/boards/components/board_column.vue
@@ -2,15 +2,12 @@
// This component is being replaced in favor of './board_column_new.vue' for GraphQL boards
import Sortable from 'sortablejs';
import BoardListHeader from 'ee_else_ce/boards/components/board_list_header.vue';
-import EmptyComponent from '~/vue_shared/components/empty_component';
import BoardList from './board_list.vue';
import boardsStore from '../stores/boards_store';
import { getBoardSortableDefaultOptions, sortableEnd } from '../mixins/sortable_default_options';
-import { ListType } from '../constants';
export default {
components: {
- BoardPromotionState: EmptyComponent,
BoardListHeader,
BoardList,
},
@@ -42,9 +39,6 @@ export default {
};
},
computed: {
- showBoardListAndBoardInfo() {
- return this.list.type !== ListType.promotion;
- },
listIssues() {
return this.list.issues;
},
@@ -105,16 +99,7 @@ export default {
class="board-inner gl-display-flex gl-flex-direction-column gl-relative gl-h-full gl-rounded-base"
>
<board-list-header :can-admin-list="canAdminList" :list="list" :disabled="disabled" />
- <board-list
- v-if="showBoardListAndBoardInfo"
- ref="board-list"
- :disabled="disabled"
- :issues="listIssues"
- :list="list"
- />
-
- <!-- Will be only available in EE -->
- <board-promotion-state v-if="list.id === 'promotion'" />
+ <board-list ref="board-list" :disabled="disabled" :issues="listIssues" :list="list" />
</div>
</div>
</template>
diff --git a/app/assets/javascripts/boards/components/board_column_new.vue b/app/assets/javascripts/boards/components/board_column_new.vue
index 7162423846b..8d01cbd9234 100644
--- a/app/assets/javascripts/boards/components/board_column_new.vue
+++ b/app/assets/javascripts/boards/components/board_column_new.vue
@@ -1,13 +1,11 @@
<script>
import { mapGetters, mapActions, mapState } from 'vuex';
import BoardListHeader from 'ee_else_ce/boards/components/board_list_header_new.vue';
-import BoardPromotionState from 'ee_else_ce/boards/components/board_promotion_state';
import BoardList from './board_list_new.vue';
import { ListType } from '../constants';
export default {
components: {
- BoardPromotionState,
BoardListHeader,
BoardList,
},
@@ -35,9 +33,6 @@ export default {
computed: {
...mapState(['filterParams']),
...mapGetters(['getIssuesByList']),
- showBoardListAndBoardInfo() {
- return this.list.type !== ListType.promotion;
- },
listIssues() {
return this.getIssuesByList(this.list.id);
},
@@ -80,16 +75,12 @@ export default {
>
<board-list-header :can-admin-list="canAdminList" :list="list" :disabled="disabled" />
<board-list
- v-if="showBoardListAndBoardInfo"
ref="board-list"
:disabled="disabled"
:issues="listIssues"
:list="list"
:can-admin-list="canAdminList"
/>
-
- <!-- Will be only available in EE -->
- <board-promotion-state v-if="list.id === 'promotion'" />
</div>
</div>
</template>
diff --git a/app/assets/javascripts/boards/components/board_content.vue b/app/assets/javascripts/boards/components/board_content.vue
index 0e983a10712..fb8f3014869 100644
--- a/app/assets/javascripts/boards/components/board_content.vue
+++ b/app/assets/javascripts/boards/components/board_content.vue
@@ -3,7 +3,7 @@ import Draggable from 'vuedraggable';
import { mapState, mapGetters, mapActions } from 'vuex';
import { sortBy } from 'lodash';
import { GlAlert } from '@gitlab/ui';
-import BoardColumn from 'ee_else_ce/boards/components/board_column.vue';
+import BoardColumn from './board_column.vue';
import BoardColumnNew from './board_column_new.vue';
import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import defaultSortableConfig from '~/sortable/sortable_config';
@@ -59,13 +59,8 @@ export default {
return this.canDragColumns ? options : {};
},
},
- mounted() {
- if (this.glFeatures.graphqlBoardLists) {
- this.showPromotionList();
- }
- },
methods: {
- ...mapActions(['moveList', 'showPromotionList']),
+ ...mapActions(['moveList']),
handleDragOnStart() {
sortableStart();
},
diff --git a/app/assets/javascripts/boards/components/board_list_header.vue b/app/assets/javascripts/boards/components/board_list_header.vue
index 722bd20f227..3e37fc0a1ac 100644
--- a/app/assets/javascripts/boards/components/board_list_header.vue
+++ b/app/assets/javascripts/boards/components/board_list_header.vue
@@ -73,10 +73,7 @@ export default {
},
showListHeaderButton() {
return (
- !this.disabled &&
- this.listType !== ListType.closed &&
- this.listType !== ListType.blank &&
- this.listType !== ListType.promotion
+ !this.disabled && this.listType !== ListType.closed && this.listType !== ListType.blank
);
},
showMilestoneListDetails() {
@@ -110,7 +107,7 @@ export default {
);
},
showBoardListAndBoardInfo() {
- return this.listType !== ListType.blank && this.listType !== ListType.promotion;
+ return this.listType !== ListType.blank;
},
uniqueKey() {
// eslint-disable-next-line @gitlab/require-i18n-strings
diff --git a/app/assets/javascripts/boards/components/board_list_header_new.vue b/app/assets/javascripts/boards/components/board_list_header_new.vue
index d74b5115214..95812dcbaac 100644
--- a/app/assets/javascripts/boards/components/board_list_header_new.vue
+++ b/app/assets/javascripts/boards/components/board_list_header_new.vue
@@ -76,10 +76,7 @@ export default {
},
showListHeaderButton() {
return (
- !this.disabled &&
- this.listType !== ListType.closed &&
- this.listType !== ListType.blank &&
- this.listType !== ListType.promotion
+ !this.disabled && this.listType !== ListType.closed && this.listType !== ListType.blank
);
},
showMilestoneListDetails() {
@@ -115,7 +112,7 @@ export default {
);
},
showBoardListAndBoardInfo() {
- return this.listType !== ListType.blank && this.listType !== ListType.promotion;
+ return this.listType !== ListType.blank;
},
uniqueKey() {
// eslint-disable-next-line @gitlab/require-i18n-strings
diff --git a/app/assets/javascripts/boards/components/board_promotion_state.js b/app/assets/javascripts/boards/components/board_promotion_state.js
deleted file mode 100644
index ff8b4c56321..00000000000
--- a/app/assets/javascripts/boards/components/board_promotion_state.js
+++ /dev/null
@@ -1 +0,0 @@
-export default {};
diff --git a/app/assets/javascripts/boards/constants.js b/app/assets/javascripts/boards/constants.js
index 49cb560594c..3256992d915 100644
--- a/app/assets/javascripts/boards/constants.js
+++ b/app/assets/javascripts/boards/constants.js
@@ -9,7 +9,6 @@ export const ListType = {
backlog: 'backlog',
closed: 'closed',
label: 'label',
- promotion: 'promotion',
blank: 'blank',
};
diff --git a/app/assets/javascripts/boards/ee_functions.js b/app/assets/javascripts/boards/ee_functions.js
index 419a640d5c5..b6b34556663 100644
--- a/app/assets/javascripts/boards/ee_functions.js
+++ b/app/assets/javascripts/boards/ee_functions.js
@@ -1,5 +1,3 @@
-export const setPromotionState = () => {};
-
export const setWeightFetchingState = () => {};
export const setEpicFetchingState = () => {};
diff --git a/app/assets/javascripts/boards/index.js b/app/assets/javascripts/boards/index.js
index 86d80d88737..159bde4e42c 100644
--- a/app/assets/javascripts/boards/index.js
+++ b/app/assets/javascripts/boards/index.js
@@ -9,7 +9,6 @@ import boardConfigToggle from 'ee_else_ce/boards/config_toggle';
import toggleLabels from 'ee_else_ce/boards/toggle_labels';
import toggleEpicsSwimlanes from 'ee_else_ce/boards/toggle_epics_swimlanes';
import {
- setPromotionState,
setWeightFetchingState,
setEpicFetchingState,
getMilestoneTitle,
@@ -131,7 +130,6 @@ export default () => {
...endpoints,
boardType: this.parent,
disabled: this.disabled,
- showPromotion: parseBoolean($boardApp.getAttribute('data-show-promotion')),
});
boardsStore.setEndpoints(endpoints);
boardsStore.rootPath = this.boardsEndpoint;
@@ -184,7 +182,6 @@ export default () => {
.then(lists => {
lists.forEach(list => boardsStore.addList(list));
boardsStore.addBlankState();
- setPromotionState(boardsStore);
this.loading = false;
})
.catch(() => {
diff --git a/app/assets/javascripts/boards/stores/actions.js b/app/assets/javascripts/boards/stores/actions.js
index a7d8144f8af..ef018b0045a 100644
--- a/app/assets/javascripts/boards/stores/actions.js
+++ b/app/assets/javascripts/boards/stores/actions.js
@@ -126,8 +126,6 @@ export default {
);
},
- showPromotionList: () => {},
-
fetchLabels: ({ state, commit }, searchTerm) => {
const { endpoints, boardType } = state;
const { fullPath } = endpoints;
diff --git a/app/assets/stylesheets/page_bundles/boards.scss b/app/assets/stylesheets/page_bundles/boards.scss
index a88ca474bb7..3d1ae3519a9 100644
--- a/app/assets/stylesheets/page_bundles/boards.scss
+++ b/app/assets/stylesheets/page_bundles/boards.scss
@@ -172,13 +172,6 @@
}
}
-.board-promotion-state {
- background-color: var(--white, $white);
- flex: 1;
- overflow-y: auto;
- overflow-x: hidden;
-}
-
.board-list-component {
min-height: 0; // firefox fix
}
diff --git a/app/finders/ci/pipelines_for_merge_request_finder.rb b/app/finders/ci/pipelines_for_merge_request_finder.rb
index 93d139652b9..da8dfc2579a 100644
--- a/app/finders/ci/pipelines_for_merge_request_finder.rb
+++ b/app/finders/ci/pipelines_for_merge_request_finder.rb
@@ -5,8 +5,6 @@ module Ci
class PipelinesForMergeRequestFinder
include Gitlab::Utils::StrongMemoize
- EVENT = 'merge_request_event'
-
def initialize(merge_request, current_user)
@merge_request = merge_request
@current_user = current_user
@@ -36,7 +34,11 @@ module Ci
pipelines =
if merge_request.persisted?
- pipelines_using_cte
+ if Feature.enabled?(:ci_pipelines_for_merge_request_finder_new_cte, target_project)
+ pipelines_using_cte
+ else
+ pipelines_using_legacy_cte
+ end
else
triggered_for_branch.for_sha(commit_shas)
end
@@ -47,7 +49,7 @@ module Ci
private
- def pipelines_using_cte
+ def pipelines_using_legacy_cte
cte = Gitlab::SQL::CTE.new(:shas, merge_request.all_commits.select(:sha))
source_sha_join = cte.table[:sha].eq(Ci::Pipeline.arel_table[:source_sha])
@@ -59,6 +61,16 @@ module Ci
.from_union([merged_result_pipelines, detached_merge_request_pipelines, pipelines_for_branch])
end
+ def pipelines_using_cte
+ cte = Gitlab::SQL::CTE.new(:shas, merge_request.all_commits.select(:sha))
+
+ pipelines_for_merge_requests = triggered_by_merge_request
+ pipelines_for_branch = filter_by_sha(triggered_for_branch, cte)
+
+ Ci::Pipeline.with(cte.to_arel) # rubocop: disable CodeReuse/ActiveRecord
+ .from_union([pipelines_for_merge_requests, pipelines_for_branch])
+ end
+
def filter_by_sha(pipelines, cte)
hex = Arel::Nodes::SqlLiteral.new("'hex'")
string_sha = Arel::Nodes::NamedFunction.new('encode', [cte.table[:sha], hex])
@@ -84,14 +96,7 @@ module Ci
end
def triggered_for_branch
- source_project.ci_pipelines
- .where(source: branch_pipeline_sources, ref: source_branch, tag: false) # rubocop: disable CodeReuse/ActiveRecord
- end
-
- def branch_pipeline_sources
- strong_memoize(:branch_pipeline_sources) do
- Ci::Pipeline.sources.reject { |source| source == EVENT }.values
- end
+ source_project.all_pipelines.ci_branch_sources.for_branch(source_branch)
end
def sort(pipelines)
diff --git a/app/graphql/mutations/container_repositories/destroy.rb b/app/graphql/mutations/container_repositories/destroy.rb
index 8312193147f..90fba66e7b3 100644
--- a/app/graphql/mutations/container_repositories/destroy.rb
+++ b/app/graphql/mutations/container_repositories/destroy.rb
@@ -2,9 +2,7 @@
module Mutations
module ContainerRepositories
- class Destroy < Mutations::BaseMutation
- include ::Mutations::PackageEventable
-
+ class Destroy < ::Mutations::ContainerRepositories::DestroyBase
graphql_name 'DestroyContainerRepository'
authorize :destroy_container_image
@@ -31,15 +29,6 @@ module Mutations
errors: []
}
end
-
- private
-
- def find_object(id:)
- # TODO: remove this line when the compatibility layer is removed
- # See: https://gitlab.com/gitlab-org/gitlab/-/issues/257883
- id = ::Types::GlobalIDType[::ContainerRepository].coerce_isolated_input(id)
- GitlabSchema.find_by_gid(id)
- end
end
end
end
diff --git a/app/graphql/mutations/container_repositories/destroy_base.rb b/app/graphql/mutations/container_repositories/destroy_base.rb
new file mode 100644
index 00000000000..ddaa6c52121
--- /dev/null
+++ b/app/graphql/mutations/container_repositories/destroy_base.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+module Mutations
+ module ContainerRepositories
+ class DestroyBase < Mutations::BaseMutation
+ include ::Mutations::PackageEventable
+
+ private
+
+ def find_object(id:)
+ # TODO: remove this line when the compatibility layer is removed
+ # See: https://gitlab.com/gitlab-org/gitlab/-/issues/257883
+ id = ::Types::GlobalIDType[::ContainerRepository].coerce_isolated_input(id)
+ GitlabSchema.find_by_gid(id)
+ end
+ end
+ end
+end
diff --git a/app/graphql/mutations/container_repositories/destroy_tags.rb b/app/graphql/mutations/container_repositories/destroy_tags.rb
new file mode 100644
index 00000000000..ca6a67867c3
--- /dev/null
+++ b/app/graphql/mutations/container_repositories/destroy_tags.rb
@@ -0,0 +1,50 @@
+# frozen_string_literal: true
+
+module Mutations
+ module ContainerRepositories
+ class DestroyTags < ::Mutations::ContainerRepositories::DestroyBase
+ LIMIT = 20.freeze
+
+ TOO_MANY_TAGS_ERROR_MESSAGE = "Number of tags is greater than #{LIMIT}"
+
+ graphql_name 'DestroyContainerRepositoryTags'
+
+ authorize :destroy_container_image
+
+ argument :id,
+ ::Types::GlobalIDType[::ContainerRepository],
+ required: true,
+ description: 'ID of the container repository.'
+
+ argument :tag_names,
+ [GraphQL::STRING_TYPE],
+ required: true,
+ description: "Container repository tag(s) to delete. Total number can't be greater than #{LIMIT}",
+ prepare: ->(tag_names, _) do
+ raise Gitlab::Graphql::Errors::ArgumentError, TOO_MANY_TAGS_ERROR_MESSAGE if tag_names.size > LIMIT
+
+ tag_names
+ end
+
+ field :deleted_tag_names,
+ [GraphQL::STRING_TYPE],
+ description: 'Deleted container repository tags',
+ null: false
+
+ def resolve(id:, tag_names:)
+ container_repository = authorized_find!(id: id)
+
+ result = ::Projects::ContainerRepository::DeleteTagsService
+ .new(container_repository.project, current_user, tags: tag_names)
+ .execute(container_repository)
+
+ track_event(:delete_tag_bulk, :tag) if result[:status] == :success
+
+ {
+ errors: Array(result[:message]),
+ deleted_tag_names: result[:deleted] || []
+ }
+ end
+ end
+ end
+end
diff --git a/app/graphql/resolvers/user_discussions_count_resolver.rb b/app/graphql/resolvers/user_discussions_count_resolver.rb
new file mode 100644
index 00000000000..201f17d2713
--- /dev/null
+++ b/app/graphql/resolvers/user_discussions_count_resolver.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+
+module Resolvers
+ class UserDiscussionsCountResolver < BaseResolver
+ include Gitlab::Graphql::Authorize::AuthorizeResource
+
+ type GraphQL::INT_TYPE, null: true
+
+ def resolve
+ authorize!(object)
+
+ BatchLoader::GraphQL.for(object.id).batch(key: :issue_user_discussions_count) do |ids, loader, args|
+ counts = Note.count_for_collection(ids, 'Issue', 'COUNT(DISTINCT discussion_id) as count').index_by(&:noteable_id)
+
+ ids.each do |id|
+ loader.call(id, counts[id]&.count || 0)
+ end
+ end
+ end
+
+ def authorized_resource?(object)
+ context[:current_user].present? && Ability.allowed?(context[:current_user], :read_issue, object)
+ end
+ end
+end
diff --git a/app/graphql/resolvers/user_notes_count_resolver.rb b/app/graphql/resolvers/user_notes_count_resolver.rb
new file mode 100644
index 00000000000..ade03d28d81
--- /dev/null
+++ b/app/graphql/resolvers/user_notes_count_resolver.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+
+module Resolvers
+ class UserNotesCountResolver < BaseResolver
+ include Gitlab::Graphql::Authorize::AuthorizeResource
+
+ type GraphQL::INT_TYPE, null: true
+
+ def resolve
+ authorize!(object)
+
+ BatchLoader::GraphQL.for(object.id).batch(key: :issue_user_notes_count) do |ids, loader, args|
+ counts = Note.count_for_collection(ids, 'Issue').index_by(&:noteable_id)
+
+ ids.each do |id|
+ loader.call(id, counts[id]&.count || 0)
+ end
+ end
+ end
+
+ def authorized_resource?(object)
+ context[:current_user].present? && Ability.allowed?(context[:current_user], :read_issue, object)
+ end
+ end
+end
diff --git a/app/graphql/types/issue_type.rb b/app/graphql/types/issue_type.rb
index 49c84f75e1a..83b8a834801 100644
--- a/app/graphql/types/issue_type.rb
+++ b/app/graphql/types/issue_type.rb
@@ -61,9 +61,11 @@ module Types
field :downvotes, GraphQL::INT_TYPE, null: false,
description: 'Number of downvotes the issue has received'
field :user_notes_count, GraphQL::INT_TYPE, null: false,
- description: 'Number of user notes of the issue'
+ description: 'Number of user notes of the issue',
+ resolver: Resolvers::UserNotesCountResolver
field :user_discussions_count, GraphQL::INT_TYPE, null: false,
- description: 'Number of user discussions in the issue'
+ description: 'Number of user discussions in the issue',
+ resolver: Resolvers::UserDiscussionsCountResolver
field :web_path, GraphQL::STRING_TYPE, null: false, method: :issue_path,
description: 'Web path of the issue'
field :web_url, GraphQL::STRING_TYPE, null: false,
@@ -119,26 +121,6 @@ module Types
field :moved_to, Types::IssueType, null: true,
description: 'Updated Issue after it got moved to another project'
- def user_notes_count
- BatchLoader::GraphQL.for(object.id).batch(key: :issue_user_notes_count) do |ids, loader, args|
- counts = Note.count_for_collection(ids, 'Issue').index_by(&:noteable_id)
-
- ids.each do |id|
- loader.call(id, counts[id]&.count || 0)
- end
- end
- end
-
- def user_discussions_count
- BatchLoader::GraphQL.for(object.id).batch(key: :issue_user_discussions_count) do |ids, loader, args|
- counts = Note.count_for_collection(ids, 'Issue', 'COUNT(DISTINCT discussion_id) as count').index_by(&:noteable_id)
-
- ids.each do |id|
- loader.call(id, counts[id]&.count || 0)
- end
- end
- end
-
def author
Gitlab::Graphql::Loaders::BatchModelLoader.new(User, object.author_id).find
end
diff --git a/app/graphql/types/mutation_type.rb b/app/graphql/types/mutation_type.rb
index 4c9070e4d5a..9eea81c9d3e 100644
--- a/app/graphql/types/mutation_type.rb
+++ b/app/graphql/types/mutation_type.rb
@@ -87,6 +87,7 @@ module Types
mount_mutation Mutations::DesignManagement::Move
mount_mutation Mutations::ContainerExpirationPolicies::Update
mount_mutation Mutations::ContainerRepositories::Destroy
+ mount_mutation Mutations::ContainerRepositories::DestroyTags
mount_mutation Mutations::Ci::PipelineCancel
mount_mutation Mutations::Ci::PipelineDestroy
mount_mutation Mutations::Ci::PipelineRetry
diff --git a/app/helpers/projects/alert_management_helper.rb b/app/helpers/projects/alert_management_helper.rb
index c6ad6bfac01..997551d9659 100644
--- a/app/helpers/projects/alert_management_helper.rb
+++ b/app/helpers/projects/alert_management_helper.rb
@@ -28,7 +28,7 @@ module Projects::AlertManagementHelper
def alert_management_enabled?(project)
!!(
- project.alerts_service_activated? ||
+ project.alert_management_alerts.any? ||
project.prometheus_service_active? ||
AlertManagement::HttpIntegrationsFinder.new(project, active: true).execute.any?
)
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index 34de90f77cb..77cca481647 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -277,12 +277,14 @@ module Ci
scope :internal, -> { where(source: internal_sources) }
scope :no_child, -> { where.not(source: :parent_pipeline) }
scope :ci_sources, -> { where(source: Enums::Ci::Pipeline.ci_sources.values) }
+ scope :ci_branch_sources, -> { where(source: Enums::Ci::Pipeline.ci_branch_sources.values) }
scope :ci_and_parent_sources, -> { where(source: Enums::Ci::Pipeline.ci_and_parent_sources.values) }
scope :for_user, -> (user) { where(user: user) }
scope :for_sha, -> (sha) { where(sha: sha) }
scope :for_source_sha, -> (source_sha) { where(source_sha: source_sha) }
scope :for_sha_or_source_sha, -> (sha) { for_sha(sha).or(for_source_sha(sha)) }
scope :for_ref, -> (ref) { where(ref: ref) }
+ scope :for_branch, -> (branch) { for_ref(branch).where(tag: false) }
scope :for_id, -> (id) { where(id: id) }
scope :for_iid, -> (iid) { where(iid: iid) }
scope :for_project, -> (project) { where(project: project) }
@@ -310,9 +312,9 @@ module Ci
# In general, please use `Ci::PipelinesForMergeRequestFinder` instead,
# for checking permission of the actor.
scope :triggered_by_merge_request, -> (merge_request) do
- ci_sources.where(source: :merge_request_event,
- merge_request: merge_request,
- project: [merge_request.source_project, merge_request.target_project])
+ where(source: :merge_request_event,
+ merge_request: merge_request,
+ project: [merge_request.source_project, merge_request.target_project])
end
# Returns the pipelines in descending order (= newest first), optionally
diff --git a/app/models/concerns/enums/ci/pipeline.rb b/app/models/concerns/enums/ci/pipeline.rb
index 28eb4c11746..a5706af0e52 100644
--- a/app/models/concerns/enums/ci/pipeline.rb
+++ b/app/models/concerns/enums/ci/pipeline.rb
@@ -54,6 +54,10 @@ module Enums
sources.except(*dangling_sources.keys)
end
+ def self.ci_branch_sources
+ ci_sources.except(:merge_request_event)
+ end
+
def self.ci_and_parent_sources
ci_sources.merge(sources.slice(:parent_pipeline))
end
diff --git a/app/views/shared/boards/_show.html.haml b/app/views/shared/boards/_show.html.haml
index 74c36af56fa..e4222d8a4fe 100644
--- a/app/views/shared/boards/_show.html.haml
+++ b/app/views/shared/boards/_show.html.haml
@@ -13,7 +13,6 @@
- content_for :page_specific_javascripts do
%script#js-board-modal-filter{ type: "text/x-template" }= render "shared/issuable/search_bar", type: :boards_modal, show_sorting_dropdown: false
- %script#js-board-promotion{ type: "text/x-template" }= render_if_exists "shared/promotions/promote_issue_board"
= render 'shared/issuable/search_bar', type: :boards, board: board
#board-app.boards-app.position-relative{ "v-cloak" => "true", data: board_data, ":class" => "{ 'is-compact': detailIssueVisible }" }
diff --git a/changelogs/unreleased/10io-graphql-mutation-delete-container-tags.yml b/changelogs/unreleased/10io-graphql-mutation-delete-container-tags.yml
new file mode 100644
index 00000000000..472ab4e1e4b
--- /dev/null
+++ b/changelogs/unreleased/10io-graphql-mutation-delete-container-tags.yml
@@ -0,0 +1,5 @@
+---
+title: Add GraphQL API to delete container repository tags
+merge_request: 48617
+author:
+type: added
diff --git a/changelogs/unreleased/239177_scope_remediations_to_projects.yml b/changelogs/unreleased/239177_scope_remediations_to_projects.yml
new file mode 100644
index 00000000000..877f96b79db
--- /dev/null
+++ b/changelogs/unreleased/239177_scope_remediations_to_projects.yml
@@ -0,0 +1,6 @@
+---
+title: Add `project_id` column into the `vulnerability_remediations` table to scope
+ the records with projects
+merge_request: 49219
+author:
+type: added
diff --git a/changelogs/unreleased/260439-remove-boards-upsell-list.yml b/changelogs/unreleased/260439-remove-boards-upsell-list.yml
new file mode 100644
index 00000000000..6dad6715dde
--- /dev/null
+++ b/changelogs/unreleased/260439-remove-boards-upsell-list.yml
@@ -0,0 +1,5 @@
+---
+title: Removed boards promotion
+merge_request: 47972
+author:
+type: changed
diff --git a/changelogs/unreleased/276491-follow-up-from-add-userdiscussionscount-to-issues-and-merge-reques.yml b/changelogs/unreleased/276491-follow-up-from-add-userdiscussionscount-to-issues-and-merge-reques.yml
new file mode 100644
index 00000000000..03c49383f5b
--- /dev/null
+++ b/changelogs/unreleased/276491-follow-up-from-add-userdiscussionscount-to-issues-and-merge-reques.yml
@@ -0,0 +1,5 @@
+---
+title: Move IssueType notes and discussions count logic to resolvers
+merge_request: 49160
+author:
+type: changed
diff --git a/changelogs/unreleased/sh-update-fog-google.yml b/changelogs/unreleased/sh-update-fog-google.yml
new file mode 100644
index 00000000000..e18d512d964
--- /dev/null
+++ b/changelogs/unreleased/sh-update-fog-google.yml
@@ -0,0 +1,5 @@
+---
+title: Update fog-google to v1.12
+merge_request: 49196
+author:
+type: fixed
diff --git a/changelogs/unreleased/sy-ensure-alerts-viewable-if-present.yml b/changelogs/unreleased/sy-ensure-alerts-viewable-if-present.yml
new file mode 100644
index 00000000000..81f49fbf841
--- /dev/null
+++ b/changelogs/unreleased/sy-ensure-alerts-viewable-if-present.yml
@@ -0,0 +1,6 @@
+---
+title: Allow alert list to be visible when alerts exist, even if alerting integrations
+ are disabled
+merge_request: 49257
+author:
+type: changed
diff --git a/config/feature_flags/development/ci_pipelines_for_merge_request_finder_new_cte.yml b/config/feature_flags/development/ci_pipelines_for_merge_request_finder_new_cte.yml
new file mode 100644
index 00000000000..84d45d51c78
--- /dev/null
+++ b/config/feature_flags/development/ci_pipelines_for_merge_request_finder_new_cte.yml
@@ -0,0 +1,8 @@
+---
+name: ci_pipelines_for_merge_request_finder_new_cte
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/49083
+rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/291006
+milestone: '13.7'
+type: development
+group: group::continuous integration
+default_enabled: false
diff --git a/db/migrate/20201204085522_add_project_id_into_vulnerability_remediations.rb b/db/migrate/20201204085522_add_project_id_into_vulnerability_remediations.rb
new file mode 100644
index 00000000000..6a136ab0389
--- /dev/null
+++ b/db/migrate/20201204085522_add_project_id_into_vulnerability_remediations.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddProjectIdIntoVulnerabilityRemediations < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ def up
+ connection.execute('DELETE FROM vulnerability_remediations')
+
+ add_column :vulnerability_remediations, :project_id, :bigint, null: false # rubocop:disable Rails/NotNullColumn
+ end
+
+ def down
+ with_lock_retries do
+ remove_column :vulnerability_remediations, :project_id
+ end
+ end
+end
diff --git a/db/migrate/20201204090855_add_compound_index_to_vulnerability_remediations_table.rb b/db/migrate/20201204090855_add_compound_index_to_vulnerability_remediations_table.rb
new file mode 100644
index 00000000000..0b4b6e552aa
--- /dev/null
+++ b/db/migrate/20201204090855_add_compound_index_to_vulnerability_remediations_table.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+class AddCompoundIndexToVulnerabilityRemediationsTable < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+ NEW_INDEX_NAME = 'index_vulnerability_remediations_on_project_id_and_checksum'
+ OLD_INDEX_NAME = 'index_vulnerability_remediations_on_checksum'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :vulnerability_remediations, [:project_id, :checksum], unique: true, name: NEW_INDEX_NAME
+ add_concurrent_foreign_key :vulnerability_remediations, :projects, column: :project_id
+
+ remove_concurrent_index_by_name :vulnerability_remediations, OLD_INDEX_NAME
+ end
+
+ def down
+ add_concurrent_index :vulnerability_remediations, :checksum, unique: true, name: OLD_INDEX_NAME
+
+ remove_concurrent_index_by_name :vulnerability_remediations, NEW_INDEX_NAME
+
+ with_lock_retries do
+ remove_foreign_key_if_exists :vulnerability_remediations, column: :project_id
+ end
+ end
+end
diff --git a/db/schema_migrations/20201204085522 b/db/schema_migrations/20201204085522
new file mode 100644
index 00000000000..21009a5d34a
--- /dev/null
+++ b/db/schema_migrations/20201204085522
@@ -0,0 +1 @@
+a1d8228731066fb6dfe436b4d8d034353421d1f45f3896e963f3c7f15fb09fbc \ No newline at end of file
diff --git a/db/schema_migrations/20201204090855 b/db/schema_migrations/20201204090855
new file mode 100644
index 00000000000..7e6bb71d977
--- /dev/null
+++ b/db/schema_migrations/20201204090855
@@ -0,0 +1 @@
+01712e32d95578fe701738529abfa0e051ef68ed646f7a9c7f775f8a8d108578 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 301597953ab..c84f5eaec80 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -17584,6 +17584,7 @@ CREATE TABLE vulnerability_remediations (
summary text NOT NULL,
file text NOT NULL,
checksum bytea NOT NULL,
+ project_id bigint NOT NULL,
CONSTRAINT check_ac0ccabff3 CHECK ((char_length(summary) <= 200)),
CONSTRAINT check_fe3325e3ba CHECK ((char_length(file) <= 255))
);
@@ -22669,7 +22670,7 @@ CREATE UNIQUE INDEX index_vulnerability_occurrences_on_uuid ON vulnerability_occ
CREATE INDEX index_vulnerability_occurrences_on_vulnerability_id ON vulnerability_occurrences USING btree (vulnerability_id);
-CREATE UNIQUE INDEX index_vulnerability_remediations_on_checksum ON vulnerability_remediations USING btree (checksum);
+CREATE UNIQUE INDEX index_vulnerability_remediations_on_project_id_and_checksum ON vulnerability_remediations USING btree (project_id, checksum);
CREATE UNIQUE INDEX index_vulnerability_scanners_on_project_id_and_external_id ON vulnerability_scanners USING btree (project_id, external_id);
@@ -23698,6 +23699,9 @@ ALTER TABLE ONLY ci_stages
ALTER TABLE ONLY system_note_metadata
ADD CONSTRAINT fk_fbd87415c9 FOREIGN KEY (description_version_id) REFERENCES description_versions(id) ON DELETE SET NULL;
+ALTER TABLE ONLY vulnerability_remediations
+ ADD CONSTRAINT fk_fc61a535a0 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY merge_requests
ADD CONSTRAINT fk_fd82eae0b9 FOREIGN KEY (head_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL;
diff --git a/doc/administration/auth/ldap/google_secure_ldap.md b/doc/administration/auth/ldap/google_secure_ldap.md
index 3b4ce1d3e81..fe54962538a 100644
--- a/doc/administration/auth/ldap/google_secure_ldap.md
+++ b/doc/administration/auth/ldap/google_secure_ldap.md
@@ -34,7 +34,7 @@ The steps below cover:
'Entire domain (GitLab)' or 'Selected organizational units' for both 'Verify user
credentials' and 'Read user information'. Select 'Add LDAP Client'
- TIP: **Tip:**
+ NOTE:
If you plan to use GitLab [LDAP Group Sync](index.md#group-sync)
, turn on 'Read group information'.
diff --git a/doc/administration/geo/disaster_recovery/runbooks/planned_failover_multi_node.md b/doc/administration/geo/disaster_recovery/runbooks/planned_failover_multi_node.md
index 6fe4030ff54..f17990ce5f8 100644
--- a/doc/administration/geo/disaster_recovery/runbooks/planned_failover_multi_node.md
+++ b/doc/administration/geo/disaster_recovery/runbooks/planned_failover_multi_node.md
@@ -168,7 +168,7 @@ follow these steps to avoid unnecessary data loss:
that has not been replicated to the **secondary** node. This data should be treated
as lost if you proceed.
- TIP: **Tip:**
+ NOTE:
If you plan to [update the **primary** domain DNS record](../index.md#step-4-optional-updating-the-primary-domain-dns-record),
you may wish to lower the TTL now to speed up propagation.
diff --git a/doc/administration/geo/disaster_recovery/runbooks/planned_failover_single_node.md b/doc/administration/geo/disaster_recovery/runbooks/planned_failover_single_node.md
index 634ff8b3b9d..a2a9350e411 100644
--- a/doc/administration/geo/disaster_recovery/runbooks/planned_failover_single_node.md
+++ b/doc/administration/geo/disaster_recovery/runbooks/planned_failover_single_node.md
@@ -156,7 +156,7 @@ follow these steps to avoid unnecessary data loss:
that has not been replicated to the **secondary** node. This data should be treated
as lost if you proceed.
- TIP: **Tip:**
+ NOTE:
If you plan to [update the **primary** domain DNS record](../index.md#step-4-optional-updating-the-primary-domain-dns-record),
you may wish to lower the TTL now to speed up propagation.
diff --git a/doc/administration/geo/replication/troubleshooting.md b/doc/administration/geo/replication/troubleshooting.md
index d6519d2c8f5..580c6696a3a 100644
--- a/doc/administration/geo/replication/troubleshooting.md
+++ b/doc/administration/geo/replication/troubleshooting.md
@@ -466,7 +466,7 @@ to start again from scratch, there are a few steps that can help you:
chown git:git /var/opt/gitlab/git-data/repositories
```
- TIP: **Tip:**
+ NOTE:
You may want to remove the `/var/opt/gitlab/git-data/repositories.old` in the future
as soon as you confirmed that you don't need it anymore, to save disk space.
diff --git a/doc/administration/incoming_email.md b/doc/administration/incoming_email.md
index f6a2639e0e4..7a49542f8bb 100644
--- a/doc/administration/incoming_email.md
+++ b/doc/administration/incoming_email.md
@@ -44,7 +44,7 @@ Gmail, Google Apps, Yahoo! Mail, Outlook.com, and iCloud, as well as the
Microsoft Exchange Server [does not support sub-addressing](#microsoft-exchange-server),
and Microsoft Office 365 [does not support sub-addressing by default](#microsoft-office-365)
-TIP: **Tip:**
+NOTE:
If your provider or server supports email sub-addressing, we recommend using it.
A dedicated email address only supports Reply by Email functionality.
A catch-all mailbox supports the same features as sub-addressing as of GitLab 11.7,
diff --git a/doc/administration/issue_closing_pattern.md b/doc/administration/issue_closing_pattern.md
index e23072c3bf4..6a5b90ae963 100644
--- a/doc/administration/issue_closing_pattern.md
+++ b/doc/administration/issue_closing_pattern.md
@@ -23,7 +23,7 @@ is installed on.
The default pattern can be located in [`gitlab.yml.example`](https://gitlab.com/gitlab-org/gitlab/blob/master/config/gitlab.yml.example)
under the "Automatic issue closing" section.
-TIP: **Tip:**
+NOTE:
You are advised to use <https://rubular.com> to test the issue closing pattern.
Because Rubular doesn't understand `%{issue_ref}`, you can replace this by
`#\d+` when testing your patterns, which matches only local issue references like `#123`.
diff --git a/doc/administration/packages/container_registry.md b/doc/administration/packages/container_registry.md
index 8443a781ef1..ec3b19503fd 100644
--- a/doc/administration/packages/container_registry.md
+++ b/doc/administration/packages/container_registry.md
@@ -468,7 +468,7 @@ you can pull from the Container Registry, but you cannot push.
sudo aws --endpoint-url https://your-object-storage-backend.com s3 sync registry s3://mybucket
```
- TIP: **Tip:**
+ NOTE:
If you have a lot of data, you may be able to improve performance by
[running parallel sync operations](https://aws.amazon.com/premiumsupport/knowledge-center/s3-improve-transfer-sync-command/).
@@ -1139,7 +1139,7 @@ and a simple solution would be to enable relative URLs in the Registry.
You can use the Container Registry debug server to diagnose problems. The debug endpoint can monitor metrics and health, as well as do profiling.
-CAUTION: **Warning:**
+WARNING:
Sensitive information may be available from the debug endpoint.
Access to the debug endpoint must be locked down in a production environment.
diff --git a/doc/administration/reference_architectures/10k_users.md b/doc/administration/reference_architectures/10k_users.md
index 4d02ae47897..caa0c059220 100644
--- a/doc/administration/reference_architectures/10k_users.md
+++ b/doc/administration/reference_architectures/10k_users.md
@@ -1750,7 +1750,7 @@ To configure the Sidekiq nodes, on each one:
1. [Reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect.
-TIP: **Tip:**
+NOTE:
You can also run [multiple Sidekiq processes](../operations/extra_sidekiq_processes.md).
<div align="right">
diff --git a/doc/administration/reference_architectures/25k_users.md b/doc/administration/reference_architectures/25k_users.md
index 7349484f9a0..6245f884371 100644
--- a/doc/administration/reference_architectures/25k_users.md
+++ b/doc/administration/reference_architectures/25k_users.md
@@ -1750,7 +1750,7 @@ To configure the Sidekiq nodes, on each one:
1. [Reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect.
-TIP: **Tip:**
+NOTE:
You can also run [multiple Sidekiq processes](../operations/extra_sidekiq_processes.md).
<div align="right">
diff --git a/doc/administration/reference_architectures/3k_users.md b/doc/administration/reference_architectures/3k_users.md
index 0770e7336ba..2d57f0b0317 100644
--- a/doc/administration/reference_architectures/3k_users.md
+++ b/doc/administration/reference_architectures/3k_users.md
@@ -1466,7 +1466,7 @@ To configure the Sidekiq nodes, one each one:
run: sidekiq: (pid 30142) 77351s; run: log: (pid 29638) 77386s
```
-TIP: **Tip:**
+NOTE:
You can also run [multiple Sidekiq processes](../operations/extra_sidekiq_processes.md).
<div align="right">
diff --git a/doc/administration/reference_architectures/50k_users.md b/doc/administration/reference_architectures/50k_users.md
index d3b6f57fb3c..3c0fefe2430 100644
--- a/doc/administration/reference_architectures/50k_users.md
+++ b/doc/administration/reference_architectures/50k_users.md
@@ -1750,7 +1750,7 @@ To configure the Sidekiq nodes, on each one:
1. [Reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect.
-TIP: **Tip:**
+NOTE:
You can also run [multiple Sidekiq processes](../operations/extra_sidekiq_processes.md).
<div align="right">
diff --git a/doc/administration/reference_architectures/5k_users.md b/doc/administration/reference_architectures/5k_users.md
index ce099f8f7e9..936f7b8f243 100644
--- a/doc/administration/reference_architectures/5k_users.md
+++ b/doc/administration/reference_architectures/5k_users.md
@@ -1466,7 +1466,7 @@ To configure the Sidekiq nodes, one each one:
run: sidekiq: (pid 30142) 77351s; run: log: (pid 29638) 77386s
```
-TIP: **Tip:**
+NOTE:
You can also run [multiple Sidekiq processes](../operations/extra_sidekiq_processes.md).
<div align="right">
diff --git a/doc/administration/troubleshooting/postgresql.md b/doc/administration/troubleshooting/postgresql.md
index 52b50bbd460..7052b68370c 100644
--- a/doc/administration/troubleshooting/postgresql.md
+++ b/doc/administration/troubleshooting/postgresql.md
@@ -129,7 +129,7 @@ Quoting from issue [#1](https://gitlab.com/gitlab-org/gitlab/-/issues/30528):
> "If a deadlock is hit, and we resolve it through aborting the transaction after a short period, then the retry mechanisms we already have will make the deadlocked piece of work try again, and it's unlikely we'll deadlock multiple times in a row."
-TIP: **Tip:**
+NOTE:
In Support, our general approach to reconfiguring timeouts (applies also to the
HTTP stack) is that it's acceptable to do it temporarily as a workaround. If it
makes GitLab usable for the customer, then it buys time to understand the
diff --git a/doc/api/branches.md b/doc/api/branches.md
index 07da8c2e7f3..74383841272 100644
--- a/doc/api/branches.md
+++ b/doc/api/branches.md
@@ -9,7 +9,6 @@ type: reference, api
This API operates on [repository branches](../user/project/repository/branches/index.md).
-TIP: **Tip:**
See also [Protected branches API](protected_branches.md).
## List repository branches
diff --git a/doc/api/graphql/reference/gitlab_schema.graphql b/doc/api/graphql/reference/gitlab_schema.graphql
index 6697e3e327f..bbb2f483a3c 100644
--- a/doc/api/graphql/reference/gitlab_schema.graphql
+++ b/doc/api/graphql/reference/gitlab_schema.graphql
@@ -6616,6 +6616,46 @@ type DestroyContainerRepositoryPayload {
}
"""
+Autogenerated input type of DestroyContainerRepositoryTags
+"""
+input DestroyContainerRepositoryTagsInput {
+ """
+ A unique identifier for the client performing the mutation.
+ """
+ clientMutationId: String
+
+ """
+ ID of the container repository.
+ """
+ id: ContainerRepositoryID!
+
+ """
+ Container repository tag(s) to delete. Total number can't be greater than 20
+ """
+ tagNames: [String!]!
+}
+
+"""
+Autogenerated return type of DestroyContainerRepositoryTags
+"""
+type DestroyContainerRepositoryTagsPayload {
+ """
+ A unique identifier for the client performing the mutation.
+ """
+ clientMutationId: String
+
+ """
+ Deleted container repository tags
+ """
+ deletedTagNames: [String!]!
+
+ """
+ Errors encountered during execution of the mutation.
+ """
+ errors: [String!]!
+}
+
+"""
Autogenerated input type of DestroyNote
"""
input DestroyNoteInput {
@@ -14284,6 +14324,7 @@ type Mutation {
destroyBoardList(input: DestroyBoardListInput!): DestroyBoardListPayload
destroyComplianceFramework(input: DestroyComplianceFrameworkInput!): DestroyComplianceFrameworkPayload
destroyContainerRepository(input: DestroyContainerRepositoryInput!): DestroyContainerRepositoryPayload
+ destroyContainerRepositoryTags(input: DestroyContainerRepositoryTagsInput!): DestroyContainerRepositoryTagsPayload
destroyNote(input: DestroyNoteInput!): DestroyNotePayload
destroySnippet(input: DestroySnippetInput!): DestroySnippetPayload
diff --git a/doc/api/graphql/reference/gitlab_schema.json b/doc/api/graphql/reference/gitlab_schema.json
index fafc1385709..97b19afa6d5 100644
--- a/doc/api/graphql/reference/gitlab_schema.json
+++ b/doc/api/graphql/reference/gitlab_schema.json
@@ -18336,6 +18336,142 @@
},
{
"kind": "INPUT_OBJECT",
+ "name": "DestroyContainerRepositoryTagsInput",
+ "description": "Autogenerated input type of DestroyContainerRepositoryTags",
+ "fields": null,
+ "inputFields": [
+ {
+ "name": "id",
+ "description": "ID of the container repository.",
+ "type": {
+ "kind": "NON_NULL",
+ "name": null,
+ "ofType": {
+ "kind": "SCALAR",
+ "name": "ContainerRepositoryID",
+ "ofType": null
+ }
+ },
+ "defaultValue": null
+ },
+ {
+ "name": "tagNames",
+ "description": "Container repository tag(s) to delete. Total number can't be greater than 20",
+ "type": {
+ "kind": "NON_NULL",
+ "name": null,
+ "ofType": {
+ "kind": "LIST",
+ "name": null,
+ "ofType": {
+ "kind": "NON_NULL",
+ "name": null,
+ "ofType": {
+ "kind": "SCALAR",
+ "name": "String",
+ "ofType": null
+ }
+ }
+ }
+ },
+ "defaultValue": null
+ },
+ {
+ "name": "clientMutationId",
+ "description": "A unique identifier for the client performing the mutation.",
+ "type": {
+ "kind": "SCALAR",
+ "name": "String",
+ "ofType": null
+ },
+ "defaultValue": null
+ }
+ ],
+ "interfaces": null,
+ "enumValues": null,
+ "possibleTypes": null
+ },
+ {
+ "kind": "OBJECT",
+ "name": "DestroyContainerRepositoryTagsPayload",
+ "description": "Autogenerated return type of DestroyContainerRepositoryTags",
+ "fields": [
+ {
+ "name": "clientMutationId",
+ "description": "A unique identifier for the client performing the mutation.",
+ "args": [
+
+ ],
+ "type": {
+ "kind": "SCALAR",
+ "name": "String",
+ "ofType": null
+ },
+ "isDeprecated": false,
+ "deprecationReason": null
+ },
+ {
+ "name": "deletedTagNames",
+ "description": "Deleted container repository tags",
+ "args": [
+
+ ],
+ "type": {
+ "kind": "NON_NULL",
+ "name": null,
+ "ofType": {
+ "kind": "LIST",
+ "name": null,
+ "ofType": {
+ "kind": "NON_NULL",
+ "name": null,
+ "ofType": {
+ "kind": "SCALAR",
+ "name": "String",
+ "ofType": null
+ }
+ }
+ }
+ },
+ "isDeprecated": false,
+ "deprecationReason": null
+ },
+ {
+ "name": "errors",
+ "description": "Errors encountered during execution of the mutation.",
+ "args": [
+
+ ],
+ "type": {
+ "kind": "NON_NULL",
+ "name": null,
+ "ofType": {
+ "kind": "LIST",
+ "name": null,
+ "ofType": {
+ "kind": "NON_NULL",
+ "name": null,
+ "ofType": {
+ "kind": "SCALAR",
+ "name": "String",
+ "ofType": null
+ }
+ }
+ }
+ },
+ "isDeprecated": false,
+ "deprecationReason": null
+ }
+ ],
+ "inputFields": null,
+ "interfaces": [
+
+ ],
+ "enumValues": null,
+ "possibleTypes": null
+ },
+ {
+ "kind": "INPUT_OBJECT",
"name": "DestroyNoteInput",
"description": "Autogenerated input type of DestroyNote",
"fields": null,
@@ -40742,6 +40878,33 @@
"deprecationReason": null
},
{
+ "name": "destroyContainerRepositoryTags",
+ "description": null,
+ "args": [
+ {
+ "name": "input",
+ "description": null,
+ "type": {
+ "kind": "NON_NULL",
+ "name": null,
+ "ofType": {
+ "kind": "INPUT_OBJECT",
+ "name": "DestroyContainerRepositoryTagsInput",
+ "ofType": null
+ }
+ },
+ "defaultValue": null
+ }
+ ],
+ "type": {
+ "kind": "OBJECT",
+ "name": "DestroyContainerRepositoryTagsPayload",
+ "ofType": null
+ },
+ "isDeprecated": false,
+ "deprecationReason": null
+ },
+ {
"name": "destroyNote",
"description": null,
"args": [
diff --git a/doc/api/graphql/reference/index.md b/doc/api/graphql/reference/index.md
index 1bb173bbed3..316476f290f 100644
--- a/doc/api/graphql/reference/index.md
+++ b/doc/api/graphql/reference/index.md
@@ -1118,6 +1118,16 @@ Autogenerated return type of DestroyContainerRepository.
| `containerRepository` | ContainerRepository! | The container repository policy after scheduling the deletion. |
| `errors` | String! => Array | Errors encountered during execution of the mutation. |
+### DestroyContainerRepositoryTagsPayload
+
+Autogenerated return type of DestroyContainerRepositoryTags.
+
+| Field | Type | Description |
+| ----- | ---- | ----------- |
+| `clientMutationId` | String | A unique identifier for the client performing the mutation. |
+| `deletedTagNames` | String! => Array | Deleted container repository tags |
+| `errors` | String! => Array | Errors encountered during execution of the mutation. |
+
### DestroyNotePayload
Autogenerated return type of DestroyNote.
diff --git a/doc/ci/README.md b/doc/ci/README.md
index 8c1ea3b75ea..3675e8c1386 100644
--- a/doc/ci/README.md
+++ b/doc/ci/README.md
@@ -16,7 +16,7 @@ through the [continuous methodologies](introduction/index.md#introduction-to-cic
- Continuous Delivery (CD)
- Continuous Deployment (CD)
-TIP: **Tip:**
+NOTE:
Out-of-the-box management systems can decrease hours spent on maintaining toolchains by 10% or more.
Watch our ["Mastering continuous software development"](https://about.gitlab.com/webcast/mastering-ci-cd/)
webcast to learn about continuous methods and how GitLab’s built-in CI can help you simplify and scale software development.
diff --git a/doc/ci/caching/index.md b/doc/ci/caching/index.md
index bcb0502ba99..04e8d3a97b6 100644
--- a/doc/ci/caching/index.md
+++ b/doc/ci/caching/index.md
@@ -92,7 +92,7 @@ cache, when declaring `cache` in your jobs, use one or a mix of the following:
different caches on each branch). For that, you can take advantage of the
[CI/CD predefined variables](../variables/README.md#predefined-environment-variables).
-TIP: **Tip:**
+NOTE:
Using the same runner for your pipeline, is the most simple and efficient way to
cache files in one stage or pipeline, and pass this cache to subsequent stages
or pipelines in a guaranteed manner.
@@ -108,7 +108,7 @@ of the following must be true:
share a common network-mounted directory (using NFS or something similar)
where the cache is stored.
-TIP: **Tip:**
+NOTE:
Read about the [availability of the cache](#availability-of-the-cache)
to learn more about the internals and get a better idea how cache works.
diff --git a/doc/ci/docker/using_docker_build.md b/doc/ci/docker/using_docker_build.md
index 88c92c9bead..78fde2767de 100644
--- a/doc/ci/docker/using_docker_build.md
+++ b/doc/ci/docker/using_docker_build.md
@@ -37,7 +37,7 @@ during jobs, each with their own tradeoffs.
An alternative to using `docker build` is to [use kaniko](using_kaniko.md).
This avoids having to execute a runner in privileged mode.
-TIP: **Tip:**
+NOTE:
To see how Docker and GitLab Runner are configured for shared runners on
GitLab.com, see [GitLab.com shared
runners](../../user/gitlab_com/index.md#shared-runners).
diff --git a/doc/ci/introduction/index.md b/doc/ci/introduction/index.md
index 0c5bb8fe7df..ed34b0d6612 100644
--- a/doc/ci/introduction/index.md
+++ b/doc/ci/introduction/index.md
@@ -12,7 +12,7 @@ This document presents an overview of the concepts of Continuous Integration,
Continuous Delivery, and Continuous Deployment, as well as an introduction to
GitLab CI/CD.
-TIP: **Tip:**
+NOTE:
Out-of-the-box management systems can decrease hours spent on maintaining toolchains by 10% or more.
Watch our ["Mastering continuous software development"](https://about.gitlab.com/webcast/mastering-ci-cd/)
webcast to learn about continuous methods and how GitLab’s built-in CI can help you simplify and scale software development.
diff --git a/doc/ci/pipelines/index.md b/doc/ci/pipelines/index.md
index bea7a20d4b5..22e331f2de0 100644
--- a/doc/ci/pipelines/index.md
+++ b/doc/ci/pipelines/index.md
@@ -10,7 +10,7 @@ type: reference
> Introduced in GitLab 8.8.
-TIP: **Tip:**
+NOTE:
Watch the
["Mastering continuous software development"](https://about.gitlab.com/webcast/mastering-ci-cd/)
webcast to see a comprehensive demo of a GitLab CI/CD pipeline.
diff --git a/doc/ci/ssh_keys/README.md b/doc/ci/ssh_keys/README.md
index d55c2ac1009..a5410d53a95 100644
--- a/doc/ci/ssh_keys/README.md
+++ b/doc/ci/ssh_keys/README.md
@@ -165,7 +165,7 @@ Create a new [variable](../variables/README.md#gitlab-cicd-environment-variables
If you need to connect to multiple servers, all the server host keys
need to be collected in the **Value** of the variable, one key per line.
-TIP: **Tip:**
+NOTE:
By using a variable instead of `ssh-keyscan` directly inside
`.gitlab-ci.yml`, it has the benefit that you don't have to change `.gitlab-ci.yml`
if the host domain name changes for some reason. Also, the values are predefined
diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md
index da9404421fb..b5038a178ff 100644
--- a/doc/ci/yaml/README.md
+++ b/doc/ci/yaml/README.md
@@ -375,7 +375,7 @@ The files defined by `include` are:
- Always evaluated first and merged with the content of `.gitlab-ci.yml`,
regardless of the position of the `include` keyword.
-TIP: **Tip:**
+NOTE:
Use merging to customize and override included CI/CD configurations with local
definitions. Local definitions in `.gitlab-ci.yml` override included definitions.
@@ -1583,7 +1583,7 @@ that begin with `issue-`, but you can use `/issue-.*/`.
Regular expression flags must be appended after the closing `/`.
-TIP: **Tip:**
+NOTE:
Use anchors `^` and `$` to avoid the regular expression
matching only a substring of the tag name or branch name.
For example, `/^issue-.*$/` is equivalent to `/^issue-/`,
diff --git a/doc/development/adding_service_component.md b/doc/development/adding_service_component.md
index 0a07f67e7ba..7e2add2c91f 100644
--- a/doc/development/adding_service_component.md
+++ b/doc/development/adding_service_component.md
@@ -47,14 +47,14 @@ Adding a new service follows the same [merge request workflow](contributing/merg
The first iteration should be to add the ability to connect and use the service as an externally installed component. Often this involves providing settings in GitLab to connect to the service, or allow connections from it. And then shipping documentation on how to install and configure the service with GitLab.
-TIP: **Tip:**
+NOTE:
[Elasticsearch](../integration/elasticsearch.md#installing-elasticsearch) is an example of a service that has been integrated this way. And many of the other services, including internal projects like Gitaly, started off as separately installed alternatives.
**For services that depend on the existing GitLab codebase:**
The first iteration should be opt-in, either through the `gitlab.yml` configuration or through [feature flags](feature_flags/index.md). For these types of services it is often necessary to [bundle the service and its dependencies with GitLab](#bundling-a-service-with-gitlab) as part of the initial integration.
-TIP: **Tip:**
+NOTE:
[ActionCable](https://docs.gitlab.com/omnibus/settings/actioncable.html) is an example of a service that has been added this way.
## Bundling a service with GitLab
diff --git a/doc/development/agent/local.md b/doc/development/agent/local.md
index 2af53d0b3bd..baa9cc5696b 100644
--- a/doc/development/agent/local.md
+++ b/doc/development/agent/local.md
@@ -9,45 +9,45 @@ info: To determine the technical writer assigned to the Stage/Group associated w
You can run `kas` and `agentk` locally to test the [Kubernetes Agent](index.md) yourself.
1. Create a `cfg.yaml` file from the contents of
- [`kas_config_example.yaml`](https://gitlab.com/gitlab-org/cluster-integration/gitlab-agent/-/blob/master/doc/kas_config_example.yaml), or this example:
-
- ```yaml
- listen_agent:
- network: tcp
- address: 127.0.0.1:8150
- websocket: false
- gitlab:
- address: http://localhost:3000
- authentication_secret_file: /Users/tkuah/code/ee-gdk/gitlab/.gitlab_kas_secret
- agent:
- gitops:
- poll_period: "10s"
- ```
+ [`config_example.yaml`](https://gitlab.com/gitlab-org/cluster-integration/gitlab-agent/-/blob/master/pkg/kascfg/config_example.yaml), or this example:
+
+ ```yaml
+ agent:
+ listen:
+ network: tcp
+ address: 127.0.0.1:8150
+ websocket: false
+ gitops:
+ poll_period: "10s"
+ gitlab:
+ address: http://localhost:3000
+ authentication_secret_file: /Users/tkuah/code/ee-gdk/gitlab/.gitlab_kas_secret
+ ```
1. Create a `token.txt`. This is the token for
- [the agent you created](../../user/clusters/agent/index.md#create-an-agent-record-in-gitlab). This file must not contain a newline character. You can create the file with this command:
+ [the agent you created](../../user/clusters/agent/index.md#create-an-agent-record-in-gitlab). This file must not contain a newline character. You can create the file with this command:
- ```shell
- echo -n "<TOKEN>" > token.txt
- ```
+ ```shell
+ echo -n "<TOKEN>" > token.txt
+ ```
1. Start the binaries with the following commands:
- ```shell
- # Need GitLab to start
- gdk start
- # Stop GDK's version of kas
- gdk stop gitlab-k8s-agent
-
- # Start kas
- bazel run //cmd/kas -- --configuration-file="$(pwd)/cfg.yaml"
- ```
+ ```shell
+ # Need GitLab to start
+ gdk start
+ # Stop GDK's version of kas
+ gdk stop gitlab-k8s-agent
+
+ # Start kas
+ bazel run //cmd/kas -- --configuration-file="$(pwd)/cfg.yaml"
+ ```
1. In a new terminal window, run this command to start agentk:
- ```shell
- bazel run //cmd/agentk -- --kas-address=grpc://127.0.0.1:8150 --token-file="$(pwd)/token.txt"
- ```
+ ```shell
+ bazel run //cmd/agentk -- --kas-address=grpc://127.0.0.1:8150 --token-file="$(pwd)/token.txt"
+ ```
You can also inspect the
[Makefile](https://gitlab.com/gitlab-org/cluster-integration/gitlab-agent/-/blob/master/Makefile)
diff --git a/doc/development/api_graphql_styleguide.md b/doc/development/api_graphql_styleguide.md
index 5ca5e17ad94..8a3fe93c4b1 100644
--- a/doc/development/api_graphql_styleguide.md
+++ b/doc/development/api_graphql_styleguide.md
@@ -179,7 +179,7 @@ end
### Connection types
-TIP: **Tip:**
+NOTE:
For specifics on implementation, see [Pagination implementation](#pagination-implementation).
GraphQL uses [cursor based
@@ -647,7 +647,7 @@ If the:
Also see [authorizing resources in a mutation](#authorizing-resources).
-TIP: **Tip:**
+NOTE:
Try to load only what the currently authenticated user is allowed to
view with our existing finders first, without relying on authorization
to filter the records. This minimizes database queries and unnecessary
diff --git a/doc/development/distributed_tracing.md b/doc/development/distributed_tracing.md
index 0137c06fd69..6eb4514730f 100644
--- a/doc/development/distributed_tracing.md
+++ b/doc/development/distributed_tracing.md
@@ -215,6 +215,6 @@ not set.
By default, the Jaeger search UI is available at <http://localhost:16686/search>.
-TIP: **Tip:**
+NOTE:
Don't forget that you must generate traces by using the application before
they appear in the Jaeger UI.
diff --git a/doc/development/documentation/index.md b/doc/development/documentation/index.md
index 4fc7b16b8c3..401168179f0 100644
--- a/doc/development/documentation/index.md
+++ b/doc/development/documentation/index.md
@@ -418,7 +418,7 @@ working on. If you don't, the remote docs branch isn't removed either,
and the server where the Review Apps are hosted can eventually run out of
disk space.
-TIP: **Tip:**
+NOTE:
Someone with no merge rights to the GitLab projects (think of forks from
contributors) cannot run the manual job. In that case, you can
ask someone from the GitLab team who has the permissions to do that for you.
diff --git a/doc/development/documentation/site_architecture/release_process.md b/doc/development/documentation/site_architecture/release_process.md
index e8ec0f39702..ba5363dbb71 100644
--- a/doc/development/documentation/site_architecture/release_process.md
+++ b/doc/development/documentation/site_architecture/release_process.md
@@ -26,7 +26,7 @@ To add a new charts version:
version mapping. Note that only the `major.minor` version is needed.
1. Create a new merge request and merge it.
-TIP: **Tip:**
+NOTE:
It can be handy to create the future mappings since they are pretty much known.
In that case, when a new GitLab version is released, you don't have to repeat
this first step.
@@ -138,7 +138,7 @@ versions (stable branches `X.Y` of the `gitlab-docs` project):
to check that their pipelines pass, and once all are merged, proceed to the
following and final step.
-TIP: **Tip:**
+NOTE:
In case a pipeline fails, see [troubleshooting](#troubleshooting).
## 5. Merge the release merge request
diff --git a/doc/development/documentation/workflow.md b/doc/development/documentation/workflow.md
index 698512e149d..87de8b9cdf6 100644
--- a/doc/development/documentation/workflow.md
+++ b/doc/development/documentation/workflow.md
@@ -62,7 +62,7 @@ To update GitLab documentation:
- The [Markdown Guide](https://about.gitlab.com/handbook/markdown-guide/).
1. Follow GitLab's [Merge Request Guidelines](../contributing/merge_request_workflow.md#merge-request-guidelines).
-TIP: **Tip:**
+NOTE:
Work in a fork if you do not have Developer access to the GitLab project.
Request help from the Technical Writing team if you:
diff --git a/doc/development/fe_guide/performance.md b/doc/development/fe_guide/performance.md
index 99e56058881..a2fa9819f43 100644
--- a/doc/development/fe_guide/performance.md
+++ b/doc/development/fe_guide/performance.md
@@ -82,7 +82,7 @@ Previously, GitLab encouraged the use of
manually generated webpack bundles. However under this new system you should
not ever need to manually add an entry point to the `webpack.config.js` file.
-TIP: **Tip:**
+NOTE:
If you are unsure what controller and action corresponds to a given page, you
can find this out by inspecting `document.body.dataset.page` within your
browser's developer console while on any page within GitLab.
diff --git a/doc/development/fe_guide/style/javascript.md b/doc/development/fe_guide/style/javascript.md
index 857913435fd..d404d3e02e9 100644
--- a/doc/development/fe_guide/style/javascript.md
+++ b/doc/development/fe_guide/style/javascript.md
@@ -13,7 +13,7 @@ linter to manage most of our JavaScript style guidelines.
In addition to the style guidelines set by Airbnb, we also have a few specific rules
listed below.
-TIP: **Tip:**
+NOTE:
You can run eslint locally by running `yarn eslint`
## Avoid forEach
diff --git a/doc/development/feature_flags/development.md b/doc/development/feature_flags/development.md
index 9ddc6eb29df..3690ec36ff1 100644
--- a/doc/development/feature_flags/development.md
+++ b/doc/development/feature_flags/development.md
@@ -96,7 +96,7 @@ Each feature flag is defined in a separate YAML file consisting of a number of f
| `rollout_issue_url` | no | The URL to the Issue covering the feature flag rollout. |
| `group` | no | The [group](https://about.gitlab.com/handbook/product/categories/#devops-stages) that owns the feature flag. |
-TIP: **Tip:**
+NOTE:
All validations are skipped when running in `RAILS_ENV=production`.
## Create a new feature flag
@@ -131,7 +131,7 @@ type: development
default_enabled: false
```
-TIP: **Tip:**
+NOTE:
To create a feature flag that is only used in EE, add the `--ee` flag: `bin/feature-flag --ee`
## Delete a feature flag
diff --git a/doc/development/i18n/externalization.md b/doc/development/i18n/externalization.md
index c5ed07fe24c..90355e1cccb 100644
--- a/doc/development/i18n/externalization.md
+++ b/doc/development/i18n/externalization.md
@@ -13,7 +13,7 @@ For working with internationalization (i18n),
used tool for this task and there are a lot of applications that help us
work with it.
-TIP: **Tip:**
+NOTE:
All `rake` commands described on this page must be run on a GitLab instance, usually GDK.
## Setting up GitLab Development Kit (GDK)
diff --git a/doc/development/redis.md b/doc/development/redis.md
index fd57143150c..bb725e3c321 100644
--- a/doc/development/redis.md
+++ b/doc/development/redis.md
@@ -106,7 +106,7 @@ requests that read the most data from the cache, we can just sort by
### The slow log
-TIP: **Tip:**
+NOTE:
There is a [video showing how to see the slow log](https://youtu.be/BBI68QuYRH8) (GitLab internal)
on GitLab.com
diff --git a/doc/development/shell_scripting_guide/index.md b/doc/development/shell_scripting_guide/index.md
index c9e2c98716b..6071ae3a09d 100644
--- a/doc/development/shell_scripting_guide/index.md
+++ b/doc/development/shell_scripting_guide/index.md
@@ -72,7 +72,7 @@ shell check:
- shellcheck scripts/**/*.sh # path to your shell scripts
```
-TIP: **Tip:**
+NOTE:
By default, ShellCheck uses the [shell detection](https://github.com/koalaman/shellcheck/wiki/SC2148#rationale)
to determine the shell dialect in use. If the shell file is out of your control and ShellCheck cannot
detect the dialect, use `-s` flag to specify it: `-s sh` or `-s bash`.
@@ -100,7 +100,7 @@ shfmt:
- shfmt -i 2 -ci -d scripts # path to your shell scripts
```
-TIP: **Tip:**
+NOTE:
By default, shfmt uses the [shell detection](https://github.com/mvdan/sh#shfmt) similar to one of ShellCheck
and ignore files starting with a period. To override this, use `-ln` flag to specify the shell dialect:
`-ln posix` or `-ln bash`.
diff --git a/doc/development/testing_guide/end_to_end/beginners_guide.md b/doc/development/testing_guide/end_to_end/beginners_guide.md
index 5f41267bc1c..d60b780eeea 100644
--- a/doc/development/testing_guide/end_to_end/beginners_guide.md
+++ b/doc/development/testing_guide/end_to_end/beginners_guide.md
@@ -29,7 +29,7 @@ must be configured to run the specs. The end-to-end tests:
- Create [resources](resources.md) (such as project, issue, user) on an ad-hoc basis.
- Test the UI and API interfaces, and use the API to efficiently set up the UI tests.
-TIP: **Tip:**
+NOTE:
For more information, see [End-to-end testing Best Practices](best_practices.md).
## Determine if end-to-end tests are needed
diff --git a/doc/gitlab-basics/create-project.md b/doc/gitlab-basics/create-project.md
index 87cee993eb2..30f467c2b12 100644
--- a/doc/gitlab-basics/create-project.md
+++ b/doc/gitlab-basics/create-project.md
@@ -99,7 +99,7 @@ Available Enterprise templates include:
- HIPAA Audit Protocol template ([introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/13756) in GitLab 12.10)
-TIP: **Tip:**
+NOTE:
You can improve the existing built-in templates or contribute new ones in the
[`project-templates`](https://gitlab.com/gitlab-org/project-templates) and
[`pages`](https://gitlab.com/pages) groups by following [these steps](https://gitlab.com/gitlab-org/project-templates/contributing).
diff --git a/doc/gitlab-basics/start-using-git.md b/doc/gitlab-basics/start-using-git.md
index ddebc57355a..ea8a58154db 100644
--- a/doc/gitlab-basics/start-using-git.md
+++ b/doc/gitlab-basics/start-using-git.md
@@ -29,7 +29,7 @@ can download GitLab's [Git Cheat Sheet](https://about.gitlab.com/images/press/gi
> - <i class="fa fa-youtube-play youtube" aria-hidden="true"></i>&nbsp;Watch the [GitLab Source Code Management Walkthrough](https://www.youtube.com/watch?v=wTQ3aXJswtM) video.
> - Learn how GitLab became the backbone of [Worldline](https://about.gitlab.com/customers/worldline/)’s development environment.
-TIP: **Tip:**
+NOTE:
To help you visualize what you're doing locally, there are
[Git GUI apps](https://git-scm.com/download/gui/) you can install.
@@ -234,7 +234,7 @@ To clone `https://gitlab.com/gitlab-tests/sample-project/` via HTTPS:
git clone https://gitlab.com/gitlab-tests/sample-project.git
```
-TIP: **Troubleshooting:**
+NOTE:
On Windows, if you entered incorrect passwords multiple times and GitLab is responding `Access denied`,
you may have to add your namespace (user name or group name) to clone through HTTPS:
`git clone https://namespace@gitlab.com/gitlab-org/gitlab.git`.
diff --git a/doc/install/aws/index.md b/doc/install/aws/index.md
index 5e90b102276..49916035616 100644
--- a/doc/install/aws/index.md
+++ b/doc/install/aws/index.md
@@ -399,7 +399,7 @@ a bug that [prevents Sidekiq from processing jobs](https://gitlab.com/gitlab-org
Since our GitLab instances will be in private subnets, we need a way to connect to these instances via SSH to make configuration changes, perform upgrades, etc. One way of doing this is via a [bastion host](https://en.wikipedia.org/wiki/Bastion_host), sometimes also referred to as a jump box.
-TIP: **Tip:**
+NOTE:
If you do not want to maintain bastion hosts, you can set up [AWS Systems Manager Session Manager](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager.html) for access to instances. This is beyond the scope of this document.
### Create Bastion Host A
diff --git a/doc/integration/elasticsearch.md b/doc/integration/elasticsearch.md
index 057cb923a13..698d6e9c38c 100644
--- a/doc/integration/elasticsearch.md
+++ b/doc/integration/elasticsearch.md
@@ -317,7 +317,7 @@ buffered and caught up once unpaused.
### Setup
-TIP: **Tip:**
+NOTE:
If your index was created with GitLab 13.0 or greater, you can directly
[trigger the reindex](#trigger-the-reindex-via-the-advanced-search-administration).
@@ -404,7 +404,7 @@ To trigger the re-index from `primary` index:
curl $CLUSTER_URL/$SECONDARY_INDEX/_count => 123123
```
- TIP: **Tip:**
+ NOTE:
Comparing the document count is more accurate than using the index size, as improvements to the storage might cause the new index to be smaller than the original one.
1. After you are confident your `secondary` index is valid, you can process to
@@ -681,7 +681,7 @@ Sidekiq processes](../administration/operations/extra_sidekiq_processes.md).
Where `ID_FROM` and `ID_TO` are project IDs. Both parameters are optional.
The above example will index all projects from ID `1001` up to (and including) ID `2000`.
- TIP: **Troubleshooting:**
+ NOTE:
Sometimes the project indexing jobs queued by `gitlab:elastic:index_projects`
can get interrupted. This may happen for many reasons, but it's always safe
to run the indexing task again. It will skip repositories that have
diff --git a/doc/integration/jira_development_panel.md b/doc/integration/jira_development_panel.md
index 0f197961946..7488df3580e 100644
--- a/doc/integration/jira_development_panel.md
+++ b/doc/integration/jira_development_panel.md
@@ -73,7 +73,7 @@ When configuring Jira DVCS Connector:
#### GitLab account configuration for DVCS
-TIP: **Tip:**
+NOTE:
To ensure that regular user account maintenance doesn't impact your integration,
create and use a single-purpose `jira` user in GitLab.
diff --git a/doc/operations/incident_management/alert_integrations.md b/doc/operations/incident_management/alert_integrations.md
index b4597110935..87c7e3b61be 100644
--- a/doc/operations/incident_management/alert_integrations.md
+++ b/doc/operations/incident_management/alert_integrations.md
@@ -102,7 +102,7 @@ can be a nested JSON object. For example:
{ "foo": { "bar": { "baz": 42 } } }
```
-TIP: **Tip:**
+NOTE:
Ensure your requests are smaller than the
[payload application limits](../../administration/instance_limits.md#generic-alert-json-payloads).
diff --git a/doc/operations/incident_management/alerts.md b/doc/operations/incident_management/alerts.md
index af5f0763b9d..aca4ef49aec 100644
--- a/doc/operations/incident_management/alerts.md
+++ b/doc/operations/incident_management/alerts.md
@@ -37,7 +37,7 @@ The alert list displays the following information:
- **Acknowledged**: Someone is actively investigating the problem.
- **Resolved**: No further work is required.
-TIP: **Tip:**
+NOTE:
Check out a live example available from the
[`tanuki-inc` project page](https://gitlab-examples-ops-incident-setup-everyone-tanuki-inc.34.69.64.147.nip.io/)
in GitLab to examine alerts in action.
@@ -67,7 +67,7 @@ Navigate to the Alert details view by visiting the [Alert list](alerts.md)
and selecting an alert from the list. You need least Developer [permissions](../../user/permissions.md)
to access alerts.
-TIP: **Tip:**
+NOTE:
To review live examples of GitLab alerts, visit the
[alert list](https://gitlab.com/gitlab-examples/ops/incident-setup/everyone/tanuki-inc/-/alert_management)
for this demo project. Select any alert in the list to examine its alert details
diff --git a/doc/operations/incident_management/incidents.md b/doc/operations/incident_management/incidents.md
index aa0840a9cca..4453faf6126 100644
--- a/doc/operations/incident_management/incidents.md
+++ b/doc/operations/incident_management/incidents.md
@@ -121,7 +121,7 @@ display an arrow next to the column name.
Incidents share the [Issues API](../../user/project/issues/index.md).
-TIP: **Tip:**
+NOTE:
For a live example of the incident list in action, visit this
[demo project](https://gitlab.com/gitlab-examples/ops/incident-setup/everyone/tanuki-inc/-/incidents).
diff --git a/doc/push_rules/push_rules.md b/doc/push_rules/push_rules.md
index 69cacd41347..99a5ac8ed3b 100644
--- a/doc/push_rules/push_rules.md
+++ b/doc/push_rules/push_rules.md
@@ -100,7 +100,7 @@ The following options are available.
| Prohibited file names | **Starter** 7.10 | Any committed filenames that match this regular expression and do not already exist in the repository are not allowed to be pushed. Leave empty to allow any filenames. See [common examples](#prohibited-file-names). |
| Maximum file size | **Starter** 7.12 | Pushes that contain added or updated files that exceed this file size (in MB) are rejected. Set to 0 to allow files of any size. Files tracked by Git LFS are exempted. |
-TIP: **Tip:**
+NOTE:
GitLab uses [RE2 syntax](https://github.com/google/re2/wiki/Syntax) for regular expressions in push rules, and you can test them at the [regex101 regex tester](https://regex101.com/).
## Prevent pushing secrets to the repository
diff --git a/doc/ssh/README.md b/doc/ssh/README.md
index dbd2a0e3935..7b0c5f5f16e 100644
--- a/doc/ssh/README.md
+++ b/doc/ssh/README.md
@@ -44,7 +44,7 @@ GitLab supports the use of RSA, DSA, ECDSA, and ED25519 keys.
- GitLab has [deprecated](https://about.gitlab.com/releases/2018/06/22/gitlab-11-0-released/#support-for-dsa-ssh-keys) DSA keys in GitLab 11.0.
- As noted in [Practical Cryptography With Go](https://leanpub.com/gocrypto/read#leanpub-auto-ecdsa), the security issues related to DSA also apply to ECDSA.
-TIP: **Tip:**
+NOTE:
Available documentation suggests that ED25519 is more secure. If you use an RSA key, the US National Institute of Science and Technology in [Publication 800-57 Part 3 (PDF)](https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-57Pt3r1.pdf) recommends a key size of at least 2048 bits.
Therefore, our documentation focuses on the use of ED25519 and RSA keys.
diff --git a/doc/subscriptions/gitlab_com/index.md b/doc/subscriptions/gitlab_com/index.md
index b73e1901dd9..5299f1f5f9c 100644
--- a/doc/subscriptions/gitlab_com/index.md
+++ b/doc/subscriptions/gitlab_com/index.md
@@ -48,7 +48,7 @@ Every occupied seat is counted in the subscription, with the following exception
- Members with Guest permissions on a Gold subscription.
-TIP: **Tip:**
+NOTE:
To support the open source community and encourage the development of open
source projects, GitLab grants access to **Gold** features for all GitLab.com
**public** projects, regardless of the subscription.
@@ -88,7 +88,7 @@ To subscribe to GitLab.com:
1. Select the namespace from the drop-down list to associate the subscription.
1. Proceed to checkout.
-TIP: **Tip:**
+NOTE:
You can also go to the [**My Account**](https://customers.gitlab.com/customers/edit)
page to add or change the GitLab.com account link.
@@ -132,7 +132,7 @@ log in and verify or update:
- The invoice contact details on the **Account details** page.
- The credit card on file on the **Payment Methods** page.
-TIP: **Tip:**
+NOTE:
Contact our [support team](https://support.gitlab.com/hc/en-us/requests/new?ticket_form_id=360000071293)
if you need assistance accessing the Customers Portal or if you need to change
the contact person who manages your subscription.
diff --git a/doc/subscriptions/self_managed/index.md b/doc/subscriptions/self_managed/index.md
index d541413606e..02dd609803d 100644
--- a/doc/subscriptions/self_managed/index.md
+++ b/doc/subscriptions/self_managed/index.md
@@ -79,7 +79,7 @@ To subscribe to GitLab through a self-managed installation:
1. After purchase, a license file is sent to the email address associated to the Customers Portal account,
which must be [uploaded to your GitLab instance](../../user/admin_area/license.md#uploading-your-license).
-TIP: **Tip:**
+NOTE:
If you're purchasing a subscription for an existing **Core** self-managed
instance, ensure you're purchasing enough seats to
[cover your users](../../user/admin_area/index.md#administering-users).
@@ -109,7 +109,7 @@ log in and verify or update:
- The invoice contact details on the **Account details** page.
- The credit card on file on the **Payment Methods** page.
-TIP: **Tip:**
+NOTE:
Contact our [support team](https://support.gitlab.com/hc/en-us/requests/new?ticket_form_id=360000071293)
if you need assistance accessing the Customers Portal or if you need to change
the contact person who manages your subscription.
@@ -158,13 +158,13 @@ We recommend following these steps during renewal:
1. Determine if you have a need for user growth in the upcoming subscription.
1. Log in to the [Customers Portal](https://customers.gitlab.com/customers/sign_in) and select the **Renew** button beneath your existing subscription.
- TIP: **Tip:**
+ NOTE:
If you need to change your [GitLab tier](https://about.gitlab.com/pricing/), contact our sales team via `renewals@gitlab.com` for assistance as this can't be done in the Customers Portal.
1. In the first box, enter the total number of user licenses you’ll need for the upcoming year. Be sure this number is at least **equal to, or greater than** the number of billable users in the system at the time of performing the renewal.
1. Enter the number of [users over license](#users-over-license) in the second box for the user overage incurred in your previous subscription term.
- TIP: **Tip:**
+ NOTE:
You can find the _users over license_ in your instance's **Admin** dashboard by clicking on the **Admin Area** in the top bar, or navigating to `/admin`.
The following table describes details of your admin dashboard and renewal terms:
diff --git a/doc/topics/autodevops/customize.md b/doc/topics/autodevops/customize.md
index be7f9071dde..0e662e84f7a 100644
--- a/doc/topics/autodevops/customize.md
+++ b/doc/topics/autodevops/customize.md
@@ -355,7 +355,7 @@ applications.
| `ROLLOUT_STATUS_DISABLED` | From GitLab 12.0, used to disable rollout status check because it does not support all resource types, for example, `cronjob`. |
| `STAGING_ENABLED` | From GitLab 10.8, used to define a [deploy policy for staging and production environments](#deploy-policy-for-staging-and-production-environments). |
-TIP: **Tip:**
+NOTE:
After you set up your replica variables using a
[project variable](../../ci/variables/README.md#gitlab-cicd-environment-variables),
you can scale your application by redeploying it.
@@ -538,7 +538,7 @@ service:
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ci-yml/-/merge_requests/160) in GitLab 10.8.
-TIP: **Tip:**
+NOTE:
You can also set this inside your [project's settings](index.md#deployment-strategy).
The normal behavior of Auto DevOps is to use continuous deployment, pushing
@@ -567,7 +567,7 @@ If you define `CANARY_ENABLED` with a non-empty value, then two manual jobs are
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/5415) in GitLab 10.8.
-TIP: **Tip:**
+NOTE:
You can also set this inside your [project's settings](index.md#deployment-strategy).
When you're ready to deploy a new version of your app to production, you may want
@@ -615,7 +615,7 @@ With `INCREMENTAL_ROLLOUT_MODE` set to `manual` and with `STAGING_ENABLED`
![Rollout and staging enabled](img/rollout_staging_enabled.png)
-WARNING: **Deprecation:**
+WARNING:
Before GitLab 11.4, the presence of the `INCREMENTAL_ROLLOUT_ENABLED` environment
variable enabled this feature. This configuration is deprecated, and is scheduled to be
removed in the future.
@@ -624,7 +624,7 @@ removed in the future.
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/7545) in GitLab 11.4.
-TIP: **Tip:**
+NOTE:
You can also set this inside your [project's settings](index.md#deployment-strategy).
This configuration is based on
diff --git a/doc/topics/autodevops/index.md b/doc/topics/autodevops/index.md
index 11b8bcdc2f0..2e078e8a2dc 100644
--- a/doc/topics/autodevops/index.md
+++ b/doc/topics/autodevops/index.md
@@ -151,7 +151,7 @@ as other environment [variables](../../ci/variables/README.md#priority-of-enviro
If the CI/CD variable is not set and the cluster setting is left blank, the instance-wide **Auto DevOps domain**
setting is used if set.
-TIP: **Tip:**
+NOTE:
If you use the [GitLab managed app for Ingress](../../user/clusters/applications.md#ingress),
the URL endpoint should be automatically configured for you. All you must do
is use its value for the `KUBE_INGRESS_BASE_DOMAIN` variable.
@@ -257,7 +257,7 @@ are available:
- `master` branch is directly deployed to staging.
- Manual actions are provided for incremental rollout to production.
-TIP: **Tip:**
+NOTE:
Use the [blue-green deployment](../../ci/environments/incremental_rollouts.md#blue-green-deployment) technique
to minimize downtime and risk.
diff --git a/doc/topics/autodevops/quick_start_guide.md b/doc/topics/autodevops/quick_start_guide.md
index 5226ae576a4..f0eba0ba354 100644
--- a/doc/topics/autodevops/quick_start_guide.md
+++ b/doc/topics/autodevops/quick_start_guide.md
@@ -29,7 +29,7 @@ or Google Drive, or create a new one.
1. Ensure you've created a [billing account](https://cloud.google.com/billing/docs/how-to/manage-billing-account)
with Google Cloud Platform.
-TIP: **Tip:**
+NOTE:
Every new Google Cloud Platform (GCP) account receives [$300 in credit](https://console.cloud.google.com/freetrial),
and in partnership with Google, GitLab is able to offer an additional $200 for new
GCP accounts to get started with GitLab's Google Kubernetes Engine Integration.
@@ -221,7 +221,7 @@ Kubernetes cluster, color-coded to show their status. Hovering over a square on
the deploy board displays the state of the deployment, and clicking the square
takes you to the pod's logs page.
-TIP: **Tip:**
+NOTE:
The example shows only one pod hosting the application at the moment, but you can add
more pods by defining the [`REPLICAS` variable](customize.md#environment-variables)
in **Settings > CI/CD > Environment variables**.
diff --git a/doc/topics/autodevops/stages.md b/doc/topics/autodevops/stages.md
index 2f84b00af61..50b45890e0e 100644
--- a/doc/topics/autodevops/stages.md
+++ b/doc/topics/autodevops/stages.md
@@ -48,7 +48,7 @@ language:
For the requirements of other languages and frameworks, read the
[Heroku buildpacks documentation](https://devcenter.heroku.com/articles/buildpacks#officially-supported-buildpacks).
-TIP: **Tip:**
+NOTE:
If Auto Build fails despite the project meeting the buildpack requirements, set
a project variable `TRACE=true` to enable verbose logging, which may help you
troubleshoot.
diff --git a/doc/topics/autodevops/upgrading_postgresql.md b/doc/topics/autodevops/upgrading_postgresql.md
index 3304b18a49f..55432ad61fa 100644
--- a/doc/topics/autodevops/upgrading_postgresql.md
+++ b/doc/topics/autodevops/upgrading_postgresql.md
@@ -36,7 +36,7 @@ involves:
any existing channel 1 database. For more information, see
[Detected an existing PostgreSQL database](index.md#detected-an-existing-postgresql-database).
-TIP: **Tip:**
+NOTE:
If you have configured Auto DevOps to have staging,
consider trying out the backup and restore steps on staging first, or
trying this out on a review app.
@@ -173,7 +173,7 @@ Using the newer version of PostgreSQL deletes
the older 0.7.1 PostgreSQL. To prevent the underlying data from being
deleted, you can choose to retain the [persistent volume](#retain-persistent-volumes).
-TIP: **Tip:**
+NOTE:
You can also
[scope](../../ci/environments/index.md#scoping-environments-with-specs) the
`AUTO_DEVOPS_POSTGRES_CHANNEL`, `AUTO_DEVOPS_POSTGRES_DELETE_V1` and
diff --git a/doc/topics/git/git_rebase.md b/doc/topics/git/git_rebase.md
index 0b0759534b3..6a4608223b4 100644
--- a/doc/topics/git/git_rebase.md
+++ b/doc/topics/git/git_rebase.md
@@ -129,7 +129,7 @@ message, squash (join multiple commits into one), edit, or delete
commits. It is handy for changing past commit messages,
as well as for organizing the commit history of your branch to keep it clean.
-TIP: **Tip:**
+NOTE:
If you want to keep the default branch commit history clean, you don't need to
manually squash all your commits before merging every merge request;
with [Squash and Merge](../../user/project/merge_requests/squash_and_merge.md)
diff --git a/doc/topics/web_application_firewall/quick_start_guide.md b/doc/topics/web_application_firewall/quick_start_guide.md
index 78cc31281fe..03b252a0700 100644
--- a/doc/topics/web_application_firewall/quick_start_guide.md
+++ b/doc/topics/web_application_firewall/quick_start_guide.md
@@ -30,7 +30,7 @@ Google account (for example, one that you use to access Gmail, Drive, etc.) or c
1. To enable the required APIs and related services, follow the steps in the ["Before you begin" section of the Kubernetes Engine docs](https://cloud.google.com/kubernetes-engine/docs/quickstart#before-you-begin).
1. Make sure you have created a [billing account](https://cloud.google.com/billing/docs/how-to/manage-billing-account).
-TIP: **Tip:**
+NOTE:
Every new Google Cloud Platform (GCP) account receives [$300 in credit](https://console.cloud.google.com/freetrial),
and in partnership with Google, GitLab is able to offer an additional $200 for new GCP accounts to get started with GitLab's
Google Kubernetes Engine integration. All you have to do is [follow this link](https://cloud.google.com/partners/partnercredit/?PCN=a0n60000006Vpz4AAC) and apply for credit.
diff --git a/doc/user/admin_area/activating_deactivating_users.md b/doc/user/admin_area/activating_deactivating_users.md
index cd28107803a..1bca1751d2e 100644
--- a/doc/user/admin_area/activating_deactivating_users.md
+++ b/doc/user/admin_area/activating_deactivating_users.md
@@ -65,5 +65,5 @@ NOTE:
Activating a user changes the user's state to active and consumes a
[seat](../../subscriptions/self_managed/index.md#billable-users).
-TIP: **Tip:**
+NOTE:
A deactivated user can also activate their account themselves by simply logging back in via the UI.
diff --git a/doc/user/admin_area/broadcast_messages.md b/doc/user/admin_area/broadcast_messages.md
index c6f5d8f7aa3..c96c57a99eb 100644
--- a/doc/user/admin_area/broadcast_messages.md
+++ b/doc/user/admin_area/broadcast_messages.md
@@ -89,7 +89,7 @@ To edit a broadcast message:
1. From the list of broadcast messages, click the appropriate button to edit the message.
1. After making the required changes, click the **Update broadcast message** button.
-TIP: **Tip:**
+NOTE:
Expired messages can be made active again by changing their end date.
## Deleting a broadcast message
diff --git a/doc/user/clusters/applications.md b/doc/user/clusters/applications.md
index f9a9f17840e..d42d3ba9d3d 100644
--- a/doc/user/clusters/applications.md
+++ b/doc/user/clusters/applications.md
@@ -178,7 +178,7 @@ to determine the external endpoint and it should be available within a few minut
After you install Ingress, the external endpoint should be available within a few minutes.
-TIP: **Tip:**
+NOTE:
This endpoint can be used for the
[Auto DevOps base domain](../../topics/autodevops/index.md#auto-devops-base-domain)
using the `KUBE_INGRESS_BASE_DOMAIN` environment variable.
diff --git a/doc/user/discussions/index.md b/doc/user/discussions/index.md
index e2d883bcb41..964e5e35d16 100644
--- a/doc/user/discussions/index.md
+++ b/doc/user/discussions/index.md
@@ -85,7 +85,7 @@ Threads created this way will only appear in the original merge request
and not when navigating to that commit under your project's
**Repository > Commits** page.
-TIP: **Tip:**
+NOTE:
When a link of a commit reference is found in a thread inside a merge
request, it will be automatically converted to a link in the context of the
current merge request.
diff --git a/doc/user/group/epics/index.md b/doc/user/group/epics/index.md
index af6c5c22ec3..0b64371b0f5 100644
--- a/doc/user/group/epics/index.md
+++ b/doc/user/group/epics/index.md
@@ -105,35 +105,18 @@ steps to create, move, reorder, or delete child epics.
To set a **Start date** and **Due date** for an epic, select one of the following:
-- **Fixed**: Enter a fixed value.
-- **From milestones**: Inherit a dynamic value from the milestones that are assigned to the epic's issues.
- Note that GitLab 12.5 replaced this option with **Inherited**.
-- **Inherited**: Inherit a dynamic value from the epic's issues, child epics, and milestones ([Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/7332) in GitLab 12.5 to replace **From milestones**).
-
-### From milestones
-
-> [Replaced](https://gitlab.com/gitlab-org/gitlab/-/issues/7332) in GitLab 12.5 by **Inherited**.
-
-If you select **From milestones** for the start date, GitLab automatically sets the date to be earliest
-start date across all milestones that are assigned to the issues that belong to the epic.
-If you select **From milestones** for the due date, GitLab sets the date to be the latest due date across
-all milestones that are assigned to those issues.
-
-These are dynamic dates which are recalculated if any of the following occur:
-
-- Milestones are re-assigned to the issues.
-- Milestone dates change.
-- Issues are added or removed from the epic.
+- **Fixed**: enter a fixed value.
+- **Inherited**: inherit a dynamic value from the epic's issues, child epics, and milestones.
### Inherited
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/7332) in GitLab 12.5 to replace **From milestones**.
-If you select:
+If you select **Inherited**:
-- **Inherited** for the start date, GitLab scans all child epics and issues assigned to the epic,
+- For the **start date**: GitLab scans all child epics and issues assigned to the epic,
and sets the start date to match the earliest found start date or milestone.
-- **Inherited** for the due date, GitLab sets the due date to match the latest due date or
+- For the **due date**: GitLab sets the due date to match the latest due date or
milestone found among its child epics and issues.
These are dynamic dates and recalculated if any of the following occur:
diff --git a/doc/user/group/index.md b/doc/user/group/index.md
index e7cc94ebd9f..998e39fa62c 100644
--- a/doc/user/group/index.md
+++ b/doc/user/group/index.md
@@ -487,7 +487,7 @@ It is currently not possible to rename a namespace if it contains a
project with [Container Registry](../packages/container_registry/index.md) tags,
because the project cannot be moved.
-TIP: **Tip:**
+NOTE:
If you want to retain ownership over the original namespace and
protect the URL redirects, then instead of changing a group's path or renaming a
username, you can create a new group and transfer projects to it.
diff --git a/doc/user/group/saml_sso/scim_setup.md b/doc/user/group/saml_sso/scim_setup.md
index d519864627c..8e45cabcbed 100644
--- a/doc/user/group/saml_sso/scim_setup.md
+++ b/doc/user/group/saml_sso/scim_setup.md
@@ -132,7 +132,7 @@ configuration. Otherwise, the Okta SCIM app may not work properly.
1. If you see an **Admin** button in the top right, click the button. This will
ensure you are in the Admin area.
- TIP: **Tip:**
+ NOTE:
If you're using the Developer Console, click **Developer Console** in the top
bar and select **Classic UI**. Otherwise, you may not see the buttons described
in the following steps:
diff --git a/doc/user/markdown.md b/doc/user/markdown.md
index bc9043b507c..f2633749cd3 100644
--- a/doc/user/markdown.md
+++ b/doc/user/markdown.md
@@ -1128,7 +1128,7 @@ These details <em>remain</em> <strong>hidden</strong> until expanded.
Markdown inside these tags is supported as well.
-TIP: **Tip:**
+NOTE:
If your Markdown isn't rendering correctly, try adding
`{::options parse_block_html="true" /}` to the top of the page, and add
`markdown="span"` to the opening summary tag like this: `<summary markdown="span">`.
diff --git a/doc/user/packages/container_registry/index.md b/doc/user/packages/container_registry/index.md
index f7ee03f47fe..3e794de22ae 100644
--- a/doc/user/packages/container_registry/index.md
+++ b/doc/user/packages/container_registry/index.md
@@ -426,7 +426,7 @@ delete_image:
- master
```
-TIP: **Tip:**
+NOTE:
You can download the latest `reg` release from
[the releases page](https://github.com/genuinetools/reg/releases), then update
the code example by changing the `REG_SHA256` and `REG_VERSION` variables
diff --git a/doc/user/packages/maven_repository/index.md b/doc/user/packages/maven_repository/index.md
index 83993ff3388..e0f5a400977 100644
--- a/doc/user/packages/maven_repository/index.md
+++ b/doc/user/packages/maven_repository/index.md
@@ -653,7 +653,7 @@ The message should show that the package is downloading from the Package Registr
Downloading from gitlab-maven: http://gitlab.example.com/api/v4/projects/PROJECT_ID/packages/maven/com/mycompany/mydepartment/my-project/1.0-SNAPSHOT/my-project-1.0-20200128.120857-1.pom
```
-TIP: **Tip:**
+NOTE:
In the GitLab UI, on the Package Registry page for Maven, you can view and copy these commands.
### Use Gradle
diff --git a/doc/user/permissions.md b/doc/user/permissions.md
index 77a17461947..b6ff850b182 100644
--- a/doc/user/permissions.md
+++ b/doc/user/permissions.md
@@ -378,7 +378,7 @@ project is internal or private, Guest users have all the abilities that are
mentioned in the [permissions table above](#project-members-permissions) (they
are unable to browse the project's repository, for example).
-TIP: **Tip:**
+NOTE:
To prevent a guest user from creating projects, as an admin, you can edit the
user's profile to mark the user as [external](#external-users).
Beware though that even if a user is external, if they already have Reporter or
diff --git a/doc/user/profile/account/two_factor_authentication.md b/doc/user/profile/account/two_factor_authentication.md
index d5605240cbe..27a2526547c 100644
--- a/doc/user/profile/account/two_factor_authentication.md
+++ b/doc/user/profile/account/two_factor_authentication.md
@@ -18,7 +18,7 @@ password secret.
## Overview
-TIP: **Tip:**
+NOTE:
When you enable 2FA, don't forget to back up your [recovery codes](#recovery-codes)!
In addition to time-based one time passwords (TOTP), GitLab supports U2F
diff --git a/doc/user/profile/index.md b/doc/user/profile/index.md
index 7c644afbb7d..59113a8bc44 100644
--- a/doc/user/profile/index.md
+++ b/doc/user/profile/index.md
@@ -106,7 +106,7 @@ It is currently not possible to change your username if it contains a
project with [Container Registry](../packages/container_registry/index.md) tags,
because the project cannot be moved.
-TIP: **Tip:**
+NOTE:
If you want to retain ownership over the original namespace and
protect the URL redirects, then instead of changing a group's path or renaming a
username, you can create a new group and transfer projects to it.
diff --git a/doc/user/project/clusters/add_remove_clusters.md b/doc/user/project/clusters/add_remove_clusters.md
index 4f4034ade7a..d4f5237311a 100644
--- a/doc/user/project/clusters/add_remove_clusters.md
+++ b/doc/user/project/clusters/add_remove_clusters.md
@@ -18,7 +18,7 @@ Watch the webcast [Scalable app deployment with GitLab and Google Cloud Platform
and learn how to spin up a Kubernetes cluster managed by Google Cloud Platform (GCP)
in a few clicks.
-TIP: **Tip:**
+NOTE:
Every new Google Cloud Platform (GCP) account receives
[$300 in credit upon sign up](https://console.cloud.google.com/freetrial).
In partnership with Google, GitLab is able to offer an additional $200 for new GCP
diff --git a/doc/user/project/description_templates.md b/doc/user/project/description_templates.md
index 27ccd36d9ae..db2631f9596 100644
--- a/doc/user/project/description_templates.md
+++ b/doc/user/project/description_templates.md
@@ -79,7 +79,7 @@ This enables the `Bug` dropdown option when creating or editing issues. When
to the issue description field. The **Reset template** button discards any
changes you made after picking the template and returns it to its initial status.
-TIP: **Tip:**
+NOTE:
You can create short-cut links to create an issue using a designated template. For example: `https://gitlab.com/gitlab-org/gitlab/-/issues/new?issuable_template=Feature%20proposal`.
![Description templates](img/description_templates.png)
@@ -117,7 +117,7 @@ We make use of Description Templates for Issues and Merge Requests within the Gi
Edition project. Please refer to the [`.gitlab` folder](https://gitlab.com/gitlab-org/gitlab/tree/master/.gitlab)
for some examples.
-TIP: **Tip:**
+NOTE:
It's possible to use [quick actions](quick_actions.md) within description templates to quickly add
labels, assignees, and milestones. The quick actions are only executed if the user submitting
the issue or merge request has the permissions to perform the relevant actions.
diff --git a/doc/user/project/issues/confidential_issues.md b/doc/user/project/issues/confidential_issues.md
index 17412f879f5..02cb0313a74 100644
--- a/doc/user/project/issues/confidential_issues.md
+++ b/doc/user/project/issues/confidential_issues.md
@@ -100,7 +100,7 @@ confidential information prematurely. When the confidential commits are ready
to be made public, this can be done by opening a merge request from the private
fork to the public upstream project.
-TIP: **Best practice:**
+NOTE:
If you create a long-lived private fork in the same group or in a sub-group of
the original upstream, all the users with Developer membership to the public
project will also have the same permissions in the private project. This way,
diff --git a/doc/user/project/issues/issue_data_and_actions.md b/doc/user/project/issues/issue_data_and_actions.md
index 04aeb991784..960d10b48d5 100644
--- a/doc/user/project/issues/issue_data_and_actions.md
+++ b/doc/user/project/issues/issue_data_and_actions.md
@@ -93,7 +93,7 @@ The assignee(s) can be changed as often as needed. The idea is that the assignee
responsible for that issue until it's reassigned to someone else to take it from there.
When assigned to someone, it will appear in their assigned issues list.
-TIP: **Tip:**
+NOTE:
If a user is not member of that project, it can only be
assigned to them if they created the issue themselves.
@@ -136,7 +136,7 @@ Group Labels, which allow you to use the same labels for all projects within the
group, can be also given to issues. They work exactly the same, but they are immediately
available to all projects in the group.
-TIP: **Tip:**
+NOTE:
If a label doesn't exist yet, you can click **Edit**, and it opens a dropdown menu
from which you can select **Create new label**.
@@ -203,7 +203,7 @@ Mentions for yourself (the current logged in user), will be highlighted in a dif
color, allowing you to easily see which comments involve you, helping you focus on
them quickly.
-TIP: **Tip:**
+NOTE:
Avoid mentioning `@all` in issues and merge requests, as it sends an email notification
to all the members of that project's group, which can be interpreted as spam.
@@ -225,7 +225,7 @@ You can award an emoji to that issue. There are shortcuts to "thumbs_up" and "th
or you can click on the light gray "face" to choose a different reaction from the
dropdown list of available [GitLab Flavored Markdown Emoji](../../markdown.md#emoji).
-TIP: **Tip:**
+NOTE:
Posting "+1" as a comment in a thread spams all subscribed participants of that issue,
clutters the threads, and is not recommended. Awarding an emoji is a way
to let them know your reaction without spamming them.
diff --git a/doc/user/project/issues/related_issues.md b/doc/user/project/issues/related_issues.md
index 66921739fd6..82b2d4fde52 100644
--- a/doc/user/project/issues/related_issues.md
+++ b/doc/user/project/issues/related_issues.md
@@ -23,7 +23,7 @@ The relationship only shows up in the UI if the user can see both issues.
When you try to close an issue that has open blockers, a warning is displayed.
-TIP: **Tip:**
+NOTE:
To manage related issues through our API, visit the [issue links API documentation](../../../api/issue_links.md).
## Adding a related issue
diff --git a/doc/user/project/merge_requests/code_quality.md b/doc/user/project/merge_requests/code_quality.md
index 8cffdc881b2..5a98338a81b 100644
--- a/doc/user/project/merge_requests/code_quality.md
+++ b/doc/user/project/merge_requests/code_quality.md
@@ -131,7 +131,7 @@ stages:
- test
```
-TIP: **Tip:**
+NOTE:
This information is automatically extracted and shown right in the merge request widget.
WARNING:
diff --git a/doc/user/project/merge_requests/creating_merge_requests.md b/doc/user/project/merge_requests/creating_merge_requests.md
index 2d4be285871..5adc4ab6b6e 100644
--- a/doc/user/project/merge_requests/creating_merge_requests.md
+++ b/doc/user/project/merge_requests/creating_merge_requests.md
@@ -46,7 +46,7 @@ the merge request.
![New Merge Request page](img/new_merge_request_page_v12_6.png)
-TIP: **Tip:**
+NOTE:
You can push one or more times to your branch in GitLab before
creating the merge request.
diff --git a/doc/user/project/merge_requests/reviewing_and_managing_merge_requests.md b/doc/user/project/merge_requests/reviewing_and_managing_merge_requests.md
index 6dc5fe209a2..726a7102663 100644
--- a/doc/user/project/merge_requests/reviewing_and_managing_merge_requests.md
+++ b/doc/user/project/merge_requests/reviewing_and_managing_merge_requests.md
@@ -132,7 +132,7 @@ specific commit page.
![MR diff](img/merge_request_diff.png)
-TIP: **Tip:**
+NOTE:
You can append `?w=1` while on the diffs page of a merge request to ignore any
whitespace changes.
diff --git a/doc/user/project/pages/lets_encrypt_for_gitlab_pages.md b/doc/user/project/pages/lets_encrypt_for_gitlab_pages.md
index 1cb7fe2ef22..331f2840ad6 100644
--- a/doc/user/project/pages/lets_encrypt_for_gitlab_pages.md
+++ b/doc/user/project/pages/lets_encrypt_for_gitlab_pages.md
@@ -67,7 +67,7 @@ might be slightly different. Follow the
sudo certbot certonly -a manual -d example.com --register-unsafely-without-email
```
- TIP: **Tip:**
+ NOTE:
Read through CertBot's documentation on their
[command line options](https://certbot.eff.org/docs/using.html#certbot-command-line-options).
diff --git a/doc/user/project/repository/file_finder.md b/doc/user/project/repository/file_finder.md
index 11fbb9938c6..4f996df5fef 100644
--- a/doc/user/project/repository/file_finder.md
+++ b/doc/user/project/repository/file_finder.md
@@ -40,7 +40,7 @@ the `app/controllers/admin/deploy_keys_controller.rb` file.
Using a fuzzy search, we start by typing letters that get us closer to the file.
-TIP: **Tip:**
+NOTE:
To narrow down your search, include `/` in your search terms.
![Find file button](img/file_finder_find_file_v12_10.png)
diff --git a/lib/gitlab/cycle_analytics/builds_event_helper.rb b/lib/gitlab/cycle_analytics/builds_event_helper.rb
index 0d6f32fdc6f..c39d41578e9 100644
--- a/lib/gitlab/cycle_analytics/builds_event_helper.rb
+++ b/lib/gitlab/cycle_analytics/builds_event_helper.rb
@@ -3,11 +3,11 @@
module Gitlab
module CycleAnalytics
module BuildsEventHelper
- def initialize(*args)
+ def initialize(...)
@projections = [build_table[:id]]
@order = build_table[:created_at]
- super(*args)
+ super(...)
end
def fetch
diff --git a/lib/gitlab/cycle_analytics/code_event_fetcher.rb b/lib/gitlab/cycle_analytics/code_event_fetcher.rb
index d75da76415a..790bf32c6c7 100644
--- a/lib/gitlab/cycle_analytics/code_event_fetcher.rb
+++ b/lib/gitlab/cycle_analytics/code_event_fetcher.rb
@@ -5,7 +5,7 @@ module Gitlab
class CodeEventFetcher < BaseEventFetcher
include CodeHelper
- def initialize(*args)
+ def initialize(...)
@projections = [mr_table[:title],
mr_table[:iid],
mr_table[:id],
@@ -14,7 +14,7 @@ module Gitlab
mr_table[:author_id]]
@order = mr_table[:created_at]
- super(*args)
+ super(...)
end
private
diff --git a/lib/gitlab/cycle_analytics/issue_event_fetcher.rb b/lib/gitlab/cycle_analytics/issue_event_fetcher.rb
index 6914cf24c19..fd04ec090b3 100644
--- a/lib/gitlab/cycle_analytics/issue_event_fetcher.rb
+++ b/lib/gitlab/cycle_analytics/issue_event_fetcher.rb
@@ -5,14 +5,14 @@ module Gitlab
class IssueEventFetcher < BaseEventFetcher
include IssueHelper
- def initialize(*args)
+ def initialize(...)
@projections = [issue_table[:title],
issue_table[:iid],
issue_table[:id],
issue_table[:created_at],
issue_table[:author_id]]
- super(*args)
+ super(...)
end
private
diff --git a/lib/gitlab/cycle_analytics/permissions.rb b/lib/gitlab/cycle_analytics/permissions.rb
index 55214e6b896..0e094fabb01 100644
--- a/lib/gitlab/cycle_analytics/permissions.rb
+++ b/lib/gitlab/cycle_analytics/permissions.rb
@@ -12,8 +12,8 @@ module Gitlab
production: :read_issue
}.freeze
- def self.get(*args)
- new(*args).get
+ def self.get(...)
+ new(...).get
end
def initialize(user:, project:)
diff --git a/lib/gitlab/cycle_analytics/plan_event_fetcher.rb b/lib/gitlab/cycle_analytics/plan_event_fetcher.rb
index bad02e00a13..4d98d589e46 100644
--- a/lib/gitlab/cycle_analytics/plan_event_fetcher.rb
+++ b/lib/gitlab/cycle_analytics/plan_event_fetcher.rb
@@ -5,14 +5,14 @@ module Gitlab
class PlanEventFetcher < BaseEventFetcher
include PlanHelper
- def initialize(*args)
+ def initialize(...)
@projections = [issue_table[:title],
issue_table[:iid],
issue_table[:id],
issue_table[:created_at],
issue_table[:author_id]]
- super(*args)
+ super(...)
end
private
diff --git a/lib/gitlab/cycle_analytics/production_event_fetcher.rb b/lib/gitlab/cycle_analytics/production_event_fetcher.rb
index 8843ab2bcb9..5fa286bd3df 100644
--- a/lib/gitlab/cycle_analytics/production_event_fetcher.rb
+++ b/lib/gitlab/cycle_analytics/production_event_fetcher.rb
@@ -5,7 +5,7 @@ module Gitlab
class ProductionEventFetcher < BaseEventFetcher
include ProductionHelper
- def initialize(*args)
+ def initialize(...)
@projections = [issue_table[:title],
issue_table[:iid],
issue_table[:id],
@@ -13,7 +13,7 @@ module Gitlab
issue_table[:author_id],
routes_table[:path]]
- super(*args)
+ super(...)
end
private
diff --git a/lib/gitlab/cycle_analytics/review_event_fetcher.rb b/lib/gitlab/cycle_analytics/review_event_fetcher.rb
index f5f8c19683d..0b7d160c7de 100644
--- a/lib/gitlab/cycle_analytics/review_event_fetcher.rb
+++ b/lib/gitlab/cycle_analytics/review_event_fetcher.rb
@@ -5,7 +5,7 @@ module Gitlab
class ReviewEventFetcher < BaseEventFetcher
include ReviewHelper
- def initialize(*args)
+ def initialize(...)
@projections = [mr_table[:title],
mr_table[:iid],
mr_table[:id],
@@ -13,7 +13,7 @@ module Gitlab
mr_table[:state_id],
mr_table[:author_id]]
- super(*args)
+ super(...)
end
private
diff --git a/lib/gitlab/cycle_analytics/updater.rb b/lib/gitlab/cycle_analytics/updater.rb
index c642809a792..5be351989e0 100644
--- a/lib/gitlab/cycle_analytics/updater.rb
+++ b/lib/gitlab/cycle_analytics/updater.rb
@@ -3,8 +3,8 @@
module Gitlab
module CycleAnalytics
class Updater
- def self.update!(*args)
- new(*args).update!
+ def self.update!(...)
+ new(...).update!
end
def initialize(event_result, from:, to:, klass:)
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 53e92f806ee..17dbe063104 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -14368,15 +14368,6 @@ msgstr ""
msgid "Imported requirements"
msgstr ""
-msgid "Improve Issue Boards"
-msgstr ""
-
-msgid "Improve Issue boards"
-msgstr ""
-
-msgid "Improve Issue boards with GitLab Enterprise Edition."
-msgstr ""
-
msgid "Improve Merge Requests and customer support with GitLab Enterprise Edition."
msgstr ""
@@ -18011,9 +18002,6 @@ msgstr ""
msgid "Multiple domains are supported."
msgstr ""
-msgid "Multiple issue boards"
-msgstr ""
-
msgid "Multiple model types found: %{model_types}"
msgstr ""
@@ -23941,9 +23929,6 @@ msgstr ""
msgid "Scope"
msgstr ""
-msgid "Scoped issue boards"
-msgstr ""
-
msgid "Scopes"
msgstr ""
@@ -27101,9 +27086,6 @@ msgstr ""
msgid "Thanks for your purchase!"
msgstr ""
-msgid "Thanks! Don't show me this again"
-msgstr ""
-
msgid "That's it, well done!"
msgstr ""
@@ -29560,9 +29542,6 @@ msgstr ""
msgid "Upgrade your plan to enable this feature of the Jira Integration."
msgstr ""
-msgid "Upgrade your plan to improve Issue boards."
-msgstr ""
-
msgid "Upgrade your plan to improve Merge Requests."
msgstr ""
diff --git a/spec/features/alert_management/alert_management_list_spec.rb b/spec/features/alert_management/alert_management_list_spec.rb
index 37658f8c545..44ed2f3d60c 100644
--- a/spec/features/alert_management/alert_management_list_spec.rb
+++ b/spec/features/alert_management/alert_management_list_spec.rb
@@ -5,54 +5,54 @@ require 'spec_helper'
RSpec.describe 'Alert Management index', :js do
let_it_be(:project) { create(:project) }
let_it_be(:developer) { create(:user) }
- let_it_be(:alert) { create(:alert_management_alert, project: project, status: 'triggered') }
before_all do
project.add_developer(developer)
end
- before do
- sign_in(developer)
+ context 'when a developer displays the alert list' do
+ before do
+ sign_in(developer)
- visit project_alert_management_index_path(project)
- wait_for_requests
- end
-
- context 'when a developer displays the alert list and alert integrations are not enabled' do
- it 'shows the alert page title' do
- expect(page).to have_content('Alerts')
+ visit project_alert_management_index_path(project)
+ wait_for_requests
end
- it 'shows the empty state by default' do
+ it 'shows the alert page title and empty state without filtered search or alert table' do
+ expect(page).to have_content('Alerts')
expect(page).to have_content('Surface alerts in GitLab')
- end
-
- it 'does not show the filtered search' do
+ expect(page).not_to have_selector('.gl-table')
page.within('.layout-page') do
expect(page).not_to have_css('[data-testid="search-icon"]')
end
end
- it 'does not show the alert table' do
- expect(page).not_to have_selector('.gl-table')
+ shared_examples 'alert page with title, filtered search, and table' do
+ it 'renders correctly' do
+ expect(page).to have_content('Alerts')
+ expect(page).to have_selector('.gl-table')
+ page.within('.layout-page') do
+ expect(page).to have_css('[data-testid="search-icon"]')
+ end
+ end
end
- end
- context 'when a developer displays the alert list and an HTTP integration is enabled' do
- let_it_be(:integration) { create(:alert_management_http_integration, project: project) }
+ context 'when alerts have already been created' do
+ let_it_be(:alert) { create(:alert_management_alert, project: project) }
- it 'shows the alert page title' do
- expect(page).to have_content('Alerts')
+ it_behaves_like 'alert page with title, filtered search, and table'
end
- it 'shows the filtered search' do
- page.within('.layout-page') do
- expect(page).to have_css('[data-testid="search-icon"]')
- end
+ context 'when an HTTP integration is enabled' do
+ let_it_be(:integration) { create(:alert_management_http_integration, project: project) }
+
+ it_behaves_like 'alert page with title, filtered search, and table'
end
- it 'shows the alert table' do
- expect(page).to have_selector('.gl-table')
+ context 'when the prometheus integration is enabled' do
+ let_it_be(:integration) { create(:prometheus_service, project: project) }
+
+ it_behaves_like 'alert page with title, filtered search, and table'
end
end
end
diff --git a/spec/finders/ci/pipelines_for_merge_request_finder_spec.rb b/spec/finders/ci/pipelines_for_merge_request_finder_spec.rb
index 65f6dc0ba74..64b3c46e122 100644
--- a/spec/finders/ci/pipelines_for_merge_request_finder_spec.rb
+++ b/spec/finders/ci/pipelines_for_merge_request_finder_spec.rb
@@ -225,6 +225,24 @@ RSpec.describe Ci::PipelinesForMergeRequestFinder do
branch_pipeline_2,
branch_pipeline])
end
+
+ context 'when ci_pipelines_for_merge_request_finder_new_cte feature flag is disabled' do
+ before do
+ stub_feature_flags(ci_pipelines_for_merge_request_finder_new_cte: false)
+ end
+
+ it 'returns only related merge request pipelines' do
+ expect(subject.all)
+ .to eq([detached_merge_request_pipeline,
+ branch_pipeline_2,
+ branch_pipeline])
+
+ expect(described_class.new(merge_request_2, nil).all)
+ .to eq([detached_merge_request_pipeline_2,
+ branch_pipeline_2,
+ branch_pipeline])
+ end
+ end
end
context 'when detached merge request pipeline is run on head ref of the merge request' do
diff --git a/spec/frontend/boards/components/board_content_spec.js b/spec/frontend/boards/components/board_content_spec.js
index 1cf05404cc9..5918710cbf5 100644
--- a/spec/frontend/boards/components/board_content_spec.js
+++ b/spec/frontend/boards/components/board_content_spec.js
@@ -3,8 +3,8 @@ import { createLocalVue, shallowMount } from '@vue/test-utils';
import { GlAlert } from '@gitlab/ui';
import Draggable from 'vuedraggable';
import EpicsSwimlanes from 'ee_component/boards/components/epics_swimlanes.vue';
-import BoardColumn from 'ee_else_ce/boards/components/board_column.vue';
import getters from 'ee_else_ce/boards/stores/getters';
+import BoardColumn from '~/boards/components/board_column.vue';
import { mockListsWithModel } from '../mock_data';
import BoardContent from '~/boards/components/board_content.vue';
@@ -13,7 +13,6 @@ localVue.use(Vuex);
const actions = {
moveList: jest.fn(),
- showPromotionList: jest.fn(),
};
describe('BoardContent', () => {
diff --git a/spec/frontend/boards/components/board_list_header_new_spec.js b/spec/frontend/boards/components/board_list_header_new_spec.js
index 80786d82620..5a0bf351992 100644
--- a/spec/frontend/boards/components/board_list_header_new_spec.js
+++ b/spec/frontend/boards/components/board_list_header_new_spec.js
@@ -79,7 +79,7 @@ describe('Board List Header Component', () => {
const findCaret = () => wrapper.find('.board-title-caret');
describe('Add issue button', () => {
- const hasNoAddButton = [ListType.promotion, ListType.blank, ListType.closed];
+ const hasNoAddButton = [ListType.blank, ListType.closed];
const hasAddButton = [ListType.backlog, ListType.label, ListType.milestone, ListType.assignee];
it.each(hasNoAddButton)('does not render when List Type is `%s`', listType => {
diff --git a/spec/frontend/boards/components/board_list_header_spec.js b/spec/frontend/boards/components/board_list_header_spec.js
index 2439c347bf0..9b7bf7a0854 100644
--- a/spec/frontend/boards/components/board_list_header_spec.js
+++ b/spec/frontend/boards/components/board_list_header_spec.js
@@ -73,7 +73,7 @@ describe('Board List Header Component', () => {
const findCaret = () => wrapper.find('.board-title-caret');
describe('Add issue button', () => {
- const hasNoAddButton = [ListType.promotion, ListType.blank, ListType.closed];
+ const hasNoAddButton = [ListType.blank, ListType.closed];
const hasAddButton = [ListType.backlog, ListType.label, ListType.milestone, ListType.assignee];
it.each(hasNoAddButton)('does not render when List Type is `%s`', listType => {
diff --git a/spec/graphql/mutations/container_repositories/destroy_tags_spec.rb b/spec/graphql/mutations/container_repositories/destroy_tags_spec.rb
new file mode 100644
index 00000000000..f22d9ffe753
--- /dev/null
+++ b/spec/graphql/mutations/container_repositories/destroy_tags_spec.rb
@@ -0,0 +1,92 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe Mutations::ContainerRepositories::DestroyTags do
+ include_context 'container repository delete tags service shared context'
+ using RSpec::Parameterized::TableSyntax
+
+ let(:id) { repository.to_global_id.to_s }
+
+ specify { expect(described_class).to require_graphql_authorizations(:destroy_container_image) }
+
+ describe '#resolve' do
+ let(:tags) { %w[A C D E] }
+
+ subject do
+ described_class.new(object: nil, context: { current_user: user }, field: nil)
+ .resolve(id: id, tag_names: tags)
+ end
+
+ shared_examples 'destroying container repository tags' do
+ before do
+ stub_delete_reference_requests(tags)
+ expect_delete_tag_by_names(tags)
+ allow_next_instance_of(ContainerRegistry::Client) do |client|
+ allow(client).to receive(:supports_tag_delete?).and_return(true)
+ end
+ end
+
+ it 'destroys the container repository tags' do
+ expect(Projects::ContainerRepository::DeleteTagsService)
+ .to receive(:new).and_call_original
+
+ expect(subject).to eq(errors: [], deleted_tag_names: tags)
+ end
+
+ it 'creates a package event' do
+ expect(::Packages::CreateEventService)
+ .to receive(:new).with(nil, user, event_name: :delete_tag_bulk, scope: :tag).and_call_original
+ expect { subject }.to change { ::Packages::Event.count }.by(1)
+ end
+ end
+
+ shared_examples 'denying access to container respository' do
+ it 'raises an error' do
+ expect(::Projects::ContainerRepository::DeleteTagsService).not_to receive(:new)
+
+ expect { subject }.to raise_error(Gitlab::Graphql::Errors::ResourceNotAvailable)
+ end
+ end
+
+ context 'with valid id' do
+ where(:user_role, :shared_examples_name) do
+ :maintainer | 'destroying container repository tags'
+ :developer | 'destroying container repository tags'
+ :reporter | 'denying access to container respository'
+ :guest | 'denying access to container respository'
+ :anonymous | 'denying access to container respository'
+ end
+
+ with_them do
+ before do
+ project.send("add_#{user_role}", user) unless user_role == :anonymous
+ end
+
+ it_behaves_like params[:shared_examples_name]
+ end
+ end
+
+ context 'with invalid id' do
+ let(:id) { 'gid://gitlab/ContainerRepository/5555' }
+
+ it_behaves_like 'denying access to container respository'
+ end
+
+ context 'with service error' do
+ before do
+ project.add_maintainer(user)
+ allow_next_instance_of(Projects::ContainerRepository::DeleteTagsService) do |service|
+ allow(service).to receive(:execute).and_return(message: 'could not delete tags', status: :error)
+ end
+ end
+
+ it { is_expected.to eq(errors: ['could not delete tags'], deleted_tag_names: []) }
+
+ it 'does not create a package event' do
+ expect(::Packages::CreateEventService).not_to receive(:new)
+ expect { subject }.not_to change { ::Packages::Event.count }
+ end
+ end
+ end
+end
diff --git a/spec/graphql/resolvers/user_discussions_count_resolver_spec.rb b/spec/graphql/resolvers/user_discussions_count_resolver_spec.rb
new file mode 100644
index 00000000000..cc855bbcb53
--- /dev/null
+++ b/spec/graphql/resolvers/user_discussions_count_resolver_spec.rb
@@ -0,0 +1,54 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe Resolvers::UserDiscussionsCountResolver do
+ include GraphqlHelpers
+
+ describe '#resolve' do
+ let_it_be(:user) { create(:user) }
+ let_it_be(:project) { create(:project, :public) }
+ let_it_be(:private_project) { create(:project, :private) }
+ let_it_be(:issue) { create(:issue, project: project) }
+ let_it_be(:private_issue) { create(:issue, project: private_project) }
+ let_it_be(:public_discussions) { create_list(:discussion_note_on_issue, 2, noteable: issue, project: project) }
+ let_it_be(:system_discussion) { create(:discussion_note_on_issue, system: true, noteable: issue, project: project) }
+ let_it_be(:private_discussion) { create_list(:discussion_note_on_issue, 3, noteable: private_issue, project: private_project) }
+
+ specify do
+ expect(described_class).to have_nullable_graphql_type(GraphQL::INT_TYPE)
+ end
+
+ context 'when counting discussions from a public issue' do
+ subject { batch_sync { resolve_user_discussions_count(issue) } }
+
+ it 'returns the number of discussions for the issue' do
+ expect(subject).to eq(2)
+ end
+ end
+
+ context 'when a user has permission to view discussions' do
+ before do
+ private_project.add_developer(user)
+ end
+
+ subject { batch_sync { resolve_user_discussions_count(private_issue) } }
+
+ it 'returns the number of non-system discussions for the issue' do
+ expect(subject).to eq(3)
+ end
+ end
+
+ context 'when a user does not have permission to view discussions' do
+ subject { batch_sync { resolve_user_discussions_count(private_issue) } }
+
+ it 'returns no discussions' do
+ expect { subject }.to raise_error(Gitlab::Graphql::Errors::ResourceNotAvailable)
+ end
+ end
+ end
+
+ def resolve_user_discussions_count(obj)
+ resolve(described_class, obj: obj, ctx: { current_user: user })
+ end
+end
diff --git a/spec/graphql/resolvers/user_notes_count_resolver_spec.rb b/spec/graphql/resolvers/user_notes_count_resolver_spec.rb
new file mode 100644
index 00000000000..dfa813703a8
--- /dev/null
+++ b/spec/graphql/resolvers/user_notes_count_resolver_spec.rb
@@ -0,0 +1,54 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe Resolvers::UserNotesCountResolver do
+ include GraphqlHelpers
+
+ describe '#resolve' do
+ let_it_be(:user) { create(:user) }
+ let_it_be(:project) { create(:project, :public) }
+ let_it_be(:private_project) { create(:project, :private) }
+ let_it_be(:issue) { create(:issue, project: project) }
+ let_it_be(:private_issue) { create(:issue, project: private_project) }
+ let_it_be(:public_notes) { create_list(:note, 2, noteable: issue, project: project) }
+ let_it_be(:system_note) { create(:note, system: true, noteable: issue, project: project) }
+ let_it_be(:private_notes) { create_list(:note, 3, noteable: private_issue, project: private_project) }
+
+ specify do
+ expect(described_class).to have_nullable_graphql_type(GraphQL::INT_TYPE)
+ end
+
+ context 'when counting notes from a public issue' do
+ subject { batch_sync { resolve_user_notes_count(issue) } }
+
+ it 'returns the number of non-system notes for the issue' do
+ expect(subject).to eq(2)
+ end
+ end
+
+ context 'when a user has permission to view notes' do
+ before do
+ private_project.add_developer(user)
+ end
+
+ subject { batch_sync { resolve_user_notes_count(private_issue) } }
+
+ it 'returns the number of notes for the issue' do
+ expect(subject).to eq(3)
+ end
+ end
+
+ context 'when a user does not have permission to view discussions' do
+ subject { batch_sync { resolve_user_notes_count(private_issue) } }
+
+ it 'returns no notes' do
+ expect { subject }.to raise_error(Gitlab::Graphql::Errors::ResourceNotAvailable)
+ end
+ end
+ end
+
+ def resolve_user_notes_count(obj)
+ resolve(described_class, obj: obj, ctx: { current_user: user })
+ end
+end
diff --git a/spec/helpers/projects/alert_management_helper_spec.rb b/spec/helpers/projects/alert_management_helper_spec.rb
index f6d0c9ca49a..fd35c1ecab8 100644
--- a/spec/helpers/projects/alert_management_helper_spec.rb
+++ b/spec/helpers/projects/alert_management_helper_spec.rb
@@ -39,28 +39,6 @@ RSpec.describe Projects::AlertManagementHelper do
end
end
- context 'with alerts service' do
- let_it_be(:alerts_service) { create(:alerts_service, project: project) }
-
- context 'when alerts service is active' do
- it 'enables alert management' do
- expect(data).to include(
- 'alert-management-enabled' => 'true'
- )
- end
- end
-
- context 'when alerts service is inactive' do
- it 'disables alert management' do
- alerts_service.update!(active: false)
-
- expect(data).to include(
- 'alert-management-enabled' => 'false'
- )
- end
- end
- end
-
context 'with prometheus service' do
let_it_be(:prometheus_service) { create(:prometheus_service, project: project) }
@@ -105,6 +83,16 @@ RSpec.describe Projects::AlertManagementHelper do
end
end
+ context 'with an alert' do
+ let_it_be(:alert) { create(:alert_management_alert, project: project) }
+
+ it 'enables alert management' do
+ expect(data).to include(
+ 'alert-management-enabled' => 'true'
+ )
+ end
+ end
+
context 'when user does not have requisite enablement permissions' do
let(:user_can_enable_alert_management) { false }
diff --git a/spec/lib/gitlab/import_export/all_models.yml b/spec/lib/gitlab/import_export/all_models.yml
index 6cad75bb419..738dc19ab7b 100644
--- a/spec/lib/gitlab/import_export/all_models.yml
+++ b/spec/lib/gitlab/import_export/all_models.yml
@@ -552,6 +552,7 @@ project:
- build_report_results
- vulnerability_statistic
- vulnerability_historical_statistics
+- vulnerability_remediations
- product_analytics_events
- pipeline_artifacts
- terraform_states
diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb
index 24f2b12c87b..7c6b9b2e671 100644
--- a/spec/models/ci/pipeline_spec.rb
+++ b/spec/models/ci/pipeline_spec.rb
@@ -222,6 +222,26 @@ RSpec.describe Ci::Pipeline, :mailer, factory_default: :keep do
end
end
+ describe '.for_branch' do
+ subject { described_class.for_branch(branch) }
+
+ let(:branch) { 'master' }
+ let!(:pipeline) { create(:ci_pipeline, ref: 'master') }
+
+ it 'returns the pipeline' do
+ is_expected.to contain_exactly(pipeline)
+ end
+
+ context 'with tag pipeline' do
+ let(:branch) { 'v1.0' }
+ let!(:pipeline) { create(:ci_pipeline, ref: 'v1.0', tag: true) }
+
+ it 'returns nothing' do
+ is_expected.to be_empty
+ end
+ end
+ end
+
describe '.ci_sources' do
subject { described_class.ci_sources }
@@ -242,6 +262,27 @@ RSpec.describe Ci::Pipeline, :mailer, factory_default: :keep do
end
end
+ describe '.ci_branch_sources' do
+ subject { described_class.ci_branch_sources }
+
+ let_it_be(:push_pipeline) { create(:ci_pipeline, source: :push) }
+ let_it_be(:web_pipeline) { create(:ci_pipeline, source: :web) }
+ let_it_be(:api_pipeline) { create(:ci_pipeline, source: :api) }
+ let_it_be(:webide_pipeline) { create(:ci_pipeline, source: :webide) }
+ let_it_be(:child_pipeline) { create(:ci_pipeline, source: :parent_pipeline) }
+ let_it_be(:merge_request_pipeline) { create(:ci_pipeline, :detached_merge_request_pipeline) }
+
+ it 'contains pipelines having CI only sources' do
+ expect(subject).to contain_exactly(push_pipeline, web_pipeline, api_pipeline)
+ end
+
+ it 'filters on expected sources' do
+ expect(::Enums::Ci::Pipeline.ci_branch_sources.keys).to contain_exactly(
+ *%i[unknown push web trigger schedule api external pipeline chat
+ external_pull_request_event])
+ end
+ end
+
describe '.outside_pipeline_family' do
subject(:outside_pipeline_family) { described_class.outside_pipeline_family(upstream_pipeline) }
diff --git a/spec/requests/api/graphql/mutations/container_repository/destroy_spec.rb b/spec/requests/api/graphql/mutations/container_repository/destroy_spec.rb
index 645edfc2e43..c4121cfed42 100644
--- a/spec/requests/api/graphql/mutations/container_repository/destroy_spec.rb
+++ b/spec/requests/api/graphql/mutations/container_repository/destroy_spec.rb
@@ -22,7 +22,7 @@ RSpec.describe 'Destroying a container repository' do
GQL
end
- let(:params) { { id: container_repository.to_global_id.to_s } }
+ let(:params) { { id: id } }
let(:mutation) { graphql_mutation(:destroy_container_repository, params, query) }
let(:mutation_response) { graphql_mutation_response(:destroyContainerRepository) }
let(:container_repository_mutation_response) { mutation_response['containerRepository'] }
diff --git a/spec/requests/api/graphql/mutations/container_repository/destroy_tags_spec.rb b/spec/requests/api/graphql/mutations/container_repository/destroy_tags_spec.rb
new file mode 100644
index 00000000000..decb2e7bccc
--- /dev/null
+++ b/spec/requests/api/graphql/mutations/container_repository/destroy_tags_spec.rb
@@ -0,0 +1,120 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe 'Destroying a container repository tags' do
+ include_context 'container repository delete tags service shared context'
+ using RSpec::Parameterized::TableSyntax
+
+ include GraphqlHelpers
+
+ let(:id) { repository.to_global_id.to_s }
+ let(:tags) { %w[A C D E] }
+
+ let(:query) do
+ <<~GQL
+ deletedTagNames
+ errors
+ GQL
+ end
+
+ let(:params) { { id: id, tag_names: tags } }
+ let(:mutation) { graphql_mutation(:destroy_container_repository_tags, params, query) }
+ let(:mutation_response) { graphql_mutation_response(:destroyContainerRepositoryTags) }
+ let(:tag_names_response) { mutation_response['deletedTagNames'] }
+ let(:errors_response) { mutation_response['errors'] }
+
+ shared_examples 'destroying the container repository tags' do
+ before do
+ stub_delete_reference_requests(tags)
+ expect_delete_tag_by_names(tags)
+ allow_next_instance_of(ContainerRegistry::Client) do |client|
+ allow(client).to receive(:supports_tag_delete?).and_return(true)
+ end
+ end
+
+ it 'destroys the container repository tags' do
+ expect(Projects::ContainerRepository::DeleteTagsService)
+ .to receive(:new).and_call_original
+ expect { subject }.to change { ::Packages::Event.count }.by(1)
+
+ expect(tag_names_response).to eq(tags)
+ expect(errors_response).to eq([])
+ end
+
+ it_behaves_like 'returning response status', :success
+ end
+
+ shared_examples 'denying the mutation request' do
+ it 'does not destroy the container repository tags' do
+ expect(Projects::ContainerRepository::DeleteTagsService)
+ .not_to receive(:new)
+
+ expect { subject }.not_to change { ::Packages::Event.count }
+
+ expect(mutation_response).to be_nil
+ end
+
+ it_behaves_like 'returning response status', :success
+ end
+
+ describe 'post graphql mutation' do
+ subject { post_graphql_mutation(mutation, current_user: user) }
+
+ context 'with valid id' do
+ where(:user_role, :shared_examples_name) do
+ :maintainer | 'destroying the container repository tags'
+ :developer | 'destroying the container repository tags'
+ :reporter | 'denying the mutation request'
+ :guest | 'denying the mutation request'
+ :anonymous | 'denying the mutation request'
+ end
+
+ with_them do
+ before do
+ project.send("add_#{user_role}", user) unless user_role == :anonymous
+ end
+
+ it_behaves_like params[:shared_examples_name]
+ end
+ end
+
+ context 'with invalid id' do
+ let(:id) { 'gid://gitlab/ContainerRepository/5555' }
+
+ it_behaves_like 'denying the mutation request'
+ end
+
+ context 'with too many tags' do
+ let(:tags) { Array.new(Mutations::ContainerRepositories::DestroyTags::LIMIT + 1, 'x') }
+
+ it 'returns too many tags error' do
+ expect { subject }.not_to change { ::Packages::Event.count }
+
+ explanation = graphql_errors.dig(0, 'extensions', 'problems', 0, 'explanation')
+ expect(explanation).to eq(Mutations::ContainerRepositories::DestroyTags::TOO_MANY_TAGS_ERROR_MESSAGE)
+ end
+ end
+
+ context 'with service error' do
+ before do
+ project.add_maintainer(user)
+ allow_next_instance_of(Projects::ContainerRepository::DeleteTagsService) do |service|
+ allow(service).to receive(:execute).and_return(message: 'could not delete tags', status: :error)
+ end
+ end
+
+ it 'returns an error' do
+ subject
+
+ expect(tag_names_response).to eq([])
+ expect(errors_response).to eq(['could not delete tags'])
+ end
+
+ it 'does not create a package event' do
+ expect(::Packages::CreateEventService).not_to receive(:new)
+ expect { subject }.not_to change { ::Packages::Event.count }
+ end
+ end
+ end
+end