summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_rebase.vue49
-rw-r--r--app/assets/javascripts/vue_merge_request_widget/constants.js3
-rw-r--r--app/assets/javascripts/vue_merge_request_widget/services/mr_widget_service.js5
-rw-r--r--app/models/clusters/applications/runner.rb4
-rw-r--r--app/services/ci/destroy_pipeline_service.rb4
-rw-r--r--data/deprecations/15-0-deprecate-monitor-tracing.yml16
-rw-r--r--db/post_migrate/20220111023852_index_cluster_agent_tokens_on_status.rb15
-rw-r--r--db/post_migrate/20220112090556_remove_cascade_delete_from_project_namespace_foreign_key.rb23
-rw-r--r--db/schema_migrations/202201110238521
-rw-r--r--db/schema_migrations/202201120905561
-rw-r--r--db/structure.sql4
-rw-r--r--doc/administration/pages/index.md9
-rw-r--r--doc/ci/ci_cd_for_external_repos/index.md4
-rw-r--r--doc/ci/pipelines/merge_trains.md4
-rw-r--r--doc/ci/pipelines/pipelines_for_merged_results.md4
-rw-r--r--doc/ci/test_cases/index.md4
-rw-r--r--doc/development/internal_api/index.md26
-rw-r--r--doc/push_rules/push_rules.md4
-rw-r--r--doc/subscriptions/index.md5
-rw-r--r--doc/update/deprecations.md6
-rw-r--r--doc/user/application_security/api_fuzzing/index.md4
-rw-r--r--doc/user/application_security/container_scanning/index.md4
-rw-r--r--doc/user/application_security/dast/index.md4
-rw-r--r--doc/user/application_security/dependency_scanning/index.md4
-rw-r--r--doc/user/application_security/index.md4
-rw-r--r--doc/user/application_security/security_dashboard/index.md4
-rw-r--r--doc/user/application_security/vulnerabilities/index.md2
-rw-r--r--doc/user/clusters/agent/index.md4
-rw-r--r--doc/user/compliance/license_compliance/index.md4
-rw-r--r--doc/user/group/epics/epic_boards.md4
-rw-r--r--doc/user/group/epics/index.md4
-rw-r--r--doc/user/group/saml_sso/index.md4
-rw-r--r--doc/user/project/code_owners.md4
-rw-r--r--doc/user/project/merge_requests/fast_forward_merge.md5
-rw-r--r--doc/user/project/merge_requests/img/ff_merge_rebase.pngbin26945 -> 0 bytes
-rw-r--r--doc/user/project/merge_requests/img/ff_merge_rebase_v14_7.pngbin0 -> 13865 bytes
-rw-r--r--doc/user/project/requirements/index.md4
-rw-r--r--doc/user/search/advanced_search.md4
-rw-r--r--locale/gitlab.pot15
-rw-r--r--spec/factories/clusters/applications/helm.rb1
-rw-r--r--spec/frontend/vue_mr_widget/components/mr_widget_rebase_spec.js134
-rw-r--r--spec/lib/gitlab/ci/pipeline/chain/create_spec.rb4
-rw-r--r--spec/models/ci/build_trace_chunk_spec.rb24
-rw-r--r--spec/models/namespaces/project_namespace_spec.rb4
-rw-r--r--spec/requests/api/commits_spec.rb8
-rw-r--r--spec/services/ci/retry_build_service_spec.rb8
-rw-r--r--spec/support/database/cross-database-modification-allowlist.yml11
-rw-r--r--spec/support/shared_examples/models/update_project_statistics_shared_examples.rb6
48 files changed, 291 insertions, 178 deletions
diff --git a/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_rebase.vue b/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_rebase.vue
index 886fab8634c..c44d14f08b6 100644
--- a/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_rebase.vue
+++ b/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_rebase.vue
@@ -1,13 +1,15 @@
<script>
-import { GlButton, GlSkeletonLoader } from '@gitlab/ui';
+import { GlSkeletonLoader } from '@gitlab/ui';
import createFlash from '~/flash';
import { __ } from '~/locale';
import glFeatureFlagMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
+import ActionsButton from '~/vue_shared/components/actions_button.vue';
import simplePoll from '../../../lib/utils/simple_poll';
import eventHub from '../../event_hub';
import mergeRequestQueryVariablesMixin from '../../mixins/merge_request_query_variables';
import rebaseQuery from '../../queries/states/rebase.query.graphql';
import statusIcon from '../mr_widget_status_icon.vue';
+import { REBASE_BUTTON_KEY, REBASE_WITHOUT_CI_BUTTON_KEY } from '../../constants';
export default {
name: 'MRWidgetRebase',
@@ -25,8 +27,8 @@ export default {
},
components: {
statusIcon,
- GlButton,
GlSkeletonLoader,
+ ActionsButton,
},
mixins: [glFeatureFlagMixin(), mergeRequestQueryVariablesMixin],
props: {
@@ -44,6 +46,7 @@ export default {
state: {},
isMakingRequest: false,
rebasingError: null,
+ selectedRebaseAction: REBASE_BUTTON_KEY,
};
},
computed: {
@@ -86,14 +89,36 @@ export default {
fastForwardMergeText() {
return __('Merge blocked: the source branch must be rebased onto the target branch.');
},
+ actions() {
+ return [this.rebaseAction, this.rebaseWithoutCiAction].filter((action) => action);
+ },
+ rebaseAction() {
+ return {
+ key: REBASE_BUTTON_KEY,
+ text: __('Rebase'),
+ secondaryText: __('Rebases and triggers a pipeline'),
+ attrs: {
+ 'data-qa-selector': 'mr_rebase_button',
+ },
+ handle: () => this.rebase(),
+ };
+ },
+ rebaseWithoutCiAction() {
+ return {
+ key: REBASE_WITHOUT_CI_BUTTON_KEY,
+ text: __('Rebase without CI'),
+ secondaryText: __('Performs a rebase but skips triggering a new pipeline'),
+ handle: () => this.rebase({ skipCi: true }),
+ };
+ },
},
methods: {
- rebase() {
+ rebase({ skipCi = false } = {}) {
this.isMakingRequest = true;
this.rebasingError = null;
this.service
- .rebase()
+ .rebase({ skipCi })
.then(() => {
simplePoll(this.checkRebaseStatus);
})
@@ -109,6 +134,9 @@ export default {
}
});
},
+ selectRebaseAction(key) {
+ this.selectedRebaseAction = key;
+ },
checkRebaseStatus(continuePolling, stopPolling) {
this.service
.poll()
@@ -168,15 +196,14 @@ export default {
v-if="!rebaseInProgress && canPushToSourceBranch && !isMakingRequest"
class="accept-merge-holder clearfix js-toggle-container accept-action media space-children"
>
- <gl-button
+ <actions-button
v-if="!glFeatures.restructuredMrWidget"
- :loading="isMakingRequest"
+ :actions="actions"
+ :selected-key="selectedRebaseAction"
variant="confirm"
- data-qa-selector="mr_rebase_button"
- @click="rebase"
- >
- {{ __('Rebase') }}
- </gl-button>
+ category="primary"
+ @select="selectRebaseAction"
+ />
<span
v-if="!rebasingError"
:class="{ 'gl-ml-0! gl-text-body!': glFeatures.restructuredMrWidget }"
diff --git a/app/assets/javascripts/vue_merge_request_widget/constants.js b/app/assets/javascripts/vue_merge_request_widget/constants.js
index 2edccce7f4e..32effb91043 100644
--- a/app/assets/javascripts/vue_merge_request_widget/constants.js
+++ b/app/assets/javascripts/vue_merge_request_widget/constants.js
@@ -162,3 +162,6 @@ export const EXTENSION_SUMMARY_FAILED_CLASS = 'gl-text-red-500';
export const EXTENSION_SUMMARY_NEUTRAL_CLASS = 'gl-text-gray-700';
export { STATE_MACHINE };
+
+export const REBASE_BUTTON_KEY = 'rebase';
+export const REBASE_WITHOUT_CI_BUTTON_KEY = 'rebaseWithoutCi';
diff --git a/app/assets/javascripts/vue_merge_request_widget/services/mr_widget_service.js b/app/assets/javascripts/vue_merge_request_widget/services/mr_widget_service.js
index 7dcb4881e7f..7b803b0fcbb 100644
--- a/app/assets/javascripts/vue_merge_request_widget/services/mr_widget_service.js
+++ b/app/assets/javascripts/vue_merge_request_widget/services/mr_widget_service.js
@@ -55,8 +55,9 @@ export default class MRWidgetService {
return axios.get(this.endpoints.mergeActionsContentPath);
}
- rebase() {
- return axios.post(this.endpoints.rebasePath);
+ rebase({ skipCi = false } = {}) {
+ const path = `${this.endpoints.rebasePath}?skip_ci=${Boolean(skipCi)}`;
+ return axios.post(path);
}
fetchApprovals() {
diff --git a/app/models/clusters/applications/runner.rb b/app/models/clusters/applications/runner.rb
index 5db065bad7f..0ca3bcbf852 100644
--- a/app/models/clusters/applications/runner.rb
+++ b/app/models/clusters/applications/runner.rb
@@ -41,7 +41,9 @@ module Clusters
end
def prepare_uninstall
- runner&.update!(active: false)
+ ::Gitlab::Database::QueryAnalyzers::PreventCrossDatabaseModification.allow_cross_database_modification_within_transaction(url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/350180') do
+ runner&.update!(active: false)
+ end
end
def post_uninstall
diff --git a/app/services/ci/destroy_pipeline_service.rb b/app/services/ci/destroy_pipeline_service.rb
index 6fbde5d291c..476c7523d60 100644
--- a/app/services/ci/destroy_pipeline_service.rb
+++ b/app/services/ci/destroy_pipeline_service.rb
@@ -12,9 +12,7 @@ module Ci
# Ci::Pipeline#destroy triggers `use_fast_destroy :job_artifacts` and
# ci_builds has ON DELETE CASCADE to ci_pipelines. The pipeline, the builds,
# job and pipeline artifacts all get destroyed here.
- ::Gitlab::Database::QueryAnalyzers::PreventCrossDatabaseModification.allow_cross_database_modification_within_transaction(url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/345664') do
- pipeline.reset.destroy!
- end
+ pipeline.reset.destroy!
ServiceResponse.success(message: 'Pipeline not found')
rescue ActiveRecord::RecordNotFound
diff --git a/data/deprecations/15-0-deprecate-monitor-tracing.yml b/data/deprecations/15-0-deprecate-monitor-tracing.yml
new file mode 100644
index 00000000000..126ada081f4
--- /dev/null
+++ b/data/deprecations/15-0-deprecate-monitor-tracing.yml
@@ -0,0 +1,16 @@
+- name: "Tracing in GitLab" # The name of the feature to be deprecated
+ announcement_milestone: "14.7" # The milestone when this feature was first announced as deprecated.
+ announcement_date: "2022-01-22" # The date of the milestone release when this feature was first announced as deprecated. This should almost always be the 22nd of a month (YYYY-MM-22), unless you did an out of band blog post.
+ removal_milestone: "15.0" # The milestone when this feature is planned to be removed
+ removal_date: "2022-05-22" # The date of the milestone release when this feature was first announced as deprecated. This should almost always be the 22nd of a month (YYYY-MM-22), unless you did an out of band blog post.
+ breaking_change: true # If this deprecation is a breaking change, set this value to true
+ body: | # Do not modify this line, instead modify the lines below.
+ Tracing in GitLab is an integration with Jaeger, an open-source end-to-end distributed tracing system. GitLab users can navigate to their Jaeger instance to gain insight into the performance of a deployed application, tracking each function or microservice that handles a given request. Tracing in GitLab is deprecated in GitLab 14.7, and scheduled for removal in 15.0. To track work on a possible replacement, see the issue for [Opstrace integration with GitLab](https://gitlab.com/groups/gitlab-org/-/epics/6976).
+# The following items are not published on the docs page, but may be used in the future.
+ stage: Monitor # (optional - may be required in the future) String value of the stage that the feature was created in. e.g., Growth
+ tiers: [Free] # (optional - may be required in the future) An array of tiers that the feature is available in currently. e.g., [Free, Silver, Gold, Core, Premium, Ultimate]
+ issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/346540 # (optional) This is a link to the deprecation issue in GitLab
+ documentation_url: https://docs.gitlab.com/ee/operations/tracing.html#tracing # (optional) This is a link to the current documentation page
+ image_url: # (optional) This is a link to a thumbnail image depicting the feature
+ video_url: # (optional) Use the youtube thumbnail URL with the structure of https://img.youtube.com/vi/UNIQUEID/hqdefault.jpg
+
diff --git a/db/post_migrate/20220111023852_index_cluster_agent_tokens_on_status.rb b/db/post_migrate/20220111023852_index_cluster_agent_tokens_on_status.rb
new file mode 100644
index 00000000000..6de0f9424e8
--- /dev/null
+++ b/db/post_migrate/20220111023852_index_cluster_agent_tokens_on_status.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class IndexClusterAgentTokensOnStatus < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_cluster_agent_tokens_on_agent_id_status_last_used_at'
+
+ def up
+ add_concurrent_index :cluster_agent_tokens, 'agent_id, status, last_used_at DESC NULLS LAST', name: INDEX_NAME
+ end
+
+ def down
+ remove_concurrent_index_by_name :cluster_agent_tokens, INDEX_NAME
+ end
+end
diff --git a/db/post_migrate/20220112090556_remove_cascade_delete_from_project_namespace_foreign_key.rb b/db/post_migrate/20220112090556_remove_cascade_delete_from_project_namespace_foreign_key.rb
new file mode 100644
index 00000000000..d786c9d846a
--- /dev/null
+++ b/db/post_migrate/20220112090556_remove_cascade_delete_from_project_namespace_foreign_key.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+class RemoveCascadeDeleteFromProjectNamespaceForeignKey < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ TARGET_COLUMN = :project_namespace_id
+
+ def up
+ with_lock_retries do
+ remove_foreign_key_if_exists(:projects, column: TARGET_COLUMN)
+ end
+
+ add_concurrent_foreign_key(:projects, :namespaces, column: TARGET_COLUMN, on_delete: :nullify)
+ end
+
+ def down
+ with_lock_retries do
+ remove_foreign_key_if_exists(:projects, column: TARGET_COLUMN)
+ end
+
+ add_concurrent_foreign_key(:projects, :namespaces, column: TARGET_COLUMN, on_delete: :cascade)
+ end
+end
diff --git a/db/schema_migrations/20220111023852 b/db/schema_migrations/20220111023852
new file mode 100644
index 00000000000..15ab0470662
--- /dev/null
+++ b/db/schema_migrations/20220111023852
@@ -0,0 +1 @@
+fdb6e193748f9933aa3ae60fab41960e06d4edf271048fc5f6c9c465d30a8334 \ No newline at end of file
diff --git a/db/schema_migrations/20220112090556 b/db/schema_migrations/20220112090556
new file mode 100644
index 00000000000..12ffaeffe00
--- /dev/null
+++ b/db/schema_migrations/20220112090556
@@ -0,0 +1 @@
+e78e11a47017c67130fe88fa538578553b7015c18cf222b5e7fb7f503254dc6d \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index ae6c128f293..1af51afd14d 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -25671,6 +25671,8 @@ CREATE UNIQUE INDEX index_ci_variables_on_project_id_and_key_and_environment_sco
CREATE INDEX index_cluster_agent_tokens_on_agent_id_and_last_used_at ON cluster_agent_tokens USING btree (agent_id, last_used_at DESC NULLS LAST);
+CREATE INDEX index_cluster_agent_tokens_on_agent_id_status_last_used_at ON cluster_agent_tokens USING btree (agent_id, status, last_used_at DESC NULLS LAST);
+
CREATE INDEX index_cluster_agent_tokens_on_created_by_user_id ON cluster_agent_tokens USING btree (created_by_user_id);
CREATE UNIQUE INDEX index_cluster_agent_tokens_on_token_encrypted ON cluster_agent_tokens USING btree (token_encrypted);
@@ -29344,7 +29346,7 @@ ALTER TABLE ONLY protected_branch_push_access_levels
ADD CONSTRAINT fk_7111b68cdb FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
ALTER TABLE ONLY projects
- ADD CONSTRAINT fk_71625606ac FOREIGN KEY (project_namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+ ADD CONSTRAINT fk_71625606ac FOREIGN KEY (project_namespace_id) REFERENCES namespaces(id) ON DELETE SET NULL;
ALTER TABLE ONLY integrations
ADD CONSTRAINT fk_71cce407f9 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
diff --git a/doc/administration/pages/index.md b/doc/administration/pages/index.md
index 9fb49716979..d691f05926f 100644
--- a/doc/administration/pages/index.md
+++ b/doc/administration/pages/index.md
@@ -1320,6 +1320,15 @@ This can happen if your `gitlab-secrets.json` file is out of date between GitLab
Pages. Follow steps 8-10 of [Running GitLab Pages on a separate server](#running-gitlab-pages-on-a-separate-server),
in all of your GitLab Pages instances.
+### Intermittent 502 errors when using an AWS Network Load Balancer and GitLab Pages is running on multiple application servers
+
+Connections will time out when using a Network Load Balancer with client IP preservation enabled and [the request is looped back to the source server](https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-troubleshooting.html#loopback-timeout).
+This can happen to GitLab instances with multiple servers
+running both the core GitLab application and GitLab Pages.
+
+AWS [recommends using an IP target type](https://aws.amazon.com/premiumsupport/knowledge-center/target-connection-fails-load-balancer/)
+to resolve this issue.
+
### 500 error with `securecookie: failed to generate random iv` and `Failed to save the session`
This problem most likely results from an [out-dated operating system](../package_information/supported_os.md#os-versions-that-are-no-longer-supported).
diff --git a/doc/ci/ci_cd_for_external_repos/index.md b/doc/ci/ci_cd_for_external_repos/index.md
index 7bc138d083d..4e0cd7609cb 100644
--- a/doc/ci/ci_cd_for_external_repos/index.md
+++ b/doc/ci/ci_cd_for_external_repos/index.md
@@ -9,10 +9,6 @@ type: index, howto
>[Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/4642) in GitLab 10.6.
-INFO:
-Get external repo access and more by upgrading to GitLab Ultimate.
-[Try a free 30-day trial now](https://about.gitlab.com/free-trial/index.html?glm_source=docs.gitlab.com&glm_content=p-ci-cd-external-docs).
-
GitLab CI/CD can be used with [GitHub](github_integration.md), [Bitbucket Cloud](bitbucket_integration.md), or any other
Git server.
diff --git a/doc/ci/pipelines/merge_trains.md b/doc/ci/pipelines/merge_trains.md
index 05a3de634f3..eb5314f4a23 100644
--- a/doc/ci/pipelines/merge_trains.md
+++ b/doc/ci/pipelines/merge_trains.md
@@ -9,10 +9,6 @@ info: To determine the technical writer assigned to the Stage/Group associated w
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/9186) in GitLab 12.0.
> - [Squash and merge](../../user/project/merge_requests/squash_and_merge.md) support [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/13001) in GitLab 12.6.
-INFO:
-Get merge trains and more in GitLab Ultimate.
-[Try a free 30-day trial now](https://about.gitlab.com/free-trial/index.html?glm_source=docs.gitlab.com&glm_content=p-ci-cd-external-docs).
-
For more information about why you might want to use merge trains, read [How merge trains keep your master green](https://about.gitlab.com/blog/2020/01/30/all-aboard-merge-trains/).
When [pipelines for merged results](pipelines_for_merged_results.md) are
diff --git a/doc/ci/pipelines/pipelines_for_merged_results.md b/doc/ci/pipelines/pipelines_for_merged_results.md
index 4796afa227c..b90e1476d73 100644
--- a/doc/ci/pipelines/pipelines_for_merged_results.md
+++ b/doc/ci/pipelines/pipelines_for_merged_results.md
@@ -8,10 +8,6 @@ info: To determine the technical writer assigned to the Stage/Group associated w
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/7380) in GitLab 11.10.
-INFO:
-Get these pipelines and more in GitLab Ultimate.
-[Try a free 30-day trial now](https://about.gitlab.com/free-trial/index.html?glm_source=docs.gitlab.com&glm_content=p-ci-cd-external-docs).
-
When you submit a merge request, you are requesting to merge changes from a
source branch into a target branch. By default, the CI pipeline runs jobs
against the source branch.
diff --git a/doc/ci/test_cases/index.md b/doc/ci/test_cases/index.md
index 4c840125d24..384bfc10779 100644
--- a/doc/ci/test_cases/index.md
+++ b/doc/ci/test_cases/index.md
@@ -11,10 +11,6 @@ type: reference
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/233479) in GitLab 13.6.
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/241983) in GitLab 13.7.
-INFO:
-Create test cases in GitLab Ultimate.
-[Try it free for 30 days](https://about.gitlab.com/free-trial/index.html?glm_source=docs.gitlab.com&glm_content=u-test-cases-docs).
-
Test cases in GitLab can help your teams create testing scenarios in their existing development platform.
Now your Implementation and Testing teams can collaborate better, as they no longer have to
diff --git a/doc/development/internal_api/index.md b/doc/development/internal_api/index.md
index 49d96dbf4c9..96910892022 100644
--- a/doc/development/internal_api/index.md
+++ b/doc/development/internal_api/index.md
@@ -826,6 +826,32 @@ Example response:
200
```
+### Deleting an `upcoming_reconciliation`
+
+Use a DELETE command to delete an `upcoming_reconciliation`.
+
+```plaintext
+DELETE /internal/upcoming_reconciliations
+```
+
+| Attribute | Type | Required | Description |
+|:---------------|:--------|:---------|:----------------------------------------------------------------------------------|
+| `namespace_id` | integer | yes | The ID of the GitLab.com namespace that no longer has an upcoming reconciliation. |
+
+Example request:
+
+```shell
+curl --request DELETE \
+ --url "http://localhost:3000/api/v4/internal/upcoming_reconciliations?namespace_id=22" \
+ --header 'PRIVATE-TOKEN: <admin_access_token>'
+```
+
+Example response:
+
+```plaintext
+204
+```
+
### Known consumers
- CustomersDot
diff --git a/doc/push_rules/push_rules.md b/doc/push_rules/push_rules.md
index 425275a0370..94de8e46240 100644
--- a/doc/push_rules/push_rules.md
+++ b/doc/push_rules/push_rules.md
@@ -14,10 +14,6 @@ GitLab already offers [protected branches](../user/project/protected_branches.md
cases when you need some specific rules. Some common scenarios: preventing Git tag removal, or
enforcing a special format for commit messages.
-INFO:
-Get access to push rules and more with a
-[free 30-day trial of GitLab Ultimate](https://about.gitlab.com/free-trial/index.html?glm_source=docs.gitlab.com&glm_content=p-push-rules-docs).
-
Push rules are [pre-receive Git hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) you
can enable in a user-friendly interface. They are defined either:
diff --git a/doc/subscriptions/index.md b/doc/subscriptions/index.md
index dfe5f1ae0ff..4e4c0309c3d 100644
--- a/doc/subscriptions/index.md
+++ b/doc/subscriptions/index.md
@@ -7,11 +7,6 @@ type: index, reference
# GitLab subscription **(PREMIUM)**
-INFO:
-Get advanced search and more with
-[a trial of GitLab Ultimate](https://about.gitlab.com/free-trial/index.html?glm_source=docs.gitlab.com&glm_content=u-subscription-docs).
-Free for 30 days.
-
GitLab offers tiers of features. Your subscription determines which tier you
have access to. Subscriptions are valid for 12 months.
diff --git a/doc/update/deprecations.md b/doc/update/deprecations.md
index b139a59899c..c19fbda30a1 100644
--- a/doc/update/deprecations.md
+++ b/doc/update/deprecations.md
@@ -327,3 +327,9 @@ and can interfere with object storage development.
It is now considered deprecated, and will be removed in GitLab 15.0.
Planned removal milestone: 15.0 (2021-06-22)
+
+### Tracing in GitLab
+
+Tracing in GitLab is an integration with Jaeger, an open-source end-to-end distributed tracing system. GitLab users can navigate to their Jaeger instance to gain insight into the performance of a deployed application, tracking each function or microservice that handles a given request. Tracing in GitLab is deprecated in GitLab 14.7, and scheduled for removal in 15.0. To track work on a possible replacement, see the issue for [Opstrace integration with GitLab](https://gitlab.com/groups/gitlab-org/-/epics/6976).
+
+Planned removal milestone: 15.0 (2022-05-22)
diff --git a/doc/user/application_security/api_fuzzing/index.md b/doc/user/application_security/api_fuzzing/index.md
index 453e3c4dde5..be6b06a0797 100644
--- a/doc/user/application_security/api_fuzzing/index.md
+++ b/doc/user/application_security/api_fuzzing/index.md
@@ -12,10 +12,6 @@ parameters to unexpected values in an effort to cause unexpected behavior and er
backend. This helps you discover bugs and potential security issues that other QA processes may
miss.
-INFO:
-Try fuzz testing in GitLab Ultimate.
-[It's free for 30 days](https://about.gitlab.com/free-trial/index.html?glm_source=docs.gitlab.com&glm_content=u-api-fuzzing-docs).
-
We recommend that you use fuzz testing in addition to [GitLab Secure](../index.md)'s
other security scanners and your own test processes. If you're using [GitLab CI/CD](../../../ci/index.md),
you can run fuzz tests as part your CI/CD workflow.
diff --git a/doc/user/application_security/container_scanning/index.md b/doc/user/application_security/container_scanning/index.md
index 85d823e5ef2..24cc8d1cf14 100644
--- a/doc/user/application_security/container_scanning/index.md
+++ b/doc/user/application_security/container_scanning/index.md
@@ -9,10 +9,6 @@ info: To determine the technical writer assigned to the Stage/Group associated w
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/3672) in GitLab 10.4.
-INFO:
-Try out Container Scanning in GitLab Ultimate.
-[It's free for 30 days](https://about.gitlab.com/free-trial/index.html?glm_source=docs.gitlab.com&glm_content=u-container-scanning-docs).
-
Your application's Docker image may itself be based on Docker images that contain known
vulnerabilities. By including an extra Container Scanning job in your pipeline that scans for those
vulnerabilities and displays them in a merge request, you can use GitLab to audit your Docker-based
diff --git a/doc/user/application_security/dast/index.md b/doc/user/application_security/dast/index.md
index 2bafcd3e10d..9faa1a31b26 100644
--- a/doc/user/application_security/dast/index.md
+++ b/doc/user/application_security/dast/index.md
@@ -16,10 +16,6 @@ Dynamic Application Security Testing (DAST) examines applications for
vulnerabilities like these in deployed environments. DAST uses the open source
tool [OWASP Zed Attack Proxy](https://www.zaproxy.org/) for analysis.
-INFO:
-Want to try out security scanning?
-[Try GitLab Ultimate free for 30 days](https://about.gitlab.com/free-trial/index.html?glm_source=docs.gitlab.com&glm_content=u-dast-docs).
-
After DAST creates its report, GitLab evaluates it for discovered
vulnerabilities between the source and target branches. Relevant
findings are noted in the merge request.
diff --git a/doc/user/application_security/dependency_scanning/index.md b/doc/user/application_security/dependency_scanning/index.md
index 192d8449297..0825dae34fc 100644
--- a/doc/user/application_security/dependency_scanning/index.md
+++ b/doc/user/application_security/dependency_scanning/index.md
@@ -7,10 +7,6 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Dependency Scanning **(ULTIMATE)**
-INFO:
-Try out Dependency Scanning in GitLab Ultimate.
-[It's free for 30 days](https://about.gitlab.com/free-trial/index.html?glm_source=docs.gitlab.com&glm_content=u-dependency-scanning-docs).
-
The Dependency Scanning feature can automatically find security vulnerabilities in your
software dependencies while you're developing and testing your applications. For example,
dependency scanning lets you know if your application uses an external (open source)
diff --git a/doc/user/application_security/index.md b/doc/user/application_security/index.md
index 2896e61b43d..c574aee9631 100644
--- a/doc/user/application_security/index.md
+++ b/doc/user/application_security/index.md
@@ -16,10 +16,6 @@ GitLab can check your application for security vulnerabilities including:
Statistics and details on vulnerabilities are included in the merge request. Providing
actionable information _before_ changes are merged enables you to be proactive.
-INFO:
-Want to try out security scanning?
-[Try GitLab Ultimate free for 30 days](https://about.gitlab.com/free-trial/index.html?glm_source=docs.gitlab.com&glm_content=u-application-security-docs).
-
GitLab also provides high-level statistics of vulnerabilities across projects and groups:
- The [Security Dashboard](security_dashboard/index.md) provides a
diff --git a/doc/user/application_security/security_dashboard/index.md b/doc/user/application_security/security_dashboard/index.md
index e3818402719..6d214c90dd2 100644
--- a/doc/user/application_security/security_dashboard/index.md
+++ b/doc/user/application_security/security_dashboard/index.md
@@ -7,10 +7,6 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# GitLab Security Dashboards and Security Center **(ULTIMATE)**
-INFO:
-Want to try out security scanning?
-[Try GitLab Ultimate free for 30 days](https://about.gitlab.com/free-trial/index.html?glm_source=docs.gitlab.com&glm_content=u-security-dashboard-docs).
-
You can use Security Dashboards to view details about vulnerabilities
detected by [security scanners](../index.md#security-scanning-tools).
These details are shown in pipelines, projects, and groups.
diff --git a/doc/user/application_security/vulnerabilities/index.md b/doc/user/application_security/vulnerabilities/index.md
index 7fd3c076fe9..9aa8a0cd3cd 100644
--- a/doc/user/application_security/vulnerabilities/index.md
+++ b/doc/user/application_security/vulnerabilities/index.md
@@ -168,7 +168,7 @@ The following vulnerability scanners and their databases are regularly updated:
| Secure scanning tool | Vulnerabilities database updates |
|:----------------------------------------------------------------|----------------------------------|
| [Container Scanning](../container_scanning/index.md) | A job runs on a daily basis to build new images with the latest vulnerability database updates from the upstream scanner. |
-| [Dependency Scanning](../dependency_scanning/index.md) | Relies on `bundler-audit` (for Ruby gems), `retire.js` (for npm packages), and `gemnasium` (the GitLab tool for all libraries). Both `bundler-audit` and `retire.js` fetch their vulnerabilities data from GitHub repositories, so vulnerabilities added to `ruby-advisory-db` and `retire.js` are immediately available. The tools themselves are updated once per month if there's a new version. The [Gemnasium DB](https://gitlab.com/gitlab-org/security-products/gemnasium-db) is updated at least once a week. See our [current measurement of time from CVE being issued to our product being updated](https://about.gitlab.com/handbook/engineering/development/performance-indicators/#cve-issue-to-update). |
+| [Dependency Scanning](../dependency_scanning/index.md) | Relies on `bundler-audit` (for Ruby gems), `retire.js` (for npm packages), and `gemnasium` (the GitLab tool for all libraries). Both `bundler-audit` and `retire.js` fetch their vulnerabilities data from GitHub repositories, so vulnerabilities added to `ruby-advisory-db` and `retire.js` are immediately available. The tools themselves are updated once per month if there's a new version. The [Gemnasium DB](https://gitlab.com/gitlab-org/security-products/gemnasium-db) is updated on a daily basis using [data from NVD, the `ruby-advisory-db` and the GitHub Security Advisory Database as data sources](https://gitlab.com/gitlab-org/security-products/gemnasium-db/-/blob/master/SOURCES.md). See our [current measurement of time from CVE being issued to our product being updated](https://about.gitlab.com/handbook/engineering/development/performance-indicators/#cve-issue-to-update). |
| [Dynamic Application Security Testing (DAST)](../dast/index.md) | The scanning engine is updated on a periodic basis. See the [version of the underlying tool `zaproxy`](https://gitlab.com/gitlab-org/security-products/dast/blob/main/Dockerfile#L1). The scanning rules are downloaded at scan runtime. |
| [Static Application Security Testing (SAST)](../sast/index.md) | Relies exclusively on [the tools GitLab wraps](../sast/index.md#supported-languages-and-frameworks). The underlying analyzers are updated at least once per month if a relevant update is available. The vulnerabilities database is updated by the upstream tools. |
diff --git a/doc/user/clusters/agent/index.md b/doc/user/clusters/agent/index.md
index 184aca1000d..8a0008bb88b 100644
--- a/doc/user/clusters/agent/index.md
+++ b/doc/user/clusters/agent/index.md
@@ -18,10 +18,6 @@ is an active in-cluster component for connecting Kubernetes clusters to GitLab s
The Agent is installed into the cluster through code, providing you with a fast, safe, stable, and scalable solution.
-INFO:
-Get Network Security Alerts in GitLab by upgrading to Ultimate.
-[Try a free 30-day trial now](https://about.gitlab.com/free-trial/index.html?glm_source=docs.gitlab.com&glm_content=p-cluster-agent-docs).
-
With GitOps, you can manage containerized clusters and applications from a Git repository that:
- Is the single source of truth of your system.
diff --git a/doc/user/compliance/license_compliance/index.md b/doc/user/compliance/license_compliance/index.md
index bdf1b0d74b4..89b7e76f1a0 100644
--- a/doc/user/compliance/license_compliance/index.md
+++ b/doc/user/compliance/license_compliance/index.md
@@ -14,10 +14,6 @@ project's dependencies for their licenses. You can then decide whether to allow
each license. For example, if your application uses an external (open source) library whose license
is incompatible with yours, then you can deny the use of that license.
-INFO:
-Try License Compliance scanning to search project dependencies in GitLab Ultimate.
-[It's free for 30 days](https://about.gitlab.com/free-trial/index.html?glm_source=docs.gitlab.com&glm_content=u-compliance-docs).
-
You can take advantage of License Compliance by either:
- [Including the job](#configuration)
diff --git a/doc/user/group/epics/epic_boards.md b/doc/user/group/epics/epic_boards.md
index 1bc1e4d703b..d184030718a 100644
--- a/doc/user/group/epics/epic_boards.md
+++ b/doc/user/group/epics/epic_boards.md
@@ -9,10 +9,6 @@ info: To determine the technical writer assigned to the Stage/Group associated w
> - [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/5067) in GitLab 13.10.
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/290039) in GitLab 14.1.
-INFO:
-Try epic boards and more with a
-[free 30-day trial of GitLab Ultimate](https://about.gitlab.com/free-trial/index.html?glm_source=docs.gitlab.com&glm_content=p-epics-boards-docs).
-
Epic boards build on the existing [epic tracking functionality](index.md) and
[labels](../../project/labels.md). Your epics appear as cards in vertical lists, organized by their assigned
labels.
diff --git a/doc/user/group/epics/index.md b/doc/user/group/epics/index.md
index 3889398e2f8..d6f87a026b8 100644
--- a/doc/user/group/epics/index.md
+++ b/doc/user/group/epics/index.md
@@ -8,10 +8,6 @@ info: To determine the technical writer assigned to the Stage/Group associated w
> Single-level epics were [moved](https://gitlab.com/gitlab-org/gitlab/-/issues/37081) from GitLab Ultimate to GitLab Premium in 12.8.
-INFO:
-Check out [multi-level child epics](manage_epics.md#multi-level-child-epics) with a
-[free 30-day trial of GitLab Ultimate](https://about.gitlab.com/free-trial/index.html?glm_source=docs.gitlab.com&glm_content=p-epics-docs).
-
When [issues](../../project/issues/index.md) share a theme across projects and milestones,
you can manage them by using epics.
diff --git a/doc/user/group/saml_sso/index.md b/doc/user/group/saml_sso/index.md
index 7029e601f71..20ff4a201f5 100644
--- a/doc/user/group/saml_sso/index.md
+++ b/doc/user/group/saml_sso/index.md
@@ -14,10 +14,6 @@ This page describes SAML for groups. For instance-wide SAML on self-managed GitL
SAML on GitLab.com allows users to sign in through their SAML identity provider. If the user is not already a member, the sign-in process automatically adds the user to the appropriate group.
-INFO:
-Use your own SAML authentication to log in to [GitLab.com](http://gitlab.com/).
-[Try GitLab Ultimate free for 30 days](https://about.gitlab.com/free-trial/index.html?glm_source=docs.gitlab.com&glm_content=p-saml-sso-docs).
-
User synchronization of SAML SSO groups is supported through [SCIM](scim_setup.md). SCIM supports adding and removing users from the GitLab group automatically.
For example, if you remove a user from the SCIM app, SCIM removes that same user from the GitLab group.
diff --git a/doc/user/project/code_owners.md b/doc/user/project/code_owners.md
index 4845316a62c..1f73cf938e7 100644
--- a/doc/user/project/code_owners.md
+++ b/doc/user/project/code_owners.md
@@ -8,10 +8,6 @@ info: To determine the technical writer assigned to the Stage/Group associated w
> Moved to GitLab Premium in 13.9.
-INFO:
-Get access to Code Owners and more with a
-[free 30-day trial of GitLab Ultimate](https://about.gitlab.com/free-trial/index.html?glm_source=docs.gitlab.com&glm_content=p-code-owners-docs).
-
Code Owners define who owns specific files or directories in a repository.
- The users you define as Code Owners are displayed in the UI when you browse directories.
diff --git a/doc/user/project/merge_requests/fast_forward_merge.md b/doc/user/project/merge_requests/fast_forward_merge.md
index a801fa17f43..cd65fe20e66 100644
--- a/doc/user/project/merge_requests/fast_forward_merge.md
+++ b/doc/user/project/merge_requests/fast_forward_merge.md
@@ -38,9 +38,12 @@ Now, when you visit the merge request page, you can accept it
If a fast-forward merge is not possible but a conflict free rebase is possible,
a rebase button is offered.
+You can also rebase without running a CI/CD pipeline.
+[Introduced in](https://gitlab.com/gitlab-org/gitlab/-/issues/118825) GitLab 14.7.
+
The rebase action is also available as a [quick action command: `/rebase`](../../../topics/git/git_rebase.md#rebase-from-the-gitlab-ui).
-![Fast forward merge request](img/ff_merge_rebase.png)
+![Fast forward merge request](img/ff_merge_rebase_v14_7.png)
If the target branch is ahead of the source branch and a conflict free rebase is
not possible, you need to rebase the
diff --git a/doc/user/project/merge_requests/img/ff_merge_rebase.png b/doc/user/project/merge_requests/img/ff_merge_rebase.png
deleted file mode 100644
index f6139f189ce..00000000000
--- a/doc/user/project/merge_requests/img/ff_merge_rebase.png
+++ /dev/null
Binary files differ
diff --git a/doc/user/project/merge_requests/img/ff_merge_rebase_v14_7.png b/doc/user/project/merge_requests/img/ff_merge_rebase_v14_7.png
new file mode 100644
index 00000000000..3c845d277e4
--- /dev/null
+++ b/doc/user/project/merge_requests/img/ff_merge_rebase_v14_7.png
Binary files differ
diff --git a/doc/user/project/requirements/index.md b/doc/user/project/requirements/index.md
index 294e493dfe9..5fe0e0ef3a2 100644
--- a/doc/user/project/requirements/index.md
+++ b/doc/user/project/requirements/index.md
@@ -17,10 +17,6 @@ In 14.4, Requirements was moved under **Issues**.
With requirements, you can set criteria to check your products against. They can be based on users,
stakeholders, system, software, or anything else you find important to capture.
-INFO:
-Meet your compliance needs with requirements in GitLab.
-[Try Ultimate free for 30 days](https://about.gitlab.com/free-trial/index.html?glm_source=docs.gitlab.com&glm_content=u-project-requirements-docs).
-
A requirement is an artifact in GitLab which describes the specific behavior of your product.
Requirements are long-lived and don't disappear unless manually cleared.
diff --git a/doc/user/search/advanced_search.md b/doc/user/search/advanced_search.md
index b9c45bce43a..13fba126169 100644
--- a/doc/user/search/advanced_search.md
+++ b/doc/user/search/advanced_search.md
@@ -14,10 +14,6 @@ This is the user documentation. To configure the Advanced Search,
visit the [administrator documentation](../../integration/elasticsearch.md).
Advanced Search is enabled in GitLab.com.
-INFO:
-Get advanced search and more with a
-[free 30-day trial of GitLab Ultimate](https://about.gitlab.com/free-trial/index.html?glm_source=docs.gitlab.com&glm_content=p-advanced-search-docs).
-
GitLab Advanced Search expands on the Basic Search with an additional set of
features for faster, more advanced searches across the entire GitLab instance
when searching in:
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index d6fca542f42..7bbbb6f7966 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -18471,6 +18471,9 @@ msgstr ""
msgid "InProductMarketing|Start a GitLab Ultimate trial today in less than one minute, no credit card required."
msgstr ""
+msgid "InProductMarketing|Start a Self-Managed trial"
+msgstr ""
+
msgid "InProductMarketing|Start a free trial of GitLab Ultimate – no credit card required"
msgstr ""
@@ -18573,6 +18576,9 @@ msgstr ""
msgid "InProductMarketing|Very easy"
msgstr ""
+msgid "InProductMarketing|Want to host GitLab on your servers?"
+msgstr ""
+
msgid "InProductMarketing|We know a thing or two about efficiency and we don't want to keep that to ourselves. Sign up for a free trial of GitLab Ultimate and your teams will be on it from day one."
msgstr ""
@@ -25840,6 +25846,9 @@ msgstr ""
msgid "PerformanceBar|wall"
msgstr ""
+msgid "Performs a rebase but skips triggering a new pipeline"
+msgstr ""
+
msgid "Period in seconds"
msgstr ""
@@ -29221,6 +29230,12 @@ msgstr ""
msgid "Rebase source branch on the target branch."
msgstr ""
+msgid "Rebase without CI"
+msgstr ""
+
+msgid "Rebases and triggers a pipeline"
+msgstr ""
+
msgid "Recaptcha verified?"
msgstr ""
diff --git a/spec/factories/clusters/applications/helm.rb b/spec/factories/clusters/applications/helm.rb
index 29197768ec0..10fa739acc1 100644
--- a/spec/factories/clusters/applications/helm.rb
+++ b/spec/factories/clusters/applications/helm.rb
@@ -118,7 +118,6 @@ FactoryBot.define do
end
factory :clusters_applications_runner, class: 'Clusters::Applications::Runner' do
- runner factory: %i(ci_runner)
cluster factory: %i(cluster with_installed_helm provided_by_gcp)
end
diff --git a/spec/frontend/vue_mr_widget/components/mr_widget_rebase_spec.js b/spec/frontend/vue_mr_widget/components/mr_widget_rebase_spec.js
index 01e0cdd134a..950c5be6af8 100644
--- a/spec/frontend/vue_mr_widget/components/mr_widget_rebase_spec.js
+++ b/spec/frontend/vue_mr_widget/components/mr_widget_rebase_spec.js
@@ -2,10 +2,15 @@ import { shallowMount } from '@vue/test-utils';
import { nextTick } from 'vue';
import WidgetRebase from '~/vue_merge_request_widget/components/states/mr_widget_rebase.vue';
import eventHub from '~/vue_merge_request_widget/event_hub';
+import ActionsButton from '~/vue_shared/components/actions_button.vue';
+import {
+ REBASE_BUTTON_KEY,
+ REBASE_WITHOUT_CI_BUTTON_KEY,
+} from '~/vue_merge_request_widget/constants';
let wrapper;
-function factory(propsData, mergeRequestWidgetGraphql) {
+function createWrapper(propsData, mergeRequestWidgetGraphql) {
wrapper = shallowMount(WidgetRebase, {
propsData,
data() {
@@ -31,8 +36,9 @@ function factory(propsData, mergeRequestWidgetGraphql) {
}
describe('Merge request widget rebase component', () => {
- const findRebaseMessageEl = () => wrapper.find('[data-testid="rebase-message"]');
- const findRebaseMessageElText = () => findRebaseMessageEl().text();
+ const findRebaseMessage = () => wrapper.find('[data-testid="rebase-message"]');
+ const findRebaseMessageText = () => findRebaseMessage().text();
+ const findRebaseButton = () => wrapper.find(ActionsButton);
afterEach(() => {
wrapper.destroy();
@@ -40,10 +46,10 @@ describe('Merge request widget rebase component', () => {
});
[true, false].forEach((mergeRequestWidgetGraphql) => {
- describe(`widget graphql is ${mergeRequestWidgetGraphql ? 'enabled' : 'dislabed'}`, () => {
- describe('While rebasing', () => {
+ describe(`widget graphql is ${mergeRequestWidgetGraphql ? 'enabled' : 'disabled'}`, () => {
+ describe('while rebasing', () => {
it('should show progress message', () => {
- factory(
+ createWrapper(
{
mr: { rebaseInProgress: true },
service: {},
@@ -51,24 +57,32 @@ describe('Merge request widget rebase component', () => {
mergeRequestWidgetGraphql,
);
- expect(findRebaseMessageElText()).toContain('Rebase in progress');
+ expect(findRebaseMessageText()).toContain('Rebase in progress');
});
});
- describe('With permissions', () => {
- it('it should render rebase button and warning message', () => {
- factory(
+ describe('with permissions', () => {
+ const rebaseMock = jest.fn().mockResolvedValue();
+ const pollMock = jest.fn().mockResolvedValue({});
+
+ beforeEach(() => {
+ createWrapper(
{
mr: {
rebaseInProgress: false,
canPushToSourceBranch: true,
},
- service: {},
+ service: {
+ rebase: rebaseMock,
+ poll: pollMock,
+ },
},
mergeRequestWidgetGraphql,
);
+ });
- const text = findRebaseMessageElText();
+ it('renders the warning message', () => {
+ const text = findRebaseMessageText();
expect(text).toContain('Merge blocked');
expect(text.replace(/\s\s+/g, ' ')).toContain(
@@ -76,42 +90,79 @@ describe('Merge request widget rebase component', () => {
);
});
- it('it should render error message when it fails', async () => {
- factory(
- {
- mr: {
- rebaseInProgress: false,
- canPushToSourceBranch: true,
- },
- service: {},
- },
- mergeRequestWidgetGraphql,
- );
-
+ it('renders an error message when rebasing has failed', async () => {
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper.setData({ rebasingError: 'Something went wrong!' });
await nextTick();
- expect(findRebaseMessageElText()).toContain('Something went wrong!');
+ expect(findRebaseMessageText()).toContain('Something went wrong!');
+ });
+
+ describe('"Rebase" button', () => {
+ it('is rendered', () => {
+ expect(findRebaseButton().exists()).toBe(true);
+ });
+
+ it('has rebase and rebase without CI actions', () => {
+ const actionNames = findRebaseButton()
+ .props('actions')
+ .map((action) => action.key);
+
+ expect(actionNames).toStrictEqual([REBASE_BUTTON_KEY, REBASE_WITHOUT_CI_BUTTON_KEY]);
+ });
+
+ it('defaults to rebase action', () => {
+ expect(findRebaseButton().props('selectedKey')).toStrictEqual(REBASE_BUTTON_KEY);
+ });
+
+ it('starts the rebase when clicking', async () => {
+ // ActionButtons use the actions props instead of emitting
+ // a click event, therefore simulating the behavior here:
+ findRebaseButton()
+ .props('actions')
+ .find((x) => x.key === REBASE_BUTTON_KEY)
+ .handle();
+
+ await nextTick();
+
+ expect(rebaseMock).toHaveBeenCalledWith({ skipCi: false });
+ });
+
+ it('starts the CI-skipping rebase when clicking on "Rebase without CI"', async () => {
+ // ActionButtons use the actions props instead of emitting
+ // a click event, therefore simulating the behavior here:
+ findRebaseButton()
+ .props('actions')
+ .find((x) => x.key === REBASE_WITHOUT_CI_BUTTON_KEY)
+ .handle();
+
+ await nextTick();
+
+ expect(rebaseMock).toHaveBeenCalledWith({ skipCi: true });
+ });
});
});
- describe('Without permissions', () => {
- it('should render a message explaining user does not have permissions', () => {
- factory(
+ describe('without permissions', () => {
+ const exampleTargetBranch = 'fake-branch-to-test-with';
+
+ beforeEach(() => {
+ createWrapper(
{
mr: {
rebaseInProgress: false,
canPushToSourceBranch: false,
- targetBranch: 'foo',
+ targetBranch: exampleTargetBranch,
},
service: {},
},
mergeRequestWidgetGraphql,
);
+ });
- const text = findRebaseMessageElText();
+ it('renders a message explaining user does not have permissions', () => {
+ const text = findRebaseMessageText();
expect(text).toContain(
'Merge blocked: the source branch must be rebased onto the target branch.',
@@ -119,32 +170,23 @@ describe('Merge request widget rebase component', () => {
expect(text).toContain('the source branch must be rebased');
});
- it('should render the correct target branch name', () => {
- const targetBranch = 'fake-branch-to-test-with';
- factory(
- {
- mr: {
- rebaseInProgress: false,
- canPushToSourceBranch: false,
- targetBranch,
- },
- service: {},
- },
- mergeRequestWidgetGraphql,
- );
-
- const elem = findRebaseMessageEl();
+ it('renders the correct target branch name', () => {
+ const elem = findRebaseMessage();
expect(elem.text()).toContain(
`Merge blocked: the source branch must be rebased onto the target branch.`,
);
});
+
+ it('does not render the "Rebase" button', () => {
+ expect(findRebaseButton().exists()).toBe(false);
+ });
});
describe('methods', () => {
it('checkRebaseStatus', async () => {
jest.spyOn(eventHub, '$emit').mockImplementation(() => {});
- factory(
+ createWrapper(
{
mr: {},
service: {
diff --git a/spec/lib/gitlab/ci/pipeline/chain/create_spec.rb b/spec/lib/gitlab/ci/pipeline/chain/create_spec.rb
index 4206483b228..7936a43d50e 100644
--- a/spec/lib/gitlab/ci/pipeline/chain/create_spec.rb
+++ b/spec/lib/gitlab/ci/pipeline/chain/create_spec.rb
@@ -7,7 +7,7 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Create do
let_it_be(:user) { create(:user) }
let(:pipeline) do
- build(:ci_empty_pipeline, project: project, ref: 'master')
+ build(:ci_empty_pipeline, project: project, ref: 'master', user: user)
end
let(:command) do
@@ -59,7 +59,7 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Create do
context 'tags persistence' do
let(:stage) do
- build(:ci_stage_entity, pipeline: pipeline)
+ build(:ci_stage_entity, pipeline: pipeline, project: project)
end
let(:job) do
diff --git a/spec/models/ci/build_trace_chunk_spec.rb b/spec/models/ci/build_trace_chunk_spec.rb
index b6e128c317c..5c76d43d753 100644
--- a/spec/models/ci/build_trace_chunk_spec.rb
+++ b/spec/models/ci/build_trace_chunk_spec.rb
@@ -49,9 +49,9 @@ RSpec.describe Ci::BuildTraceChunk, :clean_gitlab_redis_shared_state, :clean_git
end
context 'FastDestroyAll' do
- let(:parent) { create(:project) }
- let(:pipeline) { create(:ci_pipeline, project: parent) }
- let!(:build) { create(:ci_build, :running, :trace_live, pipeline: pipeline, project: parent) }
+ let(:project) { create(:project) }
+ let(:pipeline) { create(:ci_pipeline, project: project) }
+ let!(:build) { create(:ci_build, :running, :trace_live, pipeline: pipeline, project: project) }
let(:subjects) { build.trace_chunks }
describe 'Forbid #destroy and #destroy_all' do
@@ -84,7 +84,13 @@ RSpec.describe Ci::BuildTraceChunk, :clean_gitlab_redis_shared_state, :clean_git
expect(external_data_counter).to be > 0
expect(subjects.count).to be > 0
- expect { parent.destroy! }.not_to raise_error
+ ::Gitlab::Database::QueryAnalyzers::PreventCrossDatabaseModification.allow_cross_database_modification_within_transaction(url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/350185') do
+ # This should use to prevent cross-DB modification
+ # but due to https://gitlab.com/gitlab-org/gitlab/-/issues/350185
+ # the build trace chunks are not destroyed by Projects::DestroyService
+ # Change to: expect { Projects::DestroyService.new(project, project.owner).execute }.to eq(true)
+ expect { project.destroy! }.not_to raise_error
+ end
expect(subjects.count).to eq(0)
expect(external_data_counter).to eq(0)
@@ -830,7 +836,7 @@ RSpec.describe Ci::BuildTraceChunk, :clean_gitlab_redis_shared_state, :clean_git
expect(described_class.count).to eq(3)
- subject
+ expect(subject).to be_truthy
expect(described_class.count).to eq(0)
@@ -852,7 +858,13 @@ RSpec.describe Ci::BuildTraceChunk, :clean_gitlab_redis_shared_state, :clean_git
context 'when project is destroyed' do
let(:subject) do
- project.destroy!
+ ::Gitlab::Database::QueryAnalyzers::PreventCrossDatabaseModification.allow_cross_database_modification_within_transaction(url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/350185') do
+ # This should use to prevent cross-DB modification
+ # but due to https://gitlab.com/gitlab-org/gitlab/-/issues/350185
+ # the build trace chunks are not destroyed by Projects::DestroyService
+ # Change to: Projects::DestroyService.new(project, project.owner).execute
+ project.destroy!
+ end
end
it_behaves_like 'deletes all build_trace_chunk and data in redis'
diff --git a/spec/models/namespaces/project_namespace_spec.rb b/spec/models/namespaces/project_namespace_spec.rb
index 4416c49f1bf..47cf866c143 100644
--- a/spec/models/namespaces/project_namespace_spec.rb
+++ b/spec/models/namespaces/project_namespace_spec.rb
@@ -17,11 +17,11 @@ RSpec.describe Namespaces::ProjectNamespace, type: :model do
let_it_be(:project) { create(:project) }
let_it_be(:project_namespace) { project.project_namespace }
- it 'also deletes the associated project' do
+ it 'keeps the associated project' do
project_namespace.delete
expect { project_namespace.reload }.to raise_error(ActiveRecord::RecordNotFound)
- expect { project.reload }.to raise_error(ActiveRecord::RecordNotFound)
+ expect(project.reload.project_namespace).to be_nil
end
end
end
diff --git a/spec/requests/api/commits_spec.rb b/spec/requests/api/commits_spec.rb
index 1e587480fd9..2bc642f8b14 100644
--- a/spec/requests/api/commits_spec.rb
+++ b/spec/requests/api/commits_spec.rb
@@ -1056,9 +1056,7 @@ RSpec.describe API::Commits do
shared_examples_for 'ref with pipeline' do
let!(:pipeline) do
- project
- .ci_pipelines
- .create!(source: :push, ref: 'master', sha: commit.sha, protected: false)
+ create(:ci_empty_pipeline, project: project, status: :created, source: :push, ref: 'master', sha: commit.sha, protected: false)
end
it 'includes status as "created" and a last_pipeline object' do
@@ -1090,9 +1088,7 @@ RSpec.describe API::Commits do
shared_examples_for 'ref with unaccessible pipeline' do
let!(:pipeline) do
- project
- .ci_pipelines
- .create!(source: :push, ref: 'master', sha: commit.sha, protected: false)
+ create(:ci_empty_pipeline, project: project, status: :created, source: :push, ref: 'master', sha: commit.sha, protected: false)
end
it 'does not include last_pipeline' do
diff --git a/spec/services/ci/retry_build_service_spec.rb b/spec/services/ci/retry_build_service_spec.rb
index e0329995d57..4e8e41ca6e6 100644
--- a/spec/services/ci/retry_build_service_spec.rb
+++ b/spec/services/ci/retry_build_service_spec.rb
@@ -371,6 +371,14 @@ RSpec.describe Ci::RetryBuildService do
it_behaves_like 'when build with dynamic environment is retried'
context 'when create_deployment_in_separate_transaction feature flag is disabled' do
+ let(:new_build) do
+ travel_to(1.second.from_now) do
+ ::Gitlab::Database::QueryAnalyzers::PreventCrossDatabaseModification.allow_cross_database_modification_within_transaction(url: 'https://gitlab.com/gitlab-org/gitlab/-/issues/345668') do
+ service.clone!(build)
+ end
+ end
+ end
+
before do
stub_feature_flags(create_deployment_in_separate_transaction: false)
end
diff --git a/spec/support/database/cross-database-modification-allowlist.yml b/spec/support/database/cross-database-modification-allowlist.yml
index 91a4bff22c5..fe51488c706 100644
--- a/spec/support/database/cross-database-modification-allowlist.yml
+++ b/spec/support/database/cross-database-modification-allowlist.yml
@@ -1,10 +1 @@
-- "./ee/spec/replicators/geo/terraform_state_version_replicator_spec.rb"
-- "./spec/features/issues/issue_detail_spec.rb"
-- "./spec/features/projects/pipelines/pipeline_spec.rb"
-- "./spec/features/signed_commits_spec.rb"
-- "./spec/lib/gitlab/ci/pipeline/chain/create_spec.rb"
-- "./spec/models/ci/build_trace_chunk_spec.rb"
-- "./spec/models/ci/job_artifact_spec.rb"
-- "./spec/models/clusters/applications/runner_spec.rb"
-- "./spec/requests/api/commits_spec.rb"
-- "./spec/services/ci/retry_build_service_spec.rb"
+[]
diff --git a/spec/support/shared_examples/models/update_project_statistics_shared_examples.rb b/spec/support/shared_examples/models/update_project_statistics_shared_examples.rb
index 2e01de2ea84..06326ffac97 100644
--- a/spec/support/shared_examples/models/update_project_statistics_shared_examples.rb
+++ b/spec/support/shared_examples/models/update_project_statistics_shared_examples.rb
@@ -115,16 +115,14 @@ RSpec.shared_examples 'UpdateProjectStatistics' do |with_counter_attribute|
expect(ProjectStatistics)
.not_to receive(:increment_statistic)
- project.update!(pending_delete: true)
- project.destroy!
+ expect(Projects::DestroyService.new(project, project.owner).execute).to eq(true)
end
it 'does not schedule a namespace statistics worker' do
expect(Namespaces::ScheduleAggregationWorker)
.not_to receive(:perform_async)
- project.update!(pending_delete: true)
- project.destroy!
+ expect(Projects::DestroyService.new(project, project.owner).execute).to eq(true)
end
end
end