diff --git a/.gitlab/issue_templates/Feature Flag Roll Out.md b/.gitlab/issue_templates/Feature Flag Roll Out.md index 3bd39a73904..aad6c931915 100644 --- a/.gitlab/issue_templates/Feature Flag Roll Out.md +++ b/.gitlab/issue_templates/Feature Flag Roll Out.md @@ -41,7 +41,7 @@ Note: Please make sure to run the chatops commands in the Slack channel that get as this is the first environment deployed to. Make sure you are [configured to use canary](https://next.gitlab.com/). - [ ] If the feature flag causes end-to-end tests to fail, disable the feature flag on staging to avoid blocking [deployments](https://about.gitlab.com/handbook/engineering/deployments-and-releases/deployments/). -For assistance with end-to-end test failures, please reach out via the [`#quality` Slack channel](https://gitlab.slack.com/archives/C3JJET4Q6). Note that end-to-end test failures on `staging-ref` [don't block deployments](https://about.gitlab.com/handbook/engineering/infrastructure/environments/staging-ref/#how-to-use-staging-ref). +For assistance with end-to-end test failures, please reach out via the [`#test-platform` Slack channel](https://gitlab.slack.com/archives/C3JJET4Q6). Note that end-to-end test failures on `staging-ref` [don't block deployments](https://about.gitlab.com/handbook/engineering/infrastructure/environments/staging-ref/#how-to-use-staging-ref). ### Specific rollout on production diff --git a/.rubocop_todo/layout/argument_alignment.yml b/.rubocop_todo/layout/argument_alignment.yml index 3ee583e5f30..585997fdbbe 100644 --- a/.rubocop_todo/layout/argument_alignment.yml +++ b/.rubocop_todo/layout/argument_alignment.yml @@ -1416,7 +1416,6 @@ Layout/ArgumentAlignment: - 'spec/lib/gitlab/pagination_delegate_spec.rb' - 'spec/lib/gitlab/path_regex_spec.rb' - 'spec/lib/gitlab/profiler_spec.rb' - - 'spec/lib/gitlab/redis/sidekiq_status_spec.rb' - 'spec/lib/gitlab/repository_cache/preloader_spec.rb' - 'spec/lib/gitlab/repository_cache_spec.rb' - 'spec/lib/gitlab/search_context/builder_spec.rb' diff --git a/.rubocop_todo/rspec/feature_category.yml b/.rubocop_todo/rspec/feature_category.yml index db8e2f49341..4c1ad874407 100644 --- a/.rubocop_todo/rspec/feature_category.yml +++ b/.rubocop_todo/rspec/feature_category.yml @@ -3889,7 +3889,6 @@ RSpec/FeatureCategory: - 'spec/lib/gitlab/redis/rate_limiting_spec.rb' - 'spec/lib/gitlab/redis/sessions_spec.rb' - 'spec/lib/gitlab/redis/shared_state_spec.rb' - - 'spec/lib/gitlab/redis/sidekiq_status_spec.rb' - 'spec/lib/gitlab/redis/trace_chunks_spec.rb' - 'spec/lib/gitlab/redis/wrapper_spec.rb' - 'spec/lib/gitlab/reference_counter_spec.rb' diff --git a/.rubocop_todo/rspec/named_subject.yml b/.rubocop_todo/rspec/named_subject.yml index f7d70e23a41..16784226de8 100644 --- a/.rubocop_todo/rspec/named_subject.yml +++ b/.rubocop_todo/rspec/named_subject.yml @@ -2373,7 +2373,6 @@ RSpec/NamedSubject: - 'spec/lib/gitlab/redis/db_load_balancing_spec.rb' - 'spec/lib/gitlab/redis/multi_store_spec.rb' - 'spec/lib/gitlab/redis/queues_spec.rb' - - 'spec/lib/gitlab/redis/sidekiq_status_spec.rb' - 'spec/lib/gitlab/reference_extractor_spec.rb' - 'spec/lib/gitlab/regex_spec.rb' - 'spec/lib/gitlab/relative_positioning/item_context_spec.rb' diff --git a/.rubocop_todo/rspec/return_from_stub.yml b/.rubocop_todo/rspec/return_from_stub.yml index 3604a2de612..ed5b6fa5486 100644 --- a/.rubocop_todo/rspec/return_from_stub.yml +++ b/.rubocop_todo/rspec/return_from_stub.yml @@ -141,7 +141,6 @@ RSpec/ReturnFromStub: - 'spec/lib/gitlab/prometheus_client_spec.rb' - 'spec/lib/gitlab/redis/cache_spec.rb' - 'spec/lib/gitlab/redis/shared_state_spec.rb' - - 'spec/lib/gitlab/redis/sidekiq_status_spec.rb' - 'spec/lib/gitlab/relative_positioning/range_spec.rb' - 'spec/lib/gitlab/sidekiq_logging/structured_logger_spec.rb' - 'spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/duplicate_job_spec.rb' diff --git a/.rubocop_todo/style/inline_disable_annotation.yml b/.rubocop_todo/style/inline_disable_annotation.yml index a9c02aa5796..f5a43785756 100644 --- a/.rubocop_todo/style/inline_disable_annotation.yml +++ b/.rubocop_todo/style/inline_disable_annotation.yml @@ -2659,7 +2659,6 @@ Style/InlineDisableAnnotation: - 'lib/gitlab/redis/cross_slot.rb' - 'lib/gitlab/redis/hll.rb' - 'lib/gitlab/redis/multi_store.rb' - - 'lib/gitlab/redis/sidekiq_status.rb' - 'lib/gitlab/reference_extractor.rb' - 'lib/gitlab/relative_positioning/item_context.rb' - 'lib/gitlab/repository_cache_adapter.rb' diff --git a/app/models/admin/abuse_report_label.rb b/app/models/admin/abuse_report_label.rb index a2ccc8b5513..6f951b02933 100644 --- a/app/models/admin/abuse_report_label.rb +++ b/app/models/admin/abuse_report_label.rb @@ -2,5 +2,6 @@ module Admin class AbuseReportLabel < Label + self.allow_legacy_sti_class = true end end diff --git a/app/models/application_record.rb b/app/models/application_record.rb index 15e44296635..45983c08a3e 100644 --- a/app/models/application_record.rb +++ b/app/models/application_record.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true class ApplicationRecord < ActiveRecord::Base + include DisablesSti include DatabaseReflection include Transactions include LegacyBulkInsert diff --git a/app/models/badges/group_badge.rb b/app/models/badges/group_badge.rb index f74c9f89e9f..2ef8a3bd821 100644 --- a/app/models/badges/group_badge.rb +++ b/app/models/badges/group_badge.rb @@ -3,6 +3,8 @@ class GroupBadge < Badge include EachBatch + self.allow_legacy_sti_class = true + belongs_to :group validates :group, presence: true diff --git a/app/models/badges/project_badge.rb b/app/models/badges/project_badge.rb index 8c51ebafb5e..6a8a70dfe02 100644 --- a/app/models/badges/project_badge.rb +++ b/app/models/badges/project_badge.rb @@ -3,6 +3,8 @@ class ProjectBadge < Badge include EachBatch + self.allow_legacy_sti_class = true + belongs_to :project validates :project, presence: true diff --git a/app/models/ci/bridge.rb b/app/models/ci/bridge.rb index 564b10ea8e3..8db80cd05dc 100644 --- a/app/models/ci/bridge.rb +++ b/app/models/ci/bridge.rb @@ -16,6 +16,8 @@ module Ci pipeline_variables: false }.freeze + self.allow_legacy_sti_class = true + belongs_to :project belongs_to :trigger_request diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 8536f790b7d..1a758c80df8 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -15,6 +15,8 @@ module Ci extend ::Gitlab::Utils::Override + self.allow_legacy_sti_class = true + belongs_to :project, inverse_of: :builds belongs_to :runner belongs_to :trigger_request diff --git a/app/models/ci/processable.rb b/app/models/ci/processable.rb index 7ad1a727a0e..132f706d265 100644 --- a/app/models/ci/processable.rb +++ b/app/models/ci/processable.rb @@ -9,6 +9,8 @@ module Ci include Ci::Metadatable extend ::Gitlab::Utils::Override + self.allow_legacy_sti_class = true + has_one :resource, class_name: 'Ci::Resource', foreign_key: 'build_id', inverse_of: :processable has_one :sourced_pipeline, class_name: 'Ci::Sources::Pipeline', foreign_key: :source_job_id, inverse_of: :source_job diff --git a/app/models/concerns/disables_sti.rb b/app/models/concerns/disables_sti.rb new file mode 100644 index 00000000000..418da323d3d --- /dev/null +++ b/app/models/concerns/disables_sti.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +# Disables usage of STI +# See https://docs.gitlab.com/ee/development/database/single_table_inheritance.html +module DisablesSti + extend ActiveSupport::Concern + + SKIP_STI_CHECK = Gitlab.dev_or_test_env? && + Gitlab::Utils.to_boolean(ENV['SKIP_STI_CHECK'], default: false) + + included do + class_attribute :allow_legacy_sti_class + end + + class_methods do + def new(...) + if sti_class_disallowed? + raise( + "Do not use Single Table Inheritance (`#{name}` inherits `#{base_class.name}`). " \ + "See https://docs.gitlab.com/ee/development/database/single_table_inheritance.html" # rubocop:disable Gitlab/DocUrl -- route helpers don't always work + ) + end + + super + end + + def sti_class_disallowed? + return false if SKIP_STI_CHECK + + self != base_class && !allow_legacy_sti_class && has_attribute?(inheritance_column) + end + end +end diff --git a/app/models/deploy_key.rb b/app/models/deploy_key.rb index de777b8ae53..9ede494cfcc 100644 --- a/app/models/deploy_key.rb +++ b/app/models/deploy_key.rb @@ -6,6 +6,8 @@ class DeployKey < Key include PolicyActor include Presentable + self.allow_legacy_sti_class = true + has_many :deploy_keys_projects, inverse_of: :deploy_key, dependent: :destroy # rubocop:disable Cop/ActiveRecordDependent has_many :projects, through: :deploy_keys_projects diff --git a/app/models/diff_note.rb b/app/models/diff_note.rb index d680d0e334f..33dd7308e14 100644 --- a/app/models/diff_note.rb +++ b/app/models/diff_note.rb @@ -8,6 +8,8 @@ class DiffNote < Note include DiffPositionableNote include Gitlab::Utils::StrongMemoize + self.allow_legacy_sti_class = true + def self.noteable_types %w[MergeRequest Commit DesignManagement::Design] end diff --git a/app/models/discussion_note.rb b/app/models/discussion_note.rb index fa830179022..7e17a9c759e 100644 --- a/app/models/discussion_note.rb +++ b/app/models/discussion_note.rb @@ -7,6 +7,8 @@ class DiscussionNote < Note # This prepend must stay here because the `validates` below depends on it. prepend_mod_with('DiscussionNote') # rubocop: disable Cop/InjectEnterpriseEditionModule + self.allow_legacy_sti_class = true + # Names of all implementers of `Noteable` that support discussions. def self.noteable_types %w[MergeRequest Issue Commit Snippet AbuseReport] diff --git a/app/models/generic_commit_status.rb b/app/models/generic_commit_status.rb index f795585dfc5..356acfa063d 100644 --- a/app/models/generic_commit_status.rb +++ b/app/models/generic_commit_status.rb @@ -3,6 +3,8 @@ class GenericCommitStatus < CommitStatus EXTERNAL_STAGE_IDX = 1_000_000 + self.allow_legacy_sti_class = true + validates :target_url, addressable_url: true, length: { maximum: 255 }, allow_nil: true validate :name_uniqueness_across_types, unless: :importing? diff --git a/app/models/group.rb b/app/models/group.rb index 59383b51bb9..7092d5217e1 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -23,6 +23,8 @@ class Group < Namespace extend ::Gitlab::Utils::Override + self.allow_legacy_sti_class = true + README_PROJECT_PATH = 'gitlab-profile' def self.sti_name diff --git a/app/models/group_label.rb b/app/models/group_label.rb index 46e56166951..efad937b390 100644 --- a/app/models/group_label.rb +++ b/app/models/group_label.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class GroupLabel < Label + self.allow_legacy_sti_class = true + belongs_to :group belongs_to :parent_container, foreign_key: :group_id, class_name: 'Group' diff --git a/app/models/hooks/project_hook.rb b/app/models/hooks/project_hook.rb index 05c5ad22218..9b700ff17b2 100644 --- a/app/models/hooks/project_hook.rb +++ b/app/models/hooks/project_hook.rb @@ -6,6 +6,8 @@ class ProjectHook < WebHook include Limitable extend ::Gitlab::Utils::Override + self.allow_legacy_sti_class = true + self.limit_scope = :project triggerable_hooks [ diff --git a/app/models/hooks/service_hook.rb b/app/models/hooks/service_hook.rb index 453b986ca4d..b1f1ab79b6a 100644 --- a/app/models/hooks/service_hook.rb +++ b/app/models/hooks/service_hook.rb @@ -5,6 +5,8 @@ class ServiceHook < WebHook extend ::Gitlab::Utils::Override + self.allow_legacy_sti_class = true + belongs_to :integration validates :integration, presence: true diff --git a/app/models/hooks/system_hook.rb b/app/models/hooks/system_hook.rb index 3c7f0ef9ffc..57409faee5a 100644 --- a/app/models/hooks/system_hook.rb +++ b/app/models/hooks/system_hook.rb @@ -3,6 +3,8 @@ class SystemHook < WebHook include TriggerableHooks + self.allow_legacy_sti_class = true + triggerable_hooks [ :repository_update_hooks, :push_hooks, diff --git a/app/models/integration.rb b/app/models/integration.rb index 2c5731deb58..c7161574a17 100644 --- a/app/models/integration.rb +++ b/app/models/integration.rb @@ -15,6 +15,7 @@ class Integration < ApplicationRecord UnknownType = Class.new(StandardError) + self.allow_legacy_sti_class = true self.inheritance_column = :type_new INTEGRATION_NAMES = %w[ diff --git a/app/models/label_note.rb b/app/models/label_note.rb index eda650f2fa2..dcc92dbb6ae 100644 --- a/app/models/label_note.rb +++ b/app/models/label_note.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class LabelNote < SyntheticNote + self.allow_legacy_sti_class = true + attr_accessor :resource_parent attr_reader :events diff --git a/app/models/legacy_diff_note.rb b/app/models/legacy_diff_note.rb index ede20578850..336264317ac 100644 --- a/app/models/legacy_diff_note.rb +++ b/app/models/legacy_diff_note.rb @@ -9,6 +9,8 @@ class LegacyDiffNote < Note include NoteOnDiff + self.allow_legacy_sti_class = true + serialize :st_diff # rubocop:disable Cop/ActiveRecordSerialize validates :line_code, presence: true, line_code: true diff --git a/app/models/members/group_member.rb b/app/models/members/group_member.rb index b5a590d646e..50ae70734e4 100644 --- a/app/models/members/group_member.rb +++ b/app/models/members/group_member.rb @@ -4,6 +4,8 @@ class GroupMember < Member include FromUnion include CreatedAtFilterable + self.allow_legacy_sti_class = true + SOURCE_TYPE = 'Namespace' SOURCE_TYPE_FORMAT = /\ANamespace\z/ diff --git a/app/models/members/project_member.rb b/app/models/members/project_member.rb index 5e5f9ab7385..7ae6e138aca 100644 --- a/app/models/members/project_member.rb +++ b/app/models/members/project_member.rb @@ -4,6 +4,8 @@ class ProjectMember < Member SOURCE_TYPE = 'Project' SOURCE_TYPE_FORMAT = /\AProject\z/ + self.allow_legacy_sti_class = true + belongs_to :project, foreign_key: 'source_id' delegate :namespace_id, to: :project diff --git a/app/models/members/project_namespace_member.rb b/app/models/members/project_namespace_member.rb index 0e0c52ee3ca..f74a085669c 100644 --- a/app/models/members/project_namespace_member.rb +++ b/app/models/members/project_namespace_member.rb @@ -4,4 +4,5 @@ # This file is a part of the Consolidate Group and Project member management epic, # and will be developed further as we progress through that epic. class ProjectNamespaceMember < ProjectMember # rubocop:disable Gitlab/NamespacedClass + self.allow_legacy_sti_class = true end diff --git a/app/models/milestone_note.rb b/app/models/milestone_note.rb index 14808158fd0..2bbd2d9a383 100644 --- a/app/models/milestone_note.rb +++ b/app/models/milestone_note.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class MilestoneNote < SyntheticNote + self.allow_legacy_sti_class = true + attr_accessor :milestone def self.from_event(event, resource: nil, resource_parent: nil) diff --git a/app/models/namespaces/project_namespace.rb b/app/models/namespaces/project_namespace.rb index 288c5c0d2d4..573944d8f5c 100644 --- a/app/models/namespaces/project_namespace.rb +++ b/app/models/namespaces/project_namespace.rb @@ -2,6 +2,8 @@ module Namespaces class ProjectNamespace < Namespace + self.allow_legacy_sti_class = true + # These aliases are added to make it easier to sync parent/parent_id attribute with # project.namespace/project.namespace_id attribute. # diff --git a/app/models/namespaces/user_namespace.rb b/app/models/namespaces/user_namespace.rb index 408acb6dcce..fde6c4291ee 100644 --- a/app/models/namespaces/user_namespace.rb +++ b/app/models/namespaces/user_namespace.rb @@ -22,6 +22,8 @@ module Namespaces #################################################################### class UserNamespace < Namespace + self.allow_legacy_sti_class = true + def self.sti_name 'User' end diff --git a/app/models/packages/ml_model/package.rb b/app/models/packages/ml_model/package.rb index de2b5f8f2a8..a327a30ce26 100644 --- a/app/models/packages/ml_model/package.rb +++ b/app/models/packages/ml_model/package.rb @@ -3,6 +3,8 @@ module Packages module MlModel class Package < Packages::Package + self.allow_legacy_sti_class = true + has_one :model_version, class_name: "Ml::ModelVersion", inverse_of: :package validates :name, diff --git a/app/models/personal_snippet.rb b/app/models/personal_snippet.rb index 0915278fb65..299f1f7a630 100644 --- a/app/models/personal_snippet.rb +++ b/app/models/personal_snippet.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class PersonalSnippet < Snippet + self.allow_legacy_sti_class = true + include WithUploads def parent_user diff --git a/app/models/project_label.rb b/app/models/project_label.rb index 05d7b7429ff..2867006bd2e 100644 --- a/app/models/project_label.rb +++ b/app/models/project_label.rb @@ -3,6 +3,8 @@ class ProjectLabel < Label MAX_NUMBER_OF_PRIORITIES = 1 + self.allow_legacy_sti_class = true + belongs_to :project belongs_to :parent_container, foreign_key: :project_id, class_name: 'Project' diff --git a/app/models/project_snippet.rb b/app/models/project_snippet.rb index 7a80ad33d68..0f3c22bbb92 100644 --- a/app/models/project_snippet.rb +++ b/app/models/project_snippet.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class ProjectSnippet < Snippet + self.allow_legacy_sti_class = true + belongs_to :project validates :project, presence: true diff --git a/app/models/push_event.rb b/app/models/push_event.rb index 0f626cb618e..4e18d4840e6 100644 --- a/app/models/push_event.rb +++ b/app/models/push_event.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class PushEvent < Event + self.allow_legacy_sti_class = true + # This validation exists so we can't accidentally use PushEvent with a # different "action" value. validate :validate_push_action diff --git a/app/models/state_note.rb b/app/models/state_note.rb index 93c025a9bf0..8b1474b3c7a 100644 --- a/app/models/state_note.rb +++ b/app/models/state_note.rb @@ -3,6 +3,8 @@ class StateNote < SyntheticNote include Gitlab::Utils::StrongMemoize + self.allow_legacy_sti_class = true + def self.from_event(event, resource: nil, resource_parent: nil) attrs = note_attributes(action_by(event), event, resource, resource_parent) diff --git a/app/models/synthetic_note.rb b/app/models/synthetic_note.rb index f88fa052665..e71f9838d9b 100644 --- a/app/models/synthetic_note.rb +++ b/app/models/synthetic_note.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true class SyntheticNote < Note + self.allow_legacy_sti_class = true + attr_accessor :resource_parent, :event def self.note_attributes(action, event, resource, resource_parent) diff --git a/danger/stable_branch_patch/Dangerfile b/danger/stable_branch_patch/Dangerfile index a4b557c1eaa..e5635f3ae26 100644 --- a/danger/stable_branch_patch/Dangerfile +++ b/danger/stable_branch_patch/Dangerfile @@ -7,7 +7,7 @@ if stable_branch.encourage_package_and_qa_execution? **@#{helper.mr_author}, the `package-and-test` job must complete before merging this merge request.*** If there are failures on the `package-and-test` pipeline, ping your team's associated Software Engineer in Test (SET) to confirm - the failures are unrelated to the merge request. If there's no SET assigned, ask for assistance on the `#quality` Slack channel. + the failures are unrelated to the merge request. If there's no SET assigned, ask for assistance on the `#test-platform` Slack channel. MARKDOWN end diff --git a/db/docs/sbom_occurrences_vulnerabilities.yml b/db/docs/sbom_occurrences_vulnerabilities.yml index 68b19a19b52..aab36b34cfb 100644 --- a/db/docs/sbom_occurrences_vulnerabilities.yml +++ b/db/docs/sbom_occurrences_vulnerabilities.yml @@ -1,4 +1,5 @@ table_name: sbom_occurrences_vulnerabilities feature_categories: - dependency_management -gitlab_schema: gitlab_main +milestone: '16.7' +gitlab_schema: gitlab_main_cell diff --git a/doc/development/database/database_dictionary.md b/doc/development/database/database_dictionary.md index 186e02be8f0..bce1d5a43da 100644 --- a/doc/development/database/database_dictionary.md +++ b/doc/development/database/database_dictionary.md @@ -41,7 +41,7 @@ gitlab_schema: gitlab_main | `feature_categories` | Array(String) | yes | List of feature categories using this table. | | `description` | String | no | Text description of the information stored in the table, and its purpose. | | `introduced_by_url` | URL | no | URL to the merge request or commit which introduced this table. | -| `milestone` | String | no | The milestone that introduced this table. | +| `milestone` | String | yes | The milestone that introduced this table. | | `gitlab_schema` | String | yes | GitLab schema name. | ### Process diff --git a/doc/development/testing_guide/end_to_end/index.md b/doc/development/testing_guide/end_to_end/index.md index 47bf29d4d88..4b7e4f06477 100644 --- a/doc/development/testing_guide/end_to_end/index.md +++ b/doc/development/testing_guide/end_to_end/index.md @@ -302,7 +302,7 @@ Continued reading: ## Where can you ask for help? -You can ask question in the `#quality` channel on Slack (GitLab internal) or +You can ask question in the `#test-platform` channel on Slack (GitLab internal) or you can find an issue you would like to work on in [the `gitlab` issue tracker](https://gitlab.com/gitlab-org/gitlab/-/issues?label_name%5B%5D=QA&label_name%5B%5D=test), or [the `gitlab-qa` issue tracker](https://gitlab.com/gitlab-org/gitlab-qa/-/issues?label_name%5B%5D=new+scenario). diff --git a/doc/development/testing_guide/end_to_end/page_objects.md b/doc/development/testing_guide/end_to_end/page_objects.md index afc7f6d5488..6e05bb972f8 100644 --- a/doc/development/testing_guide/end_to_end/page_objects.md +++ b/doc/development/testing_guide/end_to_end/page_objects.md @@ -303,7 +303,7 @@ from within the `qa` directory. ## Where to ask for help? -If you need more information, ask for help on `#quality` channel on Slack +If you need more information, ask for help on `#test-platform` channel on Slack (internal, GitLab Team only). If you are not a Team Member, and you still need help to contribute, please diff --git a/doc/development/testing_guide/end_to_end/resources.md b/doc/development/testing_guide/end_to_end/resources.md index 2c3d2dda809..2b5d6fcf855 100644 --- a/doc/development/testing_guide/end_to_end/resources.md +++ b/doc/development/testing_guide/end_to_end/resources.md @@ -500,7 +500,7 @@ list. ## Where to ask for help? -If you need more information, ask for help on `#quality` channel on Slack +If you need more information, ask for help on `#test-platform` channel on Slack (internal, GitLab Team only). If you are not a Team Member, and you still need help to contribute, please diff --git a/doc/development/testing_guide/review_apps.md b/doc/development/testing_guide/review_apps.md index 3cbfc1e7fd6..51ca7e20300 100644 --- a/doc/development/testing_guide/review_apps.md +++ b/doc/development/testing_guide/review_apps.md @@ -212,7 +212,7 @@ subgraph "CNG-mirror pipeline" your merge request. You can also download the artifacts to see screenshots of the page at the time the failures occurred. If you don't find the cause of the failure or if it seems unrelated to your change, please post a message in the - `#quality` channel and/or create a ~Quality ~"type::bug" issue with a link to your + `#test-platform` channel and/or create a ~Quality ~"type::bug" issue with a link to your merge request. - The manual `review-stop` can be used to stop a review app manually, and is also started by GitLab once a merge diff --git a/doc/user/application_security/vulnerability_report/index.md b/doc/user/application_security/vulnerability_report/index.md index 2fe8150ad84..7493eb0e891 100644 --- a/doc/user/application_security/vulnerability_report/index.md +++ b/doc/user/application_security/vulnerability_report/index.md @@ -94,14 +94,33 @@ After each filter is selected: ### Tool filter -The tool filter allows you to focus on vulnerabilities detected by selected tools. +> Project-level tool filter [introduced](https://gitlab.com/groups/gitlab-org/-/epics/11237) in GitLab 16.6. -When using the tool filter, you can choose: +You can filter vulnerabilities by the tool that detected them. By default, the +vulnerability report lists vulnerabilities from all tools. When you select a heading, you select all the tools +under that heading. -- **All tools** (default). -- Individual GitLab-provided tools. -- Any integrated third-party tool. -- Vulnerabilities that were added manually. +::Tabs + +:::TabTitle GitLab 16.6 and later + +The content of the tool filter for both projects and groups depends on the following: + +- If you've integrated and enabled third-party analyzers, the tool filter is grouped by + scanning category (for example, container scanning, DAST, and dependency scanning). Scanner + entries are only shown if the scanner detected vulnerabilities. +- If you have not integrated any third-party analyzers, see GitLab 16.5 and + earlier. + +:::TabTitle GitLab 16.5 and earlier + +The content of the tool filter at all levels is categorized first by the analyzer's vendor, then by +scanning category. If you've only enabled GitLab analyzers, only those analyzers are listed in the +tool filter. + +::EndTabs + +To filter vulnerabilities that were added manually, use the **Manually added** filter. For details of each of the available tools, see [Security scanning tools](../index.md#application-coverage). diff --git a/doc/user/group/index.md b/doc/user/group/index.md index f232ca17768..f2f9603c263 100644 --- a/doc/user/group/index.md +++ b/doc/user/group/index.md @@ -47,25 +47,25 @@ the immediate parent group. ## View groups -To explore all public groups: +To explore all public groups you are a member of: 1. On the left sidebar, select **Search or go to**. 1. Select **View all my groups**. 1. At the top right, select **Explore groups**. -To view groups where you have a direct or indirect membership: +To view groups where you have direct or indirect membership: 1. On the left sidebar, select **Search or go to**. 1. Select **View all my groups**. -This page shows groups that you are a member of: +This page shows groups that you are a member of through: -- Through membership of a subgroup's parent group. -- Through direct or inherited membership of a project in the group or subgroup. +- Membership of a subgroup's parent group. +- Direct or inherited membership of a project in the group or subgroup. ## View group activity -To view the activity of a project: +To view the activity of a group: 1. On the left sidebar, select **Search or go to** and find your group. 1. Select **Manage > Activity**. @@ -75,7 +75,6 @@ To view the activity of a project: - **Push events**: Push events in the group's projects. - **Merge events**: Accepted merge requests in the group's projects. - **Issue events**: Issues opened and closed in the group's projects. - - **Epic events**: Epics opened and closed in the group. - **Comments**: Comments posted by group members in the group's projects. - **Wiki**: Updates to wiki pages in the group. - **Designs**: Designs added, updated, and removed in the group's projects. @@ -87,15 +86,16 @@ To create a group: 1. On the left sidebar, at the top, select **Create new** (**{plus}**) and **New group**. 1. Select **Create group**. -1. Enter a name for the group in **Group name**. For a list of words that cannot be used as group names, see +1. In the **Group name** text box, enter the name of the group. For a list of words that cannot be used as group names, see [reserved names](../reserved_names.md). -1. Enter a path for the group in **Group URL**, which is used for the [namespace](../namespace/index.md). -1. Choose the [visibility level](../public_access.md). -1. Personalize your GitLab experience by answering the following questions: - - What is your role? - - Who is using this group? - - What are you using this group for? -1. Invite GitLab members or other users to join the group. +1. In the **Group URL** text box, enter the path for the group used for the [namespace](../namespace/index.md). +1. Select the [**Visibility level**](../public_access.md) of the group. +1. Optional. To personalize your GitLab experience: + - From the **Role** dropdown list, select your role. + - For **Who will be using this group?**, select an option. + - From the **What will you use this group for?** dropdown list, select an option. +1. Optional. To invite members to the group, in the **Email 1** text box, enter the email address of the user you want to invite. To invite more users, select **Invite another member** and enter the user's email address. +1. Select **Create group**. For details about groups, watch [GitLab Namespaces (users, groups and subgroups)](https://youtu.be/r0sJgjR2f5A). @@ -110,20 +110,16 @@ To remove a group and its contents: 1. On the left sidebar, select **Settings > General**. 1. Expand the **Advanced** section. 1. In the **Remove group** section, select **Remove group**. -1. Type the group name. -1. Select **Confirm**. +1. On the confirmation dialog, type the group name and select **Confirm**. -A group can also be removed from the groups dashboard: +You can also remove a group from the groups dashboard: 1. On the left sidebar, select **Search or go to**. 1. Select **View all my groups**. 1. Select (**{ellipsis_v}**) for the group you want to delete. 1. Select **Delete**. -1. In the Remove group section, select **Remove group**. -1. Type the group name. -1. Select **Confirm**. - -This action removes the group. It also adds a background job to delete all projects in the group. +1. In the **Remove group** section, select **Remove group**. +1. On the confirmation dialog, type the group name and select **Confirm**. In [GitLab 12.8 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/33257), on GitLab [Premium](https://about.gitlab.com/pricing/premium/) and [Ultimate](https://about.gitlab.com/pricing/ultimate/), this action adds a background job to mark a group for deletion. By default, the job schedules the deletion seven days in the future. You can modify this retention period through the [instance settings](../../administration/settings/visibility_and_access_controls.md#deletion-protection). @@ -146,11 +142,10 @@ To immediately remove a group marked for deletion: 1. On the left sidebar, select **Search or go to** and find your group. 1. Select **Settings > General**. 1. Expand **Advanced**. -1. In the "Permanently remove group" section, select **Remove group**. +1. In the **Permanently remove group** section, select **Remove group**. 1. Confirm the action when asked to. -Your group, its subgroups, projects, and all related resources, including issues and merge requests, -are deleted. +This action deletes the group, its subgroups, projects, and all related resources, including issues and merge requests. ## Restore a group **(PREMIUM ALL)** @@ -161,7 +156,7 @@ To restore a group that is marked for deletion: 1. On the left sidebar, select **Search or go to** and find your group. 1. Select **Settings > General**. 1. Expand the **Advanced** section. -1. In the Restore group section, select **Restore group**. +1. In the **Restore group** section, select **Restore group**. ## Request access to a group @@ -170,11 +165,11 @@ As a user, you can request to be a member of a group, if an administrator allows 1. On the left sidebar, select **Search or go to**. 1. Select **View all my groups**. 1. At the top right side, select **Explore groups**. -1. Search for the group by name. +1. In the **Search by name** text box, enter the name of the group you want to join. 1. In the search results, select the name of the group. 1. On the group page, under the group name, select **Request Access**. -As many as ten of the most-recently-active group owners receive an email with your request. +Up to ten of the most recently active group owners receive an email with your request. Any group owner can approve or decline the request. If you change your mind before your request is approved, select @@ -189,16 +184,16 @@ To view a group's members: A table displays the member's: -- **Account** name and username +- **Account** name and username. - **Source** of their [membership](../project/members/index.md#membership-types). For transparency, GitLab displays all membership sources of group members. Members who have multiple membership sources are displayed and counted as separate members. For example, if a member has been added to the group both directly and through inheritance, the member is displayed twice in the **Members** table, with different sources, and is counted as two individual members of the group. -- [**Max role**](../project/members/index.md#which-roles-you-can-assign) in the group -- **Expiration** date of their group membership -- **Activity** related to their account +- [**Max role**](../project/members/index.md#which-roles-you-can-assign) in the group. +- **Expiration** date of their group membership. +- **Activity** related to their account. NOTE: The display of group members' **Source** might be inconsistent. @@ -223,11 +218,11 @@ In lists of group members, entries can display the following badges: 1. On the left sidebar, select **Search or go to** and find your group. 1. Select **Manage > Members**. -1. Above the list of members, in the **Filter members** box, enter filter criteria. - - To view members in the group only, select **Membership = Direct**. - - To view members of the group and its subgroups, select **Membership = Inherited**. - - To view members with two-factor authentication enabled or disabled, select **2FA = Enabled** or **Disabled**. - - To view members of the top-level group who are [enterprise users](../enterprise_user/index.md), select **Enterprise = true**. +1. Above the list of members, in the **Filter members** text box, enter your search criteria. To view: + - Direct members of the group, select **Membership = Direct**. + - Members of the group and its subgroups, select **Membership = Inherited**. + - Members with two-factor authentication enabled or disabled, select **2FA = Enabled** or **2FA = Disabled**. + - Members of the top-level group who are [enterprise users](../enterprise_user/index.md), select **Enterprise = true**. ### Search a group @@ -257,22 +252,38 @@ You can give a user access to all projects in a group. Prerequisites: -- You must have the Owner role. +- You must have the Owner role for the group. 1. On the left sidebar, select **Search or go to** and find your group. 1. Select **Manage > Members**. 1. Select **Invite members**. -1. Fill in the fields. - - The role applies to all projects in the group. For more information, see [permissions](../permissions.md). - - Optional. Select an **Access expiration date**. From that date onward, the - user can no longer access the project. -1. Select **Invite**. +1. If the user: -If you selected an access expiration date, the group member gets an email notification -seven days before their access expires. + - Has a GitLab account, enter the user's username. + - Doesn't have a GitLab account, enter the user's email address. + +1. Select a [role](../permissions.md). +1. Optional. For **Access expiration date**, enter or select a date. + From that date onward, the user can no longer access the project. + + If you enter an access expiration date, the group member gets an email notification + seven days before their access expires. + + WARNING: + If you give a member the Maintainer role and enter an expiration date, that member + has full permissions as long as they are in the role. These permissions include the member's ability + to extend their own time in the Maintainer role. + +1. Select **Invite**. + If you invite the user by their: + + - GitLab username, the user is added to the member list. + - Email address, the user receives an email invitation and is prompted to create an account. + If the invitation is not accepted, GitLab sends reminder emails two, five, and ten days later. + Unaccepted invites are automatically deleted after 90 days. Members that are not automatically added are displayed on the **Invited** tab. -Users can be on this tab because they: +This tab includes users who: - Have not yet accepted the invitation. - Are waiting for [approval from an administrator](../admin_area/moderate_users.md). @@ -293,21 +304,16 @@ To remove a member from a group: 1. Select **Manage > Members**. 1. Next to the member you want to remove, select the vertical ellipsis (**{ellipsis_v}**). 1. Select **Remove member**. -1. Optional. On the **Remove member** confirmation box: - - To remove direct user membership from subgroups and projects, select the **Also remove direct user membership from subgroups and projects** checkbox. - - To unassign the user from linked issues and merge requests, select the **Also unassign this user from linked issues and merge requests** checkbox. +1. Optional. On the **Remove member** confirmation dialog, select one or both checkboxes: + - **Also remove direct user membership from subgroups and projects** + - **Also unassign this user from linked issues and merge requests** 1. Select **Remove member**. -## Ensure removed users cannot invite themselves back - -Malicious users with the Maintainer or Owner role could exploit a race condition that allows -them to invite themselves back to a group or project that a GitLab administrator has removed them from. - -To avoid this problem, GitLab administrators can [ensure removed users cannot invite themselves back](../project/members/index.md#ensure-removed-users-cannot-invite-themselves-back). +GitLab administrators can also [ensure removed users cannot invite themselves back](../project/members/index.md#ensure-removed-users-cannot-invite-themselves-back). ## Add projects to a group -There are two different ways to add a new project to a group: +You can add a new project to a group in two ways: - Select a group, and then select **New project**. You can then continue [creating your project](../../user/project/index.md). - While you are creating a project, select a group from the dropdown list. @@ -319,10 +325,10 @@ There are two different ways to add a new project to a group: > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/2534) in GitLab 10.5. > - [Moved](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/25975) from GitLab Premium to GitLab Free in 11.10. -By default, users with: +By default, users with at least the: -- At least the Developer role can create projects under a group. This default can be changed. -- At least the Maintainer role can fork projects into a group. This default prevents users with the Developer role from forking projects that +- Developer role can create projects under a group. This default can be changed. +- Maintainer role can fork projects into a group. This default prevents users with the Developer role from forking projects that contain protected branches and cannot be changed. To change the role that can create projects under a group: @@ -330,7 +336,7 @@ To change the role that can create projects under a group: 1. On the left sidebar, select **Search or go to** and find your group. 1. Select **Settings > General**. 1. Expand the **Permissions and group features** section. -1. Select the desired option in the **Roles allowed to create projects** dropdown list. +1. From the **Roles allowed to create projects** dropdown list, select an option. 1. Select **Save changes**. To change this setting globally, see [Default project creation protection](../../administration/settings/visibility_and_access_controls.md#define-which-roles-can-create-projects). diff --git a/lib/gitlab/redis/sidekiq_status.rb b/lib/gitlab/redis/sidekiq_status.rb deleted file mode 100644 index 69e0c745c79..00000000000 --- a/lib/gitlab/redis/sidekiq_status.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -module Gitlab - module Redis - # Pseudo-store to transition `Gitlab::SidekiqStatus` from - # using `Sidekiq.redis` to using the `SharedState` redis store. - class SidekiqStatus < ::Gitlab::Redis::Wrapper - class << self - def store_name - 'SharedState' - end - - private - - def redis - primary_store = ::Gitlab::Redis::SharedState.redis - secondary_store = ::Redis.new(Gitlab::Redis::Queues.params) # rubocop:disable Cop/RedisQueueUsage - - MultiStore.new(primary_store, secondary_store, name.demodulize) - end - end - end - end -end diff --git a/lib/gitlab/sidekiq_status.rb b/lib/gitlab/sidekiq_status.rb index ae4aca7ff92..3d6c53e787c 100644 --- a/lib/gitlab/sidekiq_status.rb +++ b/lib/gitlab/sidekiq_status.rb @@ -132,7 +132,8 @@ module Gitlab Feature.enabled?(:use_primary_store_as_default_for_sidekiq_status) # TODO: Swap for Gitlab::Redis::SharedState after store transition # https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues/923 - Gitlab::Redis::SidekiqStatus.with { |redis| yield redis } + # For now, we use SharedState to reduce amount of spawned connection to Redis Cluster during initialisation + Gitlab::Redis::SharedState.with { |redis| yield redis } else # Keep the old behavior intact if neither feature flag is turned on Sidekiq.redis { |redis| yield redis } # rubocop:disable Cop/SidekiqRedisCall diff --git a/qa/qa/scenario/test/sanity/selectors.rb b/qa/qa/scenario/test/sanity/selectors.rb index 688fede1b2e..ad84f99128b 100644 --- a/qa/qa/scenario/test/sanity/selectors.rb +++ b/qa/qa/scenario/test/sanity/selectors.rb @@ -36,7 +36,7 @@ module QA For more help see documentation in https://docs.gitlab.com/ee/development/testing_guide/end_to_end/page_objects.html - or ask for help on #quality channel on Slack (GitLab Team only). + or ask for help on #test-platform channel on Slack (GitLab Team only). If you are not a Team Member, and you still need help to contribute, please open an issue in GitLab QA issue tracker. diff --git a/scripts/generate-failed-package-and-test-mr-message.rb b/scripts/generate-failed-package-and-test-mr-message.rb index c57f132d563..5db28942291 100755 --- a/scripts/generate-failed-package-and-test-mr-message.rb +++ b/scripts/generate-failed-package-and-test-mr-message.rb @@ -54,7 +54,7 @@ class GenerateFailedPackageAndTestMrMessage investigated to guarantee this backport complies with the Quality standards. Ping your team's associated Software Engineer in Test (SET) to confirm the failures are unrelated to the merge request. - If there's no SET assigned, ask for assistance on the `#quality` Slack channel. + If there's no SET assigned, ask for assistance on the `#test-platform` Slack channel. MARKDOWN end diff --git a/scripts/generate-message-to-run-e2e-pipeline.rb b/scripts/generate-message-to-run-e2e-pipeline.rb index ccbaba8a3eb..773aa4145d1 100755 --- a/scripts/generate-message-to-run-e2e-pipeline.rb +++ b/scripts/generate-message-to-run-e2e-pipeline.rb @@ -72,8 +72,8 @@ class GenerateMessageToRunE2ePipeline @#{author_username} Some end-to-end (E2E) tests should run based on the stage label. - Please start the `trigger-omnibus-and-follow-up-e2e` job in the `qa` stage and ensure tests in the `follow-up-e2e:package-and-test-ee` pipeline - pass **before this MR is merged**. + Please start the `trigger-omnibus-and-follow-up-e2e` job in the `qa` stage and wait for the tests in the `follow-up-e2e:package-and-test-ee` pipeline + to pass **before merging this MR**. Do not use **Auto-merge**, unless these tests have already completed successfully, because a failure in these tests do not block the auto-merge. (E2E tests are computationally intensive and don't run automatically for every push/rebase, so we ask you to run this job manually at least once.) To run all E2E tests, apply the ~"pipeline:run-all-e2e" label and run a new pipeline. @@ -83,7 +83,7 @@ class GenerateMessageToRunE2ePipeline Once done, apply the ✅ emoji on this comment. - **Team members only:** for any questions or help, reach out on the internal `#quality` Slack channel. + **Team members only:** for any questions or help, reach out on the internal `#test-platform` Slack channel. MARKDOWN end diff --git a/spec/db/docs_spec.rb b/spec/db/docs_spec.rb index 5c19db0238c..aa826959f37 100644 --- a/spec/db/docs_spec.rb +++ b/spec/db/docs_spec.rb @@ -185,7 +185,7 @@ RSpec.describe 'Tables documentation', feature_category: :database do database_base_models = Gitlab::Database.database_base_models.reject { |k, _| k.in?(excluded) } tables = database_base_models.flat_map { |_, m| m.connection.tables }.sort.uniq directory_path = File.join('db', 'docs') - required_fields = %i[feature_categories table_name gitlab_schema] + required_fields = %i[feature_categories table_name gitlab_schema milestone] include_examples 'validate dictionary', tables, directory_path, required_fields end diff --git a/spec/features/groups/clusters/user_spec.rb b/spec/features/groups/clusters/user_spec.rb index ca0687134b6..aff3e4574ca 100644 --- a/spec/features/groups/clusters/user_spec.rb +++ b/spec/features/groups/clusters/user_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'User Cluster', :js, feature_category: :user_profile do +RSpec.describe 'User Cluster', :js, feature_category: :environment_management do include GoogleApi::CloudPlatformHelpers let(:group) { create(:group) } diff --git a/spec/features/profiles/personal_access_tokens_spec.rb b/spec/features/profiles/personal_access_tokens_spec.rb index 094855393be..e59b83c567e 100644 --- a/spec/features/profiles/personal_access_tokens_spec.rb +++ b/spec/features/profiles/personal_access_tokens_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Profile > Personal Access Tokens', :js, feature_category: :user_profile do +RSpec.describe 'Profile > Personal Access Tokens', :js, feature_category: :system_access do include Spec::Support::Helpers::ModalHelpers include Features::AccessTokenHelpers diff --git a/spec/features/projects/cluster_agents_spec.rb b/spec/features/projects/cluster_agents_spec.rb index 5f8e17e1a15..ab566b3b433 100644 --- a/spec/features/projects/cluster_agents_spec.rb +++ b/spec/features/projects/cluster_agents_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'ClusterAgents', :js, feature_category: :groups_and_projects do +RSpec.describe 'ClusterAgents', :js, feature_category: :environment_management do let_it_be(:token) { create(:cluster_agent_token, description: 'feature test token') } let(:agent) { token.agent } diff --git a/spec/features/projects/clusters_spec.rb b/spec/features/projects/clusters_spec.rb index d799fbc49ef..241d18d5223 100644 --- a/spec/features/projects/clusters_spec.rb +++ b/spec/features/projects/clusters_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Clusters', :js, feature_category: :groups_and_projects do +RSpec.describe 'Clusters', :js, feature_category: :environment_management do include GoogleApi::CloudPlatformHelpers let(:project) { create(:project) } diff --git a/spec/features/projects/environments/environment_spec.rb b/spec/features/projects/environments/environment_spec.rb index fdedaa3f469..de4ce3a23b6 100644 --- a/spec/features/projects/environments/environment_spec.rb +++ b/spec/features/projects/environments/environment_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe 'Environment', feature_category: :groups_and_projects do +RSpec.describe 'Environment', feature_category: :environment_management do let_it_be(:project) { create(:project, :repository) } let(:user) { create(:user) } let(:role) { :developer } diff --git a/spec/lib/gitlab/database/sharding_key_spec.rb b/spec/lib/gitlab/database/sharding_key_spec.rb index 5bee095ac8d..ca01c7b8d36 100644 --- a/spec/lib/gitlab/database/sharding_key_spec.rb +++ b/spec/lib/gitlab/database/sharding_key_spec.rb @@ -7,7 +7,8 @@ RSpec.describe 'new tables missing sharding_key', feature_category: :cell do # the table name to remove this once a decision has been made. let(:allowed_to_be_missing_sharding_key) do [ - 'abuse_report_assignees' # https://gitlab.com/gitlab-org/gitlab/-/issues/432365 + 'abuse_report_assignees', # https://gitlab.com/gitlab-org/gitlab/-/issues/432365 + 'sbom_occurrences_vulnerabilities' # https://gitlab.com/gitlab-org/gitlab/-/issues/432900 ] end diff --git a/spec/lib/gitlab/redis/sidekiq_status_spec.rb b/spec/lib/gitlab/redis/sidekiq_status_spec.rb deleted file mode 100644 index 447fd78177c..00000000000 --- a/spec/lib/gitlab/redis/sidekiq_status_spec.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe Gitlab::Redis::SidekiqStatus do - # Note: this is a pseudo-store in front of `SharedState`, meant only as a tool - # to move away from `Sidekiq.redis` for sidekiq status data. Thus, we use the - # same store configuration as the former. - let(:instance_specific_config_file) { "config/redis.shared_state.yml" } - - include_examples "redis_shared_examples" - - describe '#pool' do - let(:config_new_format_host) { "spec/fixtures/config/redis_new_format_host.yml" } - let(:config_new_format_socket) { "spec/fixtures/config/redis_new_format_socket.yml" } - let(:rails_root) { mktmpdir } - - subject { described_class.pool } - - before do - # Override rails root to avoid having our fixtures overwritten by `redis.yml` if it exists - allow(Gitlab::Redis::SharedState).to receive(:rails_root).and_return(rails_root) - allow(Gitlab::Redis::Queues).to receive(:rails_root).and_return(rails_root) - allow(Gitlab::Redis::ClusterSharedState).to receive(:rails_root).and_return(rails_root) - - allow(Gitlab::Redis::SharedState).to receive(:config_file_name).and_return(config_new_format_host) - allow(Gitlab::Redis::Queues).to receive(:config_file_name).and_return(config_new_format_socket) - allow(Gitlab::Redis::ClusterSharedState).to receive(:config_file_name).and_return(config_new_format_socket) - end - - around do |example| - clear_pool - example.run - ensure - clear_pool - end - - it 'instantiates an instance of MultiStore' do - subject.with do |redis_instance| - expect(redis_instance).to be_instance_of(::Gitlab::Redis::MultiStore) - - expect(redis_instance.primary_store.secondary_store.connection[:id]).to eq("redis://test-host:6379/99") - expect(redis_instance.primary_store.primary_store.connection[:id]).to eq("unix:///path/to/redis.sock/0") - expect(redis_instance.secondary_store.connection[:id]).to eq("unix:///path/to/redis.sock/0") - - expect(redis_instance.instance_name).to eq('SidekiqStatus') - end - end - - it_behaves_like 'multi store feature flags', :use_primary_and_secondary_stores_for_sidekiq_status, - :use_primary_store_as_default_for_sidekiq_status - end - - describe '#store_name' do - it 'returns the name of the SharedState store' do - expect(described_class.store_name).to eq('SharedState') - end - end -end diff --git a/spec/lib/gitlab/sidekiq_status_spec.rb b/spec/lib/gitlab/sidekiq_status_spec.rb index a570a66ffda..51047b6580d 100644 --- a/spec/lib/gitlab/sidekiq_status_spec.rb +++ b/spec/lib/gitlab/sidekiq_status_spec.rb @@ -134,11 +134,11 @@ RSpec.describe Gitlab::SidekiqStatus, :clean_gitlab_redis_queues, context 'with multi-store feature flags turned on' do def with_redis(&block) - Gitlab::Redis::SidekiqStatus.with(&block) + Gitlab::Redis::SharedState.with(&block) end - it 'uses Gitlab::Redis::SidekiqStatus.with' do - expect(Gitlab::Redis::SidekiqStatus).to receive(:with).and_call_original + it 'uses Gitlab::Redis::SharedState.with' do + expect(Gitlab::Redis::SharedState).to receive(:with).and_call_original expect(Sidekiq).not_to receive(:redis) described_class.job_status(%w[123 456 789]) @@ -159,7 +159,7 @@ RSpec.describe Gitlab::SidekiqStatus, :clean_gitlab_redis_queues, it 'uses Sidekiq.redis' do expect(Sidekiq).to receive(:redis).and_call_original - expect(Gitlab::Redis::SidekiqStatus).not_to receive(:with) + expect(Gitlab::Redis::SharedState).not_to receive(:with) described_class.job_status(%w[123 456 789]) end diff --git a/spec/models/concerns/disables_sti_spec.rb b/spec/models/concerns/disables_sti_spec.rb new file mode 100644 index 00000000000..85b943c3563 --- /dev/null +++ b/spec/models/concerns/disables_sti_spec.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe DisablesSti, feature_category: :shared do + describe '#new' do + context 'for a non STI class like Project' do + it 'can initialize' do + expect { Project.new }.not_to raise_error + end + end + + context 'for a base class which has an inheritance column' do + it 'can initialize' do + expect { Label.new }.not_to raise_error + end + end + + context 'for an STI class that previously existed' do + it 'can initialize' do + expect { GroupLabel.new }.not_to raise_error + end + end + + context 'for an STI class that is new' do + before do + stub_const('DummyModel', Class.new(Label)) + end + + it 'cannot initialize' do + expect { DummyModel.new }.to raise_error(/Do not use Single Table Inheritance/) + end + + context 'when SKIP_STI_CHECK is true' do + before do + stub_const("#{described_class}::SKIP_STI_CHECK", 'true') + end + + it 'can initialize' do + expect { DummyModel.new }.not_to raise_error + end + end + end + + context 'for an STI class descending from Integration' do + before do + stub_const('IntegrationDummyModel', Class.new(Integration)) + end + + it 'can initialize' do + expect { IntegrationDummyModel.new }.not_to raise_error + end + end + end +end diff --git a/spec/models/concerns/triggerable_hooks_spec.rb b/spec/models/concerns/triggerable_hooks_spec.rb index 28cda269458..c209d6476f3 100644 --- a/spec/models/concerns/triggerable_hooks_spec.rb +++ b/spec/models/concerns/triggerable_hooks_spec.rb @@ -10,6 +10,8 @@ RSpec.describe TriggerableHooks do include TriggerableHooks # rubocop:disable RSpec/DescribedClass triggerable_hooks [:push_hooks] + self.allow_legacy_sti_class = true + scope :executable, -> { all } end end diff --git a/spec/scripts/generate_message_to_run_e2e_pipeline_spec.rb b/spec/scripts/generate_message_to_run_e2e_pipeline_spec.rb index aa758e19dfa..9b191215739 100644 --- a/spec/scripts/generate_message_to_run_e2e_pipeline_spec.rb +++ b/spec/scripts/generate_message_to_run_e2e_pipeline_spec.rb @@ -224,8 +224,8 @@ RSpec.describe GenerateMessageToRunE2ePipeline, feature_category: :tooling do @#{author_username} Some end-to-end (E2E) tests should run based on the stage label. - Please start the `trigger-omnibus-and-follow-up-e2e` job in the `qa` stage and ensure tests in the `follow-up-e2e:package-and-test-ee` pipeline - pass **before this MR is merged**. + Please start the `trigger-omnibus-and-follow-up-e2e` job in the `qa` stage and wait for the tests in the `follow-up-e2e:package-and-test-ee` pipeline + to pass **before merging this MR**. Do not use **Auto-merge**, unless these tests have already completed successfully, because a failure in these tests do not block the auto-merge. (E2E tests are computationally intensive and don't run automatically for every push/rebase, so we ask you to run this job manually at least once.) To run all E2E tests, apply the ~"pipeline:run-all-e2e" label and run a new pipeline. @@ -235,7 +235,7 @@ RSpec.describe GenerateMessageToRunE2ePipeline, feature_category: :tooling do Once done, apply the ✅ emoji on this comment. - **Team members only:** for any questions or help, reach out on the internal `#quality` Slack channel. + **Team members only:** for any questions or help, reach out on the internal `#test-platform` Slack channel. MARKDOWN end diff --git a/spec/support/rspec_order_todo.yml b/spec/support/rspec_order_todo.yml index b8975c7191e..9efef05d0d3 100644 --- a/spec/support/rspec_order_todo.yml +++ b/spec/support/rspec_order_todo.yml @@ -6587,7 +6587,6 @@ - './spec/lib/gitlab/redis/rate_limiting_spec.rb' - './spec/lib/gitlab/redis/sessions_spec.rb' - './spec/lib/gitlab/redis/shared_state_spec.rb' -- './spec/lib/gitlab/redis/sidekiq_status_spec.rb' - './spec/lib/gitlab/redis/trace_chunks_spec.rb' - './spec/lib/gitlab/redis/wrapper_spec.rb' - './spec/lib/gitlab/reference_counter_spec.rb'