diff --git a/app/helpers/sorting_helper.rb b/app/helpers/sorting_helper.rb index 58f0af883f5..a711f36fe05 100644 --- a/app/helpers/sorting_helper.rb +++ b/app/helpers/sorting_helper.rb @@ -157,7 +157,9 @@ module SortingHelper { sort_value_name => sort_title_name, sort_value_oldest_updated => sort_title_oldest_updated, - sort_value_recently_updated => sort_title_recently_updated + sort_value_recently_updated => sort_title_recently_updated, + sort_value_version_desc => sort_title_version_desc, + sort_value_version_asc => sort_title_version_asc } end diff --git a/app/helpers/sorting_titles_values_helper.rb b/app/helpers/sorting_titles_values_helper.rb index 4dfa7689110..b49cb617d80 100644 --- a/app/helpers/sorting_titles_values_helper.rb +++ b/app/helpers/sorting_titles_values_helper.rb @@ -86,6 +86,14 @@ module SortingTitlesValuesHelper s_('SortOptions|Name, descending') end + def sort_title_version_desc + s_('SortOptions|Latest version') + end + + def sort_title_version_asc + s_('SortOptions|Oldest version') + end + def sort_title_oldest_activity s_('SortOptions|Oldest updated') end @@ -275,6 +283,14 @@ module SortingTitlesValuesHelper 'updated_asc' end + def sort_value_version_asc + 'version_asc' + end + + def sort_value_version_desc + 'version_desc' + end + def sort_value_popularity 'popularity' end diff --git a/app/models/concerns/merge_request_reviewer_state.rb b/app/models/concerns/merge_request_reviewer_state.rb index 5efe02101ff..412b1da55da 100644 --- a/app/models/concerns/merge_request_reviewer_state.rb +++ b/app/models/concerns/merge_request_reviewer_state.rb @@ -7,7 +7,6 @@ module MergeRequestReviewerState enum state: { unreviewed: 0, reviewed: 1 - # 2 was removed with https://gitlab.com/gitlab-org/gitlab/-/merge_requests/95446 } validates :state, diff --git a/app/models/pages_domain.rb b/app/models/pages_domain.rb index 569f56fa982..16d5492a65e 100644 --- a/app/models/pages_domain.rb +++ b/app/models/pages_domain.rb @@ -58,6 +58,7 @@ class PagesDomain < ApplicationRecord where(verified_at.eq(nil).or(enabled_until.eq(nil).or(enabled_until.lt(threshold)))) end + scope :verified, -> { where.not(verified_at: nil) } scope :need_auto_ssl_renewal, -> do enabled_and_not_failed = where(auto_ssl_enabled: true, auto_ssl_failed: false) diff --git a/app/services/users/authorized_build_service.rb b/app/services/users/authorized_build_service.rb index eb2386198d3..5029105b087 100644 --- a/app/services/users/authorized_build_service.rb +++ b/app/services/users/authorized_build_service.rb @@ -16,3 +16,5 @@ module Users end end end + +Users::AuthorizedBuildService.prepend_mod_with('Users::AuthorizedBuildService') diff --git a/data/deprecations/15-4-confidence-field-in-graphql.yml b/data/deprecations/15-4-confidence-field-in-graphql.yml new file mode 100644 index 00000000000..da3287eeff9 --- /dev/null +++ b/data/deprecations/15-4-confidence-field-in-graphql.yml @@ -0,0 +1,14 @@ +- name: "Vulnerability confidence field" + announcement_milestone: "15.4" + announcement_date: "2022-09-22" + removal_milestone: "16.0" + removal_date: "2023-05-22" + breaking_change: true + reporter: matt_wilson + stage: govern + issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/372332 + body: | + In GitLab 15.3, [security report schemas below version 15 were deprecated](https://docs.gitlab.com/ee/update/deprecations.html#security-report-schemas-version-14xx). + The `confidence` attribute on vulnerability findings exists only in schema versions before `15-0-0`, and therefore is effectively deprecated since GitLab 15.4 supports schema version `15-0-0`. To maintain consistency + between the reports and our public APIs, the `confidence` attribute on any vulnerability-related components of our GraphQL API is now deprecated and will be + removed in 16.0. diff --git a/data/deprecations/15-4-create-deprecation-draft-quick-action-toggle.yml b/data/deprecations/15-4-create-deprecation-draft-quick-action-toggle.yml new file mode 100644 index 00000000000..2265354c4c7 --- /dev/null +++ b/data/deprecations/15-4-create-deprecation-draft-quick-action-toggle.yml @@ -0,0 +1,12 @@ +- name: "Toggle behavior of `/draft` quick action in merge requests" # (required) The name of the feature to be deprecated + announcement_milestone: "15.4" # (required) The milestone when this feature was first announced as deprecated. + announcement_date: "2022-09-22" # (required) The date of the milestone release when this feature was first announced as deprecated. This should almost always be the 22nd of a month (YYYY-MM-22), unless you did an out of band blog post. + removal_milestone: "16.0" # (required) The milestone when this feature is planned to be removed + removal_date: "2022-05-22"# (required) The date of the milestone release when this feature is planned to be removed. This should almost always be the 22nd of a month (YYYY-MM-22), unless you did an out of band blog post. + breaking_change: true # (required) If this deprecation is a breaking change, set this value to true + reporter: phikai # (required) GitLab username of the person reporting the deprecation + stage: create # (required) String value of the stage that the feature was created in. e.g., Growth + issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/365365 # (required) Link to the deprecation issue in GitLab + body: | # (required) Do not modify this line, instead modify the lines below. + In order to make the behavior of toggling the draft status of a merge request more clear via a quick action, we're deprecating and removing the toggle behavior of the `/draft` quick action. Beginning with the 16.0 release of GitLab, `/draft` will only set a merge request to Draft and a new `/ready` quick action will be used to remove the draft status. + documentation_url: # (optional) This is a link to the current documentation page diff --git a/db/fixtures/development/044_add_security_training_providers.rb b/db/fixtures/development/044_add_security_training_providers.rb new file mode 100644 index 00000000000..6fbd9f66127 --- /dev/null +++ b/db/fixtures/development/044_add_security_training_providers.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +Gitlab::Seeder.quiet do + ::Gitlab::DatabaseImporters::Security::TrainingProviders::Importer.upsert_providers +end diff --git a/db/fixtures/production/004_add_security_training_providers.rb b/db/fixtures/production/004_add_security_training_providers.rb new file mode 100644 index 00000000000..6fbd9f66127 --- /dev/null +++ b/db/fixtures/production/004_add_security_training_providers.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +Gitlab::Seeder.quiet do + ::Gitlab::DatabaseImporters::Security::TrainingProviders::Importer.upsert_providers +end diff --git a/db/post_migrate/20220905090300_add_tmp_index_merge_request_reviewers_attention_request_state.rb b/db/post_migrate/20220905090300_add_tmp_index_merge_request_reviewers_attention_request_state.rb new file mode 100644 index 00000000000..e192f76484c --- /dev/null +++ b/db/post_migrate/20220905090300_add_tmp_index_merge_request_reviewers_attention_request_state.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddTmpIndexMergeRequestReviewersAttentionRequestState < Gitlab::Database::Migration[2.0] + INDEX_NAME = "tmp_index_merge_request_reviewers_on_attention_requested_state" + ATTENTION_REQUESTED_STATE = 2 + + disable_ddl_transaction! + + def up + add_concurrent_index :merge_request_reviewers, [:id], + where: "state = #{ATTENTION_REQUESTED_STATE}", + name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :merge_request_reviewers, INDEX_NAME + end +end diff --git a/db/post_migrate/20220905090339_reset_attention_requested_merge_requests_reviewers_state_to_unreviewed.rb b/db/post_migrate/20220905090339_reset_attention_requested_merge_requests_reviewers_state_to_unreviewed.rb new file mode 100644 index 00000000000..d335095e674 --- /dev/null +++ b/db/post_migrate/20220905090339_reset_attention_requested_merge_requests_reviewers_state_to_unreviewed.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +class ResetAttentionRequestedMergeRequestsReviewersStateToUnreviewed < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + restrict_gitlab_migration gitlab_schema: :gitlab_main + + BATCH_SIZE = 500 + + class MergeRequestReviewer < MigrationRecord + self.table_name = 'merge_request_reviewers' + + enum state: { + unreviewed: 0, + reviewed: 1, + attention_requested: 2 + } + + include ::EachBatch + end + + def up + MergeRequestReviewer + .where(state: MergeRequestReviewer.states['attention_requested']) + .each_batch(of: BATCH_SIZE) { |batch| batch.update_all(state: MergeRequestReviewer.states['unreviewed']) } + end + + def down + # no op + end +end diff --git a/db/schema_migrations/20220905090300 b/db/schema_migrations/20220905090300 new file mode 100644 index 00000000000..32d1ab47c9e --- /dev/null +++ b/db/schema_migrations/20220905090300 @@ -0,0 +1 @@ +e15a37d20202e204fcf02ab68d3b616eec0501c2c323db69ed2fb39df0d017f6 \ No newline at end of file diff --git a/db/schema_migrations/20220905090339 b/db/schema_migrations/20220905090339 new file mode 100644 index 00000000000..52c2e038c93 --- /dev/null +++ b/db/schema_migrations/20220905090339 @@ -0,0 +1 @@ +f3a7e9c501498b22786960694a8c1f35d2db69c8c48319f99dfb81c41aa5c6ca \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 12f3de04cb3..f3dfa108d21 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -30847,6 +30847,8 @@ CREATE INDEX tmp_index_issues_on_issue_type_and_id ON issues USING btree (issue_ CREATE INDEX tmp_index_members_on_state ON members USING btree (state) WHERE (state = 2); +CREATE INDEX tmp_index_merge_request_reviewers_on_attention_requested_state ON merge_request_reviewers USING btree (id) WHERE (state = 2); + CREATE INDEX tmp_index_migrated_container_registries ON container_repositories USING btree (project_id) WHERE ((migration_state = 'import_done'::text) OR (created_at >= '2022-01-23 00:00:00'::timestamp without time zone)); CREATE UNIQUE INDEX tmp_index_on_tmp_project_id_on_namespaces ON namespaces USING btree (tmp_project_id); diff --git a/doc/update/deprecations.md b/doc/update/deprecations.md index a8e6ef93d00..44a7137f698 100644 --- a/doc/update/deprecations.md +++ b/doc/update/deprecations.md @@ -100,6 +100,37 @@ Review the details carefully before upgrading. GitLab's operational container scanning capabilities no longer require starboard to be installed. Consequently, use of the `starboard:` directive in the configuration file for the GitLab Agent for Kubernetes is now deprecated and is scheduled for removal in GitLab 16.0. Update your configuration file to use the `container_scanning:` directive. + + +