diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-31 09:11:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-10-31 09:11:42 +0300 |
commit | 01cc900e7cc64797e39a7889032325d8c32bfe46 (patch) | |
tree | 59c70ceeb8375f65fb44f951f4594a5fe15fb7e0 | |
parent | b6cb3bc944b0ca803e758d9e9da3790c0f310d21 (diff) |
Add latest changes from gitlab-org/gitlab@master
38 files changed, 158 insertions, 243 deletions
@@ -30,7 +30,7 @@ gem 'activerecord-gitlab', path: 'gems/activerecord-gitlab' # rubocop:todo Gemfi gem 'vite_rails' # rubocop:todo Gemfile/MissingFeatureCategory -gem 'bootsnap', '~> 1.16.0', require: false # rubocop:todo Gemfile/MissingFeatureCategory +gem 'bootsnap', '~> 1.17.0', require: false # rubocop:todo Gemfile/MissingFeatureCategory gem 'openssl', '~> 3.0' # rubocop:todo Gemfile/MissingFeatureCategory gem 'ipaddr', '~> 1.2.5' # rubocop:todo Gemfile/MissingFeatureCategory diff --git a/Gemfile.checksum b/Gemfile.checksum index 1e879605ba8..40e024c1382 100644 --- a/Gemfile.checksum +++ b/Gemfile.checksum @@ -60,7 +60,7 @@ {"name":"better_errors","version":"2.10.1","platform":"ruby","checksum":"f798f1bac93f3e775925b7fcb24cffbcf0bb62ee2210f5350f161a6b75fc0a73"}, {"name":"bindata","version":"2.4.11","platform":"ruby","checksum":"c38e0c99ffcd80c10a0a7ae6c8586d2fe26bf245cbefac90bec8764523220f6a"}, {"name":"binding_of_caller","version":"1.0.0","platform":"ruby","checksum":"3aad25d1d538fc6e7972978f9bf512ccd992784009947c81633bea776713161d"}, -{"name":"bootsnap","version":"1.16.0","platform":"ruby","checksum":"f87410c00f69cd84a6e72a6c4bdba733f800d80d934f4315849d18ca9f288fed"}, +{"name":"bootsnap","version":"1.17.0","platform":"ruby","checksum":"6b0ea4dd68f0d424968dcd13953c3f04b13a19a8761c540d3af13507fcfa1347"}, {"name":"browser","version":"5.3.1","platform":"ruby","checksum":"62745301701ff2c6c5d32d077bb12532b20be261929dcb52c6781ed0d5658b3c"}, {"name":"builder","version":"3.2.4","platform":"ruby","checksum":"99caf08af60c8d7f3a6b004029c4c3c0bdaebced6c949165fe98f1db27fbbc10"}, {"name":"bullet","version":"7.1.1","platform":"ruby","checksum":"ad7789d9ad2bfe772f96620ba8f927e756c74525f2c03e7843d3518ce50e5b9c"}, diff --git a/Gemfile.lock b/Gemfile.lock index 90e40727be7..0ec05189101 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -322,7 +322,7 @@ GEM bindata (2.4.11) binding_of_caller (1.0.0) debug_inspector (>= 0.0.1) - bootsnap (1.16.0) + bootsnap (1.17.0) msgpack (~> 1.2) browser (5.3.1) builder (3.2.4) @@ -1759,7 +1759,7 @@ DEPENDENCIES benchmark-ips (~> 2.11.0) benchmark-memory (~> 0.1) better_errors (~> 2.10.1) - bootsnap (~> 1.16.0) + bootsnap (~> 1.17.0) browser (~> 5.3.1) bullet (~> 7.1.1) bundler-audit (~> 0.9.1) diff --git a/app/assets/javascripts/branches/components/branch_more_actions.vue b/app/assets/javascripts/branches/components/branch_more_actions.vue index c646dab2760..ee47f6af2f8 100644 --- a/app/assets/javascripts/branches/components/branch_more_actions.vue +++ b/app/assets/javascripts/branches/components/branch_more_actions.vue @@ -74,7 +74,6 @@ export default { class: 'js-delete-branch-button gl-text-red-500!', 'aria-label': this.deleteBranchText, 'data-testid': 'delete-branch-button', - 'data-qa-selector': 'delete_branch_button', }, }); } diff --git a/app/assets/javascripts/branches/components/delete_branch_modal.vue b/app/assets/javascripts/branches/components/delete_branch_modal.vue index d5631337cec..0200a30cbdf 100644 --- a/app/assets/javascripts/branches/components/delete_branch_modal.vue +++ b/app/assets/javascripts/branches/components/delete_branch_modal.vue @@ -182,7 +182,6 @@ export default { ref="deleteBranchButton" :disabled="deleteButtonDisabled" variant="danger" - data-qa-selector="delete_branch_confirmation_button" data-testid="delete-branch-confirmation-button" @click="submitForm" >{{ buttonText }}</gl-button diff --git a/app/assets/javascripts/import_entities/import_projects/components/advanced_settings.vue b/app/assets/javascripts/import_entities/import_projects/components/advanced_settings.vue index cf1a4de68ed..d22a52df326 100644 --- a/app/assets/javascripts/import_entities/import_projects/components/advanced_settings.vue +++ b/app/assets/javascripts/import_entities/import_projects/components/advanced_settings.vue @@ -41,7 +41,7 @@ export default { :key="name" :checked="value[name]" :data-qa-option-name="name" - data-qa-selector="advanced_settings_checkbox" + data-testid="advanced-settings-checkbox" @change="$emit('input', { ...value, [name]: $event })" > {{ label }} diff --git a/app/assets/javascripts/import_entities/import_projects/components/provider_repo_table_row.vue b/app/assets/javascripts/import_entities/import_projects/components/provider_repo_table_row.vue index d75ba53d727..9b5aff45375 100644 --- a/app/assets/javascripts/import_entities/import_projects/components/provider_repo_table_row.vue +++ b/app/assets/javascripts/import_entities/import_projects/components/provider_repo_table_row.vue @@ -159,7 +159,7 @@ export default { <template> <tr class="gl-h-11" - data-qa-selector="project_import_row" + data-testid="project-import-row" :data-qa-source-project="repo.importSource.fullName" > <td> @@ -174,7 +174,7 @@ export default { :href="repo.importedProject.fullPath" class="gl-font-sm" target="_blank" - data-qa-selector="go_to_project_link" + data-testid="go-to-project-link" > {{ displayFullPath }} </gl-link> @@ -182,7 +182,7 @@ export default { </gl-sprintf> </div> </td> - <td data-testid="fullPath" data-qa-selector="project_path_content"> + <td data-testid="fullPath"> <div class="gl-display-flex gl-sm-flex-wrap"> <template v-if="repo.importSource.target">{{ repo.importSource.target }}</template> <template v-else-if="isImportNotStarted || isSelectedForReimport"> @@ -201,14 +201,14 @@ export default { ref="newNameInput" v-model="newNameInput" class="gl-rounded-top-left-none gl-rounded-bottom-left-none" - data-qa-selector="project_path_field" + data-testid="project-path-field" /> </div> </template> <template v-else-if="repo.importedProject">{{ displayFullPath }}</template> </div> </td> - <td data-qa-selector="import_status_indicator"> + <td data-testid="import-status-indicator"> <import-status :project-id="importedProjectId" :status="importStatus" :stats="stats" /> </td> <td data-testid="actions" class="gl-white-space-nowrap"> @@ -235,7 +235,7 @@ export default { <gl-button v-if="isImportNotStarted || isFinished" type="button" - data-qa-selector="import_button" + data-testid="import-button" @click="handleImportRepo()" > {{ importButtonText }} diff --git a/app/assets/javascripts/projects/commit/components/commit_options_dropdown.vue b/app/assets/javascripts/projects/commit/components/commit_options_dropdown.vue index 7c00ce45b3a..0009bd4c9a5 100644 --- a/app/assets/javascripts/projects/commit/components/commit_options_dropdown.vue +++ b/app/assets/javascripts/projects/commit/components/commit_options_dropdown.vue @@ -51,7 +51,6 @@ export default { text: s__('ChangeTypeAction|Cherry-pick'), extraAttrs: { 'data-testid': 'cherry-pick-link', - 'data-qa-selector': 'cherry_pick_button', }, action: () => this.showModal(OPEN_CHERRY_PICK_MODAL), }; @@ -62,7 +61,6 @@ export default { text: s__('ChangeTypeAction|Revert'), extraAttrs: { 'data-testid': 'revert-link', - 'data-qa-selector': 'revert_button', }, action: () => this.showModal(OPEN_REVERT_MODAL), }; @@ -85,7 +83,6 @@ export default { download: '', rel: 'nofollow', 'data-testid': 'plain-diff-link', - 'data-qa-selector': 'plain_diff', }, }; }, @@ -97,7 +94,6 @@ export default { download: '', rel: 'nofollow', 'data-testid': 'email-patches-link', - 'data-qa-selector': 'email_patches', }, }; }, @@ -148,7 +144,6 @@ export default { :toggle-text="__('Options')" right data-testid="commit-options-dropdown" - data-qa-selector="options_button" class="gl-xs-w-full gl-line-height-20" > <gl-disclosure-dropdown-group :group="optionsGroup" @action="closeDropdown" /> diff --git a/app/assets/javascripts/projects/commit/components/form_modal.vue b/app/assets/javascripts/projects/commit/components/form_modal.vue index 44b8ccb57ca..0b91fa11fa9 100644 --- a/app/assets/javascripts/projects/commit/components/form_modal.vue +++ b/app/assets/javascripts/projects/commit/components/form_modal.vue @@ -57,7 +57,6 @@ export default { variant: 'confirm', category: 'primary', 'data-testid': 'submit-commit', - 'data-qa-selector': 'submit_commit_button', }, }, actionCancel: { diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb index 795d35ec81f..5f1145c95f6 100644 --- a/app/helpers/events_helper.rb +++ b/app/helpers/events_helper.rb @@ -70,7 +70,7 @@ module EventsHelper if author name = self_added ? _('You') : author.name - link_to name, user_path(author.username), title: name + link_to name, user_path(author.username), title: name, data: { user_id: author.id, username: author.username }, class: 'js-user-link' else escape_once(event.author_name) end diff --git a/app/views/import/github/new.html.haml b/app/views/import/github/new.html.haml index 2630c2e42e8..24369ff3d39 100644 --- a/app/views/import/github/new.html.haml +++ b/app/views/import/github/new.html.haml @@ -28,7 +28,7 @@ .form-group %label.col-form-label{ for: 'personal_access_token' }= _('Personal Access Token') = hidden_field_tag(:namespace_id, params[:namespace_id]) - = password_field_tag :personal_access_token, '', class: 'form-control gl-form-input', placeholder: _('e.g. %{token}') % { token: '8d3f016698e...' }, data: { testid: 'personal_access_token_field' } + = password_field_tag :personal_access_token, '', class: 'form-control gl-form-input', placeholder: _('e.g. %{token}') % { token: '8d3f016698e...' }, data: { testid: 'personal-access-token-field' } %span.form-text.gl-text-gray-600 = import_github_personal_access_token_message @@ -37,5 +37,5 @@ .form-actions.gl-display-flex.gl-justify-content-end = render Pajamas::ButtonComponent.new(href: new_project_path) do = _('Cancel') - = render Pajamas::ButtonComponent.new(variant: :confirm, type: :submit, button_options: { class: 'gl-ml-3', data: { testid: 'authenticate_button' } }) do + = render Pajamas::ButtonComponent.new(variant: :confirm, type: :submit, button_options: { class: 'gl-ml-3', data: { testid: 'authenticate-button' } }) do = _('Authenticate') diff --git a/app/views/projects/branches/_branch.html.haml b/app/views/projects/branches/_branch.html.haml index 360e38afb5d..3b9e8e706f9 100644 --- a/app/views/projects/branches/_branch.html.haml +++ b/app/views/projects/branches/_branch.html.haml @@ -4,10 +4,10 @@ - mr_status = merge_request_status(related_merge_request) - is_default_branch = branch.name == @repository.root_ref -%li{ class: "branch-item gl-display-flex! gl-align-items-center! js-branch-item js-branch-#{branch.name} gl-pl-5! gl-pr-2!", data: { name: branch.name, qa_selector: 'branch_container', qa_name: branch.name } } +%li{ class: "branch-item gl-display-flex! gl-align-items-center! js-branch-item js-branch-#{branch.name} gl-pl-5! gl-pr-2!", data: { name: branch.name, testid: 'branch-container', qa_name: branch.name } } .branch-info .gl-display-flex.gl-align-items-center - = link_to project_tree_path(@project, branch.name, ref_type: 'heads'), class: 'item-title str-truncated-100 ref-name', data: { qa_selector: 'branch_link' } do + = link_to project_tree_path(@project, branch.name, ref_type: 'heads'), class: 'item-title str-truncated-100 ref-name', data: { testid: 'branch-link' } do = branch.name = clipboard_button(text: branch.name, title: _("Copy branch name")) - if is_default_branch diff --git a/app/views/projects/branches/_panel.html.haml b/app/views/projects/branches/_panel.html.haml index 8ef7d435420..8952ba75568 100644 --- a/app/views/projects/branches/_panel.html.haml +++ b/app/views/projects/branches/_panel.html.haml @@ -12,7 +12,7 @@ %h3.gl-new-card-title.h5 = panel_title - c.with_body do - %ul.content-list.branches-list.all-branches{ data: { qa_selector: 'all_branches_container' } } + %ul.content-list.branches-list.all-branches{ data: { testid: 'all-branches-container' } } - branches.first(overview_max_branches).each do |branch| = render "projects/branches/branch", branch: branch, merged: project.repository.merged_to_root_ref?(branch), commit_status: @branch_pipeline_statuses[branch.name], show_commit_status: @branch_pipeline_statuses.any? - if branches.size > overview_max_branches diff --git a/app/views/projects/commit/_commit_box.html.haml b/app/views/projects/commit/_commit_box.html.haml index e79a91eddaf..ee9c49a47bf 100644 --- a/app/views/projects/commit/_commit_box.html.haml +++ b/app/views/projects/commit/_commit_box.html.haml @@ -3,7 +3,7 @@ = render partial: 'signature', object: @commit.signature %strong #{ s_('CommitBoxTitle|Commit') } - %span.commit-sha{ data: { qa_selector: 'commit_sha_content' } }= @commit.short_id + %span.commit-sha{ data: { testid: 'commit-sha-content' } }= @commit.short_id = clipboard_button(text: @commit.id, title: _('Copy commit SHA')) %span.d-none.d-sm-inline= _('authored') #{time_ago_with_tooltip(@commit.authored_date)} diff --git a/doc/administration/cicd.md b/doc/administration/cicd.md index 7a6316a1e50..47cbd7d1aec 100644 --- a/doc/administration/cicd.md +++ b/doc/administration/cicd.md @@ -18,7 +18,7 @@ CI/CD to be disabled by default in new projects by modifying the settings in: - `gitlab.rb` for Linux package installations. Existing projects that already had CI/CD enabled are unchanged. Also, this setting only changes -the project default, so project owners [can still enable CI/CD in the project settings](../ci/enable_or_disable_ci.md). +the project default, so project owners [can still enable CI/CD in the project settings](../ci/index.md#disable-gitlab-cicd-in-a-project). For self-compiled installations: diff --git a/doc/administration/settings/gitaly_timeouts.md b/doc/administration/settings/gitaly_timeouts.md index edb44249aab..1cab1e9fd01 100644 --- a/doc/administration/settings/gitaly_timeouts.md +++ b/doc/administration/settings/gitaly_timeouts.md @@ -20,9 +20,10 @@ To access Gitaly timeout settings: The following timeouts are available. -| Timeout | Default | Description | -|:--------|:-----------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Timeout | Default | Description | +|:--------|:-----------|:------------| | Default | 55 seconds | Timeout for most Gitaly calls (not enforced for `git` `fetch` and `push` operations, or Sidekiq jobs). For example, checking if a repository exists on disk. Makes sure that Gitaly calls made within a web request cannot exceed the entire request timeout. It should be shorter than the [worker timeout](../operations/puma.md#change-the-worker-timeout) that can be configured for [Puma](../../install/requirements.md#puma-settings). If a Gitaly call timeout exceeds the worker timeout, the remaining time from the worker timeout is used to avoid having to terminate the worker. | -| Fast | 10 seconds | Timeout for fast Gitaly operations used within requests, sometimes multiple times. For example, checking if a repository exists on disk. If fast operations exceed this threshold, there may be a problem with a storage shard. Failing fast can help maintain the stability of the GitLab instance. | -| Medium | 30 seconds | Timeout for Gitaly operations that should be fast (possibly within requests) but preferably not used multiple times within a request. For example, loading blobs. Timeout that should be set between Default and Fast. | +| Fast | 10 seconds | Timeout for fast Gitaly operations used within requests, sometimes multiple times. For example, checking if a repository exists on disk. If fast operations exceed this threshold, there may be a problem with a storage shard. Failing fast can help maintain the stability of the GitLab instance. | +| Medium | 30 seconds | Timeout for Gitaly operations that should be fast (possibly within requests) but preferably not used multiple times within a request. For example, loading blobs. Timeout that should be set between Default and Fast. | + You can also [configure negotiation timeouts](../gitaly/configure_gitaly.md#configure-negotiation-timeouts). diff --git a/doc/architecture/blueprints/gitlab_steps/index.md b/doc/architecture/blueprints/gitlab_steps/index.md index f4715fc27d4..5e3becfec19 100644 --- a/doc/architecture/blueprints/gitlab_steps/index.md +++ b/doc/architecture/blueprints/gitlab_steps/index.md @@ -33,12 +33,12 @@ shows a need for a better way to define CI job execution. ## Motivation -Even though the current [`.gitlab-ci.yml`](../../../ci/yaml/gitlab_ci_yaml.md) is reasonably flexible, it easily becomes very +Even though the current [`.gitlab-ci.yml`](../../../ci/index.md#the-gitlab-ciyml-file) is reasonably flexible, it easily becomes very complex when trying to support complex workflows. This complexity is represented with repetetitve patterns, a purpose-specific syntax, or a complex sequence of commands to execute. -This is particularly challenging, because the [`.gitlab-ci.yml`](../../../ci/yaml/gitlab_ci_yaml.md) +This is particularly challenging, because the [`.gitlab-ci.yml`](../../../ci/index.md#the-gitlab-ciyml-file) is inflexible on more complex workflows that require fine-tuning or special behavior for the CI job execution. Its prescriptive approach how to handle Git cloning, when artifacts are downloaded, or how the shell script is being executed quite often @@ -46,7 +46,7 @@ results in the need to work around the system for pipelines that are not "standa or when new features are requested. This proves especially challenging when trying to add a new syntax to the -[`.gitlab-ci.yml`](../../../ci/yaml/gitlab_ci_yaml.md) +[`.gitlab-ci.yml`](../../../ci/index.md#the-gitlab-ciyml-file) to support a specific feature, like [`secure files`](../../../ci/secure_files/index.md) or `release:` keyword. Adding these special features on a syntax level results in a more complex config, which is harder to maintain, and more complex diff --git a/doc/ci/enable_or_disable_ci.md b/doc/ci/enable_or_disable_ci.md index 3081b8d1b39..03fe4ccfa8b 100644 --- a/doc/ci/enable_or_disable_ci.md +++ b/doc/ci/enable_or_disable_ci.md @@ -1,59 +1,11 @@ --- -stage: Verify -group: Pipeline Execution -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 -type: howto +redirect_to: 'index.md#disable-gitlab-cicd-in-a-project' +remove_date: '2024-01-30' --- -# Disabling GitLab CI/CD **(FREE ALL)** +This document was moved to [another location](index.md#disable-gitlab-cicd-in-a-project). -GitLab CI/CD is enabled by default on all new projects. -If you use an external CI/CD server like Jenkins or Drone CI, you can -disable GitLab CI/CD to avoid conflicts with the commits status -API. - -You can disable GitLab CI/CD: - -- [For each project](#disable-cicd-in-a-project). -- [For all new projects on an instance](../administration/cicd.md). - -These changes do not apply to projects in an -[external integration](../user/project/integrations/index.md#available-integrations). - -## Disable CI/CD in a project - -When you disable GitLab CI/CD: - -- The **CI/CD** item in the left sidebar is removed. -- The `/pipelines` and `/jobs` pages are no longer available. -- Existing jobs and pipelines are hidden, not removed. - -To disable GitLab CI/CD in your project: - -1. On the left sidebar, select **Search or go to** and find your project. -1. Select **Settings > General**. -1. Expand **Visibility, project features, permissions**. -1. In the **Repository** section, turn off **CI/CD**. -1. Select **Save changes**. - -## Enable CI/CD in a project - -To enable GitLab CI/CD in your project: - -1. On the left sidebar, select **Search or go to** and find your project. -1. Select **Settings > General**. -1. Expand **Visibility, project features, permissions**. -1. In the **Repository** section, turn on **CI/CD**. -1. Select **Save changes**. - -<!-- ## Troubleshooting - -Include any troubleshooting steps that you can foresee. If you know beforehand what issues -one might have when setting this up, or when something is changed, or on upgrading, it's -important to describe those, too. Think of things that may go wrong and include them here. -This is important to minimize requests for support, and to avoid doc comments with -questions that you know someone might ask. - -Each scenario can be a third-level heading, for example `### Getting error message X`. -If you have none to add when creating a doc, leave this section in place -but commented out to help encourage others to add to it in the future. --> +<!-- This redirect file can be deleted after <2024-01-30>. --> +<!-- 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/ci/index.md b/doc/ci/index.md index 413116b0e51..44bff47d9bd 100644 --- a/doc/ci/index.md +++ b/doc/ci/index.md @@ -21,17 +21,28 @@ If you're new to GitLab CI/CD, start by reviewing some of the commonly used term ### The `.gitlab-ci.yml` file -To use GitLab CI/CD, you start with a `.gitlab-ci.yml` file at the root of your project. -In this file, you specify the list of things you want to do, like test and deploy your application. -This file follows the YAML format and has its own special syntax. +To use GitLab CI/CD, you start with a `.gitlab-ci.yml` file at the root of your project +which contains the configuration for your CI/CD pipeline. This file follows the YAML format +and has its own special syntax. You can name this file anything you want, but `.gitlab-ci.yml` is the most common name. -Use the pipeline editor to edit the `.gitlab-ci.yml` file and test the syntax before you commit changes. + +In the `.gitlab-ci.yml` file, you can define: + +- The tasks you want to complete, for example test and deploy your application. +- Other configuration files and templates you want to include. +- Dependencies and caches. +- The commands you want to run in sequence and those you want to run in parallel. +- The location to deploy your application to. +- Whether you want to run the scripts automatically or trigger any of them manually. **Get started:** - [Create your first `.gitlab-ci.yml` file](quick_start/index.md). - [View all the possible keywords that you can use in the `.gitlab-ci.yml` file](yaml/index.md). +the configuration. +- Use the [pipeline editor](pipeline_editor/index.md) to edit or [visualize](pipeline_editor/index.md#visualize-ci-configuration) + your CI/CD configuration. ### Runners @@ -79,6 +90,29 @@ They can be hard-coded in your `.gitlab-ci.yml` file, project settings, or dynam A [CI/CD component](components/index.md) is a reusable single pipeline configuration unit. Use them to compose an entire pipeline configuration or a small part of a larger pipeline. +## Disable GitLab CI/CD in a project + +GitLab CI/CD is enabled by default on all new projects. If you use an external CI/CD server like +Jenkins or Drone CI, you can disable GitLab CI/CD to avoid conflicts with the commits status API. + +You can disable GitLab CI/CD per project or [for all new projects on an instance](../administration/cicd.md). + +When you disable GitLab CI/CD: + +- The **CI/CD** item in the left sidebar is removed. +- The `/pipelines` and `/jobs` pages are no longer available. +- Existing jobs and pipelines are hidden, not removed. + +To disable GitLab CI/CD in your project: + +1. On the left sidebar, select **Search or go to** and find your project. +1. Select **Settings > General**. +1. Expand **Visibility, project features, permissions**. +1. In the **Repository** section, turn off **CI/CD**. +1. Select **Save changes**. + +These changes do not apply to projects in an [external integration](../user/project/integrations/index.md#available-integrations). + ## Videos - <i class="fa fa-youtube-play youtube" aria-hidden="true"></i> [GitLab CI/CD demo](https://www.youtube-nocookie.com/embed/ljth1Q5oJoo). diff --git a/doc/ci/migration/github_actions.md b/doc/ci/migration/github_actions.md index 86ce6c4846a..46d15f506ac 100644 --- a/doc/ci/migration/github_actions.md +++ b/doc/ci/migration/github_actions.md @@ -39,7 +39,7 @@ functionality. ### Configuration file GitHub Actions can be configured with a [workflow YAML file](https://docs.github.com/en/actions/learn-github-actions/understanding-github-actions#understanding-the-workflow-file). -GitLab CI/CD uses a [`.gitlab-ci.yml` YAML file](../../ci/yaml/gitlab_ci_yaml.md) by default. +GitLab CI/CD uses a [`.gitlab-ci.yml` YAML file](../../ci/index.md#the-gitlab-ciyml-file) by default. For example, in a GitHub Actions `workflow` file: @@ -88,7 +88,7 @@ from GitHub Actions to GitLab CI/CD. generate automated CI/CD jobs that are triggered when certain event take place, for example pushing a new commit. A GitHub Action workflow is a YAML file defined in the `.github/workflows` directory located in the root of the repository. The GitLab equivalent is the -[`.gitlab-ci.yml` configuration file](../../ci/yaml/gitlab_ci_yaml.md) which also resides +[`.gitlab-ci.yml` configuration file](../../ci/index.md#the-gitlab-ciyml-file) which also resides in the repository's root directory. #### Jobs diff --git a/doc/ci/migration/jenkins.md b/doc/ci/migration/jenkins.md index e9f39e2d7af..4352b495e7b 100644 --- a/doc/ci/migration/jenkins.md +++ b/doc/ci/migration/jenkins.md @@ -38,7 +38,7 @@ functionality. ### Configuration file -Jenkins can be configured with a [`Jenkinsfile` in the Groovy format](https://www.jenkins.io/doc/book/pipeline/jenkinsfile/). GitLab CI/CD uses a [`.gitlab-ci.yml` YAML file](../../ci/yaml/gitlab_ci_yaml.md) by default. +Jenkins can be configured with a [`Jenkinsfile` in the Groovy format](https://www.jenkins.io/doc/book/pipeline/jenkinsfile/). GitLab CI/CD uses a [`.gitlab-ci.yml` YAML file](../../ci/index.md#the-gitlab-ciyml-file) by default. Example of a `Jenkinsfile`: @@ -101,7 +101,7 @@ from Jenkins to GitLab CI/CD. [Jenkins pipelines](https://www.jenkins.io/doc/book/pipeline/) generate automated CI/CD jobs that are triggered when certain event take place, such as a new commit being pushed. -A Jenkins pipeline is defined in a `Jenkinsfile`. The GitLab equivalent is the [`.gitlab-ci.yml` configuration file](../../ci/yaml/gitlab_ci_yaml.md). +A Jenkins pipeline is defined in a `Jenkinsfile`. The GitLab equivalent is the [`.gitlab-ci.yml` configuration file](../../ci/index.md#the-gitlab-ciyml-file). Jenkins does not provide a place to store source code, so the `Jenkinsfile` must be stored in a separate source control repository. diff --git a/doc/ci/yaml/gitlab_ci_yaml.md b/doc/ci/yaml/gitlab_ci_yaml.md index 920abf50546..a0e1ce04fad 100644 --- a/doc/ci/yaml/gitlab_ci_yaml.md +++ b/doc/ci/yaml/gitlab_ci_yaml.md @@ -1,89 +1,11 @@ --- -stage: Verify -group: Pipeline Authoring -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 -type: reference +redirect_to: '../index.md#the-gitlab-ciyml-file' +remove_date: '2024-01-30' --- -# The `.gitlab-ci.yml` file **(FREE ALL)** +This document was moved to [another location](../index.md#the-gitlab-ciyml-file). -To use GitLab CI/CD, you need: - -- Application code hosted in a Git repository. -- A file called [`.gitlab-ci.yml`](index.md) in the root of your repository, which - contains the CI/CD configuration. - -In the `.gitlab-ci.yml` file, you can define: - -- The scripts you want to run. -- Other configuration files and templates you want to include. -- Dependencies and caches. -- The commands you want to run in sequence and those you want to run in parallel. -- The location to deploy your application to. -- Whether you want to run the scripts automatically or trigger any of them manually. - -The scripts are grouped into **jobs**, and jobs run as part of a larger -**pipeline**. You can group multiple independent jobs into **stages** that run in a defined order. -The CI/CD configuration needs at least one job that is [not hidden](../jobs/index.md#hide-jobs). - -You should organize your jobs in a sequence that suits your application and is in accordance with -the tests you wish to perform. To [visualize](../pipeline_editor/index.md#visualize-ci-configuration) the process, imagine -the scripts you add to jobs are the same as CLI commands you run on your computer. - -When you add a `.gitlab-ci.yml` file to your -repository, GitLab detects it and an application called [GitLab Runner](https://docs.gitlab.com/runner/) -runs the scripts defined in the jobs. - -A `.gitlab-ci.yml` file might contain: - -```yaml -stages: - - build - - test - -build-code-job: - stage: build - script: - - echo "Check the ruby version, then build some Ruby project files:" - - ruby -v - - rake - -test-code-job1: - stage: test - script: - - echo "If the files are built successfully, test some files with one command:" - - rake test1 - -test-code-job2: - stage: test - script: - - echo "If the files are built successfully, test other files with a different command:" - - rake test2 -``` - -In this example, the `build-code-job` job in the `build` stage runs first. It outputs -the Ruby version the job is using, then runs `rake` to build project files. -If this job completes successfully, the two `test-code-job` jobs in the `test` stage start -in parallel and run tests on the files. - -The full pipeline in the example is composed of three jobs, grouped into two stages, -`build` and `test`. The pipeline runs every time changes are pushed to any -branch in the project. - -GitLab CI/CD not only executes the jobs but also shows you what's happening during execution, -just as you would see in your terminal: - -![job running](img/job_running_v13_10.png) - -You create the strategy for your app and GitLab runs the pipeline -according to what you've defined. Your pipeline status is also -displayed by GitLab: - -![pipeline status](img/pipeline_status.png) - -If anything goes wrong, you can -[roll back](../environments/index.md#retry-or-roll-back-a-deployment) the changes: - -![rollback button](img/rollback.png) - -[View the full syntax for the `.gitlab-ci.yml` file](index.md). +<!-- This redirect file can be deleted after <2024-01-30>. --> +<!-- 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/ci/yaml/img/job_running_v13_10.png b/doc/ci/yaml/img/job_running_v13_10.png Binary files differdeleted file mode 100644 index b1f21b8445f..00000000000 --- a/doc/ci/yaml/img/job_running_v13_10.png +++ /dev/null diff --git a/doc/ci/yaml/img/pipeline_status.png b/doc/ci/yaml/img/pipeline_status.png Binary files differdeleted file mode 100644 index 96881f072e1..00000000000 --- a/doc/ci/yaml/img/pipeline_status.png +++ /dev/null diff --git a/doc/ci/yaml/img/rollback.png b/doc/ci/yaml/img/rollback.png Binary files differdeleted file mode 100644 index 38e0552f4f1..00000000000 --- a/doc/ci/yaml/img/rollback.png +++ /dev/null diff --git a/doc/user/application_security/get-started-security.md b/doc/user/application_security/get-started-security.md index fd6829f5ae2..6143dd59373 100644 --- a/doc/user/application_security/get-started-security.md +++ b/doc/user/application_security/get-started-security.md @@ -32,7 +32,7 @@ After you've gotten familiar with how scanning works, you can then choose to: You could create a copy of a higher-traffic project for testing, or select a project that's not as busy. 1. Create a merge request to [enable Secret Detection](secret_detection/index.md#enable-secret-detection) and [enable Dependency Scanning](dependency_scanning/index.md#configuration) to identify any leaked secrets and vulnerable packages in that project. - - Security scanners run in your project's [CI/CD pipelines](../../ci/pipelines/index.md). Creating a merge request to update your [`.gitlab-ci.yml`](../../ci/yaml/gitlab_ci_yaml.md) helps you check how the scanners work with your project before they start running in every pipeline. In the merge request, you can change relevant [Secret Detection settings](secret_detection/index.md#configure-scan-settings) or [Dependency Scanning settings](dependency_scanning/index.md#available-cicd-variables) to accommodate your project's layout or configuration. For example, you might choose to exclude a directory of third-party code from scanning. + - Security scanners run in your project's [CI/CD pipelines](../../ci/pipelines/index.md). Creating a merge request to update your [`.gitlab-ci.yml`](../../ci/index.md#the-gitlab-ciyml-file) helps you check how the scanners work with your project before they start running in every pipeline. In the merge request, you can change relevant [Secret Detection settings](secret_detection/index.md#configure-scan-settings) or [Dependency Scanning settings](dependency_scanning/index.md#available-cicd-variables) to accommodate your project's layout or configuration. For example, you might choose to exclude a directory of third-party code from scanning. - After you merge this MR to your [default branch](../project/repository/branches/default.md), the system creates a baseline scan. This scan identifies which vulnerabilities already exist on the default branch so [merge requests](../project/merge_requests/index.md) can highlight only newly-introduced problems. Without a baseline scan, merge requests display every vulnerability in the branch, even if the vulnerability already exists on the default branch. 1. Let your team get comfortable with [viewing security findings in merge requests](index.md#view-security-scan-information) and the [vulnerability report](vulnerability_report/index.md). diff --git a/doc/user/clusters/agent/gitops/example_repository_structure.md b/doc/user/clusters/agent/gitops/example_repository_structure.md index 02eea3300af..52855b9731c 100644 --- a/doc/user/clusters/agent/gitops/example_repository_structure.md +++ b/doc/user/clusters/agent/gitops/example_repository_structure.md @@ -96,7 +96,7 @@ You've successfully created a repository with a protected deployment branch! Next, you'll configure CI/CD to merge changes from the default branch to your deployment branch. -In the root of `web-app-manifests`, create and push a [`.gitlab-ci.yml`](../../../../ci/yaml/gitlab_ci_yaml.md) file with the following contents: +In the root of `web-app-manifests`, create and push a [`.gitlab-ci.yml`](../../../../ci/index.md#the-gitlab-ciyml-file) file with the following contents: ```yaml deploy: diff --git a/doc/user/clusters/agent/gitops/flux_oci_tutorial.md b/doc/user/clusters/agent/gitops/flux_oci_tutorial.md index b970c818a72..2c4796adf2b 100644 --- a/doc/user/clusters/agent/gitops/flux_oci_tutorial.md +++ b/doc/user/clusters/agent/gitops/flux_oci_tutorial.md @@ -65,7 +65,7 @@ First, create a repository for your Kubernetes manifests: Next, configure [GitLab CI/CD](../../../../ci/index.md) to package your manifests into an OCI artifact, and push the artifact to the [GitLab Container Registry](../../../packages/container_registry/index.md): -1. In the root of `web-app-manifests`, create and push a [`.gitlab-ci.yml`](../../../../ci/yaml/gitlab_ci_yaml.md) file with the following contents: +1. In the root of `web-app-manifests`, create and push a [`.gitlab-ci.yml`](../../../../ci/index.md#the-gitlab-ciyml-file) file with the following contents: ```yaml package: diff --git a/doc/user/clusters/agent/install/index.md b/doc/user/clusters/agent/install/index.md index d620a9f658c..221270b69f6 100644 --- a/doc/user/clusters/agent/install/index.md +++ b/doc/user/clusters/agent/install/index.md @@ -76,7 +76,7 @@ In GitLab 14.10, a [flag](../../../../administration/feature_flags.md) named `ce Prerequisites: - For a [GitLab CI/CD workflow](../ci_cd_workflow.md), ensure that - [GitLab CI/CD is not disabled](../../../../ci/enable_or_disable_ci.md#disable-cicd-in-a-project). + [GitLab CI/CD is not disabled](../../../../ci/index.md#disable-gitlab-cicd-in-a-project). You must register an agent before you can install the agent in your cluster. To register an agent: diff --git a/doc/user/clusters/agent/vulnerabilities.md b/doc/user/clusters/agent/vulnerabilities.md index 4c6d4a9740b..e57551fc8c1 100644 --- a/doc/user/clusters/agent/vulnerabilities.md +++ b/doc/user/clusters/agent/vulnerabilities.md @@ -39,7 +39,7 @@ Other elements of the [CRON syntax](https://docs.oracle.com/cd/E12058_01/doc/doc NOTE: The CRON expression is evaluated in [UTC](https://www.timeanddate.com/worldclock/timezone/utc) using the system-time of the Kubernetes-agent pod. -By default, operational container scanning does not scan any workloads for vulnerabilities. +By default, operational container scanning does not scan any workloads for vulnerabilities. You can set the `vulnerability_report` block with the `namespaces` field which can be used to select which namespaces are scanned. For example, if you would like to scan only the `default`, `kube-system` namespaces, you can use this configuration: @@ -112,13 +112,15 @@ You can customize it with a `resource_requirements` field. container_scanning: resource_requirements: requests: - cpu: 200m + cpu: '0.2' memory: 200Mi limits: - cpu: 700m + cpu: '0.7' memory: 700Mi ``` +When using a fractional value for CPU, format the value as a string. + NOTE: Resource requirements can only be set up using the agent configuration. If you enabled `Operational Container Scanning` through `scan execution policies`, you would need to define the resource requirements within the agent configuration file. @@ -143,3 +145,10 @@ You must have at least the Developer role. > [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/415451) in GitLab 16.4. To scan private images, the scanner relies on the image pull secrets (direct references and from the service account) to pull the image. + +## Troubleshooting + +### `Error running Trivy scan. Container terminated reason: OOMKilled` + +OCS might fail with an OOM error if there are too many resources to be scanned or if the images being scanned are large. +To resolve this, [configure the resource requirement](#configure-scanner-resource-requirements) to increase the amount of memory available. diff --git a/doc/user/project/merge_requests/merge_when_pipeline_succeeds.md b/doc/user/project/merge_requests/merge_when_pipeline_succeeds.md index 699c79806f0..7994dd30046 100644 --- a/doc/user/project/merge_requests/merge_when_pipeline_succeeds.md +++ b/doc/user/project/merge_requests/merge_when_pipeline_succeeds.md @@ -79,7 +79,7 @@ merge. This configuration works for both: - GitLab CI/CD pipelines. - Pipelines run from an [external CI integration](../integrations/index.md#available-integrations). -As a result, [disabling GitLab CI/CD pipelines](../../../ci/enable_or_disable_ci.md#disable-cicd-in-a-project) +As a result, [disabling GitLab CI/CD pipelines](../../../ci/index.md#disable-gitlab-cicd-in-a-project) does not disable this feature, but you can use pipelines from external CI providers with it. diff --git a/qa/gdk/Dockerfile.gdk b/qa/gdk/Dockerfile.gdk index 914a739c99f..bc3c1c4317d 100644 --- a/qa/gdk/Dockerfile.gdk +++ b/qa/gdk/Dockerfile.gdk @@ -5,7 +5,7 @@ ENV GITLAB_LICENSE_MODE=test \ # Clone GDK at specific sha and bootstrap packages # -ARG GDK_SHA=83bbc674a24dfb6a31c858f167ae80e670856328 +ARG GDK_SHA=e2e32c98ef2874a3bd13af00e0085f8299ff3288 RUN set -eux; \ git clone --depth 1 https://gitlab.com/gitlab-org/gitlab-development-kit.git && cd gitlab-development-kit; \ git fetch --depth 1 origin ${GDK_SHA} && git -c advice.detachedHead=false checkout ${GDK_SHA}; \ diff --git a/qa/qa/page/component/commit_modal.rb b/qa/qa/page/component/commit_modal.rb index 7192e8bafb5..4f0618c6f3d 100644 --- a/qa/qa/page/component/commit_modal.rb +++ b/qa/qa/page/component/commit_modal.rb @@ -5,7 +5,7 @@ module QA module Component class CommitModal < Page::Base view 'app/assets/javascripts/projects/commit/components/form_modal.vue' do - element :submit_commit_button, required: true + element 'submit-commit', required: true end end end diff --git a/qa/qa/page/merge_request/show.rb b/qa/qa/page/merge_request/show.rb index a51c65a18c6..8129567c079 100644 --- a/qa/qa/page/merge_request/show.rb +++ b/qa/qa/page/merge_request/show.rb @@ -473,7 +473,7 @@ module QA def cherry_pick! click_element('cherry-pick-button', Page::Component::CommitModal) - click_element(:submit_commit_button) + click_element('submit-commit') end def revert_change! @@ -482,7 +482,7 @@ module QA retry_on_exception(reload: true) do click_element('revert-button', Page::Component::CommitModal) end - click_element(:submit_commit_button) + click_element('submit-commit') end def mr_widget_text diff --git a/qa/qa/page/project/branches/show.rb b/qa/qa/page/project/branches/show.rb index bbe0f91abf6..4e0d2e0265a 100644 --- a/qa/qa/page/project/branches/show.rb +++ b/qa/qa/page/project/branches/show.rb @@ -6,36 +6,36 @@ module QA module Branches class Show < Page::Base view 'app/assets/javascripts/branches/components/branch_more_actions.vue' do - element :delete_branch_button + element 'delete-branch-button' end view 'app/assets/javascripts/branches/components/delete_branch_modal.vue' do - element :delete_branch_confirmation_button + element 'delete-branch-confirmation-button' end view 'app/views/projects/branches/_branch.html.haml' do - element :branch_container - element :branch_link + element 'branch-container' + element 'branch-link' end view 'app/views/projects/branches/_panel.html.haml' do - element :all_branches_container + element 'all-branches-container' end def delete_branch(branch_name) - within_element(:branch_container, name: branch_name) do - click_element(:delete_branch_button) + within_element('branch-container', name: branch_name) do + click_element('delete-branch-button') end - click_element(:delete_branch_confirmation_button) + click_element('delete-branch-confirmation-button') finished_loading? end def has_no_branch?(branch_name, reload: false) wait_until(reload: reload) do - within_element(:all_branches_container) do - has_no_element?(:branch_link, text: branch_name) + within_element('all-branches-container') do + has_no_element?('branch-link', text: branch_name) end end end diff --git a/qa/qa/page/project/commit/show.rb b/qa/qa/page/project/commit/show.rb index bc44a4e5e72..1c876f450c5 100644 --- a/qa/qa/page/project/commit/show.rb +++ b/qa/qa/page/project/commit/show.rb @@ -6,41 +6,41 @@ module QA module Commit class Show < Page::Base view 'app/views/projects/commit/_commit_box.html.haml' do - element :commit_sha_content + element 'commit-sha-content' end view 'app/assets/javascripts/projects/commit/components/commit_options_dropdown.vue' do - element :options_button - element :revert_button - element :cherry_pick_button - element :email_patches - element :plain_diff + element 'commit-options-dropdown' + element 'revert-link' + element 'cherry-pick-link' + element 'email-patches-link' + element 'plain-diff-link' end def revert_commit - click_element(:options_button) - click_element(:revert_button, Page::Component::CommitModal) - click_element(:submit_commit_button) + click_element('commit-options-dropdown') + click_element('revert-link', Page::Component::CommitModal) + click_element('submit-commit') end def cherry_pick_commit - click_element(:options_button) - click_element(:cherry_pick_button, Page::Component::CommitModal) - click_element(:submit_commit_button) + click_element('commit-options-dropdown') + click_element('cherry-pick-link', Page::Component::CommitModal) + click_element('submit-commit') end def select_email_patches - click_element :options_button - visit_link_in_element :email_patches + click_element 'commit-options-dropdown' + visit_link_in_element 'email-patches-link' end def select_plain_diff - click_element :options_button - visit_link_in_element :plain_diff + click_element 'commit-options-dropdown' + visit_link_in_element 'plain-diff-link' end def commit_sha - find_element(:commit_sha_content).text + find_element('commit-sha-content').text end end end diff --git a/qa/qa/page/project/import/github.rb b/qa/qa/page/project/import/github.rb index 08400042028..128ed9682d4 100644 --- a/qa/qa/page/project/import/github.rb +++ b/qa/qa/page/project/import/github.rb @@ -6,17 +6,20 @@ module QA module Import class Github < Page::Base view 'app/views/import/github/new.html.haml' do - element :personal_access_token_field - element :authenticate_button + element 'personal-access-token-field' + element 'authenticate-button' + end + + view 'app/assets/javascripts/import_entities/import_projects/components/advanced_settings.vue' do + element 'advanced-settings-checkbox' end view 'app/assets/javascripts/import_entities/import_projects/components/provider_repo_table_row.vue' do - element :project_import_row - element :project_path_field - element :import_button - element :project_path_content - element :go_to_project_link - element :import_status_indicator + element 'project-import-row' + element 'project-path-field' + element 'import-button' + element 'go-to-project-link' + element 'import-status-indicator' end view "app/assets/javascripts/import_entities/components/import_target_dropdown.vue" do @@ -30,12 +33,12 @@ module QA def add_personal_access_token(personal_access_token) # If for some reasons this process is retried, user cannot re-enter github token in the same group # In this case skip this step and proceed to import project row - return unless has_element?(:personal_access_token_field) + return unless has_element?('personal-access-token-field') raise ArgumentError, "No personal access token was provided" if personal_access_token.empty? - fill_element(:personal_access_token_field, personal_access_token) - click_element(:authenticate_button) + fill_element('personal-access-token-field', personal_access_token) + click_element('authenticate-button') finished_loading? end @@ -45,15 +48,15 @@ module QA # @param [String] target_group_path # @return [void] def import!(gh_project_name, target_group_path, project_name) - within_element(:project_import_row, source_project: gh_project_name) do + within_element('project-import-row', source_project: gh_project_name) do click_element('target-namespace-dropdown') click_element("listbox-item-#{target_group_path}", wait: 10) - fill_element(:project_path_field, project_name) + fill_element('project-path-field', project_name) retry_until do - click_element(:import_button) + click_element('import-button') # Make sure import started before waiting for completion - has_no_element?(:import_status_indicator, text: "Not started", wait: 1) + has_no_element?('import-status-indicator', text: "Not started", wait: 1) end end end @@ -63,8 +66,8 @@ module QA # @param [String] gh_project_name # @return [Boolean] def has_go_to_project_link?(gh_project_name) - within_element(:project_import_row, source_project: gh_project_name) do - has_element?(:go_to_project_link) + within_element('project-import-row', source_project: gh_project_name) do + has_element?('go-to-project-link') end end @@ -78,14 +81,14 @@ module QA wait: QA::Support::WaitForRequests::DEFAULT_MAX_WAIT_TIME, allow_partial_import: false ) - within_element(:project_import_row, source_project: gh_project_name, skip_finished_loading_check: true) do + within_element('project-import-row', source_project: gh_project_name, skip_finished_loading_check: true) do wait_until( max_duration: wait, sleep_interval: 5, reload: false, skip_finished_loading_check_on_refresh: true ) do - status_selector = 'import_status_indicator' + status_selector = 'import-status-indicator' next has_element?(status_selector, text: "Complete", wait: 1) unless allow_partial_import @@ -102,7 +105,7 @@ module QA # @param [Symbol] option_name # @return [void] def select_advanced_option(option_name) - check_element(:advanced_settings_checkbox, true, option_name: option_name) + check_element('advanced-settings-checkbox', true, option_name: option_name) end end end diff --git a/spec/helpers/events_helper_spec.rb b/spec/helpers/events_helper_spec.rb index 6ffca876361..7e6c0a9086a 100644 --- a/spec/helpers/events_helper_spec.rb +++ b/spec/helpers/events_helper_spec.rb @@ -22,7 +22,8 @@ RSpec.describe EventsHelper, factory_default: :keep, feature_category: :user_pro it 'returns a link to the author' do name = user.name - expect(helper.link_to_author(event)).to eq(link_to(name, user_path(user.username), title: name)) + expect(helper.link_to_author(event)).to eq(link_to(name, user_path(user.username), title: name, + data: { user_id: user.id, username: user.username }, class: 'js-user-link')) end it 'returns the author name if the author is not present' do @@ -35,7 +36,8 @@ RSpec.describe EventsHelper, factory_default: :keep, feature_category: :user_pro allow(helper).to receive(:current_user).and_return(user) name = _('You') - expect(helper.link_to_author(event, self_added: true)).to eq(link_to(name, user_path(user.username), title: name)) + expect(helper.link_to_author(event, self_added: true)).to eq(link_to(name, user_path(user.username), title: name, + data: { user_id: user.id, username: user.username }, class: 'js-user-link')) end end |