Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml2
-rw-r--r--.gitlab/ci/package-and-test/main.gitlab-ci.yml1
-rw-r--r--app/assets/javascripts/ci/runner/admin_register_runner/admin_register_runner_app.vue13
-rw-r--r--app/assets/javascripts/ci/runner/components/registration/registration_instructions.vue28
-rw-r--r--app/controllers/projects/badges_controller.rb1
-rw-r--r--app/helpers/users/callouts_helper.rb2
-rw-r--r--app/services/resource_access_tokens/create_service.rb2
-rw-r--r--config/feature_flags/development/sec_mark_dropped_findings_as_resolved_scheduler.yml8
-rw-r--r--db/migrate/20230222193845_change_public_projects_minutes_cost_factor_default_to_1.rb17
-rw-r--r--db/schema_migrations/202302221938451
-rw-r--r--db/structure.sql2
-rw-r--r--doc/administration/auth/authentiq.md12
-rw-r--r--doc/development/integrations/secure.md4
-rw-r--r--doc/update/mysql_to_postgresql.md11
-rw-r--r--doc/update/restore_after_failure.md12
-rw-r--r--doc/update/upgrading_postgresql_using_slony.md12
-rw-r--r--doc/user/admin_area/monitoring/background_migrations.md11
-rw-r--r--doc/user/application_security/iac_scanning/index.md3
-rw-r--r--doc/user/application_security/sast/index.md3
-rw-r--r--doc/user/group/settings/import_export.md11
-rw-r--r--doc/user/project/badges.md4
-rw-r--r--doc/user/project/merge_requests/commits.md11
-rw-r--r--doc/user/project/merge_requests/reviews/img/suggestions_custom_commit_messages_v14_7.pngbin14774 -> 0 bytes
-rw-r--r--doc/user/project/merge_requests/reviews/suggestions.md102
-rw-r--r--lib/gitlab/ci/badge/release/latest_release.rb3
-rw-r--r--lib/gitlab/ci/badge/release/template.rb8
-rw-r--r--locale/gitlab.pot11
-rw-r--r--package.json10
-rw-r--r--spec/controllers/projects/badges_controller_spec.rb12
-rw-r--r--spec/frontend/ci/runner/admin_register_runner/admin_register_runner_app_spec.js80
-rw-r--r--spec/frontend/ci/runner/components/registration/registration_instructions_spec.js33
-rw-r--r--spec/helpers/users/callouts_helper_spec.rb50
-rw-r--r--spec/lib/gitlab/ci/badge/release/template_spec.rb23
-rw-r--r--spec/services/resource_access_tokens/create_service_spec.rb36
-rw-r--r--spec/support/shared_examples/helpers/callouts_for_web_hooks.rb49
-rw-r--r--workhorse/go.mod2
-rw-r--r--workhorse/go.sum4
-rw-r--r--yarn.lock8
38 files changed, 351 insertions, 251 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c3087716b13..afb2e2e88c6 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -141,7 +141,7 @@ variables:
BUNDLE_INSTALL_FLAGS: "--jobs=$(nproc) --retry=3"
BUNDLE_FROZEN: "true"
# we override the max_old_space_size to prevent OOM errors
- NODE_OPTIONS: --max_old_space_size=3584
+ NODE_OPTIONS: --max_old_space_size=4096
GIT_DEPTH: "20"
# 'GIT_STRATEGY: clone' optimizes the pack-objects cache hit ratio
GIT_STRATEGY: "clone"
diff --git a/.gitlab/ci/package-and-test/main.gitlab-ci.yml b/.gitlab/ci/package-and-test/main.gitlab-ci.yml
index 99aa62a1bca..4ebf5d17a27 100644
--- a/.gitlab/ci/package-and-test/main.gitlab-ci.yml
+++ b/.gitlab/ci/package-and-test/main.gitlab-ci.yml
@@ -229,6 +229,7 @@ _super-sidebar-nav:
QA_TESTS: ""
QA_SUPER_SIDEBAR_ENABLED: "true"
QA_ALLURE_RESULTS_DIRECTORY: tmp/allure-results-super-sidebar
+ QA_EXPORT_TEST_METRICS: "false"
GITLAB_QA_OPTS: --set-feature-flags super_sidebar_nav=enabled
RSPEC_REPORT_OPTS: "--format documentation"
SKIP_REPORT_IN_ISSUES: "true"
diff --git a/app/assets/javascripts/ci/runner/admin_register_runner/admin_register_runner_app.vue b/app/assets/javascripts/ci/runner/admin_register_runner/admin_register_runner_app.vue
index f9bf262bcac..f8d3a1df5dd 100644
--- a/app/assets/javascripts/ci/runner/admin_register_runner/admin_register_runner_app.vue
+++ b/app/assets/javascripts/ci/runner/admin_register_runner/admin_register_runner_app.vue
@@ -37,6 +37,7 @@ export default {
return {
platform: getParameterByName(PARAM_KEY_PLATFORM) || DEFAULT_PLATFORM,
runner: null,
+ token: null,
isDrawerOpen: false,
};
},
@@ -48,6 +49,17 @@ export default {
id: convertToGraphQLId(TYPENAME_CI_RUNNER, this.runnerId),
};
},
+ manual: true,
+ result({ data }) {
+ if (data?.runner) {
+ const { ephemeralAuthenticationToken, ...runner } = data.runner;
+ this.runner = runner;
+
+ // The token is available in the API for a limited amount of time
+ // preserve its original value if it is missing after polling.
+ this.token = ephemeralAuthenticationToken || this.token;
+ }
+ },
error(error) {
createAlert({ message: I18N_FETCH_ERROR });
captureException({ error, component: this.$options.name });
@@ -82,6 +94,7 @@ export default {
<div>
<registration-instructions
:runner="runner"
+ :token="token"
:platform="platform"
:loading="$apollo.queries.runner.loading"
@toggleDrawer="onToggleDrawer"
diff --git a/app/assets/javascripts/ci/runner/components/registration/registration_instructions.vue b/app/assets/javascripts/ci/runner/components/registration/registration_instructions.vue
index ee9ca5dc08c..11661888c85 100644
--- a/app/assets/javascripts/ci/runner/components/registration/registration_instructions.vue
+++ b/app/assets/javascripts/ci/runner/components/registration/registration_instructions.vue
@@ -27,6 +27,11 @@ export default {
required: false,
default: null,
},
+ token: {
+ type: String,
+ required: false,
+ default: null,
+ },
platform: {
type: String,
required: true,
@@ -53,12 +58,19 @@ export default {
}
return s__('Runners|Register runner');
},
- token() {
- return this.runner?.ephemeralAuthenticationToken;
- },
status() {
return this.runner?.status;
},
+ tokenMessage() {
+ if (this.token) {
+ return s__(
+ 'Runners|The %{boldStart}runner token%{boldEnd} %{token} displays %{boldStart}only for a short time%{boldEnd}, and is stored in the %{codeStart}config.toml%{codeEnd} after you register the runner. It will not be visible once the runner is registered.',
+ );
+ }
+ return s__(
+ 'Runners|The %{boldStart}runner token%{boldEnd} is no longer visible, it is stored in the %{codeStart}config.toml%{codeEnd} if you have registered the runner.',
+ );
+ },
commandPrompt() {
return commandPrompt({ platform: this.platform });
},
@@ -116,15 +128,9 @@ export default {
<cli-command :prompt="commandPrompt" :command="registerCommand" />
<p>
<gl-icon name="information-o" class="gl-text-blue-600!" />
- <gl-sprintf
- :message="
- s__(
- 'Runners|The %{boldStart}runner token%{boldEnd} %{token} displays %{boldStart}only for a short time%{boldEnd}, and is stored in the %{codeStart}config.toml%{codeEnd} after you create the runner. It will not be visible once the runner is registered.',
- )
- "
- >
+ <gl-sprintf :message="tokenMessage">
<template #token>
- <code>{{ token }}</code>
+ <code data-testid="runner-token">{{ token }}</code>
<clipboard-button
:text="token"
:title="__('Copy')"
diff --git a/app/controllers/projects/badges_controller.rb b/app/controllers/projects/badges_controller.rb
index dbbffc4c283..372da64cdfa 100644
--- a/app/controllers/projects/badges_controller.rb
+++ b/app/controllers/projects/badges_controller.rb
@@ -40,6 +40,7 @@ class Projects::BadgesController < Projects::ApplicationController
.new(project, current_user, opts: {
key_text: params[:key_text],
key_width: params[:key_width],
+ value_width: params[:value_width],
order_by: params[:order_by]
})
diff --git a/app/helpers/users/callouts_helper.rb b/app/helpers/users/callouts_helper.rb
index 477f8c68379..0ad1cbdff3e 100644
--- a/app/helpers/users/callouts_helper.rb
+++ b/app/helpers/users/callouts_helper.rb
@@ -61,7 +61,7 @@ module Users
end
def web_hook_disabled_dismissed?(object)
- return false unless object.class < WebHooks::HasWebHooks
+ return false unless object.is_a?(::WebHooks::HasWebHooks)
user_dismissed?(WEB_HOOK_DISABLED, object.last_webhook_failure, object: object)
end
diff --git a/app/services/resource_access_tokens/create_service.rb b/app/services/resource_access_tokens/create_service.rb
index 8bddf154017..cfa43f5d9c8 100644
--- a/app/services/resource_access_tokens/create_service.rb
+++ b/app/services/resource_access_tokens/create_service.rb
@@ -27,7 +27,7 @@ module ResourceAccessTokens
unless member.persisted?
delete_failed_user(user)
- return error("Could not provision #{Gitlab::Access.human_access(access_level).downcase} access to project access token")
+ return error("Could not provision #{Gitlab::Access.human_access(access_level.to_i).downcase} access to the access token. ERROR: #{member.errors.full_messages.to_sentence}")
end
token_response = create_personal_access_token(user)
diff --git a/config/feature_flags/development/sec_mark_dropped_findings_as_resolved_scheduler.yml b/config/feature_flags/development/sec_mark_dropped_findings_as_resolved_scheduler.yml
deleted file mode 100644
index 1f26ffb28ae..00000000000
--- a/config/feature_flags/development/sec_mark_dropped_findings_as_resolved_scheduler.yml
+++ /dev/null
@@ -1,8 +0,0 @@
----
-name: sec_mark_dropped_findings_as_resolved_scheduler
-introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/108486
-rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/387577
-milestone: '15.8'
-type: development
-group: group::static analysis
-default_enabled: false
diff --git a/db/migrate/20230222193845_change_public_projects_minutes_cost_factor_default_to_1.rb b/db/migrate/20230222193845_change_public_projects_minutes_cost_factor_default_to_1.rb
new file mode 100644
index 00000000000..c86c16f692a
--- /dev/null
+++ b/db/migrate/20230222193845_change_public_projects_minutes_cost_factor_default_to_1.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class ChangePublicProjectsMinutesCostFactorDefaultTo1 < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ change_column_default :ci_runners, :public_projects_minutes_cost_factor, from: 0.0, to: 1.0
+ end
+ end
+
+ def down
+ with_lock_retries do
+ change_column_default :ci_runners, :public_projects_minutes_cost_factor, from: 1.0, to: 0.0
+ end
+ end
+end
diff --git a/db/schema_migrations/20230222193845 b/db/schema_migrations/20230222193845
new file mode 100644
index 00000000000..eaf26ae70f1
--- /dev/null
+++ b/db/schema_migrations/20230222193845
@@ -0,0 +1 @@
+b70150d44ca3f029fe987831a880017be9e8cd8f7833e6d4d3bb68929130b614 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 251ea586b65..09d5b65ae16 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -13775,7 +13775,7 @@ CREATE TABLE ci_runners (
maximum_timeout integer,
runner_type smallint NOT NULL,
token_encrypted character varying,
- public_projects_minutes_cost_factor double precision DEFAULT 0.0 NOT NULL,
+ public_projects_minutes_cost_factor double precision DEFAULT 1.0 NOT NULL,
private_projects_minutes_cost_factor double precision DEFAULT 1.0 NOT NULL,
config jsonb DEFAULT '{}'::jsonb NOT NULL,
executor_type smallint,
diff --git a/doc/administration/auth/authentiq.md b/doc/administration/auth/authentiq.md
deleted file mode 100644
index a32d2a2cf94..00000000000
--- a/doc/administration/auth/authentiq.md
+++ /dev/null
@@ -1,12 +0,0 @@
----
-stage: Manage
-group: Authentication and Authorization
-info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
-remove_date: '2023-02-22'
-redirect_to: '../../integration/omniauth.md'
----
-
-# Authentiq OmniAuth Provider (removed) **(FREE SELF)**
-
-This feature was [removed](https://gitlab.com/gitlab-org/gitlab/-/issues/389452) in 15.9.
-Use another [OmniAuth provider](../../integration/omniauth.md) instead.
diff --git a/doc/development/integrations/secure.md b/doc/development/integrations/secure.md
index 1613cc1aec8..bc0a490f555 100644
--- a/doc/development/integrations/secure.md
+++ b/doc/development/integrations/secure.md
@@ -403,8 +403,6 @@ The `id` should not collide with any other analyzers or scanners another integra
##### Scan Primary Identifiers
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/368284) in GitLab 15.4 [with a flag](../../administration/feature_flags.md) named `sec_mark_dropped_findings_as_resolved`. Disabled by default.
-
The `scan.primary_identifiers` field is an optional field containing an array of
[primary identifiers](../../user/application_security/terminology/index.md#primary-identifier)).
This is an exhaustive list of all rulesets for which the analyzer performed the scan.
@@ -413,7 +411,7 @@ Even when the [`Vulnerabilities`](#vulnerabilities) array for a given scan may b
should contain the complete list of potential identifiers to inform the Rails application of which
rules were executed.
-When populated, the Rails application automatically resolves previously detected vulnerabilities as no
+When populated, the Rails application [may automatically resolve previously detected vulnerabilities](../../user/application_security/iac_scanning/index.md#automatic-vulnerability-resolution) as no
longer relevant when their primary identifier is not included.
##### Name, message, and description
diff --git a/doc/update/mysql_to_postgresql.md b/doc/update/mysql_to_postgresql.md
deleted file mode 100644
index ad36a9ff534..00000000000
--- a/doc/update/mysql_to_postgresql.md
+++ /dev/null
@@ -1,11 +0,0 @@
----
-stage: Data Stores
-group: Database
-info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
-remove_date: '2023-02-28'
-redirect_to: 'index.md'
----
-
-# Migrating from MySQL to PostgreSQL (removed) **(FREE SELF)**
-
-Support for MySQL was removed in GitLab 12.1.
diff --git a/doc/update/restore_after_failure.md b/doc/update/restore_after_failure.md
deleted file mode 100644
index 92b68410dca..00000000000
--- a/doc/update/restore_after_failure.md
+++ /dev/null
@@ -1,12 +0,0 @@
----
-stage: Systems
-group: Distribution
-info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
-remove_date: '2023-02-28'
-redirect_to: '../raketasks/backup_restore.md'
----
-
-# Restoring from backup after a failed upgrade (removed) **(FREE SELF)**
-
-This content was removed in GitLab 15.7.
-Use the [backup and restore](../raketasks/backup_restore.md) documentation instead.
diff --git a/doc/update/upgrading_postgresql_using_slony.md b/doc/update/upgrading_postgresql_using_slony.md
deleted file mode 100644
index 6d2abee3fc6..00000000000
--- a/doc/update/upgrading_postgresql_using_slony.md
+++ /dev/null
@@ -1,12 +0,0 @@
----
-stage: Data Stores
-group: Database
-info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
-remove_date: '2023-02-28'
-redirect_to: '../administration/postgresql/replication_and_failover.md'
----
-
-# Upgrading PostgreSQL Using Slony (removed) **(FREE SELF)**
-
-This content was removed in GitLab 15.7.
-Patroni has been used for database replication since GitLab 14.0. To perform upgrades, use the [Patroni replication documentation](../administration/postgresql/replication_and_failover.md) instead.
diff --git a/doc/user/admin_area/monitoring/background_migrations.md b/doc/user/admin_area/monitoring/background_migrations.md
deleted file mode 100644
index b4a6f7f66fb..00000000000
--- a/doc/user/admin_area/monitoring/background_migrations.md
+++ /dev/null
@@ -1,11 +0,0 @@
----
-redirect_to: '../../../update/background_migrations.md'
-remove_date: '2023-03-11'
----
-
-This document was moved to [another location](../../../update/background_migrations.md).
-
-<!-- This redirect file can be deleted after <2023-03-11>. -->
-<!-- Redirects that point to other docs in the same project expire in three months. -->
-<!-- Redirects that point to docs in a different project or site (link is not relative and starts with `https:`) expire in one year. -->
-<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
diff --git a/doc/user/application_security/iac_scanning/index.md b/doc/user/application_security/iac_scanning/index.md
index 8b0a55e5fb7..937aaf76280 100644
--- a/doc/user/application_security/iac_scanning/index.md
+++ b/doc/user/application_security/iac_scanning/index.md
@@ -243,7 +243,8 @@ kics-iac-sast:
## Automatic vulnerability resolution
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/368284) in GitLab 15.9 [with a project-level flag](../../../administration/feature_flags.md) named `sec_mark_dropped_findings_as_resolved`. Enabled by default on GitLab.com; disabled by default in self-managed. On GitLab.com, [contact Support](https://about.gitlab.com/support/) if you need to disable the flag for your project.
+> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/368284) in GitLab 15.9 [with a project-level flag](../../../administration/feature_flags.md) named `sec_mark_dropped_findings_as_resolved`.
+> - Enabled by default in 15.10. On GitLab.com, [contact Support](https://about.gitlab.com/support/) if you need to disable the flag for your project.
To help you focus on the vulnerabilities that are still relevant, GitLab IaC Scanning automatically [resolves](../vulnerabilities/index.md#vulnerability-status-values) vulnerabilities when:
diff --git a/doc/user/application_security/sast/index.md b/doc/user/application_security/sast/index.md
index b826b13d750..a0c5adc89f5 100644
--- a/doc/user/application_security/sast/index.md
+++ b/doc/user/application_security/sast/index.md
@@ -183,7 +183,8 @@ For more information, see the confidential project `https://gitlab.com/gitlab-or
## Automatic vulnerability resolution
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/368284) in GitLab 15.9 [with a project-level flag](../../../administration/feature_flags.md) named `sec_mark_dropped_findings_as_resolved`. Enabled by default on GitLab.com; disabled by default in self-managed. On GitLab.com, [contact Support](https://about.gitlab.com/support/) if you need to disable the flag for your project.
+> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/368284) in GitLab 15.9 [with a project-level flag](../../../administration/feature_flags.md) named `sec_mark_dropped_findings_as_resolved`.
+> - Enabled by default in GitLab 15.10. On GitLab.com, [contact Support](https://about.gitlab.com/support/) if you need to disable the flag for your project.
To help you focus on the vulnerabilities that are still relevant, GitLab SAST automatically [resolves](../vulnerabilities/index.md#vulnerability-status-values) vulnerabilities when:
diff --git a/doc/user/group/settings/import_export.md b/doc/user/group/settings/import_export.md
deleted file mode 100644
index ff64a7dcd54..00000000000
--- a/doc/user/group/settings/import_export.md
+++ /dev/null
@@ -1,11 +0,0 @@
----
-redirect_to: '../import/index.md'
-remove_date: '2023-03-08'
----
-
-This document was moved to [another location](../import/index.md).
-
-<!-- This redirect file can be deleted after <2023-03-08>. -->
-<!-- Redirects that point to other docs in the same project expire in three months. -->
-<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
-<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
diff --git a/doc/user/project/badges.md b/doc/user/project/badges.md
index 0ea1a80bc54..a911031118f 100644
--- a/doc/user/project/badges.md
+++ b/doc/user/project/badges.md
@@ -117,6 +117,10 @@ time with the `?order_by` query parameter.
https://gitlab.example.com/<namespace>/<project>/-/badges/release.svg?order_by=release_at
```
+You can change the width of the release name field by using the `value_width` parameter ([Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/113615) in GitLab 15.10).
+The value must be between 1 and 200, and the default value is 54.
+If you set an out of range value, GitLab automatically adjusts it to the default value.
+
## Project badges
Badges can be added to a project by Maintainers or Owners, and are visible on the project's overview page.
diff --git a/doc/user/project/merge_requests/commits.md b/doc/user/project/merge_requests/commits.md
deleted file mode 100644
index a9f67c39ae8..00000000000
--- a/doc/user/project/merge_requests/commits.md
+++ /dev/null
@@ -1,11 +0,0 @@
----
-redirect_to: '../merge_requests/index.md'
-remove_date: '2023-03-12'
----
-
-This document was removed.
-
-<!-- This redirect file can be deleted after <2023-03-12>. -->
-<!-- Redirects that point to other docs in the same project expire in three months. -->
-<!-- Redirects that point to docs in a different project or site (for example, link is not relative and starts with `https:`) expire in one year. -->
-<!-- Before deletion, see: https://docs.gitlab.com/ee/development/documentation/redirects.html -->
diff --git a/doc/user/project/merge_requests/reviews/img/suggestions_custom_commit_messages_v14_7.png b/doc/user/project/merge_requests/reviews/img/suggestions_custom_commit_messages_v14_7.png
deleted file mode 100644
index 2805ef19f2d..00000000000
--- a/doc/user/project/merge_requests/reviews/img/suggestions_custom_commit_messages_v14_7.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/project/merge_requests/reviews/suggestions.md b/doc/user/project/merge_requests/reviews/suggestions.md
index be5ecf07bb3..6976d4052e1 100644
--- a/doc/user/project/merge_requests/reviews/suggestions.md
+++ b/doc/user/project/merge_requests/reviews/suggestions.md
@@ -17,11 +17,17 @@ merge request, authored by the user who suggested the changes.
## Create suggestions
-1. On the top bar, select **Main menu > Groups** and find your group.
+1. On the top bar, select **Main menu > Projects** and find your project.
1. On the left sidebar, select **Merge requests** and find your merge request.
1. On the secondary menu, select **Changes**.
-1. Find the line of code you want to change. Hover over the line number, and
- select **Add a comment to this line** (**{comment}**).
+1. Find the lines of code you want to change.
+ - To select a single line:
+ - Hover over the line number, and
+ select **Add a comment to this line** (**{comment}**).
+ - To select multiple lines:
+ 1. Hover over the line number, and select **Add a comment to this line** (**{comment}**).
+ 1. Select and drag your selection until all desired lines are included. To
+ learn more, see [Multi-line suggestions](#multi-line-suggestions).
1. In the comment toolbar, select **Insert suggestion** (**{doc-code}**). GitLab
inserts a pre-populated code block into your comment, like this:
@@ -35,27 +41,7 @@ merge request, authored by the user who suggested the changes.
1. Select either **Start a review** or **Add to review** to add your comment to a
[review](index.md), or **Add comment now** to add the comment to the thread immediately.
-## Apply suggestions
-
-The merge request author can apply suggested changes directly from the merge request:
-
-1. On the top bar, select **Main menu > Groups** and find your group.
-1. On the left sidebar, select **Merge requests** and find your merge request.
-1. Find the comment containing the suggestion you want to apply.
- - To apply suggestions individually, select **Apply suggestion**.
- - To apply multiple suggestions in a single commit, select **Add suggestion to batch**.
-1. Optional. Provide a custom commit message to describe your change. If you don't provide a custom message, the default commit message is used.
-1. Select **Apply**.
-
-After a suggestion is applied:
-
-- The suggestion is marked as **Applied**.
-- The comment thread is resolved.
-- GitLab creates a new commit with the changes.
-- If the user has the Developer role, GitLab pushes
- the suggested change directly into the codebase in the merge request's branch.
-
-## Multi-line suggestions
+### Multi-line suggestions
> [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/232339) in GitLab 13.11: suggestions in multi-line comments also become multi-line.
@@ -78,7 +64,27 @@ Suggestions for multiple lines are limited to 100 lines _above_ and 100
lines _below_ the commented diff line. This allows for up to 200 changed lines per
suggestion.
-## Code block nested in suggestions
+## Apply suggestions
+
+The merge request author can apply suggested changes directly from the merge request:
+
+1. On the top bar, select **Main menu > Projects** and find your project.
+1. On the left sidebar, select **Merge requests** and find your merge request.
+1. Find the comment containing the suggestion you want to apply.
+ - To apply suggestions individually, select **Apply suggestion**.
+ - To apply multiple suggestions in a single commit, select **Add suggestion to batch**.
+1. Optional. Provide a custom commit message to describe your change. If you don't provide a custom message, the default commit message is used.
+1. Select **Apply**.
+
+After a suggestion is applied:
+
+- The suggestion is marked as **Applied**.
+- The comment thread is resolved.
+- GitLab creates a new commit with the changes.
+- If the user has the Developer role, GitLab pushes
+ the suggested change directly into the codebase in the merge request's branch.
+
+## Nest code blocks in suggestions
To add a suggestion that includes a
[fenced code block](../../../markdown.md#code-spans-and-blocks), wrap your suggestion
@@ -96,47 +102,45 @@ git config --global receive.advertisepushoptions true
## Configure the commit message for applied suggestions
-> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/13086) in GitLab 12.7.
+GitLab uses a default commit message when applying suggestions. This message
+supports placeholders, and can be changed. For example, the default message
+`Apply %{suggestions_count} suggestion(s) to %{files_count} file(s)` renders
+like this if you apply three suggestions to two different files:
-GitLab uses a default commit message
-when applying suggestions: `Apply %{suggestions_count} suggestion(s) to %{files_count} file(s)`
-
-<!-- vale gitlab.BadPlurals = NO -->
+```plaintext
+Apply 3 suggestion(s) to 2 file(s)
+```
-For example, consider that a user applied 3 suggestions to 2 different files, the
-default commit message is: **Apply 3 suggestion(s) to 2 file(s)**
+Merge requests created from forks use the template defined in the target project.
-<!-- vale gitlab.BadPlurals = YES -->
+To meet your project's needs, you can customize these messages and include other
+placeholder variables:
-These commit messages can be customized to follow any guidelines you might have.
-To do so, expand the **Merge requests** tab within your project's **General**
-settings and change the **Merge suggestions** text:
+1. On the top bar, select **Main menu > Projects** and find your project.
+1. On the left sidebar, select **Settings > Merge requests**.
+1. Scroll to **Merge suggestions**, and alter the text to meet your needs.
+ See [Supported variables](#supported-variables) for a list of placeholders
+ you can use in this message.
-![Custom commit message for applied suggestions](img/suggestions_custom_commit_messages_v14_7.png)
+### Supported variables
-You can also use following variables besides static text:
+The template for commit messages for applied suggestions supports these variables:
| Variable | Description | Output example |
|------------------------|-------------|----------------|
| `%{branch_name}` | The name of the branch to which suggestions were applied. | `my-feature-branch` |
-| `%{files_count}` | The number of files to which suggestions were applied.| **2** |
+| `%{files_count}` | The number of files to which suggestions were applied.| `2` |
| `%{file_paths}` | The paths of the file to which suggestions were applied. Paths are separated by commas.| `docs/index.md, docs/about.md` |
| `%{project_path}` | The project path. | `my-group/my-project` |
-| `%{project_name}` | The human-readable name of the project. | **My Project** |
-| `%{suggestions_count}` | The number of suggestions applied.| **3** |
+| `%{project_name}` | The human-readable name of the project. | `My Project` |
+| `%{suggestions_count}` | The number of suggestions applied.| `3` |
| `%{username}` | The username of the user applying suggestions. | `user_1` |
-| `%{user_full_name}` | The full name of the user applying suggestions. | **User 1** |
+| `%{user_full_name}` | The full name of the user applying suggestions. | `User 1` |
For example, to customize the commit message to output
-**Addresses user_1's review**, set the custom text to
+`Addresses user_1's review`, set the custom text to
`Addresses %{username}'s review`.
-For merge requests created from forks, GitLab uses the template defined in target project.
-
-NOTE:
-Custom commit messages for each applied suggestion is
-introduced by [#25381](https://gitlab.com/gitlab-org/gitlab/-/issues/25381).
-
## Batch suggestions
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/25486) in GitLab 13.1 as an [alpha feature](../../../../policy/alpha-beta-support.md#alpha-features) with a flag named `batch_suggestions`, disabled by default.
diff --git a/lib/gitlab/ci/badge/release/latest_release.rb b/lib/gitlab/ci/badge/release/latest_release.rb
index e73bb2a912a..8d84a54787b 100644
--- a/lib/gitlab/ci/badge/release/latest_release.rb
+++ b/lib/gitlab/ci/badge/release/latest_release.rb
@@ -10,7 +10,8 @@ module Gitlab::Ci
@project = project
@customization = {
key_width: opts[:key_width] ? opts[:key_width].to_i : nil,
- key_text: opts[:key_text]
+ key_text: opts[:key_text],
+ value_width: opts[:value_width] ? opts[:value_width].to_i : nil
}
# In the future, we should support `order_by=semver` for showing the
diff --git a/lib/gitlab/ci/badge/release/template.rb b/lib/gitlab/ci/badge/release/template.rb
index 354be6276fa..549742226a1 100644
--- a/lib/gitlab/ci/badge/release/template.rb
+++ b/lib/gitlab/ci/badge/release/template.rb
@@ -11,9 +11,11 @@ module Gitlab::Ci
}.freeze
KEY_WIDTH_DEFAULT = 90
VALUE_WIDTH_DEFAULT = 54
+ VALUE_WIDTH_MAXIMUM = 200
def initialize(badge)
@tag = badge.tag || "none"
+ @value_width = badge.customization[:value_width]
super
end
@@ -30,7 +32,11 @@ module Gitlab::Ci
end
def value_width
- VALUE_WIDTH_DEFAULT
+ if @value_width && @value_width.between?(1, VALUE_WIDTH_MAXIMUM)
+ @value_width
+ else
+ VALUE_WIDTH_DEFAULT
+ end
end
def value_color
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 9169cdb4f7c..f73dce46a6b 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -4768,6 +4768,9 @@ msgstr ""
msgid "Analytics|Code"
msgstr ""
+msgid "Analytics|Column Chart"
+msgstr ""
+
msgid "Analytics|Configure Dashboard Project"
msgstr ""
@@ -14986,6 +14989,9 @@ msgstr ""
msgid "Diffs|with %{additions} and %{deletions}"
msgstr ""
+msgid "Dimension"
+msgstr ""
+
msgid "Direct member"
msgstr ""
@@ -37816,7 +37822,10 @@ msgstr ""
msgid "Runners|Tags control which type of jobs a runner can handle. By tagging a runner, you make sure shared runners only handle the jobs they are equipped to run."
msgstr ""
-msgid "Runners|The %{boldStart}runner token%{boldEnd} %{token} displays %{boldStart}only for a short time%{boldEnd}, and is stored in the %{codeStart}config.toml%{codeEnd} after you create the runner. It will not be visible once the runner is registered."
+msgid "Runners|The %{boldStart}runner token%{boldEnd} %{token} displays %{boldStart}only for a short time%{boldEnd}, and is stored in the %{codeStart}config.toml%{codeEnd} after you register the runner. It will not be visible once the runner is registered."
+msgstr ""
+
+msgid "Runners|The %{boldStart}runner token%{boldEnd} is no longer visible, it is stored in the %{codeStart}config.toml%{codeEnd} if you have registered the runner."
msgstr ""
msgid "Runners|The project, group or instance where the runner was registered. Instance runners are always owned by Administrator."
diff --git a/package.json b/package.json
index e633367acab..0d5aeacbd26 100644
--- a/package.json
+++ b/package.json
@@ -5,7 +5,7 @@
"block-dependencies": "node scripts/frontend/block_dependencies.js",
"check:startup_css": "scripts/frontend/startup_css/startup_css_changed.sh",
"clean": "rm -rf public/assets tmp/cache/*-loader",
- "dev-server": "NODE_OPTIONS=\"--max-old-space-size=3584\" node scripts/frontend/webpack_dev_server.js",
+ "dev-server": "NODE_OPTIONS=\"--max-old-space-size=4096\" node scripts/frontend/webpack_dev_server.js",
"file-coverage": "scripts/frontend/file_test_coverage.js",
"lint-docs": "scripts/lint-doc.sh",
"internal:eslint": "eslint --cache --max-warnings 0 --report-unused-disable-directives --ext .js,.vue,.graphql",
@@ -42,9 +42,9 @@
"storybook:build": "yarn --cwd ./storybook build --quiet",
"storybook:start": "./scripts/frontend/start_storybook.sh",
"swagger:validate": "swagger-cli validate",
- "webpack": "NODE_OPTIONS=\"--max-old-space-size=3584\" webpack --config config/webpack.config.js",
- "webpack-vendor": "NODE_OPTIONS=\"--max-old-space-size=3584\" webpack --config config/webpack.vendor.config.js",
- "webpack-prod": "NODE_OPTIONS=\"--max-old-space-size=3584\" NODE_ENV=production webpack --config config/webpack.config.js"
+ "webpack": "NODE_OPTIONS=\"--max-old-space-size=4096\" webpack --config config/webpack.config.js",
+ "webpack-vendor": "NODE_OPTIONS=\"--max-old-space-size=4096\" webpack --config config/webpack.vendor.config.js",
+ "webpack-prod": "NODE_OPTIONS=\"--max-old-space-size=4096\" NODE_ENV=production webpack --config config/webpack.config.js"
},
"dependencies": {
"@apollo/client": "^3.5.10",
@@ -56,7 +56,7 @@
"@gitlab/favicon-overlay": "2.0.0",
"@gitlab/fonts": "^1.2.0",
"@gitlab/svgs": "3.24.0",
- "@gitlab/ui": "57.0.0",
+ "@gitlab/ui": "58.0.0",
"@gitlab/visual-review-tools": "1.7.3",
"@gitlab/web-ide": "0.0.1-dev-20230223005157",
"@mattiasbuelens/web-streams-adapter": "^0.1.0",
diff --git a/spec/controllers/projects/badges_controller_spec.rb b/spec/controllers/projects/badges_controller_spec.rb
index d41e8d6169f..ef2afd7ca38 100644
--- a/spec/controllers/projects/badges_controller_spec.rb
+++ b/spec/controllers/projects/badges_controller_spec.rb
@@ -98,6 +98,16 @@ RSpec.describe Projects::BadgesController do
expect(response.body).to include('123')
end
end
+
+ if badge_type == :release
+ context 'when value_width param is used' do
+ it 'sets custom value width' do
+ get_badge(badge_type, value_width: '123')
+
+ expect(response.body).to include('123')
+ end
+ end
+ end
end
shared_examples 'a badge resource' do |badge_type|
@@ -186,7 +196,7 @@ RSpec.describe Projects::BadgesController do
namespace_id: project.namespace.to_param,
project_id: project,
ref: pipeline.ref
- }.merge(args.slice(:style, :key_text, :key_width, :ignore_skipped))
+ }.merge(args.slice(:style, :key_text, :key_width, :value_width, :ignore_skipped))
get badge, params: params, format: :svg
end
diff --git a/spec/frontend/ci/runner/admin_register_runner/admin_register_runner_app_spec.js b/spec/frontend/ci/runner/admin_register_runner/admin_register_runner_app_spec.js
index 4ec19d244dd..fc8d59594df 100644
--- a/spec/frontend/ci/runner/admin_register_runner/admin_register_runner_app_spec.js
+++ b/spec/frontend/ci/runner/admin_register_runner/admin_register_runner_app_spec.js
@@ -23,7 +23,16 @@ import RegistrationInstructions from '~/ci/runner/components/registration/regist
import PlatformsDrawer from '~/ci/runner/components/registration/platforms_drawer.vue';
import { runnerForRegistration } from '../mock_data';
-const mockRunner = runnerForRegistration.data.runner;
+const MOCK_TOKEN = 'MOCK_TOKEN';
+
+const mockRunner = {
+ ...runnerForRegistration.data.runner,
+ ephemeralAuthenticationToken: MOCK_TOKEN,
+};
+const mockRunnerWithoutToken = {
+ ...runnerForRegistration.data.runner,
+ ephemeralAuthenticationToken: undefined,
+};
const mockRunnerId = `${getIdFromGraphQLId(mockRunner.id)}`;
const mockRunnersPath = '/admin/runners';
@@ -71,31 +80,34 @@ describe('AdminRegisterRunnerApp', () => {
await waitForPromises();
});
- it('loads runner', () => {
- expect(mockRunnerQuery).toHaveBeenCalledWith({ id: mockRunner.id });
- });
+ describe('when runner token is available', () => {
+ it('loads runner', () => {
+ expect(mockRunnerQuery).toHaveBeenCalledWith({ id: mockRunner.id });
+ });
- it('shows registration instructions', () => {
- expect(findRegistrationInstructions().props()).toEqual({
- loading: false,
- platform: DEFAULT_PLATFORM,
- runner: mockRunner,
+ it('shows registration instructions', () => {
+ expect(findRegistrationInstructions().props()).toEqual({
+ loading: false,
+ platform: DEFAULT_PLATFORM,
+ runner: mockRunnerWithoutToken,
+ token: MOCK_TOKEN,
+ });
});
- });
- it('configures platform drawer', () => {
- expect(findPlatformsDrawer().props()).toEqual({
- open: false,
- platform: DEFAULT_PLATFORM,
+ it('configures platform drawer', () => {
+ expect(findPlatformsDrawer().props()).toEqual({
+ open: false,
+ platform: DEFAULT_PLATFORM,
+ });
});
- });
- it('shows runner list button', () => {
- expect(findBtn().attributes('href')).toEqual(mockRunnersPath);
- expect(findBtn().props('variant')).toEqual('confirm');
+ it('shows runner list button', () => {
+ expect(findBtn().attributes('href')).toEqual(mockRunnersPath);
+ expect(findBtn().props('variant')).toEqual('confirm');
+ });
});
- describe('polling for changes in status', () => {
+ describe('polling for changes', () => {
it('fetches data', () => {
expect(mockRunnerQuery).toHaveBeenCalledTimes(1);
});
@@ -121,6 +133,35 @@ describe('AdminRegisterRunnerApp', () => {
await waitForPolling();
expect(mockRunnerQuery).toHaveBeenCalledTimes(2);
});
+
+ it('when token is no longer visible in the API, it is still visible in the UI', async () => {
+ mockRunnerQuery.mockResolvedValue({
+ data: {
+ runner: mockRunnerWithoutToken,
+ },
+ });
+
+ await waitForPolling();
+
+ expect(findRegistrationInstructions().props('token')).toBe(MOCK_TOKEN);
+ });
+
+ it('when runner is not available (e.g. deleted), the UI does not update', async () => {
+ mockRunnerQuery.mockResolvedValue({
+ data: {
+ runner: null,
+ },
+ });
+
+ await waitForPolling();
+
+ expect(findRegistrationInstructions().props()).toEqual({
+ loading: false,
+ platform: DEFAULT_PLATFORM,
+ runner: mockRunnerWithoutToken,
+ token: MOCK_TOKEN,
+ });
+ });
});
});
@@ -194,6 +235,7 @@ describe('AdminRegisterRunnerApp', () => {
expect(findRegistrationInstructions().props()).toEqual({
loading: true,
runner: null,
+ token: null,
platform: DEFAULT_PLATFORM,
});
});
diff --git a/spec/frontend/ci/runner/components/registration/registration_instructions_spec.js b/spec/frontend/ci/runner/components/registration/registration_instructions_spec.js
index 9b264e17c41..2b8fdada5b3 100644
--- a/spec/frontend/ci/runner/components/registration/registration_instructions_spec.js
+++ b/spec/frontend/ci/runner/components/registration/registration_instructions_spec.js
@@ -16,12 +16,9 @@ import {
} from '~/ci/runner/constants';
import { runnerForRegistration } from '../../mock_data';
-const AUTH_TOKEN = 'AUTH_TOKEN';
+const MOCK_TOKEN = 'MOCK_TOKEN';
-const mockRunner = {
- ...runnerForRegistration.data.runner,
- ephemeralAuthenticationToken: AUTH_TOKEN,
-};
+const mockRunner = runnerForRegistration.data.runner;
describe('RegistrationInstructions', () => {
let wrapper;
@@ -34,6 +31,7 @@ describe('RegistrationInstructions', () => {
wrapper = shallowMountExtended(RegistrationInstructions, {
propsData: {
runner: mockRunner,
+ token: MOCK_TOKEN,
platform: DEFAULT_PLATFORM,
...props,
},
@@ -94,13 +92,13 @@ describe('RegistrationInstructions', () => {
command: [
'gitlab-runner register',
` --url ${TEST_HOST}`,
- ` --registration-token ${AUTH_TOKEN}`,
+ ` --registration-token ${MOCK_TOKEN}`,
` --description '${mockRunner.description}'`,
],
prompt: '$',
});
- expect(step1.find('code').text()).toBe(AUTH_TOKEN);
- expect(step1.findComponent(ClipboardButton).props('text')).toBe(AUTH_TOKEN);
+ expect(step1.find('[data-testid="runner-token"]').text()).toBe(MOCK_TOKEN);
+ expect(step1.findComponent(ClipboardButton).props('text')).toBe(MOCK_TOKEN);
});
it('renders step 1 in loading state', () => {
@@ -115,6 +113,25 @@ describe('RegistrationInstructions', () => {
expect(step1.findComponent(ClipboardButton).exists()).toBe(false);
});
+ it('render step 1 after token is not visible', () => {
+ createComponent({
+ token: undefined,
+ });
+
+ const step1 = findStepAt(0);
+
+ expect(step1.findComponent(CliCommand).props()).toEqual({
+ command: [
+ 'gitlab-runner register',
+ ` --url ${TEST_HOST}`,
+ ` --description '${mockRunner.description}'`,
+ ],
+ prompt: '$',
+ });
+ expect(step1.find('[data-testid="runner-token"]').exists()).toBe(false);
+ expect(step1.findComponent(ClipboardButton).exists()).toBe(false);
+ });
+
it('renders step 2', () => {
createComponent();
const step2 = findStepAt(1);
diff --git a/spec/helpers/users/callouts_helper_spec.rb b/spec/helpers/users/callouts_helper_spec.rb
index c6022846059..cb724816daf 100644
--- a/spec/helpers/users/callouts_helper_spec.rb
+++ b/spec/helpers/users/callouts_helper_spec.rb
@@ -185,7 +185,7 @@ RSpec.describe Users::CalloutsHelper do
end
end
- describe '#web_hook_disabled_dismissed?' do
+ describe '#web_hook_disabled_dismissed?', feature_category: :integrations do
context 'without a project' do
it 'is false' do
expect(helper).not_to be_web_hook_disabled_dismissed(nil)
@@ -194,50 +194,12 @@ RSpec.describe Users::CalloutsHelper do
context 'with a project' do
let_it_be(:project) { create(:project) }
+ let(:factory) { :project_callout }
+ let(:container_key) { :project }
+ let(:container) { project }
+ let(:key) { "web_hooks:last_failure:project-#{project.id}" }
- context 'the web-hook failure callout has never been dismissed' do
- it 'is false' do
- expect(helper).not_to be_web_hook_disabled_dismissed(project)
- end
- end
-
- context 'the web-hook failure callout has been dismissed', :freeze_time do
- before do
- create(:project_callout,
- feature_name: described_class::WEB_HOOK_DISABLED,
- user: user,
- project: project,
- dismissed_at: 1.week.ago)
- end
-
- it 'is true' do
- expect(helper).to be_web_hook_disabled_dismissed(project)
- end
-
- context 'when there was an older failure', :clean_gitlab_redis_shared_state do
- let(:key) { "web_hooks:last_failure:project-#{project.id}" }
-
- before do
- Gitlab::Redis::SharedState.with { |r| r.set(key, 1.month.ago.iso8601) }
- end
-
- it 'is true' do
- expect(helper).to be_web_hook_disabled_dismissed(project)
- end
- end
-
- context 'when there has been a more recent failure', :clean_gitlab_redis_shared_state do
- let(:key) { "web_hooks:last_failure:project-#{project.id}" }
-
- before do
- Gitlab::Redis::SharedState.with { |r| r.set(key, 1.day.ago.iso8601) }
- end
-
- it 'is false' do
- expect(helper).not_to be_web_hook_disabled_dismissed(project)
- end
- end
- end
+ include_examples 'CalloutsHelper#web_hook_disabled_dismissed shared examples'
end
end
end
diff --git a/spec/lib/gitlab/ci/badge/release/template_spec.rb b/spec/lib/gitlab/ci/badge/release/template_spec.rb
index 2b66c296a94..6be0dcaae99 100644
--- a/spec/lib/gitlab/ci/badge/release/template_spec.rb
+++ b/spec/lib/gitlab/ci/badge/release/template_spec.rb
@@ -59,9 +59,30 @@ RSpec.describe Gitlab::Ci::Badge::Release::Template do
end
describe '#value_width' do
- it 'has a fixed value width' do
+ it 'returns the default value width' do
expect(template.value_width).to eq 54
end
+
+ it 'returns custom value width' do
+ value_width = 100
+ badge = Gitlab::Ci::Badge::Release::LatestRelease.new(project, user, opts: { value_width: value_width })
+
+ expect(described_class.new(badge).value_width).to eq value_width
+ end
+
+ it 'returns VALUE_WIDTH_DEFAULT if the custom value_width supplied is greater than permissible limit' do
+ value_width = 250
+ badge = Gitlab::Ci::Badge::Release::LatestRelease.new(project, user, opts: { value_width: value_width })
+
+ expect(described_class.new(badge).value_width).to eq 54
+ end
+
+ it 'returns VALUE_WIDTH_DEFAULT if value_width is not a number' do
+ value_width = "string"
+ badge = Gitlab::Ci::Badge::Release::LatestRelease.new(project, user, opts: { value_width: value_width })
+
+ expect(described_class.new(badge).value_width).to eq 54
+ end
end
describe '#key_color' do
diff --git a/spec/services/resource_access_tokens/create_service_spec.rb b/spec/services/resource_access_tokens/create_service_spec.rb
index cc1397a7c42..464fc18f1f0 100644
--- a/spec/services/resource_access_tokens/create_service_spec.rb
+++ b/spec/services/resource_access_tokens/create_service_spec.rb
@@ -127,9 +127,7 @@ RSpec.describe ResourceAccessTokens::CreateService, feature_category: :system_ac
end
end
- context 'when user specifies an access level' do
- let_it_be(:params) { { access_level: Gitlab::Access::DEVELOPER } }
-
+ shared_examples 'bot with access level' do
it 'adds the bot user with the specified access level in the resource' do
response = subject
access_token = response.payload[:access_token]
@@ -139,6 +137,18 @@ RSpec.describe ResourceAccessTokens::CreateService, feature_category: :system_ac
end
end
+ context 'when user specifies an access level' do
+ let_it_be(:params) { { access_level: Gitlab::Access::DEVELOPER } }
+
+ it_behaves_like 'bot with access level'
+ end
+
+ context 'with DEVELOPER access_level, in string format' do
+ let_it_be(:params) { { access_level: Gitlab::Access::DEVELOPER.to_s } }
+
+ it_behaves_like 'bot with access level'
+ end
+
context 'when user is external' do
before do
user.update!(external: true)
@@ -227,17 +237,31 @@ RSpec.describe ResourceAccessTokens::CreateService, feature_category: :system_ac
let_it_be(:bot_user) { create(:user, :project_bot) }
let(:unpersisted_member) { build(:project_member, source: resource, user: bot_user) }
- let(:error_message) { 'Could not provision maintainer access to project access token' }
+ let(:error_message) { 'Could not provision maintainer access to the access token. ERROR: error message' }
before do
allow_next_instance_of(ResourceAccessTokens::CreateService) do |service|
allow(service).to receive(:create_user).and_return(bot_user)
allow(service).to receive(:create_membership).and_return(unpersisted_member)
end
+
+ allow(unpersisted_member).to receive_message_chain(:errors, :full_messages, :to_sentence)
+ .and_return('error message')
+ end
+
+ context 'with MAINTAINER access_level, in integer format' do
+ let_it_be(:params) { { access_level: Gitlab::Access::MAINTAINER } }
+
+ it_behaves_like 'token creation fails'
+ it_behaves_like 'correct error message'
end
- it_behaves_like 'token creation fails'
- it_behaves_like 'correct error message'
+ context 'with MAINTAINER access_level, in string format' do
+ let_it_be(:params) { { access_level: Gitlab::Access::MAINTAINER.to_s } }
+
+ it_behaves_like 'token creation fails'
+ it_behaves_like 'correct error message'
+ end
end
end
diff --git a/spec/support/shared_examples/helpers/callouts_for_web_hooks.rb b/spec/support/shared_examples/helpers/callouts_for_web_hooks.rb
new file mode 100644
index 00000000000..b3d3000aa06
--- /dev/null
+++ b/spec/support/shared_examples/helpers/callouts_for_web_hooks.rb
@@ -0,0 +1,49 @@
+# frozen_string_literal: true
+
+RSpec.shared_examples 'CalloutsHelper#web_hook_disabled_dismissed shared examples' do
+ context 'when the web-hook failure callout has never been dismissed' do
+ it 'is false' do
+ expect(helper).not_to be_web_hook_disabled_dismissed(container)
+ end
+ end
+
+ context 'when the web-hook failure callout has been dismissed', :freeze_time, :clean_gitlab_redis_shared_state do
+ before do
+ create(factory,
+ feature_name: Users::CalloutsHelper::WEB_HOOK_DISABLED,
+ user: user,
+ dismissed_at: 1.week.ago,
+ container_key => container)
+ end
+
+ it 'is true' do
+ expect(helper).to be_web_hook_disabled_dismissed(container)
+ end
+
+ it 'is true when passed as a presenter' do
+ skip "Does not apply to #{container.class}" unless container.is_a?(Presentable)
+
+ expect(helper).to be_web_hook_disabled_dismissed(container.present)
+ end
+
+ context 'when there was an older failure' do
+ before do
+ Gitlab::Redis::SharedState.with { |r| r.set(key, 1.month.ago.iso8601) }
+ end
+
+ it 'is true' do
+ expect(helper).to be_web_hook_disabled_dismissed(container)
+ end
+ end
+
+ context 'when there has been a more recent failure' do
+ before do
+ Gitlab::Redis::SharedState.with { |r| r.set(key, 1.day.ago.iso8601) }
+ end
+
+ it 'is false' do
+ expect(helper).not_to be_web_hook_disabled_dismissed(container)
+ end
+ end
+ end
+end
diff --git a/workhorse/go.mod b/workhorse/go.mod
index 0e347412ea6..aad0ec2592e 100644
--- a/workhorse/go.mod
+++ b/workhorse/go.mod
@@ -7,7 +7,7 @@ require (
github.com/BurntSushi/toml v1.2.1
github.com/FZambia/sentinel v1.1.1
github.com/alecthomas/chroma/v2 v2.5.0
- github.com/aws/aws-sdk-go v1.44.217
+ github.com/aws/aws-sdk-go v1.44.218
github.com/disintegration/imaging v1.6.2
github.com/getsentry/raven-go v0.2.0
github.com/golang-jwt/jwt/v4 v4.5.0
diff --git a/workhorse/go.sum b/workhorse/go.sum
index 29139218d46..6581f5d5401 100644
--- a/workhorse/go.sum
+++ b/workhorse/go.sum
@@ -569,8 +569,8 @@ github.com/aws/aws-sdk-go v1.43.31/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4
github.com/aws/aws-sdk-go v1.44.156/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/aws/aws-sdk-go v1.44.187/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/aws/aws-sdk-go v1.44.200/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
-github.com/aws/aws-sdk-go v1.44.217 h1:FcWC56MRl+k756aH3qeMQTylSdeJ58WN0iFz3fkyRz0=
-github.com/aws/aws-sdk-go v1.44.217/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
+github.com/aws/aws-sdk-go v1.44.218 h1:p707+xOCazWhkSpZOeyhtTcg7Z+asxxvueGgYPSitn4=
+github.com/aws/aws-sdk-go v1.44.218/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/aws/aws-sdk-go-v2 v1.9.1/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4=
github.com/aws/aws-sdk-go-v2 v1.17.4 h1:wyC6p9Yfq6V2y98wfDsj6OnNQa4w2BLGCLIxzNhwOGY=
github.com/aws/aws-sdk-go-v2 v1.17.4/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw=
diff --git a/yarn.lock b/yarn.lock
index a526d6622c2..d6193287d12 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1237,10 +1237,10 @@
resolved "https://registry.yarnpkg.com/@gitlab/svgs/-/svgs-3.24.0.tgz#bc8265919aa04b06cd08be91637471bad195936d"
integrity sha512-R4s5qJUFUIbPflknpw1aI/PchiNq65vY7LVsJZnQkY+vi+AgmsETdut/AdferbGWmeWMU0q2wuVu9phE8lDUgA==
-"@gitlab/ui@57.0.0":
- version "57.0.0"
- resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-57.0.0.tgz#3a9e8894ba84ccf4e396441c17289d74757e2914"
- integrity sha512-7mNcTR/qCgeuF0AsK6UnrckELyuT8W2Kw+wrNracy7esWcGsy/DgI91vECWt421jPe1eI7m/2N4mATuAMwicHQ==
+"@gitlab/ui@58.0.0":
+ version "58.0.0"
+ resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-58.0.0.tgz#4802801786f25d5cc3e0d1d0692eb400ec5f50c7"
+ integrity sha512-eTOiMNpm4sm2BwfFaZ9kxTB49lZYgsqbwmcMBEJRh0ZKzShxKHXTzDbUNNCDGVsT7nm3HCtiEdjsYGGEdu+wWw==
dependencies:
"@popperjs/core" "^2.11.2"
bootstrap-vue "2.23.1"