summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/assets/javascripts/design_management/components/design_notes/design_note.vue30
-rw-r--r--app/controllers/sessions_controller.rb6
-rw-r--r--app/services/ci/job_artifacts/destroy_batch_service.rb4
-rw-r--r--app/views/devise/sessions/_new_base.html.haml2
-rw-r--r--doc/ci/index.md103
-rw-r--r--lib/gitlab/i18n.rb24
-rw-r--r--qa/qa/fixtures/package_managers/npm/npm_upload_install_package_project.yaml.erb1
-rw-r--r--qa/qa/specs/features/browser_ui/5_package/package_registry/composer_registry_spec.rb1
-rw-r--r--qa/qa/specs/features/browser_ui/5_package/package_registry/conan_repository_spec.rb1
-rw-r--r--qa/qa/specs/features/browser_ui/5_package/package_registry/generic_repository_spec.rb1
-rw-r--r--qa/qa/specs/features/browser_ui/5_package/package_registry/npm/npm_project_level_spec.rb1
-rw-r--r--qa/qa/specs/features/browser_ui/5_package/package_registry/pypi_repository_spec.rb1
-rw-r--r--qa/qa/specs/features/browser_ui/5_package/package_registry/rubygems_registry_spec.rb1
-rw-r--r--qa/spec/specs/helpers/feature_flag_spec.rb30
-rw-r--r--spec/frontend/design_management/components/design_notes/__snapshots__/design_note_spec.js.snap28
-rw-r--r--spec/frontend/design_management/components/design_notes/design_note_spec.js35
-rw-r--r--spec/frontend/fixtures/sessions.rb1
-rw-r--r--spec/frontend/shortcuts_spec.js2
-rw-r--r--spec/services/ci/job_artifacts/destroy_batch_service_spec.rb12
-rw-r--r--spec/spec_helper.rb4
-rw-r--r--spec/views/devise/sessions/new.html.haml_spec.rb1
-rw-r--r--spec/views/devise/shared/_signin_box.html.haml_spec.rb1
22 files changed, 174 insertions, 116 deletions
diff --git a/app/assets/javascripts/design_management/components/design_notes/design_note.vue b/app/assets/javascripts/design_management/components/design_notes/design_note.vue
index 1e1f5135290..ba95faab53e 100644
--- a/app/assets/javascripts/design_management/components/design_notes/design_note.vue
+++ b/app/assets/javascripts/design_management/components/design_notes/design_note.vue
@@ -1,11 +1,17 @@
<script>
-import { GlTooltipDirective, GlIcon, GlLink, GlSafeHtmlDirective } from '@gitlab/ui';
+import {
+ GlTooltipDirective,
+ GlIcon,
+ GlLink,
+ GlSafeHtmlDirective,
+ GlAvatar,
+ GlAvatarLink,
+} from '@gitlab/ui';
import { ApolloMutation } from 'vue-apollo';
import { getIdFromGraphQLId } from '~/graphql_shared/utils';
import { __ } from '~/locale';
import TimelineEntryItem from '~/vue_shared/components/notes/timeline_entry_item.vue';
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
-import UserAvatarLink from '~/vue_shared/components/user_avatar/user_avatar_link.vue';
import updateNoteMutation from '../../graphql/mutations/update_note.mutation.graphql';
import { hasErrors } from '../../utils/cache_update';
import { findNoteId, extractDesignNoteId } from '../../utils/design_management_utils';
@@ -16,7 +22,8 @@ export default {
editCommentLabel: __('Edit comment'),
},
components: {
- UserAvatarLink,
+ GlAvatar,
+ GlAvatarLink,
TimelineEntryItem,
TimeAgoTooltip,
DesignReplyForm,
@@ -86,18 +93,17 @@ export default {
<template>
<timeline-entry-item :id="`note_${noteAnchorId}`" class="design-note note-form">
- <user-avatar-link
- :link-href="author.webUrl"
- :img-src="author.avatarUrl"
- :img-alt="author.username"
- :img-size="40"
- />
+ <gl-avatar-link :href="author.webUrl" class="gl-float-left gl-mr-3">
+ <gl-avatar :size="32" :src="author.avatarUrl" :entity-name="author.username" />
+ </gl-avatar-link>
+
<div class="gl-display-flex gl-justify-content-space-between">
<div>
<gl-link
v-once
:href="author.webUrl"
class="js-user-link"
+ data-testid="user-link"
:data-user-id="authorId"
:data-username="author.username"
>
@@ -123,7 +129,8 @@ export default {
type="button"
:title="$options.i18n.editCommentLabel"
:aria-label="$options.i18n.editCommentLabel"
- class="note-action-button js-note-edit btn btn-transparent qa-note-edit-button"
+ class="note-action-button btn btn-transparent qa-note-edit-button"
+ data-testid="note-edit"
@click="isEditing = true"
>
<gl-icon name="pencil" class="link-highlight" />
@@ -133,8 +140,9 @@ export default {
<template v-if="!isEditing">
<div
v-safe-html="note.bodyHtml"
- class="note-text js-note-text md"
+ class="note-text md"
data-qa-selector="note_content"
+ data-testid="note-text"
></div>
<slot name="resolved-status"></slot>
</template>
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
index abdc032167b..e907e291eeb 100644
--- a/app/controllers/sessions_controller.rb
+++ b/app/controllers/sessions_controller.rb
@@ -39,7 +39,7 @@ class SessionsController < Devise::SessionsController
after_action :log_failed_login, if: :action_new_and_failed_login?
after_action :verify_known_sign_in, only: [:create]
- helper_method :captcha_enabled?, :captcha_on_login_required?, :arkose_labs_enabled?
+ helper_method :captcha_enabled?, :captcha_on_login_required?
# protect_from_forgery is already prepended in ApplicationController but
# authenticate_with_two_factor which signs in the user is prepended before
@@ -111,10 +111,6 @@ class SessionsController < Devise::SessionsController
Gitlab::Recaptcha.enabled_on_login? && unverified_anonymous_user?
end
- def arkose_labs_enabled?
- false
- end
-
# From https://github.com/plataformatec/devise/wiki/How-To:-Use-Recaptcha-with-Devise#devisepasswordscontroller
def check_captcha
return unless user_params[:password].present?
diff --git a/app/services/ci/job_artifacts/destroy_batch_service.rb b/app/services/ci/job_artifacts/destroy_batch_service.rb
index d5a0a2dd885..5801ba1633c 100644
--- a/app/services/ci/job_artifacts/destroy_batch_service.rb
+++ b/app/services/ci/job_artifacts/destroy_batch_service.rb
@@ -127,7 +127,9 @@ module Ci
def wrongly_expired?(artifact)
return false unless artifact.expire_at.present?
- match_date?(artifact.expire_at) && match_time?(artifact.expire_at)
+ # Although traces should never have expiration dates that don't match time & date here.
+ # we can explicitly exclude them by type since they should never be destroyed.
+ artifact.trace? || (match_date?(artifact.expire_at) && match_time?(artifact.expire_at))
end
def match_date?(expire_at)
diff --git a/app/views/devise/sessions/_new_base.html.haml b/app/views/devise/sessions/_new_base.html.haml
index 91d8483b933..96ba06a8323 100644
--- a/app/views/devise/sessions/_new_base.html.haml
+++ b/app/views/devise/sessions/_new_base.html.haml
@@ -16,7 +16,7 @@
- else
= link_to _('Forgot your password?'), new_password_path(:user)
%div
- - if arkose_labs_enabled?
+ - if Feature.enabled?(:arkose_labs_login_challenge)
= render_if_exists 'devise/sessions/arkose_labs'
- elsif captcha_enabled? || captcha_on_login_required?
= recaptcha_tags nonce: content_security_policy_nonce
diff --git a/doc/ci/index.md b/doc/ci/index.md
index cc86834574a..54ce8b7f299 100644
--- a/doc/ci/index.md
+++ b/doc/ci/index.md
@@ -42,32 +42,32 @@ read the [Introduction to CI/CD with GitLab](introduction/index.md).
GitLab CI/CD uses a number of concepts to describe and run your build and deploy.
-| Concept | Description |
-|:--------------------------------------------------------|:-------------------------------------------------------------------------------|
-| [Pipelines](pipelines/index.md) | Structure your CI/CD process through pipelines. |
-| [CI/CD variables](variables/index.md) | Reuse values based on a variable/value key pair. |
+| Concept | Description |
+|:--------------------------------------------------------|:--------------------------------------------------------------------------------------|
+| [Pipelines](pipelines/index.md) | Structure your CI/CD process through pipelines. |
+| [CI/CD variables](variables/index.md) | Reuse values based on a variable/value key pair. |
| [Environments](environments/index.md) | Deploy your application to different environments (for example, staging, production). |
-| [Job artifacts](pipelines/job_artifacts.md) | Output, use, and reuse job artifacts. |
-| [Cache dependencies](caching/index.md) | Cache your dependencies for a faster execution. |
-| [GitLab Runner](https://docs.gitlab.com/runner/) | Configure your own runners to execute your scripts. |
-| [Pipeline efficiency](pipelines/pipeline_efficiency.md) | Configure your pipelines to run quickly and efficiently. |
-| [Test cases](test_cases/index.md) | Create testing scenarios. |
+| [Job artifacts](pipelines/job_artifacts.md) | Output, use, and reuse job artifacts. |
+| [Cache dependencies](caching/index.md) | Cache your dependencies for a faster execution. |
+| [GitLab Runner](https://docs.gitlab.com/runner/) | Configure your own runners to execute your scripts. |
+| [Pipeline efficiency](pipelines/pipeline_efficiency.md) | Configure your pipelines to run quickly and efficiently. |
+| [Test cases](test_cases/index.md) | Create testing scenarios. |
## Configuration
GitLab CI/CD supports numerous configuration options:
-| Configuration | Description |
-|:----------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------|
-| [Schedule pipelines](pipelines/schedules.md) | Schedule pipelines to run as often as you need. |
-| [Custom path for `.gitlab-ci.yml`](pipelines/settings.md#specify-a-custom-cicd-configuration-file) | Define a custom path for the CI/CD configuration file. |
-| [Git submodules for CI/CD](git_submodules.md) | Configure jobs for using Git submodules. |
-| [SSH keys for CI/CD](ssh_keys/index.md) | Using SSH keys in your CI pipelines. |
-| [Pipeline triggers](triggers/index.md) | Trigger pipelines through the API. |
-| [Merge request pipelines](pipelines/merge_request_pipelines.md) | Design a pipeline structure for running a pipeline in merge requests. |
-| [Integrate with Kubernetes clusters](../user/infrastructure/clusters/index.md) | Connect your project to Google Kubernetes Engine (GKE) or an existing Kubernetes cluster. |
-| [Optimize GitLab and GitLab Runner for large repositories](large_repositories/index.md) | Recommended strategies for handling large repositories. |
-| [`.gitlab-ci.yml` full reference](yaml/index.md) | All the attributes you can use with GitLab CI/CD. |
+| Configuration | Description |
+|:---------------------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------------|
+| [Schedule pipelines](pipelines/schedules.md) | Schedule pipelines to run as often as you need. |
+| [Custom path for `.gitlab-ci.yml`](pipelines/settings.md#specify-a-custom-cicd-configuration-file) | Define a custom path for the CI/CD configuration file. |
+| [Git submodules for CI/CD](git_submodules.md) | Configure jobs for using Git submodules. |
+| [SSH keys for CI/CD](ssh_keys/index.md) | Using SSH keys in your CI pipelines. |
+| [Pipeline triggers](triggers/index.md) | Trigger pipelines through the API. |
+| [Merge request pipelines](pipelines/merge_request_pipelines.md) | Design a pipeline structure for running a pipeline in merge requests. |
+| [Integrate with Kubernetes clusters](../user/infrastructure/clusters/index.md) | Connect your project to Google Kubernetes Engine (GKE) or an existing Kubernetes cluster. |
+| [Optimize GitLab and GitLab Runner for large repositories](large_repositories/index.md) | Recommended strategies for handling large repositories. |
+| [`.gitlab-ci.yml` full reference](yaml/index.md) | All the attributes you can use with GitLab CI/CD. |
Certain operations can only be performed according to the
[user](../user/permissions.md#gitlab-cicd-permissions) and [job](../user/permissions.md#job-permissions) permissions.
@@ -76,39 +76,36 @@ Certain operations can only be performed according to the
GitLab CI/CD features, grouped by DevOps stage, include:
-| Feature | Description |
-|:------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------|
-| **Configure** | |
-| [Auto DevOps](../topics/autodevops/index.md) | Set up your app's entire lifecycle. |
-| [ChatOps](chatops/index.md) | Trigger CI jobs from chat, with results sent back to the channel. |
-| [Connect to cloud services](cloud_services/index.md) | Connect to cloud providers using OpenID Connect (OIDC) to retrieve temporary credentials to access services or secrets. |
-|-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------|
-| **Verify** | |
-| [Browser Performance Testing](../user/project/merge_requests/browser_performance_testing.md) | Quickly determine the browser performance impact of pending code changes. |
-| [Load Performance Testing](../user/project/merge_requests/load_performance_testing.md) | Quickly determine the server performance impact of pending code changes. |
-| [CI services](services/index.md) | Link Docker containers with your base image. |
-| [GitLab CI/CD for external repositories](ci_cd_for_external_repos/index.md) **(PREMIUM)** | Get the benefits of GitLab CI/CD combined with repositories in GitHub and Bitbucket Cloud. |
-| [Interactive Web Terminals](interactive_web_terminal/index.md) | Open an interactive web terminal to debug the running jobs. |
-| [Review Apps](review_apps/index.md) | Configure GitLab CI/CD to preview code changes. |
-| [Unit test reports](unit_test_reports.md) | Identify test failures directly on merge requests. |
-| [Using Docker images](docker/using_docker_images.md) | Use GitLab and GitLab Runner with Docker to build and test applications. |
-|-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------|
-| **Release** | |
-| [Auto Deploy](../topics/autodevops/stages.md#auto-deploy) | Deploy your application to a production environment in a Kubernetes cluster. |
-| [Building Docker images](docker/using_docker_build.md) | Maintain Docker-based projects using GitLab CI/CD. |
-| [Canary Deployments](../user/project/canary_deployments.md) | Ship features to only a portion of your pods and let a percentage of your user base to visit the temporarily deployed feature. |
-| [Deploy boards](../user/project/deploy_boards.md) | Check the current health and status of each CI/CD environment running on Kubernetes. |
-| [Feature Flags](../operations/feature_flags.md) | Deploy your features behind Feature Flags. |
-| [GitLab Pages](../user/project/pages/index.md) | Deploy static websites. |
-| [GitLab Releases](../user/project/releases/index.md) | Add release notes to Git tags. |
-| [Cloud deployment](cloud_deployment/index.md) | Deploy your application to a main cloud provider. |
-|-------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------|
-| **Secure** | |
-| [Code Quality](../user/project/merge_requests/code_quality.md) | Analyze your source code quality. |
-| [Container Scanning](../user/application_security/container_scanning/index.md) **(ULTIMATE)** | Check your Docker containers for known vulnerabilities. |
-| [Dependency Scanning](../user/application_security/dependency_scanning/index.md) **(ULTIMATE)** | Analyze your dependencies for known vulnerabilities. |
-| [License Compliance](../user/compliance/license_compliance/index.md) **(ULTIMATE)** | Search your project dependencies for their licenses. |
-| [Security Test reports](../user/application_security/index.md) **(ULTIMATE)** | Check for app vulnerabilities. |
+| Feature | Description |
+|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------|
+| **Configure** | |
+| [Auto DevOps](../topics/autodevops/index.md) | Set up your app's entire lifecycle. |
+| [ChatOps](chatops/index.md) | Trigger CI jobs from chat, with results sent back to the channel. |
+| [Connect to cloud services](cloud_services/index.md) | Connect to cloud providers using OpenID Connect (OIDC) to retrieve temporary credentials to access services or secrets. |
+| **Verify** | |
+| [Browser Performance Testing](../user/project/merge_requests/browser_performance_testing.md) | Quickly determine the browser performance impact of pending code changes. |
+| [Load Performance Testing](../user/project/merge_requests/load_performance_testing.md) | Quickly determine the server performance impact of pending code changes. |
+| [CI services](services/index.md) | Link Docker containers with your base image. |
+| [GitLab CI/CD for external repositories](ci_cd_for_external_repos/index.md) | Get the benefits of GitLab CI/CD combined with repositories in GitHub and Bitbucket Cloud. |
+| [Interactive Web Terminals](interactive_web_terminal/index.md) | Open an interactive web terminal to debug the running jobs. |
+| [Review Apps](review_apps/index.md) | Configure GitLab CI/CD to preview code changes. |
+| [Unit test reports](unit_test_reports.md) | Identify test failures directly on merge requests. |
+| [Using Docker images](docker/using_docker_images.md) | Use GitLab and GitLab Runner with Docker to build and test applications. |
+| **Release** | |
+| [Auto Deploy](../topics/autodevops/stages.md#auto-deploy) | Deploy your application to a production environment in a Kubernetes cluster. |
+| [Building Docker images](docker/using_docker_build.md) | Maintain Docker-based projects using GitLab CI/CD. |
+| [Canary Deployments](../user/project/canary_deployments.md) | Ship features to only a portion of your pods and let a percentage of your user base to visit the temporarily deployed feature. |
+| [Deploy boards](../user/project/deploy_boards.md) | Check the current health and status of each CI/CD environment running on Kubernetes. |
+| [Feature Flags](../operations/feature_flags.md) | Deploy your features behind Feature Flags. |
+| [GitLab Pages](../user/project/pages/index.md) | Deploy static websites. |
+| [GitLab Releases](../user/project/releases/index.md) | Add release notes to Git tags. |
+| [Cloud deployment](cloud_deployment/index.md) | Deploy your application to a main cloud provider. |
+| **Secure** | |
+| [Code Quality](../user/project/merge_requests/code_quality.md) | Analyze your source code quality. |
+| [Container Scanning](../user/application_security/container_scanning/index.md) | Check your Docker containers for known vulnerabilities. |
+| [Dependency Scanning](../user/application_security/dependency_scanning/index.md) | Analyze your dependencies for known vulnerabilities. |
+| [License Compliance](../user/compliance/license_compliance/index.md) | Search your project dependencies for their licenses. |
+| [Security Test reports](../user/application_security/index.md) | Check for app vulnerabilities. |
## Examples
diff --git a/lib/gitlab/i18n.rb b/lib/gitlab/i18n.rb
index d01f7d0074f..8b775d567c8 100644
--- a/lib/gitlab/i18n.rb
+++ b/lib/gitlab/i18n.rb
@@ -43,27 +43,27 @@ module Gitlab
TRANSLATION_LEVELS = {
'bg' => 0,
'cs_CZ' => 0,
- 'da_DK' => 46,
- 'de' => 15,
+ 'da_DK' => 44,
+ 'de' => 14,
'en' => 100,
'eo' => 0,
- 'es' => 40,
+ 'es' => 39,
'fil_PH' => 0,
- 'fr' => 11,
+ 'fr' => 10,
'gl_ES' => 0,
'id_ID' => 0,
- 'it' => 2,
+ 'it' => 1,
'ja' => 34,
'ko' => 12,
- 'nb_NO' => 30,
+ 'nb_NO' => 29,
'nl_NL' => 0,
'pl_PL' => 4,
- 'pt_BR' => 49,
- 'ro_RO' => 22,
- 'ru' => 32,
- 'tr_TR' => 14,
- 'uk' => 48,
- 'zh_CN' => 95,
+ 'pt_BR' => 50,
+ 'ro_RO' => 36,
+ 'ru' => 31,
+ 'tr_TR' => 13,
+ 'uk' => 46,
+ 'zh_CN' => 97,
'zh_HK' => 2,
'zh_TW' => 2
}.freeze
diff --git a/qa/qa/fixtures/package_managers/npm/npm_upload_install_package_project.yaml.erb b/qa/qa/fixtures/package_managers/npm/npm_upload_install_package_project.yaml.erb
index 8d94d03ef9b..5f2ff31b318 100644
--- a/qa/qa/fixtures/package_managers/npm/npm_upload_install_package_project.yaml.erb
+++ b/qa/qa/fixtures/package_managers/npm/npm_upload_install_package_project.yaml.erb
@@ -16,6 +16,7 @@ deploy:
install:
stage: install
script:
+ - echo "//${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=<%= auth_token %>">.npmrc
- "npm config set @<%= registry_scope %>:registry <%= gitlab_address_with_port %>/api/v4/projects/${CI_PROJECT_ID}/packages/npm/"
- "npm install <%= package.name %>"
cache:
diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/composer_registry_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/composer_registry_spec.rb
index 2da0f6a0cf8..d5ef9dce10d 100644
--- a/qa/qa/specs/features/browser_ui/5_package/package_registry/composer_registry_spec.rb
+++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/composer_registry_spec.rb
@@ -8,6 +8,7 @@ module QA
let(:project) do
Resource::Project.fabricate_via_api! do |project|
project.name = 'composer-package-project'
+ project.visibility = :private
end
end
diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/conan_repository_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/conan_repository_spec.rb
index 22495796605..1840ae4e7f8 100644
--- a/qa/qa/specs/features/browser_ui/5_package/package_registry/conan_repository_spec.rb
+++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/conan_repository_spec.rb
@@ -12,6 +12,7 @@ module QA
let(:project) do
Resource::Project.fabricate_via_api! do |project|
project.name = 'conan-package-project'
+ project.visibility = :private
end
end
diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/generic_repository_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/generic_repository_spec.rb
index 71acc3a8f92..e37102c17f7 100644
--- a/qa/qa/specs/features/browser_ui/5_package/package_registry/generic_repository_spec.rb
+++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/generic_repository_spec.rb
@@ -8,6 +8,7 @@ module QA
let(:project) do
Resource::Project.fabricate_via_api! do |project|
project.name = 'generic-package-project'
+ project.visibility = :private
end
end
diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/npm/npm_project_level_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/npm/npm_project_level_spec.rb
index 25d53a8add5..5ebcb94d0d0 100644
--- a/qa/qa/specs/features/browser_ui/5_package/package_registry/npm/npm_project_level_spec.rb
+++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/npm/npm_project_level_spec.rb
@@ -35,6 +35,7 @@ module QA
let!(:project) do
Resource::Project.fabricate_via_api! do |project|
project.name = 'npm-project-level'
+ project.visibility = :private
end
end
diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/pypi_repository_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/pypi_repository_spec.rb
index 513894d8474..4614eced300 100644
--- a/qa/qa/specs/features/browser_ui/5_package/package_registry/pypi_repository_spec.rb
+++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/pypi_repository_spec.rb
@@ -9,6 +9,7 @@ module QA
let(:project) do
Resource::Project.fabricate_via_api! do |project|
project.name = 'pypi-package-project'
+ project.visibility = :private
end
end
diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/rubygems_registry_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/rubygems_registry_spec.rb
index b2208dc644c..4a811363a83 100644
--- a/qa/qa/specs/features/browser_ui/5_package/package_registry/rubygems_registry_spec.rb
+++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/rubygems_registry_spec.rb
@@ -8,6 +8,7 @@ module QA
let(:project) do
Resource::Project.fabricate_via_api! do |project|
project.name = 'rubygems-package-project'
+ project.visibility = :private
end
end
diff --git a/qa/spec/specs/helpers/feature_flag_spec.rb b/qa/spec/specs/helpers/feature_flag_spec.rb
index b1d83dcdbe6..a1300ecf073 100644
--- a/qa/spec/specs/helpers/feature_flag_spec.rb
+++ b/qa/spec/specs/helpers/feature_flag_spec.rb
@@ -53,10 +53,14 @@ RSpec.describe QA::Specs::Helpers::FeatureFlag do
it_behaves_like 'runs with given feature flag metadata', { name: 'no_scope_ff' }
it 'is skipped if quarantine tag is also applied' do
- group = describe_successfully 'Feature flag with no scope', feature_flag: { name: 'quarantine_with_ff' }, quarantine: {
- issue: 'https://gitlab.com/test-group/test/-/issues/123',
- type: 'bug'
- } do
+ group = describe_successfully(
+ 'Feature flag with no scope',
+ feature_flag: { name: 'quarantine_with_ff' },
+ quarantine: {
+ issue: 'https://gitlab.com/test-group/test/-/issues/123',
+ type: 'bug'
+ }
+ ) do
it('is skipped') {}
end
@@ -74,7 +78,11 @@ RSpec.describe QA::Specs::Helpers::FeatureFlag do
end
it 'is skipped for that job' do
- group = describe_successfully 'Test should be skipped', feature_flag: { name: 'skip_job_ff' }, except: { job: 'job-to-skip' } do
+ group = describe_successfully(
+ 'Test should be skipped',
+ feature_flag: { name: 'skip_job_ff' },
+ except: { job: 'job-to-skip' }
+ ) do
it('does not run on staging in specified job') {}
end
@@ -88,7 +96,11 @@ RSpec.describe QA::Specs::Helpers::FeatureFlag do
end
it 'is run for that job' do
- group = describe_successfully 'Test should run', feature_flag: { name: 'run_job_ff' }, only: { job: 'job-to-run' } do
+ group = describe_successfully(
+ 'Test should run',
+ feature_flag: { name: 'run_job_ff' },
+ only: { job: 'job-to-run' }
+ ) do
it('runs on staging in specified job') {}
end
@@ -96,7 +108,11 @@ RSpec.describe QA::Specs::Helpers::FeatureFlag do
end
it 'skips if test is set to only run in a job different from current CI job' do
- group = describe_successfully 'Test should be skipped', feature_flag: { name: 'skip_job_ff' }, only: { job: 'other-job' } do
+ group = describe_successfully(
+ 'Test should be skipped',
+ feature_flag: { name: 'skip_job_ff' },
+ only: { job: 'other-job' }
+ ) do
it('does not run on staging in specified job') {}
end
diff --git a/spec/frontend/design_management/components/design_notes/__snapshots__/design_note_spec.js.snap b/spec/frontend/design_management/components/design_notes/__snapshots__/design_note_spec.js.snap
index 4ecf82a4714..402e55347af 100644
--- a/spec/frontend/design_management/components/design_notes/__snapshots__/design_note_spec.js.snap
+++ b/spec/frontend/design_management/components/design_notes/__snapshots__/design_note_spec.js.snap
@@ -5,16 +5,19 @@ exports[`Design note component should match the snapshot 1`] = `
class="design-note note-form"
id="note_123"
>
- <user-avatar-link-stub
- imgalt="foo-bar"
- imgcssclasses=""
- imgsize="40"
- imgsrc=""
- linkhref=""
- tooltipplacement="top"
- tooltiptext=""
- username=""
- />
+ <gl-avatar-link-stub
+ class="gl-float-left gl-mr-3"
+ href="https://gitlab.com/user"
+ >
+ <gl-avatar-stub
+ alt="avatar"
+ entityid="0"
+ entityname="foo-bar"
+ shape="circle"
+ size="32"
+ src="https://gitlab.com/avatar"
+ />
+ </gl-avatar-link-stub>
<div
class="gl-display-flex gl-justify-content-space-between"
@@ -22,8 +25,10 @@ exports[`Design note component should match the snapshot 1`] = `
<div>
<gl-link-stub
class="js-user-link"
+ data-testid="user-link"
data-user-id="1"
data-username="foo-bar"
+ href="https://gitlab.com/user"
>
<span
class="note-header-author-name gl-font-weight-bold"
@@ -69,8 +74,9 @@ exports[`Design note component should match the snapshot 1`] = `
</div>
<div
- class="note-text js-note-text md"
+ class="note-text md"
data-qa-selector="note_content"
+ data-testid="note-text"
/>
</timeline-entry-item-stub>
diff --git a/spec/frontend/design_management/components/design_notes/design_note_spec.js b/spec/frontend/design_management/components/design_notes/design_note_spec.js
index 35fd1273270..93a3e4e4fd7 100644
--- a/spec/frontend/design_management/components/design_notes/design_note_spec.js
+++ b/spec/frontend/design_management/components/design_notes/design_note_spec.js
@@ -1,10 +1,10 @@
-import { shallowMount } from '@vue/test-utils';
import { ApolloMutation } from 'vue-apollo';
import { nextTick } from 'vue';
+import { GlAvatar, GlAvatarLink } from '@gitlab/ui';
+import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import DesignNote from '~/design_management/components/design_notes/design_note.vue';
import DesignReplyForm from '~/design_management/components/design_notes/design_reply_form.vue';
import TimeAgoTooltip from '~/vue_shared/components/time_ago_tooltip.vue';
-import UserAvatarLink from '~/vue_shared/components/user_avatar/user_avatar_link.vue';
const scrollIntoViewMock = jest.fn();
const note = {
@@ -12,6 +12,8 @@ const note = {
author: {
id: 'gid://gitlab/User/1',
username: 'foo-bar',
+ avatarUrl: 'https://gitlab.com/avatar',
+ webUrl: 'https://gitlab.com/user',
},
body: 'test',
userPermissions: {
@@ -30,14 +32,15 @@ const mutate = jest.fn().mockResolvedValue({ data: { updateNote: {} } });
describe('Design note component', () => {
let wrapper;
- const findUserAvatar = () => wrapper.find(UserAvatarLink);
- const findUserLink = () => wrapper.find('.js-user-link');
- const findReplyForm = () => wrapper.find(DesignReplyForm);
- const findEditButton = () => wrapper.find('.js-note-edit');
- const findNoteContent = () => wrapper.find('.js-note-text');
+ const findUserAvatar = () => wrapper.findComponent(GlAvatar);
+ const findUserAvatarLink = () => wrapper.findComponent(GlAvatarLink);
+ const findUserLink = () => wrapper.findByTestId('user-link');
+ const findReplyForm = () => wrapper.findComponent(DesignReplyForm);
+ const findEditButton = () => wrapper.findByTestId('note-edit');
+ const findNoteContent = () => wrapper.findByTestId('note-text');
function createComponent(props = {}, data = { isEditing: false }) {
- wrapper = shallowMount(DesignNote, {
+ wrapper = shallowMountExtended(DesignNote, {
propsData: {
note: {},
...props,
@@ -71,12 +74,24 @@ describe('Design note component', () => {
expect(wrapper.element).toMatchSnapshot();
});
- it('should render an author', () => {
+ it('should render avatar with correct props', () => {
+ createComponent({
+ note,
+ });
+
+ expect(findUserAvatar().props()).toMatchObject({
+ src: note.author.avatarUrl,
+ entityName: note.author.username,
+ });
+
+ expect(findUserAvatarLink().attributes('href')).toBe(note.author.webUrl);
+ });
+
+ it('should render author details', () => {
createComponent({
note,
});
- expect(findUserAvatar().exists()).toBe(true);
expect(findUserLink().exists()).toBe(true);
});
diff --git a/spec/frontend/fixtures/sessions.rb b/spec/frontend/fixtures/sessions.rb
index a84a56e4d01..bb73bf3215c 100644
--- a/spec/frontend/fixtures/sessions.rb
+++ b/spec/frontend/fixtures/sessions.rb
@@ -12,7 +12,6 @@ RSpec.describe 'Sessions (JavaScript fixtures)' do
before do
set_devise_mapping(context: @request)
- allow(controller).to receive(:arkose_labs_enabled?).and_return(true)
end
it 'sessions/new.html' do
diff --git a/spec/frontend/shortcuts_spec.js b/spec/frontend/shortcuts_spec.js
index 49148123a1c..8b9a11056f2 100644
--- a/spec/frontend/shortcuts_spec.js
+++ b/spec/frontend/shortcuts_spec.js
@@ -41,7 +41,7 @@ describe('Shortcuts', () => {
).toHaveBeenCalled();
});
- it('focues preview button inside edit comment form', () => {
+ it('focuses preview button inside edit comment form', () => {
document.querySelector('.js-note-edit').click();
Shortcuts.toggleMarkdownPreview(
diff --git a/spec/services/ci/job_artifacts/destroy_batch_service_spec.rb b/spec/services/ci/job_artifacts/destroy_batch_service_spec.rb
index 67d664a617b..5e77041a632 100644
--- a/spec/services/ci/job_artifacts/destroy_batch_service_spec.rb
+++ b/spec/services/ci/job_artifacts/destroy_batch_service_spec.rb
@@ -3,7 +3,7 @@
require 'spec_helper'
RSpec.describe Ci::JobArtifacts::DestroyBatchService do
- let(:artifacts) { Ci::JobArtifact.where(id: [artifact_with_file.id, artifact_without_file.id]) }
+ let(:artifacts) { Ci::JobArtifact.where(id: [artifact_with_file.id, artifact_without_file.id, trace_artifact.id]) }
let(:service) { described_class.new(artifacts, pick_up_at: Time.current) }
let_it_be(:artifact_with_file, refind: true) do
@@ -18,6 +18,10 @@ RSpec.describe Ci::JobArtifacts::DestroyBatchService do
create(:ci_job_artifact)
end
+ let_it_be(:trace_artifact, refind: true) do
+ create(:ci_job_artifact, :trace, :expired)
+ end
+
describe '.execute' do
subject(:execute) { service.execute }
@@ -42,6 +46,12 @@ RSpec.describe Ci::JobArtifacts::DestroyBatchService do
execute
end
+ it 'preserves trace artifacts and removes any timestamp' do
+ expect { subject }
+ .to change { trace_artifact.reload.expire_at }.from(trace_artifact.expire_at).to(nil)
+ .and not_change { Ci::JobArtifact.exists?(trace_artifact.id) }
+ end
+
context 'ProjectStatistics' do
it 'resets project statistics' do
expect(ProjectStatistics).to receive(:increment_statistic).once
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 1e137ad6fc2..32745532d1d 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -329,6 +329,10 @@ RSpec.configure do |config|
stub_feature_flags(disable_anonymous_search: false)
stub_feature_flags(disable_anonymous_project_search: false)
+ # Specs should not get a CAPTCHA challenge by default, this makes the sign-in flow simpler in
+ # most cases. We do test the CAPTCHA flow in the appropriate specs.
+ stub_feature_flags(arkose_labs_login_challenge: false)
+
allow(Gitlab::GitalyClient).to receive(:can_use_disk?).and_return(enable_rugged)
else
unstub_all_feature_flags
diff --git a/spec/views/devise/sessions/new.html.haml_spec.rb b/spec/views/devise/sessions/new.html.haml_spec.rb
index 1cbef9538be..e8232a2c067 100644
--- a/spec/views/devise/sessions/new.html.haml_spec.rb
+++ b/spec/views/devise/sessions/new.html.haml_spec.rb
@@ -9,7 +9,6 @@ RSpec.describe 'devise/sessions/new' do
before do
stub_devise
disable_captcha
- allow(view).to receive(:arkose_labs_enabled?).and_return(false)
allow(Gitlab).to receive(:com?).and_return(true)
end
diff --git a/spec/views/devise/shared/_signin_box.html.haml_spec.rb b/spec/views/devise/shared/_signin_box.html.haml_spec.rb
index 8488a786bdd..8b1af1866dc 100644
--- a/spec/views/devise/shared/_signin_box.html.haml_spec.rb
+++ b/spec/views/devise/shared/_signin_box.html.haml_spec.rb
@@ -11,7 +11,6 @@ RSpec.describe 'devise/shared/_signin_box' do
allow(view).to receive(:captcha_enabled?).and_return(false)
allow(view).to receive(:captcha_on_login_required?).and_return(false)
allow(view).to receive(:experiment_enabled?).and_return(false)
- allow(view).to receive(:arkose_labs_enabled?).and_return(false)
end
it 'is shown when Crowd is enabled' do