summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-02-10 12:08:20 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-10 12:08:20 +0000
commite1bfa7aef2346a8c2d4e0ae0c69bf7649896f556 (patch)
tree0fe959464b8e3462c3fddcc0f137920267b22d33
parentef4c0a743bcfee11a647c9ada6249c3399888866 (diff)
downloadgitlab-ce-e1bfa7aef2346a8c2d4e0ae0c69bf7649896f556.tar.gz
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--app/assets/javascripts/boards/components/board_list_header.vue9
-rw-r--r--app/models/issue_user_mention.rb3
-rw-r--r--app/models/note_diff_file.rb3
-rw-r--r--app/models/packages/composer/metadatum.rb10
-rw-r--r--data/deprecations/16-0-Vault-integration.yml46
-rw-r--r--db/migrate/20230202032248_initialize_conversion_of_issue_user_mentions_note_id_to_bigint.rb16
-rw-r--r--db/migrate/20230207003737_initialize_conversion_of_note_diff_files_diff_note_id_to_bigint.rb16
-rw-r--r--db/post_migrate/20230202032302_backfill_issue_user_mentions_note_id_for_bigint_conversion.rb16
-rw-r--r--db/post_migrate/20230207003812_backfill_note_diff_files_diff_note_id_for_bigint_conversion.rb16
-rw-r--r--db/schema_migrations/202302020322481
-rw-r--r--db/schema_migrations/202302020323021
-rw-r--r--db/schema_migrations/202302070037371
-rw-r--r--db/schema_migrations/202302070038121
-rw-r--r--db/structure.sql28
-rw-r--r--doc/administration/postgresql/pgbouncer.md6
-rw-r--r--doc/update/deprecations.md21
-rw-r--r--doc/user/admin_area/settings/scim_setup.md2
-rw-r--r--locale/gitlab.pot3
-rw-r--r--qa/Gemfile2
-rw-r--r--qa/Gemfile.lock4
-rw-r--r--spec/features/projects/jobs/user_browses_job_spec.rb4
-rw-r--r--spec/frontend/boards/components/board_list_header_spec.js4
-rw-r--r--spec/models/packages/composer/metadatum_spec.rb29
23 files changed, 226 insertions, 16 deletions
diff --git a/app/assets/javascripts/boards/components/board_list_header.vue b/app/assets/javascripts/boards/components/board_list_header.vue
index e0a3086c1e0..749fae0c426 100644
--- a/app/assets/javascripts/boards/components/board_list_header.vue
+++ b/app/assets/javascripts/boards/components/board_list_header.vue
@@ -125,7 +125,7 @@ export default {
return this.list.collapsed ? this.$options.i18n.expand : this.$options.i18n.collapse;
},
chevronIcon() {
- return this.list.collapsed ? 'chevron-right' : 'chevron-down';
+ return this.list.collapsed ? 'chevron-lg-right' : 'chevron-lg-down';
},
isNewIssueShown() {
return (this.listType === ListType.backlog || this.showListHeaderButton) && !this.isEpicBoard;
@@ -323,6 +323,7 @@ export default {
v-if="listType !== 'label'"
v-gl-tooltip.hover
:class="{
+ 'gl-text-gray-500': list.collapsed,
'gl-display-block': list.collapsed || listType === 'milestone',
}"
:title="listTitle"
@@ -378,7 +379,7 @@ export default {
<!-- EE end -->
<div
- class="issue-count-badge gl-display-inline-flex gl-pr-2 no-drag gl-text-secondary"
+ class="gl-font-sm issue-count-badge gl-display-inline-flex gl-pr-2 no-drag gl-text-secondary"
data-testid="issue-count-badge"
:class="{
'gl-display-none!': list.collapsed && isSwimlanesHeader,
@@ -388,7 +389,7 @@ export default {
<span class="gl-display-inline-flex" :class="{ 'gl-rotate-90': list.collapsed }">
<gl-tooltip :target="() => $refs.itemCount" :title="itemsTooltipLabel" />
<span ref="itemCount" class="gl-display-inline-flex gl-align-items-center">
- <gl-icon class="gl-mr-2" :name="countIcon" :size="16" />
+ <gl-icon class="gl-mr-2" :name="countIcon" :size="14" />
<item-count
v-if="!isLoading"
:items-size="isEpicBoard ? list.epicsCount : boardList.issuesCount"
@@ -399,7 +400,7 @@ export default {
<template v-if="canShowTotalWeight">
<gl-tooltip :target="() => $refs.weightTooltip" :title="weightCountToolTip" />
<span ref="weightTooltip" class="gl-display-inline-flex gl-ml-3" data-testid="weight">
- <gl-icon class="gl-mr-2" name="weight" />
+ <gl-icon class="gl-mr-2" name="weight" :size="14" />
{{ totalWeight }}
</span>
</template>
diff --git a/app/models/issue_user_mention.rb b/app/models/issue_user_mention.rb
index 3eadd580f7f..bb13b83d3ba 100644
--- a/app/models/issue_user_mention.rb
+++ b/app/models/issue_user_mention.rb
@@ -3,4 +3,7 @@
class IssueUserMention < UserMention
belongs_to :issue
belongs_to :note
+ include IgnorableColumns
+
+ ignore_column :note_id_convert_to_bigint, remove_with: '16.0', remove_after: '2023-05-22'
end
diff --git a/app/models/note_diff_file.rb b/app/models/note_diff_file.rb
index 67a6d5d6d6b..4238de0a2f8 100644
--- a/app/models/note_diff_file.rb
+++ b/app/models/note_diff_file.rb
@@ -2,6 +2,9 @@
class NoteDiffFile < ApplicationRecord
include DiffFile
+ include IgnorableColumns
+
+ ignore_column :diff_note_id_convert_to_bigint, remove_with: '16.0', remove_after: '2023-05-22'
scope :referencing_sha, -> (oids, project_id:) do
joins(:diff_note).where(notes: { project_id: project_id, commit_id: oids })
diff --git a/app/models/packages/composer/metadatum.rb b/app/models/packages/composer/metadatum.rb
index 363858a3ed1..8b0b71ca86f 100644
--- a/app/models/packages/composer/metadatum.rb
+++ b/app/models/packages/composer/metadatum.rb
@@ -10,8 +10,18 @@ module Packages
validates :package, :target_sha, :composer_json, presence: true
+ validate :composer_package_type
+
scope :for_package, ->(name, project_id) { joins(:package).where(packages_packages: { name: name, project_id: project_id, package_type: Packages::Package.package_types[:composer] }) }
scope :locked_for_update, -> { lock('FOR UPDATE') }
+
+ private
+
+ def composer_package_type
+ return if package&.composer?
+
+ errors.add(:base, _('Package type must be Composer'))
+ end
end
end
end
diff --git a/data/deprecations/16-0-Vault-integration.yml b/data/deprecations/16-0-Vault-integration.yml
new file mode 100644
index 00000000000..e08666e67ff
--- /dev/null
+++ b/data/deprecations/16-0-Vault-integration.yml
@@ -0,0 +1,46 @@
+# This is a template for announcing a feature deprecation or other important planned change.
+#
+# Please refer to the deprecation guidelines to confirm your understanding of GitLab's definitions.
+# https://docs.gitlab.com/ee/development/deprecation_guidelines/#terminology
+#
+# Deprecations and other future breaking changes must be announced at least
+# three releases prior to removal.
+#
+# Breaking changes must happen in a major release.
+#
+# See the OPTIONAL END OF SUPPORT FIELDS section below if an End of Support period also applies.
+#
+# For more information please refer to the handbook documentation here:
+# https://about.gitlab.com/handbook/marketing/blog/release-posts/#deprecations-and-other-planned-breaking-change-announcements
+#
+# Please delete this line and above before submitting your merge request.
+#
+# REQUIRED FIELDS
+#
+- title: "HashiCorp Vault integration will no longer use CI_JOB_JWT by default"
+ announcement_milestone: "15.9" # (required) The milestone when this feature was first announced as deprecated.
+ removal_milestone: "16.0" # (required) The milestone when this feature is planned to be removed
+ breaking_change: true # (required) Change to false if this is not a breaking change.
+ reporter: dhershkovitch # (required) GitLab username of the person reporting the change
+ stage: stage # (required) String value of the stage that the feature was created in. e.g., Growth
+ issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/366798 # (required) Link to the deprecation issue in GitLab
+ body: | # (required) Do not modify this line, instead modify the lines below.
+ As part of our effort to improve the security of your CI workflows using JWT and OIDC, the native HashiCorp integration is also being updated in GitLab 16.0. Any projects that use the [`secrets:vault`](https://docs.gitlab.com/ee/ci/yaml/#secretsvault) keyword to retrieve secrets from Vault will need to be [configured to use ID tokens](https://docs.gitlab.com/ee/ci/secrets/id_token_authentication.html#configure-automatic-id-token-authentication).
+
+ To be prepared for this change, you should do the following before GitLab 16.0:
+
+ - [Disable the use of JSON web tokens](https://docs.gitlab.com/ee/ci/secrets/id_token_authentication.html#enable-automatic-id-token-authentication) in the pipeline.
+ - Ensure the bound audience is prefixed with `https://`.
+ - Use the new [`id_tokens`](https://docs.gitlab.com/ee/ci/yaml/#id_tokens) keyword
+ and configure the `aud` claim.
+# If an End of Support period applies, the announcement should be shared with GitLab Support
+# in the `#spt_managers` channel in Slack, and mention `@gitlab-com/support` in this MR.
+#
+ end_of_support_milestone: # (optional) Use "XX.YY" format. The milestone when support for this feature will end.
+ #
+ # OTHER OPTIONAL FIELDS
+ #
+ tiers: # (optional - may be required in the future) An array of tiers that the feature is available in currently. e.g., [Free, Silver, Gold, Core, Premium, Ultimate]
+ documentation_url: # (optional) This is a link to the current documentation page
+ image_url: # (optional) This is a link to a thumbnail image depicting the feature
+ video_url: # (optional) Use the youtube thumbnail URL with the structure of https://img.youtube.com/vi/UNIQUEID/hqdefault.jpg
diff --git a/db/migrate/20230202032248_initialize_conversion_of_issue_user_mentions_note_id_to_bigint.rb b/db/migrate/20230202032248_initialize_conversion_of_issue_user_mentions_note_id_to_bigint.rb
new file mode 100644
index 00000000000..3df255b3d6d
--- /dev/null
+++ b/db/migrate/20230202032248_initialize_conversion_of_issue_user_mentions_note_id_to_bigint.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class InitializeConversionOfIssueUserMentionsNoteIdToBigint < Gitlab::Database::Migration[2.1]
+ TABLE = :issue_user_mentions
+ COLUMNS = %i[note_id]
+
+ enable_lock_retries!
+
+ def up
+ initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ def down
+ revert_initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+end
diff --git a/db/migrate/20230207003737_initialize_conversion_of_note_diff_files_diff_note_id_to_bigint.rb b/db/migrate/20230207003737_initialize_conversion_of_note_diff_files_diff_note_id_to_bigint.rb
new file mode 100644
index 00000000000..22c7d252dc3
--- /dev/null
+++ b/db/migrate/20230207003737_initialize_conversion_of_note_diff_files_diff_note_id_to_bigint.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class InitializeConversionOfNoteDiffFilesDiffNoteIdToBigint < Gitlab::Database::Migration[2.1]
+ TABLE = :note_diff_files
+ COLUMNS = %i[diff_note_id]
+
+ enable_lock_retries!
+
+ def up
+ initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ def down
+ revert_initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+end
diff --git a/db/post_migrate/20230202032302_backfill_issue_user_mentions_note_id_for_bigint_conversion.rb b/db/post_migrate/20230202032302_backfill_issue_user_mentions_note_id_for_bigint_conversion.rb
new file mode 100644
index 00000000000..749a2f97d7c
--- /dev/null
+++ b/db/post_migrate/20230202032302_backfill_issue_user_mentions_note_id_for_bigint_conversion.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class BackfillIssueUserMentionsNoteIdForBigintConversion < Gitlab::Database::Migration[2.1]
+ TABLE = :issue_user_mentions
+ COLUMNS = %i[note_id]
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ def up
+ backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS, batch_size: 40_000, sub_batch_size: 500)
+ end
+
+ def down
+ revert_backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+end
diff --git a/db/post_migrate/20230207003812_backfill_note_diff_files_diff_note_id_for_bigint_conversion.rb b/db/post_migrate/20230207003812_backfill_note_diff_files_diff_note_id_for_bigint_conversion.rb
new file mode 100644
index 00000000000..ce53a855b2a
--- /dev/null
+++ b/db/post_migrate/20230207003812_backfill_note_diff_files_diff_note_id_for_bigint_conversion.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class BackfillNoteDiffFilesDiffNoteIdForBigintConversion < Gitlab::Database::Migration[2.1]
+ TABLE = :note_diff_files
+ COLUMNS = %i[diff_note_id]
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+
+ def up
+ backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS, batch_size: 40_000)
+ end
+
+ def down
+ revert_backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+end
diff --git a/db/schema_migrations/20230202032248 b/db/schema_migrations/20230202032248
new file mode 100644
index 00000000000..61a5bfbf6bd
--- /dev/null
+++ b/db/schema_migrations/20230202032248
@@ -0,0 +1 @@
+b2ccc83a631f40528c073b9e5387a7fdd0190d0339ec3c42b8f1ee4408c14ca2 \ No newline at end of file
diff --git a/db/schema_migrations/20230202032302 b/db/schema_migrations/20230202032302
new file mode 100644
index 00000000000..f6077769d62
--- /dev/null
+++ b/db/schema_migrations/20230202032302
@@ -0,0 +1 @@
+84e9b2a8d4a85a7d4c458c0c224b4082f2840cfb3b4b2b777bcbea21abbdf930 \ No newline at end of file
diff --git a/db/schema_migrations/20230207003737 b/db/schema_migrations/20230207003737
new file mode 100644
index 00000000000..d66f0ed1543
--- /dev/null
+++ b/db/schema_migrations/20230207003737
@@ -0,0 +1 @@
+f054d4b0332145a5c27c3c7d329d0f4851a8a7abf1314055077a2ac4c7a8463a \ No newline at end of file
diff --git a/db/schema_migrations/20230207003812 b/db/schema_migrations/20230207003812
new file mode 100644
index 00000000000..6422de7ce37
--- /dev/null
+++ b/db/schema_migrations/20230207003812
@@ -0,0 +1 @@
+5d0e6aed4be364bd4884259f56b44812200963cea724b23130fa8b19f58e2574 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 0f59e43a95e..e01791b7fe0 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -261,6 +261,15 @@ BEGIN
END;
$$;
+CREATE FUNCTION trigger_775287b6d67a() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ NEW."diff_note_id_convert_to_bigint" := NEW."diff_note_id";
+ RETURN NEW;
+END;
+$$;
+
CREATE FUNCTION trigger_7f4fcd5aa322() RETURNS trigger
LANGUAGE plpgsql
AS $$
@@ -279,6 +288,15 @@ BEGIN
END;
$$;
+CREATE FUNCTION trigger_c2051020aa8b() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ NEW."note_id_convert_to_bigint" := NEW."note_id";
+ RETURN NEW;
+END;
+$$;
+
CREATE FUNCTION trigger_c5a5f48f12b0() RETURNS trigger
LANGUAGE plpgsql
AS $$
@@ -17118,7 +17136,8 @@ CREATE TABLE issue_user_mentions (
note_id integer,
mentioned_users_ids integer[],
mentioned_projects_ids integer[],
- mentioned_groups_ids integer[]
+ mentioned_groups_ids integer[],
+ note_id_convert_to_bigint bigint
);
CREATE SEQUENCE issue_user_mentions_id_seq
@@ -18513,7 +18532,8 @@ CREATE TABLE note_diff_files (
a_mode character varying NOT NULL,
b_mode character varying NOT NULL,
new_path text NOT NULL,
- old_path text NOT NULL
+ old_path text NOT NULL,
+ diff_note_id_convert_to_bigint bigint DEFAULT 0 NOT NULL
);
CREATE SEQUENCE note_diff_files_id_seq
@@ -33553,10 +33573,14 @@ CREATE TRIGGER trigger_3207b8d0d6f3 BEFORE INSERT OR UPDATE ON ci_build_needs FO
CREATE TRIGGER trigger_3dc62927cae8 BEFORE INSERT OR UPDATE ON design_user_mentions FOR EACH ROW EXECUTE FUNCTION trigger_3dc62927cae8();
+CREATE TRIGGER trigger_775287b6d67a BEFORE INSERT OR UPDATE ON note_diff_files FOR EACH ROW EXECUTE FUNCTION trigger_775287b6d67a();
+
CREATE TRIGGER trigger_7f4fcd5aa322 BEFORE INSERT OR UPDATE ON sent_notifications FOR EACH ROW EXECUTE FUNCTION trigger_7f4fcd5aa322();
CREATE TRIGGER trigger_bfc6e47be8cc BEFORE INSERT OR UPDATE ON snippet_user_mentions FOR EACH ROW EXECUTE FUNCTION trigger_bfc6e47be8cc();
+CREATE TRIGGER trigger_c2051020aa8b BEFORE INSERT OR UPDATE ON issue_user_mentions FOR EACH ROW EXECUTE FUNCTION trigger_c2051020aa8b();
+
CREATE TRIGGER trigger_c5a5f48f12b0 BEFORE INSERT OR UPDATE ON epic_user_mentions FOR EACH ROW EXECUTE FUNCTION trigger_c5a5f48f12b0();
CREATE TRIGGER trigger_c7107f30d69d BEFORE INSERT OR UPDATE ON merge_request_metrics FOR EACH ROW EXECUTE FUNCTION trigger_c7107f30d69d();
diff --git a/doc/administration/postgresql/pgbouncer.md b/doc/administration/postgresql/pgbouncer.md
index 25c4c940b97..5dd0aad7162 100644
--- a/doc/administration/postgresql/pgbouncer.md
+++ b/doc/administration/postgresql/pgbouncer.md
@@ -5,7 +5,11 @@ info: To determine the technical writer assigned to the Stage/Group associated w
type: reference
---
-# Working with the bundled PgBouncer service **(PREMIUM SELF)**
+# Working with the bundled PgBouncer service **(FREE SELF)**
+
+NOTE:
+PgBouncer is bundled in the `gitlab-ee` package, but is free to use.
+For support, you need a [Premium subscription](https://about.gitlab.com/pricing/).
[PgBouncer](https://www.pgbouncer.org/) is used to seamlessly migrate database
connections between servers in a failover scenario. Additionally, it can be used
diff --git a/doc/update/deprecations.md b/doc/update/deprecations.md
index 2329649c25c..6857967e9bf 100644
--- a/doc/update/deprecations.md
+++ b/doc/update/deprecations.md
@@ -157,6 +157,27 @@ are deprecated and will be removed from the GraphQL API. For installation instru
</div>
+<div class="deprecation removal-160 breaking-change">
+
+### HashiCorp Vault integration will no longer use CI_JOB_JWT by default
+
+Planned removal: GitLab <span class="removal-milestone">16.0</span> <span class="removal-date"></span>
+
+WARNING:
+This is a [breaking change](https://docs.gitlab.com/ee/development/deprecation_guidelines/).
+Review the details carefully before upgrading.
+
+As part of our effort to improve the security of your CI workflows using JWT and OIDC, the native HashiCorp integration is also being updated in GitLab 16.0. Any projects that use the [`secrets:vault`](https://docs.gitlab.com/ee/ci/yaml/#secretsvault) keyword to retrieve secrets from Vault will need to be [configured to use ID tokens](https://docs.gitlab.com/ee/ci/secrets/id_token_authentication.html#configure-automatic-id-token-authentication).
+
+To be prepared for this change, you should do the following before GitLab 16.0:
+
+- [Disable the use of JSON web tokens](https://docs.gitlab.com/ee/ci/secrets/id_token_authentication.html#enable-automatic-id-token-authentication) in the pipeline.
+- Ensure the bound audience is prefixed with `https://`.
+- Use the new [`id_tokens`](https://docs.gitlab.com/ee/ci/yaml/#id_tokens) keyword
+ and configure the `aud` claim.
+
+</div>
+
<div class="deprecation removal-170 breaking-change">
### Load Performance Testing is deprecated
diff --git a/doc/user/admin_area/settings/scim_setup.md b/doc/user/admin_area/settings/scim_setup.md
index 2e3dc4b4cab..fd6e3061140 100644
--- a/doc/user/admin_area/settings/scim_setup.md
+++ b/doc/user/admin_area/settings/scim_setup.md
@@ -7,6 +7,8 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Configure SCIM for self-managed GitLab instances **(PREMIUM SELF)**
+> [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/8902) in GitLab 15.8.
+
You can use the open standard System for Cross-domain Identity Management (SCIM) to automatically:
- Create users.
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 4e279e58756..95d2015d78c 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -29817,6 +29817,9 @@ msgstr ""
msgid "Package type"
msgstr ""
+msgid "Package type must be Composer"
+msgstr ""
+
msgid "Package type must be Conan"
msgstr ""
diff --git a/qa/Gemfile b/qa/Gemfile
index 01fd4117a9f..ca0955b4320 100644
--- a/qa/Gemfile
+++ b/qa/Gemfile
@@ -40,7 +40,7 @@ gem 'chemlab-library-www-gitlab-com', '~> 0.1', '>= 0.1.1'
# dependencies for jenkins client
gem 'nokogiri', '~> 1.14', '>= 1.14.1'
-gem 'deprecation_toolkit', '~> 2.0.2', require: false
+gem 'deprecation_toolkit', '~> 2.0.3', require: false
group :development do
gem 'pry-byebug', '~> 3.10.1', platform: :mri
diff --git a/qa/Gemfile.lock b/qa/Gemfile.lock
index 8c2f1a51794..5a8cd6cf3d3 100644
--- a/qa/Gemfile.lock
+++ b/qa/Gemfile.lock
@@ -57,7 +57,7 @@ GEM
zeitwerk (>= 2.5, < 3)
debug_inspector (1.1.0)
declarative (0.0.20)
- deprecation_toolkit (2.0.2)
+ deprecation_toolkit (2.0.3)
activesupport (>= 5.2)
diff-lcs (1.3)
domain_name (0.5.20190701)
@@ -312,7 +312,7 @@ DEPENDENCIES
chemlab (~> 0.10)
chemlab-library-www-gitlab-com (~> 0.1, >= 0.1.1)
confiner (~> 0.4)
- deprecation_toolkit (~> 2.0.2)
+ deprecation_toolkit (~> 2.0.3)
faker (~> 3.1, >= 3.1.1)
faraday-retry (~> 2.0)
fog-core (= 2.1.0)
diff --git a/spec/features/projects/jobs/user_browses_job_spec.rb b/spec/features/projects/jobs/user_browses_job_spec.rb
index 78fb72ad2df..dd57b4117f9 100644
--- a/spec/features/projects/jobs/user_browses_job_spec.rb
+++ b/spec/features/projects/jobs/user_browses_job_spec.rb
@@ -34,10 +34,6 @@ RSpec.describe 'User browses a job', :js, feature_category: :projects do
wait_for_requests
expect(page).to have_no_css('.artifacts')
- expect(build).not_to have_trace
- expect(build.artifacts_file.present?).to be_falsy
- expect(build.artifacts_metadata.present?).to be_falsy
-
expect(page).to have_content('Job has been erased')
end
diff --git a/spec/frontend/boards/components/board_list_header_spec.js b/spec/frontend/boards/components/board_list_header_spec.js
index 80e77921459..9e65e900440 100644
--- a/spec/frontend/boards/components/board_list_header_spec.js
+++ b/spec/frontend/boards/components/board_list_header_spec.js
@@ -162,7 +162,7 @@ describe('Board List Header Component', () => {
const icon = findCaret();
- expect(icon.props('icon')).toBe('chevron-down');
+ expect(icon.props('icon')).toBe('chevron-lg-down');
});
it('should display expand icon when column is collapsed', async () => {
@@ -170,7 +170,7 @@ describe('Board List Header Component', () => {
const icon = findCaret();
- expect(icon.props('icon')).toBe('chevron-right');
+ expect(icon.props('icon')).toBe('chevron-lg-right');
});
it('should dispatch toggleListCollapse when clicking the collapse icon', async () => {
diff --git a/spec/models/packages/composer/metadatum_spec.rb b/spec/models/packages/composer/metadatum_spec.rb
index 1c888f1563c..326eba7aa0e 100644
--- a/spec/models/packages/composer/metadatum_spec.rb
+++ b/spec/models/packages/composer/metadatum_spec.rb
@@ -10,6 +10,35 @@ RSpec.describe Packages::Composer::Metadatum, type: :model do
it { is_expected.to validate_presence_of(:package) }
it { is_expected.to validate_presence_of(:target_sha) }
it { is_expected.to validate_presence_of(:composer_json) }
+
+ describe '#composer_package_type' do
+ subject { build(:composer_metadatum, package: package) }
+
+ shared_examples 'an invalid record' do
+ it do
+ expect(subject).not_to be_valid
+ expect(subject.errors.to_a).to include('Package type must be Composer')
+ end
+ end
+
+ context 'when the metadatum package_type is Composer' do
+ let(:package) { build(:composer_package) }
+
+ it { is_expected.to be_valid }
+ end
+
+ context 'when the metadatum has no associated package' do
+ let(:package) { nil }
+
+ it_behaves_like 'an invalid record'
+ end
+
+ context 'when the metadatum package_type is not Composer' do
+ let(:package) { build(:npm_package) }
+
+ it_behaves_like 'an invalid record'
+ end
+ end
end
describe 'scopes' do