From 5d47d3f8ed7a2957c6feb96e3011bdfb93b7db29 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 29 Oct 2020 21:08:54 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- app/models/service.rb | 8 ++- .../bulk_create_integration_service.rb | 4 +- app/services/post_receive_service.rb | 20 ++++++- bin/feature-flag | 12 ++++ .../unreleased/218167-stop-review-for-ecs.yml | 5 ++ .../244289-quickaction-with-codeblocks.yml | 5 ++ changelogs/unreleased/rmay-216344-2.yml | 5 ++ .../deploy_boards_dedupe_instances.yml | 7 --- doc/user/abuse_reports.md | 6 ++ .../admin_area/analytics/dev_ops_report.md | 6 ++ doc/user/admin_area/analytics/index.md | 6 ++ .../analytics/instance_statistics.md | 6 ++ doc/user/admin_area/analytics/user_cohorts.md | 6 ++ doc/user/admin_area/appearance.md | 3 + doc/user/admin_area/broadcast_messages.md | 3 + doc/user/admin_area/index.md | 3 + .../admin_area/monitoring/health_check.md | 3 + .../settings/external_authorization.md | 3 + doc/user/admin_area/settings/help_page.md | 3 + doc/user/admin_area/settings/index.md | 3 + .../admin_area/settings/protected_paths.md | 3 + .../settings/rate_limits_on_raw_endpoints.md | 3 + .../settings/sign_in_restrictions.md | 3 + .../settings/sign_up_restrictions.md | 3 + doc/user/admin_area/settings/terms.md | 3 + .../admin_area/settings/third_party_offers.md | 3 + .../admin_area/settings/usage_statistics.md | 3 + .../settings/user_and_ip_rate_limits.md | 3 + doc/user/application_security/index.md | 3 + doc/user/feature_highlight.md | 6 ++ doc/user/gitlab_com/index.md | 6 ++ doc/user/group/subgroups/index.md | 3 + doc/user/index.md | 3 + doc/user/operations_dashboard/index.md | 6 ++ doc/user/profile/active_sessions.md | 3 + doc/user/profile/preferences.md | 3 + doc/user/project/canary_deployments.md | 6 ++ doc/user/project/deploy_boards.md | 6 +- doc/user/project/import/tfvc.md | 3 + doc/user/project/insights/index.md | 6 ++ lib/feature/shared.rb | 1 + .../templates/Jobs/Deploy/ECS.gitlab-ci.yml | 56 ++++++++++++++++++- lib/gitlab/quick_actions/extractor.rb | 4 +- .../auto_devops_gitlab_ci_yaml_spec.rb | 4 +- .../gitlab/quick_actions/extractor_spec.rb | 16 ++++++ spec/models/service_spec.rb | 32 ++++++++++- spec/services/post_receive_service_spec.rb | 43 ++++++++++++++ 47 files changed, 326 insertions(+), 25 deletions(-) create mode 100644 changelogs/unreleased/218167-stop-review-for-ecs.yml create mode 100644 changelogs/unreleased/244289-quickaction-with-codeblocks.yml create mode 100644 changelogs/unreleased/rmay-216344-2.yml delete mode 100644 config/feature_flags/development/deploy_boards_dedupe_instances.yml diff --git a/app/models/service.rb b/app/models/service.rb index 281bfc6351a..c544c5a53c1 100644 --- a/app/models/service.rb +++ b/app/models/service.rb @@ -422,8 +422,12 @@ class Service < ApplicationRecord ProjectServiceWorker.perform_async(id, data) end - def issue_tracker? - self.category == :issue_tracker + def external_issue_tracker? + category == :issue_tracker && active? + end + + def external_wiki? + type == 'ExternalWikiService' && active? end # override if needed diff --git a/app/services/bulk_create_integration_service.rb b/app/services/bulk_create_integration_service.rb index 96bf8a6abaf..06a2a107966 100644 --- a/app/services/bulk_create_integration_service.rb +++ b/app/services/bulk_create_integration_service.rb @@ -34,11 +34,11 @@ class BulkCreateIntegrationService end def run_callbacks(batch) - if integration.issue_tracker? && integration.active? + if integration.external_issue_tracker? batch.update_all(has_external_issue_tracker: true) end - if integration.type == 'ExternalWikiService' && integration.active? + if integration.external_wiki? batch.update_all(has_external_wiki: true) end end diff --git a/app/services/post_receive_service.rb b/app/services/post_receive_service.rb index 69c9868c75c..79b613f6a88 100644 --- a/app/services/post_receive_service.rb +++ b/app/services/post_receive_service.rb @@ -29,9 +29,7 @@ class PostReceiveService response.add_alert_message(message) end - broadcast_message = BroadcastMessage.current_banner_messages&.last&.message response.add_alert_message(broadcast_message) - response.add_merge_request_urls(merge_request_urls) # Neither User nor Project are guaranteed to be returned; an orphaned write deploy @@ -74,6 +72,24 @@ class PostReceiveService ::MergeRequests::GetUrlsService.new(project).execute(params[:changes]) end + + private + + def broadcast_message + banner = nil + + if project + scoped_messages = BroadcastMessage.current_banner_messages(project.full_path).select do |message| + message.target_path.present? && message.matches_current_path(project.full_path) + end + + banner = scoped_messages.last + end + + banner ||= BroadcastMessage.current_banner_messages.last + + banner&.message + end end PostReceiveService.prepend_if_ee('EE::PostReceiveService') diff --git a/bin/feature-flag b/bin/feature-flag index 43e273be1fa..0de9b90681f 100755 --- a/bin/feature-flag +++ b/bin/feature-flag @@ -35,6 +35,7 @@ class FeatureFlagOptionParser :name, :type, :group, + :milestone, :ee, :amend, :dry_run, @@ -64,6 +65,10 @@ class FeatureFlagOptionParser options.introduced_by_url = value end + opts.on('-M', '--milestone [string]', String, 'Milestone in which the Feature Flag was introduced') do |value| + options.milestone = value + end + opts.on('-i', '--rollout-issue-url [string]', String, 'URL of Issue rolling out the Feature Flag') do |value| options.rollout_issue_url = value end @@ -188,6 +193,11 @@ class FeatureFlagOptionParser end end + def read_milestone + milestone = File.read('VERSION') + milestone.gsub(/^(\d+\.\d+).*$/, '\1').chomp + end + def read_default_enabled(options) TYPES.dig(options.type, :default_enabled) end @@ -214,6 +224,7 @@ class FeatureFlagCreator options.group ||= FeatureFlagOptionParser.read_group options.introduced_by_url ||= FeatureFlagOptionParser.read_introduced_by_url options.rollout_issue_url ||= FeatureFlagOptionParser.read_rollout_issue_url(options) + options.milestone ||= FeatureFlagOptionParser.read_milestone $stdout.puts "\e[32mcreate\e[0m #{file_path}" $stdout.puts contents @@ -243,6 +254,7 @@ class FeatureFlagCreator 'name' => options.name, 'introduced_by_url' => options.introduced_by_url, 'rollout_issue_url' => options.rollout_issue_url, + 'milestone' => options.milestone, 'group' => options.group, 'type' => options.type.to_s, 'default_enabled' => FeatureFlagOptionParser.read_default_enabled(options) diff --git a/changelogs/unreleased/218167-stop-review-for-ecs.yml b/changelogs/unreleased/218167-stop-review-for-ecs.yml new file mode 100644 index 00000000000..95d49113d84 --- /dev/null +++ b/changelogs/unreleased/218167-stop-review-for-ecs.yml @@ -0,0 +1,5 @@ +--- +title: Add a stop review job for ECS +merge_request: 44717 +author: +type: added diff --git a/changelogs/unreleased/244289-quickaction-with-codeblocks.yml b/changelogs/unreleased/244289-quickaction-with-codeblocks.yml new file mode 100644 index 00000000000..6dc0df9e009 --- /dev/null +++ b/changelogs/unreleased/244289-quickaction-with-codeblocks.yml @@ -0,0 +1,5 @@ +--- +title: Fix QuickActions not working if written before a codeblock +merge_request: 46401 +author: +type: fixed diff --git a/changelogs/unreleased/rmay-216344-2.yml b/changelogs/unreleased/rmay-216344-2.yml new file mode 100644 index 00000000000..8def899032f --- /dev/null +++ b/changelogs/unreleased/rmay-216344-2.yml @@ -0,0 +1,5 @@ +--- +title: Allow for return of scoped broadcast messages on shell +merge_request: 46333 +author: +type: changed diff --git a/config/feature_flags/development/deploy_boards_dedupe_instances.yml b/config/feature_flags/development/deploy_boards_dedupe_instances.yml deleted file mode 100644 index d407e11babd..00000000000 --- a/config/feature_flags/development/deploy_boards_dedupe_instances.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -name: deploy_boards_dedupe_instances -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/40768 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/258214 -type: development -group: group::progressive delivery -default_enabled: false diff --git a/doc/user/abuse_reports.md b/doc/user/abuse_reports.md index e6c86cc8f2e..155f45f087f 100644 --- a/doc/user/abuse_reports.md +++ b/doc/user/abuse_reports.md @@ -1,3 +1,9 @@ +--- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers +--- + # Abuse reports You can report abuse from other GitLab users to GitLab administrators. diff --git a/doc/user/admin_area/analytics/dev_ops_report.md b/doc/user/admin_area/analytics/dev_ops_report.md index 51173257c2b..381cabd187e 100644 --- a/doc/user/admin_area/analytics/dev_ops_report.md +++ b/doc/user/admin_area/analytics/dev_ops_report.md @@ -1,3 +1,9 @@ +--- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers +--- + # DevOps Report > - [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/30469) in GitLab 9.3. diff --git a/doc/user/admin_area/analytics/index.md b/doc/user/admin_area/analytics/index.md index f79245c7325..0e019670c22 100644 --- a/doc/user/admin_area/analytics/index.md +++ b/doc/user/admin_area/analytics/index.md @@ -1,3 +1,9 @@ +--- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers +--- + # Instance-level analytics > [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/41416) in GitLab 11.2. diff --git a/doc/user/admin_area/analytics/instance_statistics.md b/doc/user/admin_area/analytics/instance_statistics.md index 380cbcf1d6f..0260fcf26d1 100644 --- a/doc/user/admin_area/analytics/instance_statistics.md +++ b/doc/user/admin_area/analytics/instance_statistics.md @@ -1,3 +1,9 @@ +--- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers +--- + # Instance Statistics > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/235754) in GitLab 13.4. diff --git a/doc/user/admin_area/analytics/user_cohorts.md b/doc/user/admin_area/analytics/user_cohorts.md index fd9266c6e06..66e568f9f6a 100644 --- a/doc/user/admin_area/analytics/user_cohorts.md +++ b/doc/user/admin_area/analytics/user_cohorts.md @@ -1,3 +1,9 @@ +--- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers +--- + # Cohorts > [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/23361) in GitLab 9.1. diff --git a/doc/user/admin_area/appearance.md b/doc/user/admin_area/appearance.md index da1e4ca2581..23a6de38e17 100644 --- a/doc/user/admin_area/appearance.md +++ b/doc/user/admin_area/appearance.md @@ -1,4 +1,7 @@ --- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers type: howto disqus_identifier: 'https://docs.gitlab.com/ee/customization/branded_login_page.html' --- diff --git a/doc/user/admin_area/broadcast_messages.md b/doc/user/admin_area/broadcast_messages.md index 7e1a4faee75..985008061ac 100644 --- a/doc/user/admin_area/broadcast_messages.md +++ b/doc/user/admin_area/broadcast_messages.md @@ -1,4 +1,7 @@ --- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers type: reference, howto --- diff --git a/doc/user/admin_area/index.md b/doc/user/admin_area/index.md index 0ddbe17580a..701ce95ebdd 100644 --- a/doc/user/admin_area/index.md +++ b/doc/user/admin_area/index.md @@ -1,4 +1,7 @@ --- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers type: reference --- diff --git a/doc/user/admin_area/monitoring/health_check.md b/doc/user/admin_area/monitoring/health_check.md index 2a38ccb31f0..88c98248435 100644 --- a/doc/user/admin_area/monitoring/health_check.md +++ b/doc/user/admin_area/monitoring/health_check.md @@ -1,4 +1,7 @@ --- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers type: concepts, howto --- diff --git a/doc/user/admin_area/settings/external_authorization.md b/doc/user/admin_area/settings/external_authorization.md index 0b250e07412..80bca6f5b2c 100644 --- a/doc/user/admin_area/settings/external_authorization.md +++ b/doc/user/admin_area/settings/external_authorization.md @@ -1,4 +1,7 @@ --- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers type: reference --- diff --git a/doc/user/admin_area/settings/help_page.md b/doc/user/admin_area/settings/help_page.md index ca983edd4fa..c0237c3da73 100644 --- a/doc/user/admin_area/settings/help_page.md +++ b/doc/user/admin_area/settings/help_page.md @@ -1,4 +1,7 @@ --- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers type: howto --- diff --git a/doc/user/admin_area/settings/index.md b/doc/user/admin_area/settings/index.md index bc8df63e33f..eb01518ab51 100644 --- a/doc/user/admin_area/settings/index.md +++ b/doc/user/admin_area/settings/index.md @@ -1,4 +1,7 @@ --- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers type: index --- diff --git a/doc/user/admin_area/settings/protected_paths.md b/doc/user/admin_area/settings/protected_paths.md index 0cfaf5843d0..bb6fff9650d 100644 --- a/doc/user/admin_area/settings/protected_paths.md +++ b/doc/user/admin_area/settings/protected_paths.md @@ -1,4 +1,7 @@ --- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers type: reference --- diff --git a/doc/user/admin_area/settings/rate_limits_on_raw_endpoints.md b/doc/user/admin_area/settings/rate_limits_on_raw_endpoints.md index 45dcc9119ac..96cd71033d0 100644 --- a/doc/user/admin_area/settings/rate_limits_on_raw_endpoints.md +++ b/doc/user/admin_area/settings/rate_limits_on_raw_endpoints.md @@ -1,4 +1,7 @@ --- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers type: reference --- diff --git a/doc/user/admin_area/settings/sign_in_restrictions.md b/doc/user/admin_area/settings/sign_in_restrictions.md index 311b79af7e3..c4c77aa7ba3 100644 --- a/doc/user/admin_area/settings/sign_in_restrictions.md +++ b/doc/user/admin_area/settings/sign_in_restrictions.md @@ -1,4 +1,7 @@ --- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers type: reference --- diff --git a/doc/user/admin_area/settings/sign_up_restrictions.md b/doc/user/admin_area/settings/sign_up_restrictions.md index f57cf7c2045..a890e8f9ee8 100644 --- a/doc/user/admin_area/settings/sign_up_restrictions.md +++ b/doc/user/admin_area/settings/sign_up_restrictions.md @@ -1,4 +1,7 @@ --- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers type: reference --- diff --git a/doc/user/admin_area/settings/terms.md b/doc/user/admin_area/settings/terms.md index 77c172aa927..95c32af5716 100644 --- a/doc/user/admin_area/settings/terms.md +++ b/doc/user/admin_area/settings/terms.md @@ -1,4 +1,7 @@ --- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers type: reference --- diff --git a/doc/user/admin_area/settings/third_party_offers.md b/doc/user/admin_area/settings/third_party_offers.md index 29ca3bf5ab2..f0e53115cb1 100644 --- a/doc/user/admin_area/settings/third_party_offers.md +++ b/doc/user/admin_area/settings/third_party_offers.md @@ -1,4 +1,7 @@ --- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers type: reference --- diff --git a/doc/user/admin_area/settings/usage_statistics.md b/doc/user/admin_area/settings/usage_statistics.md index 140d149555a..d4080b3921a 100644 --- a/doc/user/admin_area/settings/usage_statistics.md +++ b/doc/user/admin_area/settings/usage_statistics.md @@ -1,4 +1,7 @@ --- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers type: reference --- diff --git a/doc/user/admin_area/settings/user_and_ip_rate_limits.md b/doc/user/admin_area/settings/user_and_ip_rate_limits.md index 5d49d88d254..3c6ec728dbd 100644 --- a/doc/user/admin_area/settings/user_and_ip_rate_limits.md +++ b/doc/user/admin_area/settings/user_and_ip_rate_limits.md @@ -1,4 +1,7 @@ --- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers type: reference --- diff --git a/doc/user/application_security/index.md b/doc/user/application_security/index.md index 2b585b84fa0..a1c94f4bd7d 100644 --- a/doc/user/application_security/index.md +++ b/doc/user/application_security/index.md @@ -1,4 +1,7 @@ --- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers type: reference, howto --- diff --git a/doc/user/feature_highlight.md b/doc/user/feature_highlight.md index 9b52c178493..31eb0e6375d 100644 --- a/doc/user/feature_highlight.md +++ b/doc/user/feature_highlight.md @@ -1,3 +1,9 @@ +--- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers +--- + # Feature highlight > [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/16379) in GitLab 10.5 diff --git a/doc/user/gitlab_com/index.md b/doc/user/gitlab_com/index.md index 673015bcb0c..8cd2679eabc 100644 --- a/doc/user/gitlab_com/index.md +++ b/doc/user/gitlab_com/index.md @@ -1,3 +1,9 @@ +--- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers +--- + # GitLab.com settings In this page you will find information about the settings that are used on diff --git a/doc/user/group/subgroups/index.md b/doc/user/group/subgroups/index.md index 8750d541641..031815d4d1a 100644 --- a/doc/user/group/subgroups/index.md +++ b/doc/user/group/subgroups/index.md @@ -1,4 +1,7 @@ --- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers type: reference, howto, concepts --- diff --git a/doc/user/index.md b/doc/user/index.md index 0e22c01cc97..17539a8b0a5 100644 --- a/doc/user/index.md +++ b/doc/user/index.md @@ -1,4 +1,7 @@ --- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers type: reference, index description: 'Read through the GitLab User documentation to learn how to use, configure, and customize GitLab and GitLab.com to your own needs.' --- diff --git a/doc/user/operations_dashboard/index.md b/doc/user/operations_dashboard/index.md index 5a2ff410253..9e2dfd9ad96 100644 --- a/doc/user/operations_dashboard/index.md +++ b/doc/user/operations_dashboard/index.md @@ -1,3 +1,9 @@ +--- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers +--- + # Operations Dashboard **(PREMIUM)** > [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/5781) in [GitLab Ultimate](https://about.gitlab.com/pricing/) 11.5. [Moved](https://gitlab.com/gitlab-org/gitlab/-/issues/9218) to [GitLab Premium](https://about.gitlab.com/pricing/) in 11.10. diff --git a/doc/user/profile/active_sessions.md b/doc/user/profile/active_sessions.md index a5b15a7880c..4630215eca6 100644 --- a/doc/user/profile/active_sessions.md +++ b/doc/user/profile/active_sessions.md @@ -1,4 +1,7 @@ --- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers type: howto --- diff --git a/doc/user/profile/preferences.md b/doc/user/profile/preferences.md index 61944bb9d0b..168bcb5a42e 100644 --- a/doc/user/profile/preferences.md +++ b/doc/user/profile/preferences.md @@ -1,4 +1,7 @@ --- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers type: concepts, howto --- diff --git a/doc/user/project/canary_deployments.md b/doc/user/project/canary_deployments.md index afce3869cbf..1ce13278fe4 100644 --- a/doc/user/project/canary_deployments.md +++ b/doc/user/project/canary_deployments.md @@ -1,3 +1,9 @@ +--- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers +--- + # Canary Deployments **(PREMIUM)** > [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/1659) in [GitLab Premium](https://about.gitlab.com/pricing/) 9.1. diff --git a/doc/user/project/deploy_boards.md b/doc/user/project/deploy_boards.md index 3c6494d5f1a..2bf35b48547 100644 --- a/doc/user/project/deploy_boards.md +++ b/doc/user/project/deploy_boards.md @@ -41,9 +41,9 @@ knowledge. In particular, you should be familiar with: - [Kubernetes namespaces](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/) - [Kubernetes canary deployments](https://kubernetes.io/docs/concepts/cluster-administration/manage-deployment/#canary-deployments) -NOTE: **Note:** -Apps that consist of multiple deployments are shown as duplicates on the deploy board. -Follow [this issue](https://gitlab.com/gitlab-org/gitlab/-/issues/8463) for details. +In GitLab 13.5 and earlier, apps that consist of multiple deployments are shown as +duplicates on the deploy board. This is [fixed](https://gitlab.com/gitlab-org/gitlab/-/issues/8463) +in GitLab 13.6. ## Use cases diff --git a/doc/user/project/import/tfvc.md b/doc/user/project/import/tfvc.md index faa2a9b4927..cbc25552873 100644 --- a/doc/user/project/import/tfvc.md +++ b/doc/user/project/import/tfvc.md @@ -1,4 +1,7 @@ --- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers type: concepts --- diff --git a/doc/user/project/insights/index.md b/doc/user/project/insights/index.md index 4d646ee2f79..eaef0b8d69f 100644 --- a/doc/user/project/insights/index.md +++ b/doc/user/project/insights/index.md @@ -1,3 +1,9 @@ +--- +stage: none +group: unassigned +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers +--- + # Insights **(ULTIMATE)** > [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/725) in [GitLab Ultimate](https://about.gitlab.com/pricing/) 12.0. diff --git a/lib/feature/shared.rb b/lib/feature/shared.rb index 5716bc007a6..1fcbc8fa173 100644 --- a/lib/feature/shared.rb +++ b/lib/feature/shared.rb @@ -57,6 +57,7 @@ class Feature name introduced_by_url rollout_issue_url + milestone type group default_enabled diff --git a/lib/gitlab/ci/templates/Jobs/Deploy/ECS.gitlab-ci.yml b/lib/gitlab/ci/templates/Jobs/Deploy/ECS.gitlab-ci.yml index 317e8bfab0e..0289ba1c473 100644 --- a/lib/gitlab/ci/templates/Jobs/Deploy/ECS.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Jobs/Deploy/ECS.gitlab-ci.yml @@ -8,8 +8,11 @@ # # More about including CI templates: https://docs.gitlab.com/ee/ci/yaml/#includetemplate -.deploy_to_ecs: +.ecs_image: image: 'registry.gitlab.com/gitlab-org/cloud-deploy/aws-ecs:latest' + +.deploy_to_ecs: + extends: .ecs_image dependencies: [] script: - ecs update-task-definition @@ -17,8 +20,6 @@ .review_ecs_base: stage: review extends: .deploy_to_ecs - environment: - name: review/$CI_COMMIT_REF_NAME .production_ecs_base: stage: production @@ -26,8 +27,18 @@ environment: name: production +.stop_review_ecs_base: + extends: .ecs_image + stage: cleanup + allow_failure: true + script: + - ecs stop-task + review_ecs: extends: .review_ecs_base + environment: + name: review/$CI_COMMIT_REF_NAME + on_stop: stop_review_ecs rules: - if: '$AUTO_DEVOPS_PLATFORM_TARGET != "ECS"' when: never @@ -39,8 +50,30 @@ review_ecs: when: never - if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH' +stop_review_ecs: + extends: .stop_review_ecs_base + environment: + name: review/$CI_COMMIT_REF_NAME + action: stop + rules: + - if: '$AUTO_DEVOPS_PLATFORM_TARGET != "ECS"' + when: never + - if: '$CI_KUBERNETES_ACTIVE' + when: never + - if: '$REVIEW_DISABLED' + when: never + - if: '$CI_COMMIT_BRANCH == "master"' + when: never + - if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH' + when: manual + review_fargate: extends: .review_ecs_base + environment: + name: review/$CI_COMMIT_REF_NAME + on_stop: stop_review_fargate + script: + - ecs update-task-definition rules: - if: '$AUTO_DEVOPS_PLATFORM_TARGET != "FARGATE"' when: never @@ -52,6 +85,23 @@ review_fargate: when: never - if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH' +stop_review_fargate: + extends: .stop_review_ecs_base + environment: + name: review/$CI_COMMIT_REF_NAME + action: stop + rules: + - if: '$AUTO_DEVOPS_PLATFORM_TARGET != "FARGATE"' + when: never + - if: '$CI_KUBERNETES_ACTIVE' + when: never + - if: '$REVIEW_DISABLED' + when: never + - if: '$CI_COMMIT_BRANCH == "master"' + when: never + - if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH' + when: manual + production_ecs: extends: .production_ecs_base rules: diff --git a/lib/gitlab/quick_actions/extractor.rb b/lib/gitlab/quick_actions/extractor.rb index dd7a27ead01..1294e475145 100644 --- a/lib/gitlab/quick_actions/extractor.rb +++ b/lib/gitlab/quick_actions/extractor.rb @@ -29,9 +29,9 @@ module Gitlab # Anything, including `/cmd arg` which are ignored by this filter # ` - ^.*`\n* + `\n* .+? - \n*`$ + \n*` ) }mix.freeze diff --git a/spec/lib/gitlab/ci/templates/auto_devops_gitlab_ci_yaml_spec.rb b/spec/lib/gitlab/ci/templates/auto_devops_gitlab_ci_yaml_spec.rb index 4d90e7ca9e6..740c6849952 100644 --- a/spec/lib/gitlab/ci/templates/auto_devops_gitlab_ci_yaml_spec.rb +++ b/spec/lib/gitlab/ci/templates/auto_devops_gitlab_ci_yaml_spec.rb @@ -94,14 +94,14 @@ RSpec.describe 'Auto-DevOps.gitlab-ci.yml' do end it 'creates an ECS deployment job for review only' do - expect(review_prod_build_names).to contain_exactly('review_ecs') + expect(review_prod_build_names).to contain_exactly('review_ecs', 'stop_review_ecs') end context 'with FARGATE as a launch type' do let(:platform_value) { 'FARGATE' } it 'creates an FARGATE deployment job for review only' do - expect(review_prod_build_names).to contain_exactly('review_fargate') + expect(review_prod_build_names).to contain_exactly('review_fargate', 'stop_review_fargate') end end end diff --git a/spec/lib/gitlab/quick_actions/extractor_spec.rb b/spec/lib/gitlab/quick_actions/extractor_spec.rb index f4104b78d5c..61fffe3fb6b 100644 --- a/spec/lib/gitlab/quick_actions/extractor_spec.rb +++ b/spec/lib/gitlab/quick_actions/extractor_spec.rb @@ -264,6 +264,22 @@ RSpec.describe Gitlab::QuickActions::Extractor do expect(msg).to eq 'Fixes #123' end + it 'does not get confused if command comes before an inline code' do + msg = "/reopen\n`some inline code`\n/labels ~a\n`more inline code`" + msg, commands = extractor.extract_commands(msg) + + expect(commands).to eq([['reopen'], ['labels', '~a']]) + expect(msg).to eq "`some inline code`\n`more inline code`" + end + + it 'does not get confused if command comes before a blockcode' do + msg = "/reopen\n```\nsome blockcode\n```\n/labels ~a\n```\nmore blockcode\n```" + msg, commands = extractor.extract_commands(msg) + + expect(commands).to eq([['reopen'], ['labels', '~a']]) + expect(msg).to eq "```\nsome blockcode\n```\n```\nmore blockcode\n```" + end + it 'does not extract commands inside a blockcode' do msg = "Hello\r\n```\r\nThis is some text\r\n/close\r\n/assign @user\r\n```\r\n\r\nWorld" expected = msg.delete("\r") diff --git a/spec/models/service_spec.rb b/spec/models/service_spec.rb index 25e9577967b..d5ceb0edaf5 100644 --- a/spec/models/service_spec.rb +++ b/spec/models/service_spec.rb @@ -3,6 +3,8 @@ require 'spec_helper' RSpec.describe Service do + using RSpec::Parameterized::TableSyntax + let_it_be(:group) { create(:group) } let_it_be(:project) { create(:project, group: group) } @@ -15,8 +17,6 @@ RSpec.describe Service do end describe 'validations' do - using RSpec::Parameterized::TableSyntax - it { is_expected.to validate_presence_of(:type) } where(:project_id, :group_id, :template, :instance, :valid) do @@ -863,4 +863,32 @@ RSpec.describe Service do end end end + + describe '#external_issue_tracker?' do + where(:category, :active, :result) do + :issue_tracker | true | true + :issue_tracker | false | false + :common | true | false + end + + with_them do + it 'returns the right result' do + expect(build(:service, category: category, active: active).external_issue_tracker?).to eq(result) + end + end + end + + describe '#external_wiki?' do + where(:type, :active, :result) do + 'ExternalWikiService' | true | true + 'ExternalWikiService' | false | false + 'SlackService' | true | false + end + + with_them do + it 'returns the right result' do + expect(build(:service, type: type, active: active).external_wiki?).to eq(result) + end + end + end end diff --git a/spec/services/post_receive_service_spec.rb b/spec/services/post_receive_service_spec.rb index c726e1851a7..7c4b7f51cc3 100644 --- a/spec/services/post_receive_service_spec.rb +++ b/spec/services/post_receive_service_spec.rb @@ -232,6 +232,49 @@ RSpec.describe PostReceiveService do end end + context "broadcast message has a target_path" do + let!(:older_scoped_message) do + create(:broadcast_message, message: "Old top secret", target_path: "/company/sekrit-project") + end + + let!(:latest_scoped_message) do + create(:broadcast_message, message: "Top secret", target_path: "/company/sekrit-project") + end + + let!(:unscoped_message) do + create(:broadcast_message, message: "Hi") + end + + context "no project path matches" do + it "does not output the scoped broadcast messages" do + expect(subject).not_to include(build_alert_message(older_scoped_message.message)) + expect(subject).not_to include(build_alert_message(latest_scoped_message.message)) + end + + it "does output another message that doesn't have a target_path" do + expect(subject).to include(build_alert_message(unscoped_message.message)) + end + end + + context "project path matches" do + before do + allow(project).to receive(:full_path).and_return("/company/sekrit-project") + end + + it "does output the latest scoped broadcast message" do + expect(subject).to include(build_alert_message(latest_scoped_message.message)) + end + + it "does not output the older scoped broadcast message" do + expect(subject).not_to include(build_alert_message(older_scoped_message.message)) + end + + it "does not output another message that doesn't have a target_path" do + expect(subject).not_to include(build_alert_message(unscoped_message.message)) + end + end + end + context 'with a redirected data' do it 'returns redirected message on the response' do project_moved = Gitlab::Checks::ProjectMoved.new(project.repository, user, 'http', 'foo/baz')