summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitlab/CODEOWNERS2
-rw-r--r--Gemfile2
-rw-r--r--Gemfile.checksum2
-rw-r--r--Gemfile.lock6
-rw-r--r--app/assets/javascripts/import_entities/import_projects/components/provider_repo_table_row.vue2
-rw-r--r--app/assets/javascripts/monitoring/components/links_section.vue2
-rw-r--r--app/assets/javascripts/vue_merge_request_widget/components/widget/widget.vue1
-rw-r--r--app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_image.vue2
-rw-r--r--app/assets/stylesheets/page_bundles/issues_list.scss5
-rw-r--r--app/assets/stylesheets/page_bundles/merge_requests.scss9
-rw-r--r--app/controllers/concerns/renders_commits.rb2
-rw-r--r--app/graphql/resolvers/blobs_resolver.rb2
-rw-r--r--app/models/active_session.rb7
-rw-r--r--config/feature_flags/development/product_analytics_dashboards.yml8
-rw-r--r--config/feature_flags/development/project_analytics_dashboards_page.yml8
-rw-r--r--config/sidekiq_queues.yml2
-rw-r--r--db/migrate/20230307212637_remove_create_learn_gitlab_worker_job_instances.rb6
-rw-r--r--db/post_migrate/20230322023442_ensure_note_diff_files_bigint_backfill_is_finished_for_gitlab_dot_com.rb29
-rw-r--r--db/post_migrate/20230323005730_add_unique_index_diff_note_id_convert_to_bigint_for_gitlab_com.rb30
-rw-r--r--db/post_migrate/20230323010111_add_fk_on_diff_note_id_convert_to_bigint_for_gitlab_com.rb43
-rw-r--r--db/post_migrate/20230323013251_async_validate_fk_note_diff_files_diff_note_id_convert_to_bigint_for_gitlab_com.rb27
-rw-r--r--db/schema_migrations/202303220234421
-rw-r--r--db/schema_migrations/202303230057301
-rw-r--r--db/schema_migrations/202303230101111
-rw-r--r--db/schema_migrations/202303230132511
-rw-r--r--db/structure.sql5
-rw-r--r--doc/api/product_analytics.md1
-rw-r--r--doc/ci/pipelines/cicd_minutes.md2
-rw-r--r--doc/user/product_analytics/index.md11
-rw-r--r--lib/gitlab/git_ref_validator.rb4
-rw-r--r--spec/controllers/projects/commits_controller_spec.rb6
-rw-r--r--spec/controllers/projects/compare_controller_spec.rb27
-rw-r--r--spec/graphql/resolvers/blobs_resolver_spec.rb8
-rw-r--r--spec/lib/gitlab/git_ref_validator_spec.rb5
-rw-r--r--spec/migrations/ensure_note_diff_files_bigint_backfill_is_finished_for_gitlab_dot_com_spec.rb35
-rw-r--r--spec/models/active_session_spec.rb24
-rw-r--r--spec/workers/every_sidekiq_worker_spec.rb1
-rw-r--r--workhorse/go.mod2
-rw-r--r--workhorse/go.sum4
39 files changed, 259 insertions, 77 deletions
diff --git a/.gitlab/CODEOWNERS b/.gitlab/CODEOWNERS
index 53c06dfe33f..707d98a0ad9 100644
--- a/.gitlab/CODEOWNERS
+++ b/.gitlab/CODEOWNERS
@@ -320,6 +320,8 @@ Dangerfile @gl-quality/eng-prod
/ee/spec/lib/ee/api/entities/experiment_spec.rb @gitlab-org/growth/experiment-devs
^[Growth]
+/ee/app/workers/onboarding/ @gitlab-org/growth/engineers
+/ee/spec/workers/onboarding/ @gitlab-org/growth/engineers
/app/models/onboarding/ @gitlab-org/growth/engineers
/spec/models/onboarding/ @gitlab-org/growth/engineers
/app/services/onboarding/ @gitlab-org/growth/engineers
diff --git a/Gemfile b/Gemfile
index 960f5c1dbae..f32b7553c9b 100644
--- a/Gemfile
+++ b/Gemfile
@@ -368,7 +368,7 @@ gem 'prometheus-client-mmap', '~> 0.19', require: 'prometheus/client'
gem 'warning', '~> 1.3.0'
group :development do
- gem 'lefthook', '~> 1.3.7', require: false
+ gem 'lefthook', '~> 1.3.8', require: false
gem 'rubocop'
gem 'solargraph', '~> 0.47.2', require: false
diff --git a/Gemfile.checksum b/Gemfile.checksum
index 5999503f466..f5293c82637 100644
--- a/Gemfile.checksum
+++ b/Gemfile.checksum
@@ -326,7 +326,7 @@
{"name":"kramdown-parser-gfm","version":"1.1.0","platform":"ruby","checksum":"fb39745516427d2988543bf01fc4cf0ab1149476382393e0e9c48592f6581729"},
{"name":"kubeclient","version":"4.11.0","platform":"ruby","checksum":"4985fcd749fb8c364a668a8350a49821647f03aa52d9ee6cbc582beb8e883fcc"},
{"name":"launchy","version":"2.5.0","platform":"ruby","checksum":"954243c4255920982ce682f89a42e76372dba94770bf09c23a523e204bdebef5"},
-{"name":"lefthook","version":"1.3.7","platform":"ruby","checksum":"94bcec3a7bba79fa6f0d1aec9e9cf5b1a75ac507700edb5e7f5662cec710f651"},
+{"name":"lefthook","version":"1.3.8","platform":"ruby","checksum":"17a68731c15113529391c512aeb34bafd043390d471c1bb70d423774af33b241"},
{"name":"letter_opener","version":"1.7.0","platform":"ruby","checksum":"095bc0d58e006e5b43ea7d219e64ecf2de8d1f7d9dafc432040a845cf59b4725"},
{"name":"letter_opener_web","version":"2.0.0","platform":"ruby","checksum":"33860ad41e1785d75456500e8ca8bba8ed71ee6eaf08a98d06bbab67c5577b6f"},
{"name":"libyajl2","version":"1.2.0","platform":"ruby","checksum":"1117cd1e48db013b626e36269bbf1cef210538ca6d2e62d3fa3db9ded005b258"},
diff --git a/Gemfile.lock b/Gemfile.lock
index 2f9ebf90e01..484ebdaf7d5 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -876,7 +876,7 @@ GEM
rest-client (~> 2.0)
launchy (2.5.0)
addressable (~> 2.7)
- lefthook (1.3.7)
+ lefthook (1.3.8)
letter_opener (1.7.0)
launchy (~> 2.2)
letter_opener_web (2.0.0)
@@ -1780,7 +1780,7 @@ DEPENDENCIES
knapsack (~> 1.21.1)
kramdown (~> 2.3.1)
kubeclient (~> 4.11.0)
- lefthook (~> 1.3.7)
+ lefthook (~> 1.3.8)
letter_opener_web (~> 2.0.0)
license_finder (~> 7.0)
licensee (~> 9.15)
@@ -1936,4 +1936,4 @@ DEPENDENCIES
yajl-ruby (~> 1.4.3)
BUNDLED WITH
- 2.4.8
+ 2.4.9
diff --git a/app/assets/javascripts/import_entities/import_projects/components/provider_repo_table_row.vue b/app/assets/javascripts/import_entities/import_projects/components/provider_repo_table_row.vue
index 265cca9070e..a5f29490e24 100644
--- a/app/assets/javascripts/import_entities/import_projects/components/provider_repo_table_row.vue
+++ b/app/assets/javascripts/import_entities/import_projects/components/provider_repo_table_row.vue
@@ -180,7 +180,7 @@ export default {
</div>
</td>
<td
- class="gl-display-flex gl-sm-flex-wrap gl-p-4 gl-pt-5 gl-vertical-align-top"
+ class="gl-display-flex gl-sm-flex-wrap-wrap gl-p-4 gl-pt-5 gl-vertical-align-top"
data-testid="fullPath"
data-qa-selector="project_path_content"
>
diff --git a/app/assets/javascripts/monitoring/components/links_section.vue b/app/assets/javascripts/monitoring/components/links_section.vue
index fb5ab12916e..e431ba6ea0a 100644
--- a/app/assets/javascripts/monitoring/components/links_section.vue
+++ b/app/assets/javascripts/monitoring/components/links_section.vue
@@ -15,7 +15,7 @@ export default {
<template>
<div
ref="linksSection"
- class="gl-sm-display-flex gl-sm-flex-wrap gl-mt-5 gl-p-3 gl-bg-gray-10 border gl-rounded-base links-section"
+ class="gl-sm-display-flex gl-sm-flex-wrap-wrap gl-mt-5 gl-p-3 gl-bg-gray-10 border gl-rounded-base links-section"
>
<div
v-for="(link, key) in links"
diff --git a/app/assets/javascripts/vue_merge_request_widget/components/widget/widget.vue b/app/assets/javascripts/vue_merge_request_widget/components/widget/widget.vue
index a754d4e80ea..40873245beb 100644
--- a/app/assets/javascripts/vue_merge_request_widget/components/widget/widget.vue
+++ b/app/assets/javascripts/vue_merge_request_widget/components/widget/widget.vue
@@ -346,6 +346,7 @@ export default {
category="tertiary"
data-testid="toggle-button"
size="small"
+ data-qa-selector="expand_report_button"
@click="toggleCollapsed"
/>
</div>
diff --git a/app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_image.vue b/app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_image.vue
index 6552a874c3a..71cf85c75a7 100644
--- a/app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_image.vue
+++ b/app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_image.vue
@@ -90,7 +90,7 @@ export default {
</script>
<template>
- <span ref="userAvatar">
+ <span ref="userAvatar" class="gl-display-inline-flex">
<gl-avatar
:class="{
lazy: lazy,
diff --git a/app/assets/stylesheets/page_bundles/issues_list.scss b/app/assets/stylesheets/page_bundles/issues_list.scss
index 41515a98e0a..f39dee12126 100644
--- a/app/assets/stylesheets/page_bundles/issues_list.scss
+++ b/app/assets/stylesheets/page_bundles/issues_list.scss
@@ -23,11 +23,6 @@
margin-bottom: 2px;
}
- .issue-labels,
- .author-link {
- display: inline-block;
- }
-
.icon-merge-request-unmerged {
height: 13px;
margin-bottom: 3px;
diff --git a/app/assets/stylesheets/page_bundles/merge_requests.scss b/app/assets/stylesheets/page_bundles/merge_requests.scss
index b01ff498ad3..c9a937e21a7 100644
--- a/app/assets/stylesheets/page_bundles/merge_requests.scss
+++ b/app/assets/stylesheets/page_bundles/merge_requests.scss
@@ -915,15 +915,6 @@ $tabs-holder-z-index: 250;
&:not(:first-child) {
margin-top: $gl-padding;
}
-
- &:not(:last-child)::before {
- content: '';
- border-left: 2px solid var(--border-color, $border-color);
- position: absolute;
- bottom: -17px;
- left: 26px;
- height: 16px;
- }
}
.mr-version-controls {
diff --git a/app/controllers/concerns/renders_commits.rb b/app/controllers/concerns/renders_commits.rb
index f1f5a1179c9..fca394f9fe1 100644
--- a/app/controllers/concerns/renders_commits.rb
+++ b/app/controllers/concerns/renders_commits.rb
@@ -33,6 +33,6 @@ module RendersCommits
def valid_ref?(ref_name)
return true unless ref_name.present?
- Gitlab::GitRefValidator.validate(ref_name)
+ Gitlab::GitRefValidator.validate(ref_name, skip_head_ref_check: true)
end
end
diff --git a/app/graphql/resolvers/blobs_resolver.rb b/app/graphql/resolvers/blobs_resolver.rb
index fb5fa4465f9..0b8180dbce7 100644
--- a/app/graphql/resolvers/blobs_resolver.rb
+++ b/app/graphql/resolvers/blobs_resolver.rb
@@ -38,7 +38,7 @@ module Resolvers
private
def validate_ref(ref)
- unless Gitlab::GitRefValidator.validate(ref)
+ unless Gitlab::GitRefValidator.validate(ref, skip_head_ref_check: true)
raise Gitlab::Graphql::Errors::ArgumentError, 'Ref is not valid'
end
end
diff --git a/app/models/active_session.rb b/app/models/active_session.rb
index 2d1dec1977d..83d86d02608 100644
--- a/app/models/active_session.rb
+++ b/app/models/active_session.rb
@@ -91,13 +91,6 @@ class ActiveSession
active_user_session.dump
)
- # Deprecated legacy format - temporary to support mixed deployments
- pipeline.setex(
- key_name_v1(user.id, session_private_id),
- expiry,
- Marshal.dump(active_user_session)
- )
-
pipeline.sadd?(
lookup_key_name(user.id),
session_private_id
diff --git a/config/feature_flags/development/product_analytics_dashboards.yml b/config/feature_flags/development/product_analytics_dashboards.yml
new file mode 100644
index 00000000000..7133d01d4db
--- /dev/null
+++ b/config/feature_flags/development/product_analytics_dashboards.yml
@@ -0,0 +1,8 @@
+---
+name: product_analytics_dashboards
+introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/115177
+rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/398653
+milestone: '15.11'
+type: development
+group: group::product analytics
+default_enabled: false
diff --git a/config/feature_flags/development/project_analytics_dashboards_page.yml b/config/feature_flags/development/project_analytics_dashboards_page.yml
deleted file mode 100644
index 192d86bd30a..00000000000
--- a/config/feature_flags/development/project_analytics_dashboards_page.yml
+++ /dev/null
@@ -1,8 +0,0 @@
----
-name: project_analytics_dashboards_page
-introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/109618
-rollout_issue_url:
-milestone: '15.9'
-type: development
-group: group::optimize
-default_enabled: false
diff --git a/config/sidekiq_queues.yml b/config/sidekiq_queues.yml
index 344e779714a..d380a721a4c 100644
--- a/config/sidekiq_queues.yml
+++ b/config/sidekiq_queues.yml
@@ -365,6 +365,8 @@
- 1
- - object_storage
- 1
+- - onboarding_create_learn_gitlab
+ - 1
- - onboarding_issue_created
- 1
- - onboarding_pipeline_created
diff --git a/db/migrate/20230307212637_remove_create_learn_gitlab_worker_job_instances.rb b/db/migrate/20230307212637_remove_create_learn_gitlab_worker_job_instances.rb
index d3b6ee2ffd8..b2e4cc8ceb2 100644
--- a/db/migrate/20230307212637_remove_create_learn_gitlab_worker_job_instances.rb
+++ b/db/migrate/20230307212637_remove_create_learn_gitlab_worker_job_instances.rb
@@ -1,13 +1,11 @@
# frozen_string_literal: true
class RemoveCreateLearnGitlabWorkerJobInstances < Gitlab::Database::Migration[2.1]
- DEPRECATED_JOB_CLASSES = %w[Onboarding::CreateLearnGitlabWorker]
-
def up
- sidekiq_remove_jobs(job_klasses: DEPRECATED_JOB_CLASSES)
+ # No-op to fix https://gitlab.com/gitlab-com/gl-infra/production/-/issues/8612
end
def down
- # This migration removes any instances of deprecated workers and cannot be undone.
+ # No-op to fix https://gitlab.com/gitlab-com/gl-infra/production/-/issues/8612
end
end
diff --git a/db/post_migrate/20230322023442_ensure_note_diff_files_bigint_backfill_is_finished_for_gitlab_dot_com.rb b/db/post_migrate/20230322023442_ensure_note_diff_files_bigint_backfill_is_finished_for_gitlab_dot_com.rb
new file mode 100644
index 00000000000..40b4967b306
--- /dev/null
+++ b/db/post_migrate/20230322023442_ensure_note_diff_files_bigint_backfill_is_finished_for_gitlab_dot_com.rb
@@ -0,0 +1,29 @@
+# frozen_string_literal: true
+
+class EnsureNoteDiffFilesBigintBackfillIsFinishedForGitlabDotCom < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::ConvertToBigint
+
+ restrict_gitlab_migration gitlab_schema: :gitlab_main
+ disable_ddl_transaction!
+
+ def up
+ return unless should_run?
+
+ ensure_batched_background_migration_is_finished(
+ job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
+ table_name: 'note_diff_files',
+ column_name: 'id',
+ job_arguments: [['diff_note_id'], ['diff_note_id_convert_to_bigint']]
+ )
+ end
+
+ def down
+ # no-op
+ end
+
+ private
+
+ def should_run?
+ com_or_dev_or_test_but_not_jh?
+ end
+end
diff --git a/db/post_migrate/20230323005730_add_unique_index_diff_note_id_convert_to_bigint_for_gitlab_com.rb b/db/post_migrate/20230323005730_add_unique_index_diff_note_id_convert_to_bigint_for_gitlab_com.rb
new file mode 100644
index 00000000000..2550b5b07e9
--- /dev/null
+++ b/db/post_migrate/20230323005730_add_unique_index_diff_note_id_convert_to_bigint_for_gitlab_com.rb
@@ -0,0 +1,30 @@
+# frozen_string_literal: true
+
+class AddUniqueIndexDiffNoteIdConvertToBigintForGitlabCom < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::ConvertToBigint
+
+ disable_ddl_transaction!
+
+ TABLE_NAME = :note_diff_files
+ INDEX_NAME = :index_note_diff_files_on_diff_note_id_convert_to_bigint
+
+ def up
+ return unless should_run?
+
+ # This will replace the existing index_note_diff_files_on_diff_note_id
+ add_concurrent_index TABLE_NAME, :diff_note_id_convert_to_bigint, unique: true,
+ name: INDEX_NAME
+ end
+
+ def down
+ return unless should_run?
+
+ remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME)
+ end
+
+ private
+
+ def should_run?
+ com_or_dev_or_test_but_not_jh?
+ end
+end
diff --git a/db/post_migrate/20230323010111_add_fk_on_diff_note_id_convert_to_bigint_for_gitlab_com.rb b/db/post_migrate/20230323010111_add_fk_on_diff_note_id_convert_to_bigint_for_gitlab_com.rb
new file mode 100644
index 00000000000..d2c833fd8d6
--- /dev/null
+++ b/db/post_migrate/20230323010111_add_fk_on_diff_note_id_convert_to_bigint_for_gitlab_com.rb
@@ -0,0 +1,43 @@
+# frozen_string_literal: true
+
+class AddFkOnDiffNoteIdConvertToBigintForGitlabCom < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::ConvertToBigint
+
+ disable_ddl_transaction!
+
+ SOURCE_TABLE_NAME = :note_diff_files
+ TARGET_TABLE_NAME = :notes
+ FK_NAME = :fk_note_diff_files_diff_note_id_convert_to_bigint
+
+ def up
+ return unless should_run?
+
+ # This will replace the existing fk_rails_3d66047aeb
+ # when we swap the integer and bigint columns
+ add_concurrent_foreign_key SOURCE_TABLE_NAME, TARGET_TABLE_NAME,
+ column: :diff_note_id_convert_to_bigint,
+ name: FK_NAME,
+ on_delete: :cascade,
+ reverse_lock_order: true,
+ validate: false
+ end
+
+ def down
+ return unless should_run?
+
+ with_lock_retries do
+ remove_foreign_key_if_exists(
+ SOURCE_TABLE_NAME,
+ TARGET_TABLE_NAME,
+ name: FK_NAME,
+ reverse_lock_order: true
+ )
+ end
+ end
+
+ private
+
+ def should_run?
+ com_or_dev_or_test_but_not_jh?
+ end
+end
diff --git a/db/post_migrate/20230323013251_async_validate_fk_note_diff_files_diff_note_id_convert_to_bigint_for_gitlab_com.rb b/db/post_migrate/20230323013251_async_validate_fk_note_diff_files_diff_note_id_convert_to_bigint_for_gitlab_com.rb
new file mode 100644
index 00000000000..1e65fae223a
--- /dev/null
+++ b/db/post_migrate/20230323013251_async_validate_fk_note_diff_files_diff_note_id_convert_to_bigint_for_gitlab_com.rb
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+
+class AsyncValidateFkNoteDiffFilesDiffNoteIdConvertToBigintForGitlabCom < Gitlab::Database::Migration[2.1]
+ include Gitlab::Database::MigrationHelpers::ConvertToBigint
+
+ TABLE_NAME = :note_diff_files
+ COLUMN = :diff_note_id_convert_to_bigint
+ FK_NAME = :fk_note_diff_files_diff_note_id_convert_to_bigint
+
+ def up
+ return unless should_run?
+
+ prepare_async_foreign_key_validation TABLE_NAME, COLUMN, name: FK_NAME
+ end
+
+ def down
+ return unless should_run?
+
+ unprepare_async_foreign_key_validation TABLE_NAME, COLUMN, name: FK_NAME
+ end
+
+ private
+
+ def should_run?
+ com_or_dev_or_test_but_not_jh?
+ end
+end
diff --git a/db/schema_migrations/20230322023442 b/db/schema_migrations/20230322023442
new file mode 100644
index 00000000000..59de5395302
--- /dev/null
+++ b/db/schema_migrations/20230322023442
@@ -0,0 +1 @@
+41d619c9e22fb91b3cf4f04482b48a66d027dda0c705423c4a9a84de991ea42d \ No newline at end of file
diff --git a/db/schema_migrations/20230323005730 b/db/schema_migrations/20230323005730
new file mode 100644
index 00000000000..52e64f71e51
--- /dev/null
+++ b/db/schema_migrations/20230323005730
@@ -0,0 +1 @@
+38395557e91452474bbebcbaa7e728ce83277757d38e72cec41392e3437d40ba \ No newline at end of file
diff --git a/db/schema_migrations/20230323010111 b/db/schema_migrations/20230323010111
new file mode 100644
index 00000000000..896d7f5488b
--- /dev/null
+++ b/db/schema_migrations/20230323010111
@@ -0,0 +1 @@
+89f6e9276f2b5518315e70c9d91371ca6ae291e7dace64934f49c9793ce8d51f \ No newline at end of file
diff --git a/db/schema_migrations/20230323013251 b/db/schema_migrations/20230323013251
new file mode 100644
index 00000000000..67c69c00346
--- /dev/null
+++ b/db/schema_migrations/20230323013251
@@ -0,0 +1 @@
+504a374319d8da45286d609e7ef1a06b154436e0ed7c44ccbce4ad98ef9f6c00 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 2982be22aa7..c471cd3068a 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -31187,6 +31187,8 @@ CREATE INDEX index_non_requested_project_members_on_source_id_and_type ON member
CREATE UNIQUE INDEX index_note_diff_files_on_diff_note_id ON note_diff_files USING btree (diff_note_id);
+CREATE UNIQUE INDEX index_note_diff_files_on_diff_note_id_convert_to_bigint ON note_diff_files USING btree (diff_note_id_convert_to_bigint);
+
CREATE INDEX index_notes_for_cherry_picked_merge_requests ON notes USING btree (project_id, commit_id) WHERE ((noteable_type)::text = 'MergeRequest'::text);
CREATE INDEX index_notes_on_author_id_and_created_at_and_id ON notes USING btree (author_id, created_at, id);
@@ -35164,6 +35166,9 @@ ALTER TABLE ONLY issues
ALTER TABLE ONLY geo_event_log
ADD CONSTRAINT fk_geo_event_log_on_geo_event_id FOREIGN KEY (geo_event_id) REFERENCES geo_events(id) ON DELETE CASCADE;
+ALTER TABLE ONLY note_diff_files
+ ADD CONSTRAINT fk_note_diff_files_diff_note_id_convert_to_bigint FOREIGN KEY (diff_note_id_convert_to_bigint) REFERENCES notes(id) ON DELETE CASCADE NOT VALID;
+
ALTER TABLE ONLY path_locks
ADD CONSTRAINT fk_path_locks_user_id FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
diff --git a/doc/api/product_analytics.md b/doc/api/product_analytics.md
index 8eda24d1c65..c37fe223778 100644
--- a/doc/api/product_analytics.md
+++ b/doc/api/product_analytics.md
@@ -8,6 +8,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
> - Introduced in GitLab 15.4 [with a flag](../administration/feature_flags.md) named `cube_api_proxy`. Disabled by default.
> - `cube_api_proxy` removed and replaced with `product_analytics_internal_preview` in GitLab 15.10.
+> - `product_analytics_internal_preview` replaced with `product_analytics_dashboards` in GitLab 15.11.
FLAG:
On self-managed GitLab, by default this feature is not available. To make it available per project or for your entire instance, ask an administrator to [enable the feature flag](../administration/feature_flags.md) named `cube_api_proxy`.
diff --git a/doc/ci/pipelines/cicd_minutes.md b/doc/ci/pipelines/cicd_minutes.md
index bda4f65cff5..cba0004eb67 100644
--- a/doc/ci/pipelines/cicd_minutes.md
+++ b/doc/ci/pipelines/cicd_minutes.md
@@ -8,7 +8,7 @@ type: reference
# CI/CD minutes quota **(PREMIUM)**
NOTE:
-`CI/CD minutes` is being renamed to `compute credits`. During this transition, you might see references in the UI and documentation to `CI/CD minutes`, `CI minutes`, `pipeline minutes`, `CI pipeline minutes`, `pipeline minutes quota`, and `compute credits`. For more information, see [issue 5218](https://gitlab.com/gitlab-com/Product/-/issues/5218).
+The term `CI/CD minutes` is being renamed to `compute credits`. During this transition, you might see references in the UI and documentation to `CI/CD minutes`, `CI minutes`, `pipeline minutes`, `CI pipeline minutes`, `pipeline minutes quota`, and `compute credits`. For more information, see [issue 5218](https://gitlab.com/gitlab-com/Product/-/issues/5218).
Administrators can limit the amount of time that projects can use to run jobs on
[shared runners](../runners/runners_scope.md#shared-runners) each month. This limit
diff --git a/doc/user/product_analytics/index.md b/doc/user/product_analytics/index.md
index 1a6ad4edf02..64889fc75c3 100644
--- a/doc/user/product_analytics/index.md
+++ b/doc/user/product_analytics/index.md
@@ -9,9 +9,10 @@ info: To determine the technical writer assigned to the Stage/Group associated w
> - Introduced in GitLab 15.4 as an [Alpha](../../policy/alpha-beta-support.md#alpha-features) feature [with a flag](../../administration/feature_flags.md) named `cube_api_proxy`. Disabled by default.
> - `cube_api_proxy` revised to only reference the [Product Analytics API](../../api/product_analytics.md) in GitLab 15.6.
> - `cube_api_proxy` removed and replaced with `product_analytics_internal_preview` in GitLab 15.10.
+> - `product_analytics_internal_preview` replaced with `product_analytics_dashboards` in GitLab 15.11.
FLAG:
-On self-managed GitLab, by default this feature is not available. To make it available per project or for your entire instance, ask an administrator to [enable the feature flag](../../administration/feature_flags.md) named `product_analytics_internal_preview`.
+On self-managed GitLab, by default this feature is not available. To make it available per project or for your entire instance, ask an administrator to [enable the feature flag](../../administration/feature_flags.md) named `product_analytics_dashboards`.
On GitLab.com, this feature is not available.
This feature is not ready for production use.
@@ -52,9 +53,10 @@ Product Analytics uses several tools:
> - Introduced in GitLab 15.6 behind the [feature flag](../../administration/feature_flags.md) named `cube_api_proxy`. Disabled by default.
> - Moved to be behind the [feature flag](../../administration/feature_flags.md) named `product_analytics_admin_settings` in GitLab 15.7. Disabled by default.
> - `cube_api_proxy` removed and replaced with `product_analytics_internal_preview` in GitLab 15.10.
+> - `product_analytics_admin_settings` and `product_analytics_internal_preview` consolidated and replaced with `product_analytics_dashboards` in GitLab 15.11.
FLAG:
-On self-managed GitLab, by default this feature is not available. To make it available per project or for your entire instance, ask an administrator to [enable the feature flag](../../administration/feature_flags.md) named `product_analytics_admin_settings`.
+On self-managed GitLab, by default this feature is not available. To make it available per project or for your entire instance, ask an administrator to [enable the feature flag](../../administration/feature_flags.md) named `product_analytics_dashboards`.
On GitLab.com, this feature is not available.
This feature is not ready for production use.
@@ -85,10 +87,11 @@ Prerequisite:
## Product analytics dashboards
-> Introduced in GitLab 15.5 behind the [feature flag](../../administration/feature_flags.md) named `product_analytics_internal_preview`. Disabled by default.
+> - Introduced in GitLab 15.5 behind the [feature flag](../../administration/feature_flags.md) named `product_analytics_internal_preview`. Disabled by default.
+> - `product_analytics_internal_preview` replaced with `product_analytics_dashboards` in GitLab 15.11.
FLAG:
-On self-managed GitLab, by default this feature is not available. To make it available per project or for your entire instance, ask an administrator to [enable the feature flag](../../administration/feature_flags.md) named `product_analytics_internal_preview`.
+On self-managed GitLab, by default this feature is not available. To make it available per project or for your entire instance, ask an administrator to [enable the feature flag](../../administration/feature_flags.md) named `product_analytics_dashboards`.
On GitLab.com, this feature is not available.
This feature is not ready for production use.
diff --git a/lib/gitlab/git_ref_validator.rb b/lib/gitlab/git_ref_validator.rb
index f4d4cebc096..7867e1b8c37 100644
--- a/lib/gitlab/git_ref_validator.rb
+++ b/lib/gitlab/git_ref_validator.rb
@@ -12,10 +12,10 @@ module Gitlab
# Validates a given name against the git reference specification
#
# Returns true for a valid reference name, false otherwise
- def validate(ref_name)
+ def validate(ref_name, skip_head_ref_check: false)
return false if ref_name.to_s.empty? # #blank? raises an ArgumentError for invalid encodings
return false if ref_name.start_with?(*(EXPANDED_PREFIXES + DISALLOWED_PREFIXES))
- return false if ref_name == 'HEAD'
+ return false if ref_name == 'HEAD' && !skip_head_ref_check
begin
Rugged::Reference.valid_name?("refs/heads/#{ref_name}")
diff --git a/spec/controllers/projects/commits_controller_spec.rb b/spec/controllers/projects/commits_controller_spec.rb
index 9e03d1f315b..55ad92c517c 100644
--- a/spec/controllers/projects/commits_controller_spec.rb
+++ b/spec/controllers/projects/commits_controller_spec.rb
@@ -39,6 +39,12 @@ RSpec.describe Projects::CommitsController, feature_category: :source_code_manag
it { is_expected.to respond_with(:success) }
end
+ context "HEAD, valid file" do
+ let(:id) { 'HEAD/README.md' }
+
+ it { is_expected.to respond_with(:success) }
+ end
+
context "valid branch, invalid file" do
let(:id) { 'master/invalid-path.rb' }
diff --git a/spec/controllers/projects/compare_controller_spec.rb b/spec/controllers/projects/compare_controller_spec.rb
index 3751b89951c..a49f8b51c12 100644
--- a/spec/controllers/projects/compare_controller_spec.rb
+++ b/spec/controllers/projects/compare_controller_spec.rb
@@ -284,14 +284,18 @@ RSpec.describe Projects::CompareController do
let(:to_ref) { '5937ac0a7beb003549fc5fd26fc247adbce4a52e' }
let(:page) { 1 }
- it 'shows the diff' do
- show_request
+ shared_examples 'valid compare page' do
+ it 'shows the diff' do
+ show_request
- expect(response).to be_successful
- expect(assigns(:diffs).diff_files.first).to be_present
- expect(assigns(:commits).length).to be >= 1
+ expect(response).to be_successful
+ expect(assigns(:diffs).diff_files.first).to be_present
+ expect(assigns(:commits).length).to be >= 1
+ end
end
+ it_behaves_like 'valid compare page'
+
it 'only loads blobs in the current page' do
stub_const('Projects::CompareController::COMMIT_DIFFS_PER_PAGE', 1)
@@ -306,6 +310,19 @@ RSpec.describe Projects::CompareController do
expect(response).to be_successful
end
+
+ context 'when from_ref is HEAD ref' do
+ let(:from_ref) { 'HEAD' }
+ let(:to_ref) { 'feature' } # Need to change to_ref too so there's something to compare with HEAD
+
+ it_behaves_like 'valid compare page'
+ end
+
+ context 'when to_ref is HEAD ref' do
+ let(:to_ref) { 'HEAD' }
+
+ it_behaves_like 'valid compare page'
+ end
end
context 'when page is not valid' do
diff --git a/spec/graphql/resolvers/blobs_resolver_spec.rb b/spec/graphql/resolvers/blobs_resolver_spec.rb
index a666ed2a9fc..26eb6dc0abe 100644
--- a/spec/graphql/resolvers/blobs_resolver_spec.rb
+++ b/spec/graphql/resolvers/blobs_resolver_spec.rb
@@ -71,6 +71,14 @@ RSpec.describe Resolvers::BlobsResolver do
end
end
+ context 'when specifying HEAD ref' do
+ let(:ref) { 'HEAD' }
+
+ it 'returns the specified blobs for HEAD' do
+ is_expected.to contain_exactly(have_attributes(path: 'README.md'))
+ end
+ end
+
context 'when specifying an invalid ref' do
let(:ref) { 'ma:in' }
diff --git a/spec/lib/gitlab/git_ref_validator_spec.rb b/spec/lib/gitlab/git_ref_validator_spec.rb
index 03dd4e7b89b..1a79817130c 100644
--- a/spec/lib/gitlab/git_ref_validator_spec.rb
+++ b/spec/lib/gitlab/git_ref_validator_spec.rb
@@ -37,6 +37,11 @@ RSpec.describe Gitlab::GitRefValidator do
it { expect(described_class.validate("\xA0\u0000\xB0")).to be false }
it { expect(described_class.validate("")).to be false }
it { expect(described_class.validate(nil)).to be false }
+ it { expect(described_class.validate('HEAD')).to be false }
+
+ context 'when skip_head_ref_check is true' do
+ it { expect(described_class.validate('HEAD', skip_head_ref_check: true)).to be true }
+ end
end
describe '.validate_merge_request_branch' do
diff --git a/spec/migrations/ensure_note_diff_files_bigint_backfill_is_finished_for_gitlab_dot_com_spec.rb b/spec/migrations/ensure_note_diff_files_bigint_backfill_is_finished_for_gitlab_dot_com_spec.rb
new file mode 100644
index 00000000000..acafc211e8c
--- /dev/null
+++ b/spec/migrations/ensure_note_diff_files_bigint_backfill_is_finished_for_gitlab_dot_com_spec.rb
@@ -0,0 +1,35 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+require_migration!
+
+RSpec.describe EnsureNoteDiffFilesBigintBackfillIsFinishedForGitlabDotCom, feature_category: :database do
+ describe '#up' do
+ let(:migration_arguments) do
+ {
+ job_class_name: 'CopyColumnUsingBackgroundMigrationJob',
+ table_name: 'note_diff_files',
+ column_name: 'id',
+ job_arguments: [['diff_note_id'], ['diff_note_id_convert_to_bigint']]
+ }
+ end
+
+ it 'ensures the migration is completed for GitLab.com, dev, or test' do
+ expect_next_instance_of(described_class) do |instance|
+ expect(instance).to receive(:com_or_dev_or_test_but_not_jh?).and_return(true)
+ expect(instance).to receive(:ensure_batched_background_migration_is_finished).with(migration_arguments)
+ end
+
+ migrate!
+ end
+
+ it 'skips the check for other instances' do
+ expect_next_instance_of(described_class) do |instance|
+ expect(instance).to receive(:com_or_dev_or_test_but_not_jh?).and_return(false)
+ expect(instance).not_to receive(:ensure_batched_background_migration_is_finished)
+ end
+
+ migrate!
+ end
+ end
+end
diff --git a/spec/models/active_session_spec.rb b/spec/models/active_session_spec.rb
index 3665f13015e..d092ebd89a3 100644
--- a/spec/models/active_session_spec.rb
+++ b/spec/models/active_session_spec.rb
@@ -190,8 +190,7 @@ RSpec.describe ActiveSession, :clean_gitlab_redis_sessions do
Gitlab::Redis::Sessions.with do |redis|
expect(redis.scan_each.to_a).to include(
- described_class.key_name(user.id, session_id), # current session
- described_class.key_name_v1(user.id, session_id), # support for mixed deployment
+ described_class.key_name(user.id, session_id), # current session
lookup_key
)
end
@@ -217,19 +216,6 @@ RSpec.describe ActiveSession, :clean_gitlab_redis_sessions do
end
end
- it 'is possible to log in only using the old session key' do
- session_id = "2::418729c72310bbf349a032f0bb6e3fce9f5a69df8f000d8ae0ac5d159d8f21ae"
- ActiveSession.set(user, request)
-
- Gitlab::Redis::SharedState.with do |redis|
- redis.del(described_class.key_name(user.id, session_id))
- end
-
- sessions = ActiveSession.list(user)
-
- expect(sessions).to be_present
- end
-
it 'keeps the created_at from the login on consecutive requests' do
created_at = Time.zone.parse('2018-03-12 09:06')
updated_at = created_at + 1.minute
@@ -593,7 +579,7 @@ RSpec.describe ActiveSession, :clean_gitlab_redis_sessions do
let(:active_count) { 3 }
before do
- Gitlab::Redis::SharedState.with do |redis|
+ Gitlab::Redis::Sessions.with do |redis|
active_count.times do |number|
redis.set(
key_name(user.id, number),
@@ -608,13 +594,13 @@ RSpec.describe ActiveSession, :clean_gitlab_redis_sessions do
end
it 'removes obsolete lookup entries' do
- active = Gitlab::Redis::SharedState.with do |redis|
+ active = Gitlab::Redis::Sessions.with do |redis|
ActiveSession.cleaned_up_lookup_entries(redis, user)
end
expect(active.count).to eq(active_count)
- Gitlab::Redis::SharedState.with do |redis|
+ Gitlab::Redis::Sessions.with do |redis|
lookup_entries = redis.smembers(lookup_key)
expect(lookup_entries.count).to eq(active_count)
@@ -627,7 +613,7 @@ RSpec.describe ActiveSession, :clean_gitlab_redis_sessions do
it 'reports the removed entries' do
removed = []
- Gitlab::Redis::SharedState.with do |redis|
+ Gitlab::Redis::Sessions.with do |redis|
ActiveSession.cleaned_up_lookup_entries(redis, user, removed)
end
diff --git a/spec/workers/every_sidekiq_worker_spec.rb b/spec/workers/every_sidekiq_worker_spec.rb
index 481a2848f48..ece36ad39a5 100644
--- a/spec/workers/every_sidekiq_worker_spec.rb
+++ b/spec/workers/every_sidekiq_worker_spec.rb
@@ -380,6 +380,7 @@ RSpec.describe 'Every Sidekiq worker', feature_category: :shared do
'ObjectPool::JoinWorker' => 3,
'ObjectPool::ScheduleJoinWorker' => 3,
'ObjectStorage::MigrateUploadsWorker' => 3,
+ 'Onboarding::CreateLearnGitlabWorker' => 3,
'Packages::CleanupPackageFileWorker' => 0,
'Packages::Cleanup::ExecutePolicyWorker' => 0,
'Packages::Composer::CacheUpdateWorker' => false,
diff --git a/workhorse/go.mod b/workhorse/go.mod
index 0f6fb445bb3..989aa5b02df 100644
--- a/workhorse/go.mod
+++ b/workhorse/go.mod
@@ -7,7 +7,7 @@ require (
github.com/BurntSushi/toml v1.2.1
github.com/FZambia/sentinel v1.1.1
github.com/alecthomas/chroma/v2 v2.7.0
- github.com/aws/aws-sdk-go v1.44.225
+ github.com/aws/aws-sdk-go v1.44.226
github.com/disintegration/imaging v1.6.2
github.com/getsentry/raven-go v0.2.0
github.com/golang-jwt/jwt/v4 v4.5.0
diff --git a/workhorse/go.sum b/workhorse/go.sum
index 3c7e21ad717..77769e7b221 100644
--- a/workhorse/go.sum
+++ b/workhorse/go.sum
@@ -569,8 +569,8 @@ github.com/aws/aws-sdk-go v1.43.31/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4
github.com/aws/aws-sdk-go v1.44.156/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/aws/aws-sdk-go v1.44.187/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/aws/aws-sdk-go v1.44.200/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
-github.com/aws/aws-sdk-go v1.44.225 h1:JNJpUg+M1cm4jtKnyex//Mw1Rv8QN/kWT3dtr+oLdW4=
-github.com/aws/aws-sdk-go v1.44.225/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
+github.com/aws/aws-sdk-go v1.44.226 h1:lqTNeHJUq0U6dpMGJc9ZcmfTUkuAjklcwewj96RhMlc=
+github.com/aws/aws-sdk-go v1.44.226/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/aws/aws-sdk-go-v2 v1.9.1/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4=
github.com/aws/aws-sdk-go-v2 v1.17.4 h1:wyC6p9Yfq6V2y98wfDsj6OnNQa4w2BLGCLIxzNhwOGY=
github.com/aws/aws-sdk-go-v2 v1.17.4/go.mod h1:uzbQtefpm44goOPmdKyAlXSNcwlRgF3ePWVW6EtJvvw=