Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2024-11-01 15:24:07 +00:00
parent c702311a6e
commit 7a8b152ddf
37 changed files with 397 additions and 99 deletions

View File

@ -228,6 +228,7 @@ variables:
RETRY_FAILED_TESTS_IN_NEW_PROCESS: "true"
# Run with decomposed databases by default
DECOMPOSED_DB: "true"
SEC_DECOMPOSED_DB: "false"
DOCS_REVIEW_APPS_DOMAIN: "docs.gitlab-review.app"
DOCS_GITLAB_REPO_SUFFIX: "ee"

View File

@ -31,6 +31,36 @@ db:backup_and_restore single-db-ci-connection:
- .single-db-ci-connection
- .rails:rules:db-backup
db:rollback single-db-sec-connection:
extends:
- db:rollback
- .single-db-sec-connection
- .rails:rules:single-db-sec-connection
db:migrate:reset single-db-sec-connection:
extends:
- db:migrate:reset
- .single-db-sec-connection
- .rails:rules:single-db-sec-connection
db:check-schema-single-db-sec-connection:
extends:
- db:check-schema
- .single-db-sec-connection
- .rails:rules:single-db-sec-connection
db:post_deployment_migrations_validator-single-db-sec-connection:
extends:
- db:post_deployment_migrations_validator
- .single-db-sec-connection
- .rails:rules:db:check-migrations-single-db-sec-connection
db:backup_and_restore single-db-sec-connection:
extends:
- db:backup_and_restore
- .single-db-sec-connection
- .rails:rules:db-backup
db:rollback:
extends:
- .db-job-base

View File

@ -195,6 +195,13 @@ rspec unit pg14 single-db-ci-connection:
- .rspec-unit-parallel
- .rails:rules:single-db-ci-connection
rspec unit pg14 single-db-sec-connection:
extends:
- rspec unit pg14
- .single-db-sec-connection-rspec
- .rspec-unit-parallel
- .rails:rules:single-db-sec-connection
rspec unit pg14 praefect:
extends:
- rspec unit pg14
@ -229,6 +236,13 @@ rspec integration pg14 single-db-ci-connection:
- .rspec-integration-parallel
- .rails:rules:single-db-ci-connection
rspec integration pg14 single-db-sec-connection:
extends:
- rspec integration pg14
- .single-db-sec-connection-rspec
- .rspec-integration-parallel
- .rails:rules:single-db-sec-connection
rspec integration pg14 praefect:
extends:
- rspec integration pg14
@ -265,6 +279,15 @@ rspec system pg14 single-db-ci-connection:
- .rspec-system-parallel
- .rails:rules:single-db-ci-connection
- .rails:rules:single-db
rspec system pg14 single-db-sec-connection:
extends:
- rspec system pg14
- .single-db-sec-connection-rspec
- .rspec-system-parallel
- .rails:rules:single-db-sec-connection
rspec system pg14 praefect:
extends:
- rspec system pg14
@ -818,6 +841,18 @@ rspec-ee background_migration pg14 single-db-ci-connection:
- .single-db-ci-connection-rspec
- .rails:rules:single-db-ci-connection-ee
rspec-ee migration pg14 single-db-sec-connection:
extends:
- rspec-ee migration pg14
- .single-db-sec-connection-rspec
- .rails:rules:single-db-sec-connection-ee
rspec-ee background_migration pg14 single-db-sec-connection:
extends:
- rspec-ee background_migration pg14
- .single-db-sec-connection-rspec
- .rails:rules:single-db-sec-connection-ee
rspec-ee migration pg14 praefect:
extends:
- rspec migration pg14
@ -864,6 +899,13 @@ rspec-ee unit pg14 single-db-ci-connection:
- .rspec-ee-unit-parallel
- .rails:rules:single-db-ci-connection-ee
rspec-ee unit pg14 single-db-sec-connection:
extends:
- rspec-ee unit pg14
- .single-db-sec-connection-rspec
- .rspec-ee-unit-parallel
- .rails:rules:single-db-sec-connection-ee
rspec-ee integration pg14:
extends:
- .rspec-ee-base-pg14
@ -896,6 +938,13 @@ rspec-ee integration pg14 single-db-ci-connection:
- .rspec-ee-integration-parallel
- .rails:rules:single-db-ci-connection-ee
rspec-ee integration pg14 single-db-sec-connection:
extends:
- rspec-ee integration pg14
- .single-db-sec-connection-rspec
- .rspec-ee-integration-parallel
- .rails:rules:single-db-sec-connection-ee
.custom-models-variables:
variables:
AIGW_CUSTOM_MODELS__ENABLED: true
@ -943,6 +992,13 @@ rspec-ee system pg14 single-db-ci-connection:
- .rspec-ee-system-parallel
- .rails:rules:single-db-ci-connection-ee
rspec-ee system pg14 single-db-sec-connection:
extends:
- rspec-ee system pg14
- .single-db-sec-connection-rspec
- .rspec-ee-system-parallel
- .rails:rules:single-db-sec-connection-ee
# EE: default refs (MRs, default branch, schedules) jobs #
##################################################

View File

@ -42,12 +42,20 @@ include:
variables:
CI_CONNECTION_DB: "true"
.single-db-sec-connection:
extends: .single-db
variables:
SEC_CONNECTION_DB: "true"
.single-db-rspec:
extends: .single-db
.single-db-ci-connection-rspec:
extends: .single-db-ci-connection
.single-db-sec-connection-rspec:
extends: .single-db-sec-connection
.praefect-with-db:
variables:
GITALY_PRAEFECT_WITH_DB: '1'

View File

@ -111,6 +111,9 @@
.if-merge-request-labels-run-single-db: &if-merge-request-labels-run-single-db
if: '($CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_EVENT_TYPE != "merge_train") && $CI_MERGE_REQUEST_LABELS =~ /pipeline:run-single-db/'
.if-merge-request-labels-sec-decomposition: &if-merge-request-labels-sec-decomposition
if: '($CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_EVENT_TYPE != "merge_train") && $CI_MERGE_REQUEST_LABELS =~ /sec-decomposition/'
.if-merge-request-labels-run-review-app: &if-merge-request-labels-run-review-app
if: '($CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_EVENT_TYPE != "merge_train") && $CI_MERGE_REQUEST_LABELS =~ /pipeline:run-review-app/'
@ -1963,6 +1966,30 @@
- <<: *if-merge-request
changes: *decomposed-db-models-patterns
.rails:rules:single-db-sec-connection:
rules:
- <<: *if-default-branch-schedule-nightly
- <<: *if-merge-request-labels-run-single-db
- <<: *if-merge-request-labels-sec-decomposition
- <<: *if-merge-request-labels-pipeline-expedite
when: never
- if: '$ENABLE_RSPEC_SINGLE_DB_SEC_CONNECTION == "true"'
- <<: *if-merge-request-not-approved
when: never
.rails:rules:single-db-sec-connection-ee:
rules:
- <<: *if-not-ee
when: never
- !reference [".rails:rules:single-db-sec-connection", "rules"]
.rails:rules:db:check-migrations-single-db-sec-connection:
rules:
- <<: *if-merge-request-labels-run-single-db
- <<: *if-merge-request-labels-sec-decomposition
- <<: *if-merge-request-labels-pipeline-expedite
when: never
.rails:rules:db:migrate:multi-version-upgrade:
rules:
- if: '$DISABLE_DB_MULTI_VERSION_UPGRADE =~ /true|yes|1/i'

View File

@ -2907,7 +2907,6 @@ Gitlab/BoundedContexts:
- 'ee/app/models/elastic/index_setting.rb'
- 'ee/app/models/elastic/migration_record.rb'
- 'ee/app/models/elastic/reindexing_slice.rb'
- 'ee/app/models/elastic/reindexing_task.rb'
- 'ee/app/models/elasticsearch_indexed_namespace.rb'
- 'ee/app/models/elasticsearch_indexed_project.rb'
- 'ee/app/models/embedding/application_record.rb'

View File

@ -31,7 +31,6 @@ Search/NamespacedClass:
- 'ee/app/models/elastic/index_setting.rb'
- 'ee/app/models/elastic/migration_record.rb'
- 'ee/app/models/elastic/reindexing_slice.rb'
- 'ee/app/models/elastic/reindexing_task.rb'
- 'ee/app/models/elasticsearch_indexed_namespace.rb'
- 'ee/app/models/elasticsearch_indexed_project.rb'
- 'ee/app/presenters/ee/search_service_presenter.rb'

View File

@ -421,7 +421,6 @@ Style/ClassAndModuleChildren:
- 'ee/app/models/dast/profile_schedule.rb'
- 'ee/app/models/ee/ci/job_artifact.rb'
- 'ee/app/models/elastic/reindexing_slice.rb'
- 'ee/app/models/elastic/reindexing_task.rb'
- 'ee/app/models/epic/metrics.rb'
- 'ee/app/models/epic/related_epic_link.rb'
- 'ee/app/models/geo/base_registry.rb'

View File

@ -1,10 +0,0 @@
---
# Cop supports --autocorrect.
Style/CombinableLoops:
Exclude:
- 'ee/db/fixtures/development/30_customizable_cycle_analytics.rb'
- 'ee/lib/gitlab/audit/events/preloader.rb'
- 'ee/spec/finders/snippets_finder_spec.rb'
- 'spec/features/merge_request/user_suggests_changes_on_diff_spec.rb'
- 'spec/finders/packages/group_packages_finder_spec.rb'
- 'spec/requests/api/members_spec.rb'

View File

@ -16,7 +16,7 @@ module Types
field :created_at, Types::TimeType, null: false, description: 'Date of creation.'
field :author, ::Types::UserType, null: false, description: 'User that created the model version.'
field :author, ::Types::UserType, null: true, description: 'User that created the model version.'
field :description, ::GraphQL::Types::String,
null: true,

View File

@ -11,7 +11,7 @@ module Ml
end
def author
model_version.package.creator
model_version.package&.creator
end
def path

View File

@ -0,0 +1,152 @@
#
# PRODUCTION
#
production:
main:
adapter: postgresql
encoding: unicode
database: gitlabhq_production
username: git
password: "secure password"
host: localhost
# load_balancing:
# hosts:
# - host1.example.com
# - host2.example.com
# discover:
# nameserver: 1.2.3.4
# port: 8600
# record: secondary.postgresql.service.consul
# interval: 300
ci:
adapter: postgresql
encoding: unicode
database: gitlabhq_production_ci
username: git
password: "secure password"
host: localhost
# load_balancing:
# hosts:
# - host1.example.com
# - host2.example.com
# discover:
# nameserver: 1.2.3.4
# port: 8600
# record: secondary-ci.postgresql.service.consul
# interval: 300
sec:
adapter: postgresql
encoding: unicode
database: gitlabhq_production_sec
username: git
password: "secure password"
host: localhost
# load_balancing:
# hosts:
# - host1.example.com
# - host2.example.com
# discover:
# nameserver: 1.2.3.4
# port: 8600
# record: secondary-sec.postgresql.service.consul
# interval: 300
geo:
adapter: postgresql
encoding: unicode
database: gitlabhq_geo_production
username: git
password: "secure password"
host: localhost
#
# Development specific
#
development:
main:
adapter: postgresql
encoding: unicode
database: gitlabhq_development
username: postgres
password: "secure password"
host: localhost
variables:
statement_timeout: 15s
ci:
adapter: postgresql
encoding: unicode
database: gitlabhq_development_ci
username: postgres
password: "secure password"
host: localhost
variables:
statement_timeout: 15s
sec:
adapter: postgresql
encoding: unicode
database: gitlabhq_development_sec
username: postgres
password: "secure password"
host: localhost
variables:
statement_timeout: 15s
geo:
adapter: postgresql
encoding: unicode
database: gitlabhq_geo_development
username: postgres
password: "secure password"
host: localhost
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test: &test
main:
adapter: postgresql
encoding: unicode
database: gitlabhq_test
username: postgres
password:
host: localhost
prepared_statements: false
reaping_frequency: nil
variables:
statement_timeout: 15s
ci:
adapter: postgresql
encoding: unicode
database: gitlabhq_test_ci
username: postgres
password:
host: localhost
prepared_statements: false
reaping_frequency: nil
variables:
statement_timeout: 15s
sec:
adapter: postgresql
encoding: unicode
database: gitlabhq_test_sec
username: postgres
password:
host: localhost
prepared_statements: false
reaping_frequency: nil
variables:
statement_timeout: 15s
geo:
adapter: postgresql
encoding: unicode
database: gitlabhq_geo_test
username: postgres
password:
host: localhost
reaping_frequency: nil
embedding:
adapter: postgresql
encoding: unicode
database: gitlabhq_embedding_test
username: postgres
password:
host: localhost
reaping_frequency: nil

View File

@ -0,0 +1,18 @@
---
description: Tracks Credit card validation errors as part of Identity Verification
action: failed_attempt
identifiers:
- user
product_group: anti-abuse
milestone: '15.9'
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169117
distributions:
- ce
- ee
tiers:
- free
- premium
- ultimate
additional_properties:
property:
description: Error message

View File

@ -1,7 +1,7 @@
---
table_name: elastic_reindexing_tasks
classes:
- Elastic::ReindexingTask
- Search::Elastic::ReindexingTask
feature_categories:
- global_search
description: TODO

View File

@ -11,7 +11,7 @@ class RequeueBackfillFindingIdInVulnerabilities3 < Gitlab::Database::Migration[2
restrict_gitlab_migration gitlab_schema: :gitlab_main
def up
Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas.with_suppressed do
Gitlab::Database::QueryAnalyzers::Base.suppress_schema_issues_for_decomposed_tables do
delete_batched_background_migration(
MIGRATION,
:vulnerabilities,
@ -31,7 +31,7 @@ class RequeueBackfillFindingIdInVulnerabilities3 < Gitlab::Database::Migration[2
end
def down
Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas.with_suppressed do
Gitlab::Database::QueryAnalyzers::Base.suppress_schema_issues_for_decomposed_tables do
delete_batched_background_migration(MIGRATION, :vulnerabilities, :id, [])
end
end

View File

@ -12,7 +12,7 @@ class Requeue2BackfillHasRemediationsOfVulnerabilityReads < Gitlab::Database::Mi
disable_ddl_transaction!
def up
Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas.with_suppressed do
Gitlab::Database::QueryAnalyzers::Base.suppress_schema_issues_for_decomposed_tables do
# remove the original migration
delete_batched_background_migration(MIGRATION, :vulnerability_reads, :vulnerability_id, [])
@ -28,7 +28,7 @@ class Requeue2BackfillHasRemediationsOfVulnerabilityReads < Gitlab::Database::Mi
end
def down
Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas.with_suppressed do
Gitlab::Database::QueryAnalyzers::Base.suppress_schema_issues_for_decomposed_tables do
delete_batched_background_migration(MIGRATION, :vulnerability_reads, :vulnerability_id, [])
end
end

View File

@ -11,7 +11,7 @@ class QueueDropVulnerabilitiesWithoutFindingId < Gitlab::Database::Migration[2.2
restrict_gitlab_migration gitlab_schema: :gitlab_main
def up
Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas.with_suppressed do
Gitlab::Database::QueryAnalyzers::Base.suppress_schema_issues_for_decomposed_tables do
queue_batched_background_migration(
MIGRATION,
:vulnerabilities,
@ -24,7 +24,7 @@ class QueueDropVulnerabilitiesWithoutFindingId < Gitlab::Database::Migration[2.2
end
def down
Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas.with_suppressed do
Gitlab::Database::QueryAnalyzers::Base.suppress_schema_issues_for_decomposed_tables do
delete_batched_background_migration(MIGRATION, :vulnerabilities, :id, [])
end
end

View File

@ -10,7 +10,7 @@ class DropInvalidVulnerabilitiesGdk < Gitlab::Database::Migration[2.2]
end
def up
Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas.with_suppressed do
Gitlab::Database::QueryAnalyzers::Base.suppress_schema_issues_for_decomposed_tables do
Vulnerability.where(finding_id: nil).delete_all if Gitlab.dev_or_test_env?
end
end

View File

@ -8,13 +8,13 @@ class BackfillVulnerabilityFeedbackPipelineIdBigint < Gitlab::Database::Migratio
COLUMN = :pipeline_id
def up
Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas.with_suppressed do
Gitlab::Database::QueryAnalyzers::Base.suppress_schema_issues_for_decomposed_tables do
backfill_conversion_of_integer_to_bigint(TABLE, COLUMN)
end
end
def down
Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas.with_suppressed do
Gitlab::Database::QueryAnalyzers::Base.suppress_schema_issues_for_decomposed_tables do
revert_backfill_conversion_of_integer_to_bigint(TABLE, COLUMN)
end
end

View File

@ -12,7 +12,7 @@ class QueueFixCorruptedScannerIdsOfVulnerabilityReads < Gitlab::Database::Migrat
restrict_gitlab_migration gitlab_schema: :gitlab_main
def up
Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas.with_suppressed do
Gitlab::Database::QueryAnalyzers::Base.suppress_schema_issues_for_decomposed_tables do
queue_batched_background_migration(
MIGRATION,
:vulnerability_reads,
@ -25,7 +25,7 @@ class QueueFixCorruptedScannerIdsOfVulnerabilityReads < Gitlab::Database::Migrat
end
def down
Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas.with_suppressed do
Gitlab::Database::QueryAnalyzers::Base.suppress_schema_issues_for_decomposed_tables do
delete_batched_background_migration(MIGRATION, :vulnerability_reads, :id, [])
end
end

View File

@ -11,7 +11,7 @@ class RequeueBackfillArchivedAndTraversalIdsToVulnerabilityReads < Gitlab::Datab
SUB_BATCH_SIZE = 100
def up
Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas.with_suppressed do
Gitlab::Database::QueryAnalyzers::Base.suppress_schema_issues_for_decomposed_tables do
# Clear previous background migration execution from QueueBackfillArchivedAndTraversalIdsToVulnerabilityReads
delete_batched_background_migration(MIGRATION, :vulnerability_reads, :id, [])
@ -27,7 +27,7 @@ class RequeueBackfillArchivedAndTraversalIdsToVulnerabilityReads < Gitlab::Datab
end
def down
Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas.with_suppressed do
Gitlab::Database::QueryAnalyzers::Base.suppress_schema_issues_for_decomposed_tables do
delete_batched_background_migration(MIGRATION, :vulnerability_reads, :id, [])
end
end

View File

@ -28808,7 +28808,7 @@ Version of a machine learning model.
| ---- | ---- | ----------- |
| <a id="mlmodelversion_links"></a>`_links` | [`MLModelVersionLinks!`](#mlmodelversionlinks) | Map of links to perform actions on the model version. |
| <a id="mlmodelversionartifactscount"></a>`artifactsCount` | [`Int`](#int) | Number of files in the package. |
| <a id="mlmodelversionauthor"></a>`author` | [`UserCore!`](#usercore) | User that created the model version. |
| <a id="mlmodelversionauthor"></a>`author` | [`UserCore`](#usercore) | User that created the model version. |
| <a id="mlmodelversioncandidate"></a>`candidate` | [`MlCandidate!`](#mlcandidate) | Metrics, params and metadata for the model version. |
| <a id="mlmodelversioncreatedat"></a>`createdAt` | [`Time!`](#time) | Date of creation. |
| <a id="mlmodelversiondescription"></a>`description` | [`String`](#string) | Description of the version. |

View File

@ -815,7 +815,7 @@ Links help the docs adhere to the
However, you should avoid putting too many links on any page. Too many links can hinder readability.
- Do not duplicate links on the same page. For example, on **Page A**, do not link to **Page B** multiple times.
- Do not use links in headings. Subheadings are rendered as links, and subheadings that contain links cause errors.
- Do not use links in headings. Headings that contain links cause errors.
- Avoid multiple links in a single paragraph.
- Avoid multiple links in a single task.
- On any one page, try not to use more than 15 links to other pages.

View File

@ -27,8 +27,10 @@ const extendConfigs = [
// Allowing JiHu to add rules on their side since the update from
// eslintrc.yml to eslint.config.mjs is not allowing subdirectory
// rewrite.
let jhConfigs = [];
if (existsSync(path.resolve(dirname, 'jh'))) {
extendConfigs.push('./jh/eslint.config.js');
// eslint-disable-next-line import/no-unresolved, import/extensions
jhConfigs = (await import('jh/eslint.config.js')).default;
}
const jestConfig = {
@ -690,4 +692,5 @@ export default [
'@gitlab/require-i18n-strings': 'off',
},
},
...jhConfigs,
];

View File

@ -33,6 +33,19 @@ module Gitlab
attr_writer :suppress_in_rspec
end
# During database decomposition, db migrations using tables that will be decomposed
# will begin to contravene their configuration for intended gitlab_schema and database connection.
# As these migrations already exist, ideally they should be finalized and removed prior to decomposition.
# In this situations, it's necessary to suppress warnings related to their incorrect connection and schema
# to progress our CI pipelines.
def self.suppress_schema_issues_for_decomposed_tables
Gitlab::Database::QueryAnalyzers::RestrictAllowedSchemas.with_suppressed do
Gitlab::Database::QueryAnalyzers::GitlabSchemasValidateConnection.with_suppressed do
yield
end
end
end
def self.with_suppressed(value = true, &blk)
previous = self.suppressed?
self.suppress = value

View File

@ -35353,6 +35353,24 @@ msgstr ""
msgid "MrList|Review requested from %{name}"
msgstr ""
msgid "MrReports|All reports"
msgstr ""
msgid "MrReports|Blockers"
msgstr ""
msgid "MrReports|Code quality"
msgstr ""
msgid "MrReports|License Compliance"
msgstr ""
msgid "MrReports|Reports"
msgstr ""
msgid "MrReports|Security"
msgstr ""
msgid "MrSurvey|By continuing, you acknowledge that responses will be used to improve GitLab and in accordance with the %{linkStart}GitLab Privacy Policy%{linkEnd}."
msgstr ""

View File

@ -75,7 +75,7 @@
"@gitlab/fonts": "^1.3.0",
"@gitlab/query-language": "^0.0.5-a-20241017",
"@gitlab/svgs": "3.120.0",
"@gitlab/ui": "101.4.0",
"@gitlab/ui": "101.6.1",
"@gitlab/web-ide": "^0.0.1-dev-20240909013227",
"@mattiasbuelens/web-streams-adapter": "^0.1.0",
"@rails/actioncable": "7.0.8-4",

View File

@ -142,8 +142,13 @@ function assets_compile_script() {
function setup_database_yml() {
if [ "$DECOMPOSED_DB" == "true" ]; then
echo "Using decomposed database config (config/database.yml.decomposed-postgresql)"
cp config/database.yml.decomposed-postgresql config/database.yml
if [ "$SEC_DECOMPOSED_DB" == "true" ]; then
echo "Using SEC decomposed database config (config/database.yml.decomposed-sec-postgresql)"
cp config/database.yml.decomposed-sec-postgresql config/database.yml
else
echo "Using decomposed database config (config/database.yml.decomposed-postgresql)"
cp config/database.yml.decomposed-postgresql config/database.yml
fi
else
echo "Using two connections, single database config (config/database.yml.postgresql)"
cp config/database.yml.postgresql config/database.yml

View File

@ -135,6 +135,7 @@ RSpec.describe 'User comments on a diff', :js, feature_category: :code_review_wo
end
it 'can add and remove suggestions from a batch' do
# rubocop:disable Style/CombinableLoops -- "Add suggestion to batch" only exists with more than one suggestion
files.each_with_index do |file, index|
page.within("[id='#{file[:hash]}']") do
find('.js-diff-more-actions').click
@ -166,6 +167,7 @@ RSpec.describe 'User comments on a diff', :js, feature_category: :code_review_wo
expect(page).to have_content("Apply #{index + 1} suggestions")
end
end
# rubocop:enable Style/CombinableLoops
end
page.within("[id='#{files[0][:hash]}']") do

View File

@ -4,7 +4,7 @@ require 'spec_helper'
RSpec.describe 'Navigation menu item pinning', :js, feature_category: :navigation do
let_it_be(:user) { create(:user) }
let_it_be(:project) { create(:project) }
let_it_be(:project) { create(:project, developers: user) }
before do
sign_in(user)
@ -15,13 +15,11 @@ RSpec.describe 'Navigation menu item pinning', :js, feature_category: :navigatio
visit explore_projects_path
end
it 'does not show the Pinned section' do
it 'does not show the Pinned section nor buttons to pin items' do
within '#super-sidebar' do
expect(page).not_to have_content 'Pinned'
end
end
it 'does not show the buttons to pin items' do
within '#super-sidebar' do
expect(page).not_to have_css 'button svg[data-testid="thumbtack-icon"]'
end
@ -30,7 +28,6 @@ RSpec.describe 'Navigation menu item pinning', :js, feature_category: :navigatio
describe 'pinnable navigation menu' do
before do
project.add_member(user, :owner)
visit project_path(project)
end
@ -115,13 +112,13 @@ RSpec.describe 'Navigation menu item pinning', :js, feature_category: :navigatio
it 'can be reordered' do
within_testid 'pinned-nav-items' do
pinned_items = page.find_all('a').map(&:text)
pinned_items = page.find_all('a', wait: false).map(&:text)
item2 = page.find('a', text: 'Terraform states')
item3 = page.find('a', text: 'Terraform modules')
expect(pinned_items[1..2]).to eq [item2.text, item3.text]
drag_item(item3, to: item2)
pinned_items = page.find_all('a').map(&:text)
pinned_items = page.find_all('a', wait: false).map(&:text)
expect(pinned_items[1..2]).to eq [item3.text, item2.text]
end
end
@ -129,13 +126,10 @@ RSpec.describe 'Navigation menu item pinning', :js, feature_category: :navigatio
end
describe 'reordering pins with hidden pins from non-available features' do
let_it_be(:project_with_repo) { create(:project, :repository) }
let_it_be(:project_without_repo) { create(:project, :repository_disabled) }
let_it_be(:project_with_repo) { create(:project, :repository, developers: user) }
let_it_be(:project_without_repo) { create(:project, :repository_disabled, developers: user) }
before do
project_with_repo.add_member(user, :owner)
project_without_repo.add_member(user, :owner)
visit project_path(project_with_repo)
within '#super-sidebar' do
click_on 'Code'
@ -157,7 +151,7 @@ RSpec.describe 'Navigation menu item pinning', :js, feature_category: :navigatio
it 'keeps pins of non-available features' do
within_testid 'pinned-nav-items' do
pinned_items = page.find_all('a')
pinned_items = page.find_all('a', wait: false)
.map(&:text)
.map { |text| text.split("\n").first } # to drop the counter badge text from "Issues\n0"
expect(pinned_items).to eq ["Issues", "Merge requests", "Commits", "Members", "Activity"]
@ -178,13 +172,11 @@ RSpec.describe 'Navigation menu item pinning', :js, feature_category: :navigatio
end
end
it 'shows the Pinned section as expanded' do
it 'shows the Pinned section as expanded and the original section as collapsed' do
within_testid 'pinned-nav-items' do
expect(page).to have_link 'Issues'
end
end
it 'shows the original section as collapsed' do
within '#menu-section-button-plan' do
expect(page).not_to have_link 'Issues'
end
@ -201,13 +193,10 @@ RSpec.describe 'Navigation menu item pinning', :js, feature_category: :navigatio
end
end
it 'shows the Pinned section as collapsed' do
it 'shows the Pinned section as collapsed and the original section as expanded' do
within '#menu-section-button-plan' do
expect(page).not_to have_link 'Issues'
end
end
it 'shows the original section as expanded' do
within '#super-sidebar #plan' do
expect(page).to have_link 'Issues'
end

View File

@ -15,22 +15,18 @@ RSpec.describe 'Projects > User sees sidebar', :js, feature_category: :groups_an
end
shared_examples 'has an expanded nav sidebar' do
it 'has an expanded nav sidebar on load' do
it 'has an expanded nav sidebar on load that can be collapsed' do
expect(page).to have_selector('[data-testid="super-sidebar-collapse-button"]', visible: :visible)
end
it 'can collapse the nav sidebar' do
find_by_testid('super-sidebar-collapse-button').click
expect(page).to have_selector('[data-testid="super-sidebar-collapse-button"]', visible: :hidden)
end
end
shared_examples 'has a collapsed nav sidebar' do
it 'has a collapsed nav sidebar on load' do
it 'has a collapsed nav sidebar on load that can be expanded' do
expect(page).to have_selector('[data-testid="super-sidebar-collapse-button"]', visible: :hidden)
end
it 'can expand the nav sidebar' do
page.find('.js-super-sidebar-toggle-expand').click
expect(page).to have_selector('[data-testid="super-sidebar-collapse-button"]', visible: :visible)
end

View File

@ -252,12 +252,10 @@ RSpec.describe Packages::GroupPackagesFinder, feature_category: :package_registr
end
context 'group has package of all types' do
package_types.each do |pt| # rubocop:disable RSpec/UselessDynamicDefinition -- `pt` used in `let`
let_it_be("package_#{pt}") { create("#{pt}_package", project: project) }
end
package_types.each do |type| # rubocop:disable RSpec/UselessDynamicDefinition -- `type` used in `let`
let_it_be("package_#{type}") { create("#{type}_package", project: project) }
package_types.each do |package_type|
it_behaves_like 'with package type', package_type
it_behaves_like 'with package type', type
end
end

View File

@ -149,4 +149,12 @@ RSpec.describe GitlabSchema.types['MlModelVersion'], feature_category: :mlops do
}
})
end
it 'allows an author to be null' do
model_version.package.update!(creator: nil)
version_data = data.dig('data', 'mlModel', 'latestVersion')
expect(version_data['author']).to be_nil
end
end

View File

@ -19,7 +19,8 @@ RSpec.describe QueueBackfillIdentifierNamesOfVulnerabilityReads,
column_name: :id,
interval: described_class::DELAY_INTERVAL,
batch_size: described_class::BATCH_SIZE,
sub_batch_size: described_class::SUB_BATCH_SIZE
sub_batch_size: described_class::SUB_BATCH_SIZE,
gitlab_schema: :gitlab_sec
)
}
end

View File

@ -6,6 +6,7 @@ RSpec.describe Ml::ModelVersionPresenter, feature_category: :mlops do
let_it_be(:project) { build_stubbed(:project) }
let_it_be(:model) { build_stubbed(:ml_models, name: 'a_model', project: project) }
let_it_be(:model_version) { build_stubbed(:ml_model_versions, :with_package, model: model, version: '1.1.1') }
let_it_be(:model_version_without_package) { build_stubbed(:ml_model_versions, model: model, version: '1.1.1') }
let_it_be(:presenter) { model_version.present }
describe '.display_name' do
@ -38,6 +39,14 @@ RSpec.describe Ml::ModelVersionPresenter, feature_category: :mlops do
it { is_expected.to eq(model_version.package.creator) }
end
describe 'when author is not present' do
let_it_be(:presenter) { model_version_without_package.present }
subject { presenter.author }
it { is_expected.to be_nil }
end
describe '#artifacts_count' do
subject { presenter.artifacts_count }

View File

@ -1045,6 +1045,7 @@ RSpec.describe API::Members, feature_category: :groups_and_projects do
end
end
# rubocop:disable Style/CombinableLoops -- new projects and groups must not be created for specs to pass
[false, true].each do |all|
it_behaves_like 'GET /:source_type/:id/members/(all)', 'project', all do
let(:source) { project }
@ -1064,6 +1065,7 @@ RSpec.describe API::Members, feature_category: :groups_and_projects do
let(:source) { all ? create(:group, parent: group) : group }
end
end
# rubocop:enable Style/CombinableLoops
describe 'POST /projects/:id/members' do
context 'adding owner to project' do

View File

@ -1401,10 +1401,10 @@
resolved "https://registry.yarnpkg.com/@gitlab/svgs/-/svgs-3.120.0.tgz#0f26908d4ded2e3f63b6e5028afbe8b59b7fe6dc"
integrity sha512-lsMKCgg0o3FLbNzvNPahkDtKGOH4U99bHff2aGlyqYFIpPvGFes/DfGr0IXVtWdfavZyoT42zE0/rquG64bANw==
"@gitlab/ui@101.4.0":
version "101.4.0"
resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-101.4.0.tgz#12b8fdda044b878f689d469ccc5d211d08fd9386"
integrity sha512-VPCFRvJpwaVtT+bMj+3JjpqrCQcGDz+StsMadIs//Nof+ldeRryYWPYauSnkWjLeMAWbbKmRRoxbDozQNjjlXw==
"@gitlab/ui@101.6.1":
version "101.6.1"
resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-101.6.1.tgz#cf5046f3460fa3d181d6cff5bbb4bb036b95a489"
integrity sha512-2FkvNWdt4a/KrRkMoFGMiKDVHkk6xRUx7ZFJJb3NTvZpLsn/kpbRAd+7vddwcywDpUkxSiD3TJJecwfVqrGDGQ==
dependencies:
"@floating-ui/dom" "1.4.3"
echarts "^5.3.2"
@ -13776,16 +13776,7 @@ string-length@^4.0.1:
char-regex "^1.0.2"
strip-ansi "^6.0.0"
"string-width-cjs@npm:string-width@^4.2.0":
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"
"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@ -13838,7 +13829,7 @@ string_decoder@^1.0.0, string_decoder@^1.1.1, string_decoder@~1.1.1:
dependencies:
safe-buffer "~5.1.0"
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
@ -13852,13 +13843,6 @@ strip-ansi@^5.2.0:
dependencies:
ansi-regex "^4.1.0"
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"
strip-ansi@^7.0.1, strip-ansi@^7.1.0:
version "7.1.0"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45"
@ -15583,7 +15567,7 @@ worker-loader@^3.0.8:
loader-utils "^2.0.0"
schema-utils "^3.0.0"
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
@ -15601,15 +15585,6 @@ wrap-ansi@^6.2.0:
string-width "^4.1.0"
strip-ansi "^6.0.0"
wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"
wrap-ansi@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"