summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-02-08 03:10:25 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-08 03:10:25 +0000
commitd8b3ba4b19f12a88a2aa6881bf770f9713a68d32 (patch)
tree2fc2ecd02a7edae8be4502240a09d709b6e8bb6a
parent9f1ce98c1d456b962fc43ec99180e042592fa307 (diff)
downloadgitlab-ce-d8b3ba4b19f12a88a2aa6881bf770f9713a68d32.tar.gz
Add latest changes from gitlab-org/gitlab@master
-rw-r--r--Gemfile.checksum6
-rw-r--r--Gemfile.lock8
-rw-r--r--app/assets/javascripts/import_entities/components/import_status.vue8
-rw-r--r--app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_list.vue2
-rw-r--r--app/models/ci/build_need.rb3
-rw-r--r--app/models/ci/runner.rb5
-rw-r--r--app/services/import/gitlab_projects/file_acquisition_strategies/remote_file.rb16
-rw-r--r--db/migrate/20230130104819_initialize_conversion_of_ci_build_needs_to_bigint.rb16
-rw-r--r--db/migrate/20230130110855_backfill_ci_build_needs_for_big_int_conversion.rb16
-rw-r--r--db/schema_migrations/202301301048191
-rw-r--r--db/schema_migrations/202301301108551
-rw-r--r--db/structure.sql14
-rw-r--r--doc/administration/gitaly/monitoring.md11
-rw-r--r--doc/ci/services/index.md9
-rw-r--r--doc/ci/testing/code_quality.md1
-rw-r--r--doc/user/group/roadmap/index.md2
-rw-r--r--spec/factories/ci/runners.rb2
-rw-r--r--spec/frontend/vue_shared/components/user_avatar/user_avatar_list_spec.js31
-rw-r--r--spec/models/ci/runner_spec.rb24
-rw-r--r--spec/services/import/gitlab_projects/file_acquisition_strategies/remote_file_spec.rb86
20 files changed, 153 insertions, 109 deletions
diff --git a/Gemfile.checksum b/Gemfile.checksum
index 19ed2a937b2..d151d0e2530 100644
--- a/Gemfile.checksum
+++ b/Gemfile.checksum
@@ -67,7 +67,7 @@
{"name":"byebug","version":"11.1.3","platform":"ruby","checksum":"2485944d2bb21283c593d562f9ae1019bf80002143cc3a255aaffd4e9cf4a35b"},
{"name":"capybara","version":"3.35.3","platform":"ruby","checksum":"3389f8203b05175352b763f4d04c31b29ba606a96224649ac42ef967f56538ee"},
{"name":"capybara-screenshot","version":"1.0.22","platform":"ruby","checksum":"f86040349a0df7f723123460d9456023f7d693068338991529f10f670fa420f5"},
-{"name":"carrierwave","version":"1.3.2","platform":"ruby","checksum":"3c42f3f3c2c83b29efe2b441d246829c42bc626ac3f6af1486c9a62d971fb114"},
+{"name":"carrierwave","version":"1.3.3","platform":"ruby","checksum":"0f0244de2ece54c80745b755993bd26cf47d4650823e5f89c115dbc9d73a13f1"},
{"name":"cbor","version":"0.5.9.6","platform":"ruby","checksum":"434a147658dd1df24ec9e7b3297c1fd4f8a691c97d0e688b3049df8e728b2114"},
{"name":"character_set","version":"1.4.1","platform":"java","checksum":"38b632136b40e02fecba2898497b07ac640cc121f17ac536eaf19873d50053d0"},
{"name":"character_set","version":"1.4.1","platform":"ruby","checksum":"f71b1ac35b21c4c6f9f26b8a67c7eec8e10bdf0da17488ac7f8fae756d9f8062"},
@@ -580,7 +580,7 @@
{"name":"sqlite3","version":"1.6.0","platform":"x86_64-darwin","checksum":"e177778f16415370eb1e7401a492ec25c48d00ac5ff83789ba905e50ee083c64"},
{"name":"sqlite3","version":"1.6.0","platform":"x86_64-linux","checksum":"a2488dcf0e72928bab2b15b934113ce8d7a3b4031277e362d66e40956d5c709e"},
{"name":"ssh_data","version":"1.3.0","platform":"ruby","checksum":"ec7c1e95a3aebeee412147998f4c147b4b05da6ed0aafda6083f9449318eaac0"},
-{"name":"ssrf_filter","version":"1.0.7","platform":"ruby","checksum":"80dc5728e5743201239e465c7e14290c7acf1de3b9f1f664579112429c79953a"},
+{"name":"ssrf_filter","version":"1.0.8","platform":"ruby","checksum":"03f49f54837e407d43ee93ec733a8a94dc1bcf8185647ac61606e63aaedaa0db"},
{"name":"stackprof","version":"0.2.21","platform":"ruby","checksum":"2b6406c55dc2e134b2789c4cc631d96e67da87821a166f4ae12f15bec5cff5ae"},
{"name":"state_machines","version":"0.5.0","platform":"ruby","checksum":"23e6249d374a920b528dccade403518b4abbd83841a3e2c9ef13e6f1a009b102"},
{"name":"state_machines-activemodel","version":"0.8.0","platform":"ruby","checksum":"e932dab190d4be044fb5f9cab01a3ea0b092c5f113d4676c6c0a0d49bf738d2c"},
@@ -620,7 +620,7 @@
{"name":"tty-reader","version":"0.9.0","platform":"ruby","checksum":"c62972c985c0b1566f0e56743b6a7882f979d3dc32ff491ed490a076f899c2b1"},
{"name":"tty-screen","version":"0.8.1","platform":"ruby","checksum":"6508657c38f32bdca64880abe201ce237d80c94146e1f9b911cba3c7823659a2"},
{"name":"typhoeus","version":"1.4.0","platform":"ruby","checksum":"fff9880d5dc35950e7706cf132fd297f377c049101794be1cf01c95567f642d4"},
-{"name":"tzinfo","version":"2.0.5","platform":"ruby","checksum":"c5352fd901544d396745d013f46a04ae2ed081ce806d942099825b7c2b09a167"},
+{"name":"tzinfo","version":"2.0.6","platform":"ruby","checksum":"8daf828cc77bcf7d63b0e3bdb6caa47e2272dcfaf4fbfe46f8c3a9df087a829b"},
{"name":"u2f","version":"0.2.1","platform":"ruby","checksum":"7907b163c00682ce94d82178154af2ec3930e50f342c3502d64929c6370c5553"},
{"name":"uber","version":"0.1.0","platform":"ruby","checksum":"5beeb407ff807b5db994f82fa9ee07cfceaa561dad8af20be880bc67eba935dc"},
{"name":"undercover","version":"0.4.5","platform":"ruby","checksum":"27bb5d708e253e2c1a3f3edd3668a30728f0e59a1e18004b623d5e7b1e86f3b9"},
diff --git a/Gemfile.lock b/Gemfile.lock
index deec0b5c88d..b36d3db3ff6 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -266,11 +266,11 @@ GEM
capybara-screenshot (1.0.22)
capybara (>= 1.0, < 4)
launchy
- carrierwave (1.3.2)
+ carrierwave (1.3.3)
activemodel (>= 4.0.0)
activesupport (>= 4.0.0)
mime-types (>= 1.16)
- ssrf_filter (~> 1.0)
+ ssrf_filter (~> 1.0, < 1.1.0)
cbor (0.5.9.6)
character_set (1.4.1)
sorted_set (~> 1.0)
@@ -1427,7 +1427,7 @@ GEM
sqlite3 (1.6.0)
mini_portile2 (~> 2.8.0)
ssh_data (1.3.0)
- ssrf_filter (1.0.7)
+ ssrf_filter (1.0.8)
stackprof (0.2.21)
state_machines (0.5.0)
state_machines-activemodel (0.8.0)
@@ -1508,7 +1508,7 @@ GEM
tty-screen (0.8.1)
typhoeus (1.4.0)
ethon (>= 0.9.0)
- tzinfo (2.0.5)
+ tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
u2f (0.2.1)
uber (0.1.0)
diff --git a/app/assets/javascripts/import_entities/components/import_status.vue b/app/assets/javascripts/import_entities/components/import_status.vue
index db677c574d1..e2a4cca289d 100644
--- a/app/assets/javascripts/import_entities/components/import_status.vue
+++ b/app/assets/javascripts/import_entities/components/import_status.vue
@@ -142,7 +142,13 @@ export default {
<template>
<div>
<div class="gl-display-inline-block gl-w-13">
- <gl-badge :icon="mappedStatus.icon" :variant="mappedStatus.variant" size="md" class="gl-mr-2">
+ <gl-badge
+ :icon="mappedStatus.icon"
+ :variant="mappedStatus.variant"
+ size="md"
+ icon-size="sm"
+ class="gl-mr-2"
+ >
{{ mappedStatus.text }}
</gl-badge>
</div>
diff --git a/app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_list.vue b/app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_list.vue
index 4f3b482d7f8..167db3ce1f2 100644
--- a/app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_list.vue
+++ b/app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_list.vue
@@ -74,7 +74,7 @@ export default {
<user-avatar-link
v-for="item in visibleItems"
:key="item.id"
- :link-href="item.web_url"
+ :link-href="item.web_url || item.webUrl"
:img-src="item.avatar_url || item.avatarUrl"
:img-alt="item.name"
:tooltip-text="item.name"
diff --git a/app/models/ci/build_need.rb b/app/models/ci/build_need.rb
index 3fa17d6d286..03d1bd14bfb 100644
--- a/app/models/ci/build_need.rb
+++ b/app/models/ci/build_need.rb
@@ -4,6 +4,9 @@ module Ci
class BuildNeed < Ci::ApplicationRecord
include Ci::Partitionable
include BulkInsertSafe
+ include IgnorableColumns
+
+ ignore_column :id_convert_to_bigint, remove_with: '16.0', remove_after: '2023-04-22'
belongs_to :build, class_name: "Ci::Processable", foreign_key: :build_id, inverse_of: :needs
diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb
index 19acd86a7f4..db58a995f0b 100644
--- a/app/models/ci/runner.rb
+++ b/app/models/ci/runner.rb
@@ -387,7 +387,10 @@ module Ci
end
def short_sha
- token[0...8] if token
+ return unless token
+
+ start_index = created_via_ui? ? CREATED_RUNNER_TOKEN_PREFIX.length : 0
+ token[start_index..start_index + 8]
end
def tag_list
diff --git a/app/services/import/gitlab_projects/file_acquisition_strategies/remote_file.rb b/app/services/import/gitlab_projects/file_acquisition_strategies/remote_file.rb
index e179a14c497..e30818cc5d2 100644
--- a/app/services/import/gitlab_projects/file_acquisition_strategies/remote_file.rb
+++ b/app/services/import/gitlab_projects/file_acquisition_strategies/remote_file.rb
@@ -16,10 +16,8 @@ module Import
allow_local_network: allow_local_requests?,
dns_rebind_protection: true
}
- validate :aws_s3, if: :validate_aws_s3?
- # When removing the import_project_from_remote_file_s3 remove the
- # whole condition of this validation:
- validates_with RemoteFileValidator, if: -> { validate_aws_s3? || !s3_request? }
+
+ validates_with RemoteFileValidator, if: -> { !s3_request? }
def initialize(params:, current_user: nil)
@params = params
@@ -47,20 +45,10 @@ module Import
attr_reader :params
- def aws_s3
- if s3_request?
- errors.add(:base, 'To import from AWS S3 use `projects/remote-import-s3`')
- end
- end
-
def s3_request?
headers['Server'] == 'AmazonS3' && headers['x-amz-request-id'].present?
end
- def validate_aws_s3?
- ::Feature.enabled?(:import_project_from_remote_file_s3)
- end
-
def headers
return {} if file_url.blank?
diff --git a/db/migrate/20230130104819_initialize_conversion_of_ci_build_needs_to_bigint.rb b/db/migrate/20230130104819_initialize_conversion_of_ci_build_needs_to_bigint.rb
new file mode 100644
index 00000000000..680ad570391
--- /dev/null
+++ b/db/migrate/20230130104819_initialize_conversion_of_ci_build_needs_to_bigint.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class InitializeConversionOfCiBuildNeedsToBigint < Gitlab::Database::Migration[2.1]
+ TABLE = :ci_build_needs
+ COLUMNS = %i[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/20230130110855_backfill_ci_build_needs_for_big_int_conversion.rb b/db/migrate/20230130110855_backfill_ci_build_needs_for_big_int_conversion.rb
new file mode 100644
index 00000000000..ae7ad3b52c2
--- /dev/null
+++ b/db/migrate/20230130110855_backfill_ci_build_needs_for_big_int_conversion.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class BackfillCiBuildNeedsForBigIntConversion < Gitlab::Database::Migration[2.1]
+ TABLE = :ci_build_needs
+ COLUMNS = %i[id]
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_ci
+
+ def up
+ backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+
+ def down
+ revert_backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS)
+ end
+end
diff --git a/db/schema_migrations/20230130104819 b/db/schema_migrations/20230130104819
new file mode 100644
index 00000000000..5236cd410ea
--- /dev/null
+++ b/db/schema_migrations/20230130104819
@@ -0,0 +1 @@
+1d1db0265c80b089d2438bdc43565b2de065d44dce2b737aa022385f45cdbeb0 \ No newline at end of file
diff --git a/db/schema_migrations/20230130110855 b/db/schema_migrations/20230130110855
new file mode 100644
index 00000000000..1ad25e84bfa
--- /dev/null
+++ b/db/schema_migrations/20230130110855
@@ -0,0 +1 @@
+1ee31ee657b890ba62e125c23fecfcc588192521181986b017b524e9044adb18 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 4345733c761..50cc77078c9 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -252,6 +252,15 @@ BEGIN
END;
$$;
+CREATE FUNCTION trigger_3207b8d0d6f3() RETURNS trigger
+ LANGUAGE plpgsql
+ AS $$
+BEGIN
+ NEW."id_convert_to_bigint" := NEW."id";
+ RETURN NEW;
+END;
+$$;
+
CREATE FUNCTION unset_has_issues_on_vulnerability_reads() RETURNS trigger
LANGUAGE plpgsql
AS $$
@@ -12680,7 +12689,8 @@ CREATE TABLE ci_build_needs (
artifacts boolean DEFAULT true NOT NULL,
optional boolean DEFAULT false NOT NULL,
build_id bigint NOT NULL,
- partition_id bigint DEFAULT 100 NOT NULL
+ partition_id bigint DEFAULT 100 NOT NULL,
+ id_convert_to_bigint bigint DEFAULT 0 NOT NULL
);
CREATE SEQUENCE ci_build_needs_id_seq
@@ -33463,6 +33473,8 @@ CREATE TRIGGER trigger_1a857e8db6cd BEFORE INSERT OR UPDATE ON vulnerability_occ
CREATE TRIGGER trigger_c5a5f48f12b0 BEFORE INSERT OR UPDATE ON epic_user_mentions FOR EACH ROW EXECUTE FUNCTION trigger_c5a5f48f12b0();
+CREATE TRIGGER trigger_3207b8d0d6f3 BEFORE INSERT OR UPDATE ON ci_build_needs FOR EACH ROW EXECUTE FUNCTION trigger_3207b8d0d6f3();
+
CREATE TRIGGER trigger_c7107f30d69d BEFORE INSERT OR UPDATE ON merge_request_metrics FOR EACH ROW EXECUTE FUNCTION trigger_c7107f30d69d();
CREATE TRIGGER trigger_delete_project_namespace_on_project_delete AFTER DELETE ON projects FOR EACH ROW WHEN ((old.project_namespace_id IS NOT NULL)) EXECUTE FUNCTION delete_associated_project_namespace();
diff --git a/doc/administration/gitaly/monitoring.md b/doc/administration/gitaly/monitoring.md
index cfaeb53fcea..0fd34d5c89f 100644
--- a/doc/administration/gitaly/monitoring.md
+++ b/doc/administration/gitaly/monitoring.md
@@ -167,16 +167,8 @@ To monitor [strong consistency](index.md#strong-consistency), you can use the fo
- `gitaly_hook_transaction_voting_delay_seconds`, the client-side delay introduced by waiting for
the transaction to be committed.
-To monitor the number of repositories that have no healthy, up-to-date replicas:
-
-- `gitaly_praefect_unavailable_repositories`, the number of repositories that have no healthy, up to date replicas.
- - [Deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/390266) in GitLab 15.9 and will be removed in GitLab 16.0.
-
To monitor [repository verification](praefect.md#repository-verification), use the following Prometheus metrics:
-- `gitaly_praefect_verification_queue_depth`, the total number of replicas pending verification. This metric is:
- - Scraped from the database and is only available when Prometheus is scraping the database metrics.
- - [Deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/390266) in GitLab 15.9 and will be removed in GitLab 16.0.
- `gitaly_praefect_verification_jobs_dequeued_total`, the number of verification jobs picked up by the
worker.
- `gitaly_praefect_verification_jobs_completed_total`, the number of verification jobs completed by the
@@ -187,6 +179,9 @@ To monitor [repository verification](praefect.md#repository-verification), use t
- `gitaly_praefect_stale_verification_leases_released_total`, the number of stale verification leases
released.
+The `/metrics` endpoint also provides all the metrics available under the `/db_metrics` endpoint. Using `/metrics` for `/db_metrics` metrics
+is [deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/390266) in GitLab 15.9 and will be removed in GitLab 16.0.
+
You can also monitor the [Praefect logs](../logs/index.md#praefect-logs).
### Database metrics `/db_metrics` endpoint
diff --git a/doc/ci/services/index.md b/doc/ci/services/index.md
index 8a08ba5450f..f26751c56e7 100644
--- a/doc/ci/services/index.md
+++ b/doc/ci/services/index.md
@@ -404,10 +404,10 @@ time.
Logs generated by applications running in service containers can be captured for subsequent examination and debugging.
You might want to look at service container's logs when the service container has started successfully, but is not
-behaving es expected, leading to job failures. The logs can indicate missing or incorrect configuration of the service
+behaving as expected, leading to job failures. The logs can indicate missing or incorrect configuration of the service
within the container.
-`CI_DEBUG_SERVICES` should only by enabled when service containers are being actively debugged as there are both storage
+`CI_DEBUG_SERVICES` should only be enabled when service containers are being actively debugged as there are both storage
and performance consequences to capturing service container logs.
To enable service logging, add the `CI_DEBUG_SERVICES` variable to the project's
@@ -496,3 +496,8 @@ creation.
## Security when using services containers
Docker privileged mode applies to services. This means that the service image container can access the host system. You should use container images from trusted sources only.
+
+## Shared /builds directory
+
+Services can access files from the build because all services have the job
+directory mounted as a volume under `/builds`.
diff --git a/doc/ci/testing/code_quality.md b/doc/ci/testing/code_quality.md
index 28e10bccf83..175a250d75e 100644
--- a/doc/ci/testing/code_quality.md
+++ b/doc/ci/testing/code_quality.md
@@ -432,7 +432,6 @@ include:
code_quality:
variables:
- CODE_QUALITY_IMAGE: "$CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/codequality:0.85.24"
## You must add a trailing slash to `$CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX`.
CODECLIMATE_PREFIX: $CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX/
CODECLIMATE_REGISTRY_USERNAME: $CI_DEPENDENCY_PROXY_USER
diff --git a/doc/user/group/roadmap/index.md b/doc/user/group/roadmap/index.md
index d73c7d87580..2ad3c28d0ae 100644
--- a/doc/user/group/roadmap/index.md
+++ b/doc/user/group/roadmap/index.md
@@ -38,6 +38,7 @@ heading to toggle the list of the milestone bars.
> - Filtering by epic confidentiality [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/218624) in GitLab 13.9.
> - Filtering by epic [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/218623) in GitLab 13.11.
> - Filtering by milestone [feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/323917) in GitLab 14.5.
+> - Filtering by group was [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/385191) in GitLab 15.9.
NOTE:
Filtering roadmaps by milestone might not be available to you. Be sure to review this section's version history for details.
@@ -62,6 +63,7 @@ You can also filter epics in the Roadmap view by the epics':
- [Confidentiality](../epics/manage_epics.md#make-an-epic-confidential)
- Epic
- Your Reaction
+- Groups
![roadmap date range in weeks](img/roadmap_filters_v13_11.png)
diff --git a/spec/factories/ci/runners.rb b/spec/factories/ci/runners.rb
index 860322075e2..1f4a8eebca2 100644
--- a/spec/factories/ci/runners.rb
+++ b/spec/factories/ci/runners.rb
@@ -58,7 +58,7 @@ FactoryBot.define do
end
end
- trait :created_in_ui do
+ trait :created_via_ui do
legacy_registered { false }
end
diff --git a/spec/frontend/vue_shared/components/user_avatar/user_avatar_list_spec.js b/spec/frontend/vue_shared/components/user_avatar/user_avatar_list_spec.js
index 1ad6d043399..63371b1492b 100644
--- a/spec/frontend/vue_shared/components/user_avatar/user_avatar_list_spec.js
+++ b/spec/frontend/vue_shared/components/user_avatar/user_avatar_list_spec.js
@@ -4,6 +4,7 @@ import { nextTick } from 'vue';
import { TEST_HOST } from 'spec/test_constants';
import UserAvatarLink from '~/vue_shared/components/user_avatar/user_avatar_link.vue';
import UserAvatarList from '~/vue_shared/components/user_avatar/user_avatar_list.vue';
+import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
const TEST_IMAGE_SIZE = 7;
const TEST_BREAKPOINT = 5;
@@ -16,10 +17,13 @@ const createUser = (id) => ({
web_url: `${TEST_HOST}/${id}`,
avatar_url: `${TEST_HOST}/${id}/avatar`,
});
+
const createList = (n) =>
Array(n)
.fill(1)
.map((x, id) => createUser(id));
+const createListCamelCase = (n) =>
+ createList(n).map((user) => convertObjectPropsToCamelCase(user, { deep: true }));
describe('UserAvatarList', () => {
let props;
@@ -75,14 +79,14 @@ describe('UserAvatarList', () => {
props.breakpoint = 0;
});
- it('renders avatars', () => {
+ const linkProps = () =>
+ wrapper.findAllComponents(UserAvatarLink).wrappers.map((x) => x.props());
+
+ it('renders avatars when user has snake_case attributes', () => {
const items = createList(20);
factory({ propsData: { items } });
- const links = wrapper.findAllComponents(UserAvatarLink);
- const linkProps = links.wrappers.map((x) => x.props());
-
- expect(linkProps).toEqual(
+ expect(linkProps()).toEqual(
items.map((x) =>
expect.objectContaining({
linkHref: x.web_url,
@@ -94,6 +98,23 @@ describe('UserAvatarList', () => {
),
);
});
+
+ it('renders avatars when user has camelCase attributes', () => {
+ const items = createListCamelCase(20);
+ factory({ propsData: { items } });
+
+ expect(linkProps()).toEqual(
+ items.map((x) =>
+ expect.objectContaining({
+ linkHref: x.webUrl,
+ imgSrc: x.avatarUrl,
+ imgAlt: x.name,
+ tooltipText: x.name,
+ imgSize: TEST_IMAGE_SIZE,
+ }),
+ ),
+ );
+ });
});
describe('with breakpoint and length equal to breakpoint', () => {
diff --git a/spec/models/ci/runner_spec.rb b/spec/models/ci/runner_spec.rb
index c75d1faf48f..95b87c26c01 100644
--- a/spec/models/ci/runner_spec.rb
+++ b/spec/models/ci/runner_spec.rb
@@ -1737,6 +1737,24 @@ RSpec.describe Ci::Runner, feature_category: :runner do
end
end
+ describe '#short_sha' do
+ subject(:short_sha) { runner.short_sha }
+
+ context 'when registered via command-line' do
+ let(:runner) { create(:ci_runner) }
+
+ specify { expect(runner.token).not_to start_with(described_class::CREATED_RUNNER_TOKEN_PREFIX) }
+ it { is_expected.not_to start_with(described_class::CREATED_RUNNER_TOKEN_PREFIX) }
+ end
+
+ context 'when creating new runner via UI' do
+ let(:runner) { create(:ci_runner, :created_via_ui) }
+
+ specify { expect(runner.token).to start_with(described_class::CREATED_RUNNER_TOKEN_PREFIX) }
+ it { is_expected.not_to start_with(described_class::CREATED_RUNNER_TOKEN_PREFIX) }
+ end
+ end
+
describe '#token' do
subject(:token) { runner.token }
@@ -1746,8 +1764,8 @@ RSpec.describe Ci::Runner, feature_category: :runner do
it { is_expected.not_to start_with('glrt-') }
end
- context 'when runner is created in UI' do
- let(:runner) { create(:ci_runner, :created_in_ui) }
+ context 'when runner is created via UI' do
+ let(:runner) { create(:ci_runner, :created_via_ui) }
it { is_expected.to start_with('glrt-') }
end
@@ -1986,7 +2004,7 @@ RSpec.describe Ci::Runner, feature_category: :runner do
end
context 'when runner created via UI' do
- let(:runner) { create(:ci_runner, :created_in_ui) }
+ let(:runner) { create(:ci_runner, :created_via_ui) }
it { is_expected.to eq true }
end
diff --git a/spec/services/import/gitlab_projects/file_acquisition_strategies/remote_file_spec.rb b/spec/services/import/gitlab_projects/file_acquisition_strategies/remote_file_spec.rb
index 8565299b9b7..a28a552746f 100644
--- a/spec/services/import/gitlab_projects/file_acquisition_strategies/remote_file_spec.rb
+++ b/spec/services/import/gitlab_projects/file_acquisition_strategies/remote_file_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe ::Import::GitlabProjects::FileAcquisitionStrategies::RemoteFile, :aggregate_failures do
+RSpec.describe ::Import::GitlabProjects::FileAcquisitionStrategies::RemoteFile, :aggregate_failures, feature_category: :importers do
let(:remote_url) { 'https://external.file.path/file.tar.gz' }
let(:params) { { remote_import_url: remote_url } }
@@ -40,23 +40,19 @@ RSpec.describe ::Import::GitlabProjects::FileAcquisitionStrategies::RemoteFile,
end
end
- context 'when import_project_from_remote_file_s3 is enabled' do
- before do
- stub_feature_flags(import_project_from_remote_file_s3: true)
- end
-
- context 'when the HTTP request fail to recover the headers' do
- it 'adds the error message' do
- expect(Gitlab::HTTP)
- .to receive(:head)
- .and_raise(StandardError, 'request invalid')
+ context 'when the HTTP request fails to recover the headers' do
+ it 'adds the error message' do
+ expect(Gitlab::HTTP)
+ .to receive(:head)
+ .and_raise(StandardError, 'request invalid')
- expect(subject).not_to be_valid
- expect(subject.errors.full_messages)
- .to include('Failed to retrive headers: request invalid')
- end
+ expect(subject).not_to be_valid
+ expect(subject.errors.full_messages)
+ .to include('Failed to retrive headers: request invalid')
end
+ end
+ context 'when request is not from an S3 server' do
it 'validates the remote content-length' do
stub_headers_for(remote_url, { 'content-length' => 11.gigabytes })
@@ -72,57 +68,19 @@ RSpec.describe ::Import::GitlabProjects::FileAcquisitionStrategies::RemoteFile,
expect(subject.errors.full_messages)
.to include("Content type 'unknown' not allowed. (Allowed: application/gzip, application/x-tar, application/x-gzip)")
end
-
- context 'when trying to import from AWS S3' do
- it 'adds an error suggesting to use `projects/remote-import-s3`' do
- stub_headers_for(
- remote_url,
- 'Server' => 'AmazonS3',
- 'x-amz-request-id' => 'some-id'
- )
-
- expect(subject).not_to be_valid
- expect(subject.errors.full_messages)
- .to include('To import from AWS S3 use `projects/remote-import-s3`')
- end
- end
end
- context 'when import_project_from_remote_file_s3 is disabled' do
- before do
- stub_feature_flags(import_project_from_remote_file_s3: false)
- end
-
- context 'when trying to import from AWS S3' do
- it 'does not validate the remote content-length or content-type' do
- stub_headers_for(
- remote_url,
- 'Server' => 'AmazonS3',
- 'x-amz-request-id' => 'some-id',
- 'content-length' => 11.gigabytes,
- 'content-type' => 'unknown'
- )
-
- expect(subject).to be_valid
- end
- end
-
- context 'when NOT trying to import from AWS S3' do
- it 'validates content-length and content-type' do
- stub_headers_for(
- remote_url,
- 'Server' => 'NOT AWS S3',
- 'content-length' => 11.gigabytes,
- 'content-type' => 'unknown'
- )
-
- expect(subject).not_to be_valid
-
- expect(subject.errors.full_messages)
- .to include("Content type 'unknown' not allowed. (Allowed: application/gzip, application/x-tar, application/x-gzip)")
- expect(subject.errors.full_messages)
- .to include('Content length is too big (should be at most 10 GB)')
- end
+ context 'when request is from an S3 server' do
+ it 'does not validate the remote content-length or content-type' do
+ stub_headers_for(
+ remote_url,
+ 'Server' => 'AmazonS3',
+ 'x-amz-request-id' => 'some-id',
+ 'content-length' => 11.gigabytes,
+ 'content-type' => 'unknown'
+ )
+
+ expect(subject).to be_valid
end
end
end