Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2023-05-09 00:08:55 +00:00
parent 7db94a9807
commit 9ca5333a12
65 changed files with 677 additions and 350 deletions

View File

@ -174,7 +174,7 @@ gem 'seed-fu', '~> 2.3.7'
gem 'elasticsearch-model', '~> 7.2'
gem 'elasticsearch-rails', '~> 7.2', require: 'elasticsearch/rails/instrumentation'
gem 'elasticsearch-api', '7.13.3'
gem 'aws-sdk-core', '~> 3.171.1'
gem 'aws-sdk-core', '~> 3.172.0'
gem 'aws-sdk-cloudformation', '~> 1'
gem 'aws-sdk-s3', '~> 1.122.0'
gem 'faraday_middleware-aws-sigv4', '~>0.3.0'
@ -457,7 +457,7 @@ group :test do
gem 'capybara', '~> 3.39'
gem 'capybara-screenshot', '~> 1.0.26'
gem 'selenium-webdriver', '~> 4.9'
gem 'selenium-webdriver', '~> 4.9.0'
gem 'graphlyte', '~> 1.0.0'

View File

@ -35,9 +35,9 @@
{"name":"awesome_print","version":"1.9.2","platform":"ruby","checksum":"e99b32b704acff16d768b3468680793ced40bfdc4537eb07e06a4be11133786e"},
{"name":"awrence","version":"1.2.1","platform":"ruby","checksum":"dd1d214c12a91f449d1ef81d7ee3babc2816944e450752e7522c65521872483e"},
{"name":"aws-eventstream","version":"1.2.0","platform":"ruby","checksum":"ffa53482c92880b001ff2fb06919b9bb82fd847cbb0fa244985d2ebb6dd0d1df"},
{"name":"aws-partitions","version":"1.760.0","platform":"ruby","checksum":"60aaa70f3a7d40361226f6d07104ec5c3dafcd4f2f01a3827d1989beaafa48e9"},
{"name":"aws-partitions","version":"1.761.0","platform":"ruby","checksum":"291e444e1edfc92c5521a6dbdd1236ccc3f122b3520163b2be6ec5b6ef350ef2"},
{"name":"aws-sdk-cloudformation","version":"1.41.0","platform":"ruby","checksum":"31e47539719734413671edf9b1a31f8673fbf9688549f50c41affabbcb1c6b26"},
{"name":"aws-sdk-core","version":"3.171.1","platform":"ruby","checksum":"615fd8756af946eb10fe41ea06608e814b29fd72ade4934713b7e50c8bcc7df6"},
{"name":"aws-sdk-core","version":"3.172.0","platform":"ruby","checksum":"ddc03774a8957033ca2f1564349d5b273a4b615c2cb756407e1b3b8983754c1b"},
{"name":"aws-sdk-kms","version":"1.64.0","platform":"ruby","checksum":"40de596c95047bfc6e1aacea24f3df6241aa716b6f7ce08ac4c5f7e3120395ad"},
{"name":"aws-sdk-s3","version":"1.122.0","platform":"ruby","checksum":"3d1fb6d0a6c55cf568ff66d657b4a6e7eaa718675f1f3156d7b44e3791f39905"},
{"name":"aws-sigv4","version":"1.5.1","platform":"ruby","checksum":"d68c87fff4ee843b4b92b23c7f31f957f254ec6eb064181f7119124aab8b8bb4"},

View File

@ -207,11 +207,11 @@ GEM
awesome_print (1.9.2)
awrence (1.2.1)
aws-eventstream (1.2.0)
aws-partitions (1.760.0)
aws-partitions (1.761.0)
aws-sdk-cloudformation (1.41.0)
aws-sdk-core (~> 3, >= 3.99.0)
aws-sigv4 (~> 1.1)
aws-sdk-core (3.171.1)
aws-sdk-core (3.172.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.5)
@ -1681,7 +1681,7 @@ DEPENDENCIES
autoprefixer-rails (= 10.2.5.1)
awesome_print
aws-sdk-cloudformation (~> 1)
aws-sdk-core (~> 3.171.1)
aws-sdk-core (~> 3.172.0)
aws-sdk-s3 (~> 1.122.0)
axe-core-rspec
babosa (~> 1.0.4)
@ -1920,7 +1920,7 @@ DEPENDENCIES
sassc-rails (~> 2.1.0)
sd_notify (~> 0.1.0)
seed-fu (~> 2.3.7)
selenium-webdriver (~> 4.9)
selenium-webdriver (~> 4.9.0)
semver_dialects (~> 1.2.1)
sentry-rails (~> 5.8.0)
sentry-raven (~> 3.1)

View File

@ -12,19 +12,16 @@ module Resolvers
argument :legacy_mode,
type: GraphQL::Types::String,
default_value: '14.5',
default_value: nil,
required: false,
description: 'Compatibility mode. A null value turns off compatibility mode.',
description: 'No-op, left for compatibility.',
deprecated: {
reason: 'Will be removed in 17.0. In GitLab 16.0 and later, ' \
'the field will act as if `legacyMode` is null',
reason: 'Will be removed in 17.0',
milestone: '15.0'
}
def resolve(legacy_mode:, **args)
legacy_mode = nil if Feature.enabled?(:disable_runner_graphql_legacy_mode)
runner.status(legacy_mode)
def resolve(**args)
runner.status
end
end
end

View File

@ -345,12 +345,7 @@ module Ci
[created_at, contacted_at].compact.max <= self.class.stale_deadline
end
def status(legacy_mode = nil)
# TODO Deprecate legacy_mode in %16.0 and make it a no-op
# (see https://gitlab.com/gitlab-org/gitlab/-/issues/360545)
# TODO Remove legacy_mode in %17.0
return deprecated_rest_status if legacy_mode == '14.5'
def status
return :stale if stale?
return :never_contacted unless contacted_at

View File

@ -1040,14 +1040,30 @@ class User < ApplicationRecord
password_allowed
end
# Override Devise Rememberable#remember_me!
#
# In Devise this method sets `remember_created_at` and writes the session token
# to the session cookie. When remember me is disabled this method ensures these
# values aren't set.
def remember_me!
super if ::Gitlab::Database.read_write?
super if ::Gitlab::Database.read_write? && ::Gitlab::CurrentSettings.remember_me_enabled?
end
def forget_me!
super if ::Gitlab::Database.read_write?
end
# Override Devise Rememberable#remember_me?
#
# In Devise this method compares the remember me token received from the user session
# and compares to the stored value. When remember me is disabled this method ensures
# the upstream comparison does not happen.
def remember_me?(token, generated_at)
return false unless ::Gitlab::CurrentSettings.remember_me_enabled?
super
end
def disable_two_factor!
transaction do
self.disable_webauthn!

View File

@ -1,8 +0,0 @@
---
name: disable_runner_graphql_legacy_mode
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/117875
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/344648
milestone: '15.11'
type: development
group: group::runner
default_enabled: false

View File

@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/408218
milestone: '16.0'
type: development
group: group::source code
default_enabled: false
default_enabled: true

View File

@ -0,0 +1,8 @@
---
name: revert_daily_hll_events_to_weekly_aggregation
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/114967
rollout_issue_url:
milestone: '16.0'
type: development
group: group::analytics instrumentation
default_enabled: false

View File

@ -10,10 +10,7 @@
The updates will include improvements already released in the Latest versions of the CI/CD templates.
We released these changes in the Latest template versions because they have the potential to disrupt customized CI/CD pipeline configurations.
In all updated templates, we're:
- Adding support for running scans in merge request (MR) pipelines.
- Updating the definition of variables like `SAST_DISABLED` and `DEPENDENCY_SCANNING_DISABLED` to disable scanning only if the value is `"true"`. Previously, even if the value were `"false"`, scanning would be disabled.
In all updated templates, we're updating the definition of variables like `SAST_DISABLED` and `DEPENDENCY_SCANNING_DISABLED` to disable scanning only if the value is `"true"`. Previously, even if the value were `"false"`, scanning would be disabled.
The following templates will be updated:
@ -27,7 +24,7 @@
- SAST: [`SAST.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Jobs/SAST.gitlab-ci.yml)
- Secret Detection: [`Secret-Detection.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Jobs/Secret-Detction.gitlab-ci.yml)
We recommend that you test your pipelines before the 16.0 release if you use one of the templates listed above and you do any of the following:
We recommend that you test your pipelines before the 16.0 release if you use one of the templates listed above and you use the `_DISABLED` variables but set a value other than `"true"`.
1. You override `rules` for your security scanning jobs.
1. You use the `_DISABLED` variables but set a value other than `"true"`.
**Update:** We previously announced that we would update the `rules` on the affected templates to run in [merge request pipelines](https://docs.gitlab.com/ee/ci/pipelines/merge_request_pipelines.html) by default.
However, due to compatibility issues [discussed in the deprecation issue](https://gitlab.com/gitlab-org/gitlab/-/issues/388988#note_1372629948), we will no longer make this change in GitLab 16.0. We will still release the changes to the `_DISABLED` variables as described above.

View File

@ -6,3 +6,5 @@ description: "(Deprecated) A GitLab managed Helm installation in a Kubernetes cl
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/64be8d70ae20928df351e495a3442bb6036bc3e7
milestone: '10.2'
gitlab_schema: gitlab_main
removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119380
removed_in_milestone: '16.0'

View File

@ -6,3 +6,5 @@ description: "(Deprecated) A custom domain for a GitLab managed Knative installa
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/19835
milestone: '12.6'
gitlab_schema: gitlab_main
removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/119543
removed_in_milestone: '16.0'

View File

@ -0,0 +1,11 @@
---
table_name: value_stream_dashboard_aggregations
classes:
- Analytics::ValueStreamDashboard::Aggregation
feature_categories:
- value_stream_management
description: Stores the top-level namespaces which are opted-in to the value stream
dashboard feature.
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/118908
milestone: '16.0'
gitlab_schema: gitlab_main

View File

@ -0,0 +1,14 @@
# frozen_string_literal: true
class CreateAnalyticsValueStreamDashboardAggregations < Gitlab::Database::Migration[2.1]
def change
create_table :value_stream_dashboard_aggregations, id: false do |t|
t.references :namespace, primary_key: true, null: false, index: false, foreign_key: { on_delete: :cascade }
t.datetime_with_timezone :last_run_at
t.boolean :enabled, null: false, default: true
t.index [:last_run_at, :namespace_id], where: 'enabled IS TRUE',
name: 'index_on_value_stream_dashboard_aggregations_last_run_at_id'
end
end
end

View File

@ -0,0 +1,46 @@
# frozen_string_literal: true
class MigrateDailyRedisHllEventsToWeeklyAggregation < Gitlab::Database::Migration[2.1]
disable_ddl_transaction!
def up
days_back = 29.days
start_date = Date.today - days_back - 1.day
end_date = Date.today + 1.day
keys = {}
Gitlab::UsageDataCounters::HLLRedisCounter.known_events.each do |event|
next unless event[:aggregation].to_sym == :daily
(start_date..end_date).each do |date|
daily_key = redis_key(event, date, :daily)
weekly_key = redis_key(event, date, :weekly)
keys.key?(weekly_key) ? keys[weekly_key] << daily_key : keys[weekly_key] = [daily_key]
end
end
keys.each do |weekly_key, daily_keys|
Gitlab::Redis::SharedState.with do |redis|
redis.pfmerge(weekly_key, *daily_keys)
redis.expire(weekly_key, 6.weeks)
end
end
end
def down
# no-op
end
# can't set daily key in HLLRedisCounter anymore, so need to duplicate logic here
def redis_key(event, time, aggregation)
key = "{hll_counters}_#{event[:name]}"
if aggregation.to_sym == :daily
year_day = time.strftime('%G-%j')
"#{year_day}-#{key}"
else
year_week = time.strftime('%G-%V')
"#{key}-#{year_week}"
end
end
end

View File

@ -39,7 +39,7 @@ class ReMigrateRedisSlotKeys < Gitlab::Database::Migration[2.1]
def rename_key(event, date)
old_key = old_redis_key(event, date)
new_key = Gitlab::UsageDataCounters::HLLRedisCounter.send(:redis_key, event, date)
new_key = new_redis_key(event, date)
# cannot simply rename due to different slots
Gitlab::Redis::SharedState.with do |redis|
@ -68,6 +68,21 @@ class ReMigrateRedisSlotKeys < Gitlab::Database::Migration[2.1]
"{#{event[:name]}}"
end
Gitlab::UsageDataCounters::HLLRedisCounter.send(:apply_time_aggregation, name_with_slot, time, event)
apply_time_aggregation(name_with_slot, time, event)
end
def new_redis_key(event, time)
key = "{hll_counters}_#{event[:name]}"
apply_time_aggregation(key, time, event)
end
def apply_time_aggregation(key, time, event)
if event[:aggregation].to_sym == :daily
year_day = time.strftime('%G-%j')
"#{year_day}-#{key}"
else
year_week = time.strftime('%G-%V')
"#{key}-#{year_week}"
end
end
end

View File

@ -0,0 +1,31 @@
# frozen_string_literal: true
# See https://docs.gitlab.com/ee/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class DropClustersApplicationsHelm < Gitlab::Database::Migration[2.1]
def up
drop_table :clusters_applications_helm
end
# Based on init schema:
# https://gitlab.com/gitlab-org/gitlab/-/blob/b237f836df215a4ada92b9406733e6cd2483ca2d/db/migrate/20181228175414_init_schema.rb#L691-L702
# rubocop:disable Migration/SchemaAdditionMethodsNoPost
# rubocop:disable Migration/Datetime
def down
create_table "clusters_applications_helm", id: :serial, force: :cascade do |t|
t.integer "cluster_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "status", null: false
t.string "version", null: false
t.text "status_reason"
t.text "encrypted_ca_key"
t.text "encrypted_ca_key_iv"
t.text "ca_cert"
t.index ["cluster_id"], name: "index_clusters_applications_helm_on_cluster_id", unique: true
end
end
# rubocop:enable Migration/SchemaAdditionMethodsNoPost
# rubocop:enable Migration/Datetime
end

View File

@ -0,0 +1,33 @@
# frozen_string_literal: true
# See https://docs.gitlab.com/ee/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class DropServerlessDomainCluster < Gitlab::Database::Migration[2.1]
def up
drop_table :serverless_domain_cluster
end
# Based on original migration:
# https://gitlab.com/gitlab-org/gitlab/-/blob/5f7bd5b1455d87e2f1a2d1ae2c1147d51e97aa55/db/migrate/20191127030005_create_serverless_domain_cluster.rb
# rubocop:disable Migration/SchemaAdditionMethodsNoPost
def down
create_table :serverless_domain_cluster, id: false, primary_key: :uuid do |t|
t.string :uuid, null: false, limit: 14, primary_key: true
t.bigint :pages_domain_id, null: false
t.bigint :clusters_applications_knative_id, null: false
t.bigint :creator_id
t.datetime_with_timezone :created_at, null: false
t.datetime_with_timezone :updated_at, null: false
t.text :encrypted_key
t.string :encrypted_key_iv, limit: 255
t.text :certificate
t.index :clusters_applications_knative_id,
unique: true,
name: 'idx_serverless_domain_cluster_on_clusters_applications_knative'
t.index :pages_domain_id, name: 'index_serverless_domain_cluster_on_pages_domain_id'
t.index :creator_id, name: 'index_serverless_domain_cluster_on_creator_id'
end
end
# rubocop:enable Migration/SchemaAdditionMethodsNoPost
end

View File

@ -0,0 +1 @@
d3189deaf413a7e96b3e65cab06037dd7fa577bd977549ac5aca168b12d9d1ff

View File

@ -0,0 +1 @@
53c1bc1774ad4d570538e5486640e9d5beef87baf0301ba89ddfca019745ac2e

View File

@ -0,0 +1 @@
cf43d34ef75776417d3f0ef73e79fb71735d3ce8323082a63c9f7feb1a95ba06

View File

@ -0,0 +1 @@
59423550699ab55d8bd2439c423c113d6f66d2cfcea2e606ffad92e00ae555de

View File

@ -14387,28 +14387,6 @@ CREATE TABLE clusters (
helm_major_version integer DEFAULT 3 NOT NULL
);
CREATE TABLE clusters_applications_helm (
id integer NOT NULL,
cluster_id integer NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
status integer NOT NULL,
version character varying NOT NULL,
status_reason text,
encrypted_ca_key text,
encrypted_ca_key_iv text,
ca_cert text
);
CREATE SEQUENCE clusters_applications_helm_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE clusters_applications_helm_id_seq OWNED BY clusters_applications_helm.id;
CREATE TABLE clusters_applications_knative (
id integer NOT NULL,
cluster_id integer NOT NULL,
@ -22560,18 +22538,6 @@ CREATE SEQUENCE sentry_issues_id_seq
ALTER SEQUENCE sentry_issues_id_seq OWNED BY sentry_issues.id;
CREATE TABLE serverless_domain_cluster (
uuid character varying(14) NOT NULL,
pages_domain_id bigint NOT NULL,
clusters_applications_knative_id bigint NOT NULL,
creator_id bigint,
created_at timestamp with time zone NOT NULL,
updated_at timestamp with time zone NOT NULL,
encrypted_key text,
encrypted_key_iv character varying(255),
certificate text
);
CREATE TABLE service_desk_custom_email_credentials (
project_id bigint NOT NULL,
created_at timestamp with time zone NOT NULL,
@ -23839,6 +23805,12 @@ CREATE SEQUENCE users_statistics_id_seq
ALTER SEQUENCE users_statistics_id_seq OWNED BY users_statistics.id;
CREATE TABLE value_stream_dashboard_aggregations (
namespace_id bigint NOT NULL,
last_run_at timestamp with time zone,
enabled boolean DEFAULT true NOT NULL
);
CREATE SEQUENCE value_stream_dashboard_counts_id_seq
START WITH 1
INCREMENT BY 1
@ -25059,8 +25031,6 @@ ALTER TABLE ONLY cluster_providers_gcp ALTER COLUMN id SET DEFAULT nextval('clus
ALTER TABLE ONLY clusters ALTER COLUMN id SET DEFAULT nextval('clusters_id_seq'::regclass);
ALTER TABLE ONLY clusters_applications_helm ALTER COLUMN id SET DEFAULT nextval('clusters_applications_helm_id_seq'::regclass);
ALTER TABLE ONLY clusters_applications_knative ALTER COLUMN id SET DEFAULT nextval('clusters_applications_knative_id_seq'::regclass);
ALTER TABLE ONLY clusters_applications_runners ALTER COLUMN id SET DEFAULT nextval('clusters_applications_runners_id_seq'::regclass);
@ -26964,9 +26934,6 @@ ALTER TABLE ONLY cluster_providers_aws
ALTER TABLE ONLY cluster_providers_gcp
ADD CONSTRAINT cluster_providers_gcp_pkey PRIMARY KEY (id);
ALTER TABLE ONLY clusters_applications_helm
ADD CONSTRAINT clusters_applications_helm_pkey PRIMARY KEY (id);
ALTER TABLE ONLY clusters_applications_knative
ADD CONSTRAINT clusters_applications_knative_pkey PRIMARY KEY (id);
@ -28155,9 +28122,6 @@ ALTER TABLE ONLY sentry_issues
ALTER TABLE ONLY sprints
ADD CONSTRAINT sequence_is_unique_per_iterations_cadence_id UNIQUE (iterations_cadence_id, sequence) DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE ONLY serverless_domain_cluster
ADD CONSTRAINT serverless_domain_cluster_pkey PRIMARY KEY (uuid);
ALTER TABLE ONLY service_desk_custom_email_credentials
ADD CONSTRAINT service_desk_custom_email_credentials_pkey PRIMARY KEY (project_id);
@ -28344,6 +28308,9 @@ ALTER TABLE ONLY users_star_projects
ALTER TABLE ONLY users_statistics
ADD CONSTRAINT users_statistics_pkey PRIMARY KEY (id);
ALTER TABLE ONLY value_stream_dashboard_aggregations
ADD CONSTRAINT value_stream_dashboard_aggregations_pkey PRIMARY KEY (namespace_id);
ALTER TABLE ONLY value_stream_dashboard_counts
ADD CONSTRAINT value_stream_dashboard_counts_pkey PRIMARY KEY (namespace_id, metric, recorded_at, count, id);
@ -29658,8 +29625,6 @@ CREATE UNIQUE INDEX idx_security_scans_on_build_and_scan_type ON security_scans
CREATE INDEX idx_security_scans_on_scan_type ON security_scans USING btree (scan_type);
CREATE UNIQUE INDEX idx_serverless_domain_cluster_on_clusters_applications_knative ON serverless_domain_cluster USING btree (clusters_applications_knative_id);
CREATE UNIQUE INDEX idx_software_license_policies_unique_on_project_and_scan_policy ON software_license_policies USING btree (project_id, software_license_id, scan_result_policy_id);
CREATE INDEX idx_streaming_headers_on_external_audit_event_destination_id ON audit_events_streaming_headers USING btree (external_audit_event_destination_id);
@ -30430,8 +30395,6 @@ CREATE INDEX index_cluster_providers_gcp_on_cloud_run ON cluster_providers_gcp U
CREATE UNIQUE INDEX index_cluster_providers_gcp_on_cluster_id ON cluster_providers_gcp USING btree (cluster_id);
CREATE UNIQUE INDEX index_clusters_applications_helm_on_cluster_id ON clusters_applications_helm USING btree (cluster_id);
CREATE UNIQUE INDEX index_clusters_applications_knative_on_cluster_id ON clusters_applications_knative USING btree (cluster_id);
CREATE UNIQUE INDEX index_clusters_applications_runners_on_cluster_id ON clusters_applications_runners USING btree (cluster_id);
@ -31748,6 +31711,8 @@ CREATE INDEX index_on_users_lower_username ON users USING btree (lower((username
CREATE INDEX index_on_users_name_lower ON users USING btree (lower((name)::text));
CREATE INDEX index_on_value_stream_dashboard_aggregations_last_run_at_id ON value_stream_dashboard_aggregations USING btree (last_run_at, namespace_id) WHERE (enabled IS TRUE);
CREATE INDEX index_onboarding_progresses_for_create_track ON onboarding_progresses USING btree (created_at) WHERE (git_write_at IS NULL);
CREATE INDEX index_onboarding_progresses_for_team_track ON onboarding_progresses USING btree (GREATEST(git_write_at, pipeline_created_at, trial_started_at)) WHERE ((git_write_at IS NOT NULL) AND (pipeline_created_at IS NOT NULL) AND (trial_started_at IS NOT NULL) AND (user_added_at IS NULL));
@ -32500,10 +32465,6 @@ CREATE UNIQUE INDEX index_sentry_issues_on_issue_id ON sentry_issues USING btree
CREATE INDEX index_sentry_issues_on_sentry_issue_identifier ON sentry_issues USING btree (sentry_issue_identifier);
CREATE INDEX index_serverless_domain_cluster_on_creator_id ON serverless_domain_cluster USING btree (creator_id);
CREATE INDEX index_serverless_domain_cluster_on_pages_domain_id ON serverless_domain_cluster USING btree (pages_domain_id);
CREATE INDEX index_service_desk_custom_email_verifications_on_triggerer_id ON service_desk_custom_email_verifications USING btree (triggerer_id);
CREATE INDEX index_service_desk_enabled_projects_on_id_creator_id_created_at ON projects USING btree (id, creator_id, created_at) WHERE (service_desk_enabled = true);
@ -36671,6 +36632,9 @@ ALTER TABLE ONLY zentao_tracker_data
ALTER TABLE ONLY boards_epic_user_preferences
ADD CONSTRAINT fk_rails_851fe1510a FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
ALTER TABLE ONLY value_stream_dashboard_aggregations
ADD CONSTRAINT fk_rails_859b4f86f3 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
ALTER TABLE ONLY deployment_merge_requests
ADD CONSTRAINT fk_rails_86a6d8bf12 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE;

View File

@ -21,7 +21,7 @@ NOTE:
The stages of the setup process must be completed in the documented order.
If not, [complete all prior stages](../setup/index.md#using-omnibus-gitlab) before proceeding.
Ensure the **secondary** site is running the same version of GitLab Enterprise Edition as the **primary** site. Confirm you have added the [premium or higher licenses](https://about.gitlab.com/pricing/) to your **primary** site.
Ensure the **secondary** site is running the same version of GitLab Enterprise Edition as the **primary** site. Confirm you have added a license for a [Premium or Ultimate subscription](https://about.gitlab.com/pricing/) to your **primary** site.
Be sure to read and review all of these steps before you execute them in your
testing or production environments.

View File

@ -16,7 +16,7 @@ type: howto
NOTE:
Geo supports multiple secondaries. You can follow the same steps and make any changes accordingly.
- Ensure the **primary** site has a [GitLab Premium](https://about.gitlab.com/pricing/) license or higher to unlock Geo. You only need one license for all the sites.
- Ensure the **primary** site has a [GitLab Premium or Ultimate](https://about.gitlab.com/pricing/) subscription to unlock Geo. You only need one license for all the sites.
- Confirm the [requirements for running Geo](../index.md#requirements-for-running-geo) are met by all sites. For example, sites must use the same GitLab version, and sites must be able to communicate with each other over certain ports.
## Using Omnibus GitLab

View File

@ -478,10 +478,10 @@ checked each time a new subscription is created.
If a new subscription would cause the total number of subscription to exceed the
limit, the subscription is considered invalid.
- GitLab SaaS subscribers have different limits [defined per plan](../user/gitlab_com/index.md#gitlab-cicd),
- On GitLab SaaS: Limits are [defined per plan](../user/gitlab_com/index.md#gitlab-cicd),
and they affect all projects under that plan.
- On [GitLab Premium](https://about.gitlab.com/pricing/) self-managed
or higher installations, this limit is defined under a `default` plan that
- On self-managed: On [GitLab Premium or Ultimate](https://about.gitlab.com/pricing/),
this limit is defined under a `default` plan that
affects all projects. By default, there is a limit of `2` subscriptions.
To set this limit for a self-managed installation, run the following in the

View File

@ -422,7 +422,7 @@ spread connections equally in practice.
Next, we set up the Consul servers.
NOTE:
Consul must be deployed in an odd number of 3 nodes or higher. This is to ensure the nodes can take votes as part of a quorum.
Consul must be deployed in an odd number of 3 nodes or more. This is to ensure the nodes can take votes as part of a quorum.
The following IPs will be used as an example:
@ -809,7 +809,7 @@ topology with a [Redis Sentinel](https://redis.io/docs/manual/sentinel/) service
start the failover procedure.
NOTE:
Redis clusters must each be deployed in an odd number of 3 nodes or higher. This is to ensure Redis Sentinel can take votes as part of a quorum. This does not apply when configuring Redis externally, such as a cloud provider service.
Redis clusters must each be deployed in an odd number of 3 nodes or more. This is to ensure Redis Sentinel can take votes as part of a quorum. This does not apply when configuring Redis externally, such as a cloud provider service.
Redis requires authentication if used with Sentinel. See
[Redis Security](https://redis.io/docs/manual/security/) documentation for more
@ -845,7 +845,7 @@ to be used with GitLab. The following IPs will be used as an example:
Managed Redis from cloud providers (such as AWS ElastiCache) will work. If these
services support high availability, be sure it _isn't_ of the Redis Cluster type.
Because Omnibus GitLab packages ship with Redis 6.0 or later, Redis 6.0 or higher is required. Older Redis versions have reached end-of-life.
Because Omnibus GitLab packages ship with Redis 6.0 or later, Redis 6.0 or later is required. Older Redis versions have reached end-of-life.
Note the Redis node's IP address or hostname, port, and password (if required).
These will be necessary later when configuring the [GitLab application servers](#configure-gitlab-rails).
@ -1347,7 +1347,7 @@ Praefect is the router and transaction manager for Gitaly Cluster and all connec
it. This section details how to configure it.
NOTE:
Consul must be deployed in an odd number of 3 nodes or higher. This is to ensure the nodes can take votes as part of a quorum.
Consul must be deployed in an odd number of 3 nodes or more. This is to ensure the nodes can take votes as part of a quorum.
Praefect requires several secret tokens to secure communications across the Cluster:

View File

@ -439,7 +439,7 @@ spread connections equally in practice.
Next, we set up the Consul servers.
NOTE:
Consul must be deployed in an odd number of 3 nodes or higher. This is to ensure the nodes can take votes as part of a quorum.
Consul must be deployed in an odd number of 3 nodes or more. This is to ensure the nodes can take votes as part of a quorum.
The following IPs will be used as an example:
@ -826,7 +826,7 @@ topology with a [Redis Sentinel](https://redis.io/docs/manual/sentinel/) service
start the failover procedure.
NOTE:
Redis clusters must each be deployed in an odd number of 3 nodes or higher. This is to ensure Redis Sentinel can take votes as part of a quorum. This does not apply when configuring Redis externally, such as a cloud provider service.
Redis clusters must each be deployed in an odd number of 3 nodes or more. This is to ensure Redis Sentinel can take votes as part of a quorum. This does not apply when configuring Redis externally, such as a cloud provider service.
Redis requires authentication if used with Sentinel. See
[Redis Security](https://redis.io/docs/manual/security/) documentation for more
@ -862,7 +862,7 @@ to be used with GitLab. The following IPs will be used as an example:
Managed Redis from cloud providers (such as AWS ElastiCache) will work. If these
services support high availability, be sure it _isn't_ of the Redis Cluster type.
Because Omnibus GitLab packages ship with Redis 6.0 or later, Redis 6.0 or higher is required. Older Redis versions have reached end-of-life.
Because Omnibus GitLab packages ship with Redis 6.0 or later, Redis 6.0 or later is required. Older Redis versions have reached end-of-life.
Note the Redis node's IP address or hostname, port, and password (if required).
These will be necessary later when configuring the [GitLab application servers](#configure-gitlab-rails).
@ -1364,7 +1364,7 @@ Praefect is the router and transaction manager for Gitaly Cluster and all connec
it. This section details how to configure it.
NOTE:
Praefect must be deployed in an odd number of 3 nodes or higher. This is to ensure the nodes can take votes as part of a quorum.
Praefect must be deployed in an odd number of 3 nodes or more. This is to ensure the nodes can take votes as part of a quorum.
Praefect requires several secret tokens to secure communications across the Cluster:

View File

@ -341,7 +341,7 @@ to be used with GitLab.
### Provide your own Redis instance
Because Omnibus GitLab packages ship with Redis 6.0 or later, Redis 6.0 or higher is required. Older Redis versions have reached end-of-life.
Because Omnibus GitLab packages ship with Redis 6.0 or later, Redis 6.0 or later is required. Older Redis versions have reached end-of-life.
Managed Redis from cloud providers such as AWS ElastiCache will work. If these
services support high availability, be sure it is not the Redis Cluster type.

View File

@ -455,7 +455,7 @@ to be used with GitLab. The following IPs will be used as an example:
Managed Redis from cloud providers such as AWS ElastiCache will work. If these
services support high availability, be sure it is **not** the Redis Cluster type.
Because Omnibus GitLab packages ship with Redis 6.0 or later, Redis 6.0 or higher is required. Older Redis versions have reached end-of-life.
Because Omnibus GitLab packages ship with Redis 6.0 or later, Redis 6.0 or later is required. Older Redis versions have reached end-of-life.
Note the Redis node's IP address or hostname, port, and password (if required).
These will be necessary when configuring the
@ -643,7 +643,7 @@ Now that the Redis servers are all set up, let's configure the Consul + Sentinel
servers.
NOTE:
Consul and Redis Sentinel must be deployed in an odd number of 3 nodes or higher. This is to ensure the nodes can take votes as part of a quorum.
Consul and Redis Sentinel must be deployed in an odd number of 3 nodes or more. This is to ensure the nodes can take votes as part of a quorum.
The following IPs will be used as an example:
@ -1293,7 +1293,7 @@ Praefect is the router and transaction manager for Gitaly Cluster and all connec
it. This section details how to configure it.
NOTE:
Praefect must be deployed in an odd number of 3 nodes or higher. This is to ensure the nodes can take votes as part of a quorum.
Praefect must be deployed in an odd number of 3 nodes or more. This is to ensure the nodes can take votes as part of a quorum.
Praefect requires several secret tokens to secure communications across the Cluster:

View File

@ -431,7 +431,7 @@ spread connections equally in practice.
Next, we set up the Consul servers.
NOTE:
Consul must be deployed in an odd number of 3 nodes or higher. This is to ensure the nodes can take votes as part of a quorum.
Consul must be deployed in an odd number of 3 nodes or more. This is to ensure the nodes can take votes as part of a quorum.
The following IPs will be used as an example:
@ -819,7 +819,7 @@ topology with a [Redis Sentinel](https://redis.io/docs/manual/sentinel/) service
start the failover procedure.
NOTE:
Redis clusters must each be deployed in an odd number of 3 nodes or higher. This is to ensure Redis Sentinel can take votes as part of a quorum. This does not apply when configuring Redis externally, such as a cloud provider service.
Redis clusters must each be deployed in an odd number of 3 nodes or more. This is to ensure Redis Sentinel can take votes as part of a quorum. This does not apply when configuring Redis externally, such as a cloud provider service.
Redis requires authentication if used with Sentinel. See
[Redis Security](https://redis.io/docs/manual/security/) documentation for more
@ -855,7 +855,7 @@ to be used with GitLab. The following IPs will be used as an example:
Managed Redis from cloud providers (such as AWS ElastiCache) will work. If these
services support high availability, be sure it _isn't_ of the Redis Cluster type.
Because Omnibus GitLab packages ship with Redis 6.0 or later, Redis 6.0 or higher is required. Older Redis versions have reached end-of-life.
Because Omnibus GitLab packages ship with Redis 6.0 or later, Redis 6.0 or later is required. Older Redis versions have reached end-of-life.
Note the Redis node's IP address or hostname, port, and password (if required).
These will be necessary later when configuring the [GitLab application servers](#configure-gitlab-rails).
@ -1360,7 +1360,7 @@ Praefect is the router and transaction manager for Gitaly Cluster and all connec
it. This section details how to configure it.
NOTE:
Praefect must be deployed in an odd number of 3 nodes or higher. This is to ensure the nodes can take votes as part of a quorum.
Praefect must be deployed in an odd number of 3 nodes or later. This is to ensure the nodes can take votes as part of a quorum.
Praefect requires several secret tokens to secure communications across the Cluster:

View File

@ -452,7 +452,7 @@ to be used with GitLab. The following IPs are used as an example:
Managed Redis from cloud providers such as AWS ElastiCache works. If these
services support high availability, be sure it is **not** the Redis Cluster type.
Because Omnibus GitLab packages ship with Redis 6.0 or later, Redis 6.0 or higher is required. Older Redis versions have reached end-of-life.
Because Omnibus GitLab packages ship with Redis 6.0 or later, Redis 6.0 or later is required. Older Redis versions have reached end-of-life.
Note the Redis node's IP address or hostname, port, and password (if required).
These are necessary when configuring the
@ -640,7 +640,7 @@ Now that the Redis servers are all set up, let's configure the Consul + Sentinel
servers.
NOTE:
Consul and Redis Sentinel must be deployed in an odd number of 3 nodes or higher. This is to ensure the nodes can take votes as part of a quorum.
Consul and Redis Sentinel must be deployed in an odd number of 3 nodes or later. This is to ensure the nodes can take votes as part of a quorum.
The following IPs will be used as an example:
@ -1290,7 +1290,7 @@ Praefect is the router and transaction manager for Gitaly Cluster and all connec
it. This section details how to configure it.
NOTE:
Praefect must be deployed in an odd number of 3 nodes or higher. This is to ensure the nodes can take votes as part of a quorum.
Praefect must be deployed in an odd number of 3 nodes or later. This is to ensure the nodes can take votes as part of a quorum.
Praefect requires several secret tokens to secure communications across the Cluster:

View File

@ -49,7 +49,7 @@ Example response:
## Project deploy tokens
Project deploy token API endpoints require the Maintainer role or higher
Project deploy token API endpoints require at least the Maintainer role
for the project.
### List project deploy tokens

View File

@ -11,7 +11,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
API for accessing resources of [GitLab feature flags](../operations/feature_flags.md).
Users with Developer or higher [permissions](../user/permissions.md) can access the feature flag API.
Users with at least the Developer [role](../user/permissions.md) can access the feature flag API.
## Feature flags pagination

View File

@ -107,6 +107,9 @@ Set a feature's gate value. If a feature with the given name doesn't exist yet,
it's created. The value can be a boolean, or an integer to indicate
percentage of time.
WARNING:
Before you enable a feature still in development, you should understand the [security and stability risks](../administration/feature_flags.md#risks-when-enabling-features-still-in-development).
```plaintext
POST /features/:name
```

View File

@ -12403,7 +12403,7 @@ Returns [`CiRunnerStatus!`](#cirunnerstatus).
| Name | Type | Description |
| ---- | ---- | ----------- |
| <a id="cirunnerstatuslegacymode"></a>`legacyMode` **{warning-solid}** | [`String`](#string) | **Deprecated** in 15.0. Will be removed in 17.0. In GitLab 16.0 and later, the field will act as if `legacyMode` is null. |
| <a id="cirunnerstatuslegacymode"></a>`legacyMode` **{warning-solid}** | [`String`](#string) | **Deprecated** in 15.0. Will be removed in 17.0. |
### `CiRunnerManager`

View File

@ -76,7 +76,7 @@ Example response:
]
```
Users on [GitLab Premium or higher](https://about.gitlab.com/pricing/) see
Users on [GitLab Premium or Ultimate](https://about.gitlab.com/pricing/) see
different parameters, due to the ability to have multiple group boards.
Example response:
@ -192,7 +192,7 @@ Example response:
}
```
Users on [GitLab Premium or higher](https://about.gitlab.com/pricing/) see
Users on [GitLab Premium or Ultimate](https://about.gitlab.com/pricing/) see
different parameters, due to the ability to have multiple group issue boards.
Example response:

View File

@ -120,7 +120,7 @@ GET /groups?statistics=true
]
```
Users of [GitLab Premium or higher](https://about.gitlab.com/pricing/) also see the `wiki_access_level` attribute.
Users of [GitLab Premium or Ultimate](https://about.gitlab.com/pricing/) also see the `wiki_access_level` attribute.
You can search for groups by name or path, see below.
@ -191,7 +191,7 @@ GET /groups/:id/subgroups
]
```
Users of [GitLab Premium or higher](https://about.gitlab.com/pricing/) also see the `wiki_access_level` attribute.
Users of [GitLab Premium or Ultimate](https://about.gitlab.com/pricing/) also see the `wiki_access_level` attribute.
## List a group's descendant groups
@ -276,7 +276,7 @@ GET /groups/:id/descendant_groups
]
```
Users of [GitLab Premium or higher](https://about.gitlab.com/pricing/) also see the `wiki_access_level` attribute.
Users of [GitLab Premium or Ultimate](https://about.gitlab.com/pricing/) also see the `wiki_access_level` attribute.
## List a group's projects
@ -701,7 +701,7 @@ Example response:
The `prevent_sharing_groups_outside_hierarchy` attribute is present only on top-level groups.
Users of [GitLab Premium or higher](https://about.gitlab.com/pricing/) also see the attributes:
Users of [GitLab Premium or Ultimate](https://about.gitlab.com/pricing/) also see the attributes:
- `shared_runners_minutes_limit`
- `extra_shared_runners_minutes_limit`
@ -1070,7 +1070,7 @@ Example response:
The `prevent_sharing_groups_outside_hierarchy` attribute is present in the response only for top-level groups.
Users of [GitLab Premium or higher](https://about.gitlab.com/pricing/) also see the `wiki_access_level` attribute.
Users of [GitLab Premium or Ultimate](https://about.gitlab.com/pricing/) also see the `wiki_access_level` attribute.
### Disable the results limit **(FREE SELF)**
@ -1734,7 +1734,7 @@ GET /groups/:id/push_rule
}
```
Users on [GitLab Premium or higher](https://about.gitlab.com/pricing/) also see
Users on [GitLab Premium or Ultimate](https://about.gitlab.com/pricing/) also see
the `commit_committer_check` and `reject_unsigned_commits` parameters:
```json

View File

@ -182,7 +182,7 @@ Example response:
]
```
Issues created by users on GitLab Premium or higher include the `weight` property:
Issues created by users on GitLab Premium or Ultimate include the `weight` property:
```json
[
@ -195,7 +195,7 @@ Issues created by users on GitLab Premium or higher include the `weight` propert
]
```
Issues created by users on GitLab Premium or higher include the `epic` property:
Issues created by users on GitLab Premium or Ultimate include the `epic` property:
```json
{
@ -213,7 +213,7 @@ Issues created by users on GitLab Premium or higher include the `epic` property:
}
```
Issues created by users on GitLab Premium or higher include the `iteration` property:
Issues created by users on GitLab Premium or Ultimate include the `iteration` property:
```json
{
@ -409,7 +409,7 @@ Example response:
]
```
Issues created by users on GitLab Premium or higher include the `weight` property:
Issues created by users on GitLab Premium or Ultimate include the `weight` property:
```json
[
@ -422,7 +422,7 @@ Issues created by users on GitLab Premium or higher include the `weight` propert
]
```
Issues created by users on GitLab Premium or higher include the `epic` property:
Issues created by users on GitLab Premium or Ultimate include the `epic` property:
```json
{
@ -619,7 +619,7 @@ Example response:
]
```
Issues created by users on GitLab Premium or higher include the `weight` property:
Issues created by users on GitLab Premium or Ultimate include the `weight` property:
```json
[
@ -632,7 +632,7 @@ Issues created by users on GitLab Premium or higher include the `weight` propert
]
```
Issues created by users on GitLab Premium or higher include the `epic` property:
Issues created by users on GitLab Premium or Ultimate include the `epic` property:
```json
{
@ -781,7 +781,7 @@ Example response:
}
```
Issues created by users on GitLab Premium or higher include the `weight` property:
Issues created by users on GitLab Premium or Ultimate include the `weight` property:
```json
{
@ -792,7 +792,7 @@ Issues created by users on GitLab Premium or higher include the `weight` propert
}
```
Issues created by users on GitLab Premium or higher include the `epic` property:
Issues created by users on GitLab Premium or Ultimate include the `epic` property:
```json
{
@ -941,7 +941,7 @@ Example response:
}
```
Issues created by users on GitLab Premium or higher include the `weight` property:
Issues created by users on GitLab Premium or Ultimate include the `weight` property:
```json
{
@ -952,7 +952,7 @@ Issues created by users on GitLab Premium or higher include the `weight` propert
}
```
Issues created by users on GitLab Premium or higher include the `epic` property:
Issues created by users on GitLab Premium or Ultimate include the `epic` property:
```json
{
@ -1090,7 +1090,7 @@ Example response:
}
```
Issues created by users on GitLab Premium or higher include the `weight` property:
Issues created by users on GitLab Premium or Ultimate include the `weight` property:
```json
{
@ -1101,7 +1101,7 @@ Issues created by users on GitLab Premium or higher include the `weight` propert
}
```
Issues created by users on GitLab Premium or higher include the `epic` property:
Issues created by users on GitLab Premium or Ultimate include the `epic` property:
```json
{
@ -1267,7 +1267,7 @@ Example response:
}
```
Issues created by users on GitLab Premium or higher include the `weight` property:
Issues created by users on GitLab Premium or Ultimate include the `weight` property:
```json
{
@ -1278,7 +1278,7 @@ Issues created by users on GitLab Premium or higher include the `weight` propert
}
```
Issues created by users on GitLab Premium or higher include the `epic` property:
Issues created by users on GitLab Premium or Ultimate include the `epic` property:
```json
{
@ -1452,7 +1452,7 @@ Example response:
}
```
Issues created by users on GitLab Premium or higher include the `weight` property:
Issues created by users on GitLab Premium or Ultimate include the `weight` property:
```json
{
@ -1463,7 +1463,7 @@ Issues created by users on GitLab Premium or higher include the `weight` propert
}
```
Issues created by users on GitLab Premium or higher include the `epic` property:
Issues created by users on GitLab Premium or Ultimate include the `epic` property:
```json
{
@ -1704,7 +1704,7 @@ Example response:
}
```
Issues created by users on GitLab Premium or higher include the `weight` property:
Issues created by users on GitLab Premium or Ultimate include the `weight` property:
```json
{
@ -1715,7 +1715,7 @@ Issues created by users on GitLab Premium or higher include the `weight` propert
}
```
Issues created by users on GitLab Premium or higher include the `epic` property:
Issues created by users on GitLab Premium or Ultimate include the `epic` property:
```json
{

View File

@ -196,7 +196,7 @@ Supported attributes:
]
```
Users on [GitLab Premium or higher](https://about.gitlab.com/pricing/) also see
Users on [GitLab Premium or Ultimate](https://about.gitlab.com/pricing/) also see
the `approvals_before_merge` parameter:
```json
@ -400,7 +400,7 @@ Supported attributes:
]
```
Users on [GitLab Premium or higher](https://about.gitlab.com/pricing/) also see
Users on [GitLab Premium or Ultimate](https://about.gitlab.com/pricing/) also see
the `approvals_before_merge` parameter:
```json
@ -587,7 +587,7 @@ Supported attributes:
]
```
Users on [GitLab Premium or higher](https://about.gitlab.com/pricing/) also see
Users on [GitLab Premium or Ultimate](https://about.gitlab.com/pricing/) also see
the `approvals_before_merge` parameter:
```json
@ -821,7 +821,7 @@ Supported attributes:
"user": {
"can_merge": true
},
"approvals_before_merge": { // Available for GitLab Premium and higher tiers only
"approvals_before_merge": { // Available for GitLab Premium and Ultimate tiers only
"id": 1,
"title": "test1",
"approvals_before_merge": null
@ -1421,7 +1421,7 @@ If `approvals_before_merge` is not provided, it inherits the value from the targ
}
```
Users of [GitLab Premium or higher](https://about.gitlab.com/pricing/) also see
Users of [GitLab Premium or Ultimate](https://about.gitlab.com/pricing/) also see
the `approvals_before_merge` parameter:
```json
@ -1604,7 +1604,7 @@ Must include at least one non-required attribute from above.
}
```
Users on [GitLab Premium or higher](https://about.gitlab.com/pricing/) also see
Users on [GitLab Premium or Ultimate](https://about.gitlab.com/pricing/) also see
the `approvals_before_merge` parameter:
```json
@ -1793,7 +1793,7 @@ Supported attributes:
}
```
Users on [GitLab Premium or higher](https://about.gitlab.com/pricing/) also see
Users on [GitLab Premium or Ultimate](https://about.gitlab.com/pricing/) also see
the `approvals_before_merge` parameter:
```json
@ -2006,7 +2006,7 @@ Supported attributes:
}
```
Users on [GitLab Premium or higher](https://about.gitlab.com/pricing/) also see
Users on [GitLab Premium or Ultimate](https://about.gitlab.com/pricing/) also see
the `approvals_before_merge` parameter:
```json
@ -2318,7 +2318,7 @@ Example response:
}
```
Users on [GitLab Premium or higher](https://about.gitlab.com/pricing/) also see
Users on [GitLab Premium or Ultimate](https://about.gitlab.com/pricing/) also see
the `approvals_before_merge` parameter:
```json
@ -2489,7 +2489,7 @@ Example response:
}
```
Users on [GitLab Premium or higher](https://about.gitlab.com/pricing/) also see
Users on [GitLab Premium or Ultimate](https://about.gitlab.com/pricing/) also see
the `approvals_before_merge` parameter:
```json

View File

@ -9,7 +9,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/36146) in GitLab 12.9.
> - Using this API you can consume [Merge Train](../ci/pipelines/merge_trains.md) entries.
Every API call to merge trains must be authenticated with Developer or higher [permissions](../user/permissions.md).
Every API call to merge trains must be authenticated with at lease the Developer [role](../user/permissions.md).
If a user is not a member of a project and the project is private, a `GET` request on that project returns a `404` status code.

View File

@ -90,7 +90,7 @@ Example response:
]
```
Users on GitLab Premium or higher also see
Users on GitLab Premium or Ultimate also see
the `user_id`, `group_id` and `inherited` parameters. If the `inherited` parameter
exists, means the setting was inherited from the project's group.
@ -177,7 +177,7 @@ Example response:
}
```
Users on GitLab Premium or higher also see
Users on GitLab Premium or Ultimate also see
the `user_id` and `group_id` parameters:
Example response:
@ -267,7 +267,7 @@ Example response:
}
```
Users on GitLab Premium or higher also see
Users on GitLab Premium or Ultimate also see
the `user_id` and `group_id` parameters:
Example response:

View File

@ -209,7 +209,7 @@ GET /users
]
```
Users on [GitLab Premium or higher](https://about.gitlab.com/pricing/) also see the `shared_runners_minutes_limit`, `extra_shared_runners_minutes_limit`, `is_auditor`, and `using_license_seat` parameters.
Users on [GitLab Premium or Ultimate](https://about.gitlab.com/pricing/) also see the `shared_runners_minutes_limit`, `extra_shared_runners_minutes_limit`, `is_auditor`, and `using_license_seat` parameters.
```json
[
@ -225,7 +225,7 @@ Users on [GitLab Premium or higher](https://about.gitlab.com/pricing/) also see
]
```
Users on [GitLab Premium or higher](https://about.gitlab.com/pricing/) also see
Users on [GitLab Premium or Ultimate](https://about.gitlab.com/pricing/) also see
the `group_saml` provider option and `provisioned_by_group_id` parameter:
```json
@ -409,7 +409,7 @@ Example Responses:
NOTE:
The `plan` and `trial` parameters are only available on GitLab Enterprise Edition.
Users on [GitLab Premium or higher](https://about.gitlab.com/pricing/) also see
Users on [GitLab Premium or Ultimate](https://about.gitlab.com/pricing/) also see
the `shared_runners_minutes_limit`, `is_auditor`, and `extra_shared_runners_minutes_limit` parameters.
```json
@ -423,7 +423,7 @@ the `shared_runners_minutes_limit`, `is_auditor`, and `extra_shared_runners_minu
}
```
Users on [GitLab.com Premium or higher](https://about.gitlab.com/pricing/) also
Users on [GitLab.com Premium or Ultimate](https://about.gitlab.com/pricing/) also
see the `group_saml` option and `provisioned_by_group_id` parameter:
```json
@ -663,7 +663,7 @@ GET /user
}
```
Users on [GitLab Premium or higher](https://about.gitlab.com/pricing/) also see the `shared_runners_minutes_limit`, `extra_shared_runners_minutes_limit` parameters.
Users on [GitLab Premium or Ultimate](https://about.gitlab.com/pricing/) also see the `shared_runners_minutes_limit`, `extra_shared_runners_minutes_limit` parameters.
### For administrators **(FREE SELF)**
@ -727,7 +727,7 @@ Parameters:
}
```
Users on [GitLab Premium or higher](https://about.gitlab.com/pricing/) also see these
Users on [GitLab Premium or Ultimate](https://about.gitlab.com/pricing/) also see these
parameters:
- `shared_runners_minutes_limit`

View File

@ -1735,10 +1735,7 @@ GitLab-managed CI/CD templates for security scanning will be updated in the GitL
The updates will include improvements already released in the Latest versions of the CI/CD templates.
We released these changes in the Latest template versions because they have the potential to disrupt customized CI/CD pipeline configurations.
In all updated templates, we're:
- Adding support for running scans in merge request (MR) pipelines.
- Updating the definition of variables like `SAST_DISABLED` and `DEPENDENCY_SCANNING_DISABLED` to disable scanning only if the value is `"true"`. Previously, even if the value were `"false"`, scanning would be disabled.
In all updated templates, we're updating the definition of variables like `SAST_DISABLED` and `DEPENDENCY_SCANNING_DISABLED` to disable scanning only if the value is `"true"`. Previously, even if the value were `"false"`, scanning would be disabled.
The following templates will be updated:
@ -1752,10 +1749,10 @@ The following templates will be updated:
- SAST: [`SAST.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Jobs/SAST.gitlab-ci.yml)
- Secret Detection: [`Secret-Detection.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Jobs/Secret-Detction.gitlab-ci.yml)
We recommend that you test your pipelines before the 16.0 release if you use one of the templates listed above and you do any of the following:
We recommend that you test your pipelines before the 16.0 release if you use one of the templates listed above and you use the `_DISABLED` variables but set a value other than `"true"`.
1. You override `rules` for your security scanning jobs.
1. You use the `_DISABLED` variables but set a value other than `"true"`.
**Update:** We previously announced that we would update the `rules` on the affected templates to run in [merge request pipelines](https://docs.gitlab.com/ee/ci/pipelines/merge_request_pipelines.html) by default.
However, due to compatibility issues [discussed in the deprecation issue](https://gitlab.com/gitlab-org/gitlab/-/issues/388988#note_1372629948), we will no longer make this change in GitLab 16.0. We will still release the changes to the `_DISABLED` variables as described above.
</div>

View File

@ -24,7 +24,7 @@ module Gitlab
# Event example:
#
# - name: g_compliance_dashboard # Unique event name
# aggregation: daily # Aggregation level, keys are stored daily or weekly
# aggregation: weekly # Aggregation level, keys are stored weekly
#
# Usage:
#
@ -94,7 +94,13 @@ module Gitlab
return if event.blank?
return unless Feature.enabled?(:redis_hll_tracking, type: :ops)
if event[:aggregation].to_sym == :daily
weekly_event = event.dup.tap { |e| e['aggregation'] = 'weekly' }
Gitlab::Redis::HLL.add(key: redis_key(weekly_event, time, context), value: values, expiry: expiry(weekly_event))
end
Gitlab::Redis::HLL.add(key: redis_key(event, time, context), value: values, expiry: expiry(event))
rescue StandardError => e
# Ignore any exceptions unless is dev or test env
# The application flow should not be blocked by erros in tracking
@ -113,6 +119,11 @@ module Gitlab
aggregation = events.first[:aggregation]
if Feature.disabled?(:revert_daily_hll_events_to_weekly_aggregation)
aggregation = :weekly
events.each { |e| e[:aggregation] = :weekly }
end
keys = keys_for_aggregation(aggregation, events: events, start_date: start_date, end_date: end_date, context: context)
return FALLBACK unless keys.any?
@ -162,6 +173,8 @@ module Gitlab
# Compose the key in order to store events daily or weekly
def redis_key(event, time, context = '')
raise UnknownEvent, "Unknown event #{event[:name]}" unless known_events_names.include?(event[:name].to_s)
# ToDo: remove during https://gitlab.com/groups/gitlab-org/-/epics/9542 cleanup
raise UnknownAggregation, "Use :daily or :weekly aggregation" unless ALLOWED_AGGREGATIONS.include?(event[:aggregation].to_sym)
key = "{#{REDIS_SLOT}}_#{event[:name]}"

View File

@ -57,7 +57,7 @@
"@gitlab/favicon-overlay": "2.0.0",
"@gitlab/fonts": "^1.2.0",
"@gitlab/svgs": "3.45.0",
"@gitlab/ui": "62.9.0",
"@gitlab/ui": "62.9.1",
"@gitlab/visual-review-tools": "1.7.3",
"@gitlab/web-ide": "0.0.1-dev-20230425040132",
"@mattiasbuelens/web-streams-adapter": "^0.1.0",

View File

@ -22,10 +22,8 @@ RSpec.describe 'Database schema', feature_category: :database do
# In the subsequent table removal MR, remove the entries.
# See: https://docs.gitlab.com/ee/development/migration_style_guide.html#dropping-a-database-table
REMOVED_FKS = {
clusters_applications_helm: %w[cluster_id],
clusters_applications_knative: %w[cluster_id],
clusters_applications_runners: %w[cluster_id],
serverless_domain_cluster: %w[clusters_applications_knative_id creator_id pages_domain_id]
clusters_applications_runners: %w[cluster_id]
}.with_indifferent_access.freeze
# List of columns historically missing a FK, don't add more columns

View File

@ -513,6 +513,43 @@ RSpec.describe 'Login', :clean_gitlab_redis_sessions, feature_category: :system_
gitlab_sign_in(user)
end
context 'when the session expires' do
it 'signs the user out' do
expect(authentication_metrics)
.to increment(:user_authenticated_counter)
gitlab_sign_in(user)
expire_session
visit root_path
expect(page).to have_current_path new_user_session_path
end
it 'extends the session when using remember me' do
expect(authentication_metrics)
.to increment(:user_authenticated_counter).twice
gitlab_sign_in(user, remember: true)
expire_session
visit root_path
expect(page).to have_current_path root_path
end
it 'does not extend the session when remember me is not enabled' do
expect(authentication_metrics)
.to increment(:user_authenticated_counter)
gitlab_sign_in(user, remember: true)
expire_session
stub_application_setting(remember_me_enabled: false)
visit root_path
expect(page).to have_current_path new_user_session_path
end
end
context 'when the users password is expired' do
before do
user.update!(password_expires_at: Time.zone.parse('2018-05-08 11:29:46 UTC'))

View File

@ -9,44 +9,12 @@ RSpec.describe Resolvers::Ci::RunnerStatusResolver, feature_category: :runner_fl
let(:user) { build(:user) }
let(:runner) { build(:ci_runner) }
subject(:resolve_subject) { resolve(described_class, ctx: { current_user: user }, obj: runner, args: args) }
subject(:resolve_subject) { resolve(described_class, ctx: { current_user: user }, obj: runner) }
context 'with legacy_mode' do
context 'set to 14.5' do
let(:args) do
{ legacy_mode: '14.5' }
end
it 'calls runner.status and returns it' do
expect(runner).to receive(:status).once.and_return(:stale)
it 'calls runner.status with nil' do
expect(runner).to receive(:status).with(nil).once.and_return(:stale)
expect(resolve_subject).to eq(:stale)
end
context 'when disable_runner_graphql_legacy_mode feature is disabled' do
before do
stub_feature_flags(disable_runner_graphql_legacy_mode: false)
end
it 'calls runner.status with specified legacy_mode' do
expect(runner).to receive(:status).with('14.5').once.and_return(:online)
expect(resolve_subject).to eq(:online)
end
end
end
context 'set to nil' do
let(:args) do
{ legacy_mode: nil }
end
it 'calls runner.status with nil' do
expect(runner).to receive(:status).with(nil).once.and_return(:stale)
expect(resolve_subject).to eq(:stale)
end
end
expect(resolve_subject).to eq(:stale)
end
end
end

View File

@ -18,10 +18,9 @@ RSpec.describe Gitlab::UsageDataCounters::EditorUniqueCounter, :clean_gitlab_red
aggregate_failures do
expect(track_action(author: user1, project: project)).to be_truthy
expect(track_action(author: user2, project: project)).to be_truthy
expect(track_action(author: user3, time: time - 3.days, project: project)).to be_truthy
expect(track_action(author: user3, time: time.end_of_week - 3.days, project: project)).to be_truthy
expect(count_unique(date_from: time, date_to: Date.today)).to eq(2)
expect(count_unique(date_from: time - 5.days, date_to: Date.tomorrow)).to eq(3)
expect(count_unique(date_from: time.beginning_of_week, date_to: 1.week.from_now)).to eq(3)
end
end

View File

@ -23,6 +23,72 @@ RSpec.describe Gitlab::UsageDataCounters::HLLRedisCounter, :clean_gitlab_redis_s
described_class.clear_memoization(:known_events)
end
describe '.track_event' do
# ToDo: remove during https://gitlab.com/groups/gitlab-org/-/epics/9542 cleanup
describe 'daily to weekly key migration precautions' do
let(:event_name) { 'example_event' }
let(:known_events) do
[
{ name: event_name, aggregation: 'daily' }
].map(&:with_indifferent_access)
end
let(:start_date) { (Date.current - 1.week).beginning_of_week }
let(:end_date) { Date.current }
let(:daily_event) { known_events.first }
let(:daily_key) { described_class.send(:redis_key, daily_event, start_date) }
let(:weekly_key) do
weekly_event = known_events.first.merge(aggregation: 'weekly')
described_class.send(:redis_key, weekly_event, start_date)
end
before do
allow(described_class).to receive(:known_events).and_return(known_events)
end
shared_examples 'writes daily events to daily and weekly keys' do
it :aggregate_failures do
expect(Gitlab::Redis::HLL).to receive(:add).with(expiry: 29.days, key: daily_key, value: 1).and_call_original
expect(Gitlab::Redis::HLL).to receive(:add).with(expiry: 6.weeks, key: weekly_key, value: 1).and_call_original
described_class.track_event(event_name, values: 1, time: start_date)
end
end
context 'when revert_daily_hll_events_to_weekly_aggregation FF is disabled' do
before do
stub_feature_flags(revert_daily_hll_events_to_weekly_aggregation: false)
end
it_behaves_like 'writes daily events to daily and weekly keys'
it 'aggregates weekly for daily keys', :aggregate_failures do
expect(Gitlab::Redis::HLL).to receive(:count).with(keys: [weekly_key]).and_call_original
expect(Gitlab::Redis::HLL).not_to receive(:count).with(keys: [daily_key]).and_call_original
described_class.unique_events(event_names: [event_name], start_date: start_date, end_date: end_date)
end
end
context 'when revert_daily_hll_events_to_weekly_aggregation FF is enabled' do
before do
stub_feature_flags(revert_daily_hll_events_to_weekly_aggregation: true)
end
# we want to write events no matter of the feature state
it_behaves_like 'writes daily events to daily and weekly keys'
it 'aggregates daily for daily keys', :aggregate_failures do
expect(Gitlab::Redis::HLL).to receive(:count).with(keys: [daily_key]).and_call_original
expect(Gitlab::Redis::HLL).not_to receive(:count).with(keys: [weekly_key]).and_call_original
described_class.unique_events(event_names: [event_name], start_date: start_date, end_date: start_date)
end
end
end
end
describe '.known_events' do
let(:ce_temp_dir) { Dir.mktmpdir }
let(:ce_temp_file) { Tempfile.new(%w[common .yml], ce_temp_dir) }

View File

@ -16,7 +16,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
let(:time) { Time.zone.now }
context 'for Issue title edit actions' do
it_behaves_like 'daily tracked issuable snowplow and service ping events with project' do
it_behaves_like 'tracked issuable snowplow and service ping events with project' do
let(:action) { described_class::ISSUE_TITLE_CHANGED }
def track_action(params)
@ -26,7 +26,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context 'for Issue description edit actions' do
it_behaves_like 'daily tracked issuable snowplow and service ping events with project' do
it_behaves_like 'tracked issuable snowplow and service ping events with project' do
let(:action) { described_class::ISSUE_DESCRIPTION_CHANGED }
def track_action(params)
@ -36,7 +36,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context 'for Issue assignee edit actions' do
it_behaves_like 'daily tracked issuable snowplow and service ping events with project' do
it_behaves_like 'tracked issuable snowplow and service ping events with project' do
let(:action) { described_class::ISSUE_ASSIGNEE_CHANGED }
def track_action(params)
@ -46,7 +46,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context 'for Issue make confidential actions' do
it_behaves_like 'daily tracked issuable snowplow and service ping events with project' do
it_behaves_like 'tracked issuable snowplow and service ping events with project' do
let(:action) { described_class::ISSUE_MADE_CONFIDENTIAL }
def track_action(params)
@ -56,7 +56,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context 'for Issue make visible actions' do
it_behaves_like 'daily tracked issuable snowplow and service ping events with project' do
it_behaves_like 'tracked issuable snowplow and service ping events with project' do
let(:action) { described_class::ISSUE_MADE_VISIBLE }
def track_action(params)
@ -66,7 +66,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context 'for Issue created actions' do
it_behaves_like 'daily tracked issuable snowplow and service ping events with project' do
it_behaves_like 'tracked issuable snowplow and service ping events with project' do
let(:action) { described_class::ISSUE_CREATED }
let(:original_params) { { namespace: project.project_namespace.reload } }
@ -77,7 +77,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context 'for Issue closed actions' do
it_behaves_like 'daily tracked issuable snowplow and service ping events with project' do
it_behaves_like 'tracked issuable snowplow and service ping events with project' do
let(:action) { described_class::ISSUE_CLOSED }
def track_action(params)
@ -87,7 +87,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context 'for Issue reopened actions' do
it_behaves_like 'daily tracked issuable snowplow and service ping events with project' do
it_behaves_like 'tracked issuable snowplow and service ping events with project' do
let(:action) { described_class::ISSUE_REOPENED }
def track_action(params)
@ -97,7 +97,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context 'for Issue label changed actions' do
it_behaves_like 'daily tracked issuable snowplow and service ping events with project' do
it_behaves_like 'tracked issuable snowplow and service ping events with project' do
let(:action) { described_class::ISSUE_LABEL_CHANGED }
def track_action(params)
@ -107,7 +107,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context 'for Issue label milestone actions' do
it_behaves_like 'daily tracked issuable snowplow and service ping events with project' do
it_behaves_like 'tracked issuable snowplow and service ping events with project' do
let(:action) { described_class::ISSUE_MILESTONE_CHANGED }
def track_action(params)
@ -117,7 +117,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context 'for Issue cross-referenced actions' do
it_behaves_like 'daily tracked issuable snowplow and service ping events with project' do
it_behaves_like 'tracked issuable snowplow and service ping events with project' do
let(:action) { described_class::ISSUE_CROSS_REFERENCED }
def track_action(params)
@ -127,7 +127,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context 'for Issue moved actions' do
it_behaves_like 'daily tracked issuable snowplow and service ping events with project' do
it_behaves_like 'tracked issuable snowplow and service ping events with project' do
let(:action) { described_class::ISSUE_MOVED }
def track_action(params)
@ -137,7 +137,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context 'for Issue cloned actions' do
it_behaves_like 'daily tracked issuable snowplow and service ping events with project' do
it_behaves_like 'tracked issuable snowplow and service ping events with project' do
let_it_be(:action) { described_class::ISSUE_CLONED }
def track_action(params)
@ -147,7 +147,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context 'for Issue relate actions' do
it_behaves_like 'daily tracked issuable snowplow and service ping events with project' do
it_behaves_like 'tracked issuable snowplow and service ping events with project' do
let(:action) { described_class::ISSUE_RELATED }
def track_action(params)
@ -157,7 +157,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context 'for Issue unrelate actions' do
it_behaves_like 'daily tracked issuable snowplow and service ping events with project' do
it_behaves_like 'tracked issuable snowplow and service ping events with project' do
let(:action) { described_class::ISSUE_UNRELATED }
def track_action(params)
@ -167,7 +167,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context 'for Issue marked as duplicate actions' do
it_behaves_like 'daily tracked issuable snowplow and service ping events with project' do
it_behaves_like 'tracked issuable snowplow and service ping events with project' do
let(:action) { described_class::ISSUE_MARKED_AS_DUPLICATE }
def track_action(params)
@ -177,7 +177,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context 'for Issue locked actions' do
it_behaves_like 'daily tracked issuable snowplow and service ping events with project' do
it_behaves_like 'tracked issuable snowplow and service ping events with project' do
let(:action) { described_class::ISSUE_LOCKED }
def track_action(params)
@ -187,7 +187,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context 'for Issue unlocked actions' do
it_behaves_like 'daily tracked issuable snowplow and service ping events with project' do
it_behaves_like 'tracked issuable snowplow and service ping events with project' do
let(:action) { described_class::ISSUE_UNLOCKED }
def track_action(params)
@ -197,7 +197,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context 'for Issue designs added actions' do
it_behaves_like 'daily tracked issuable snowplow and service ping events with project' do
it_behaves_like 'tracked issuable snowplow and service ping events with project' do
let(:action) { described_class::ISSUE_DESIGNS_ADDED }
def track_action(params)
@ -207,7 +207,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context 'for Issue designs modified actions' do
it_behaves_like 'daily tracked issuable snowplow and service ping events with project' do
it_behaves_like 'tracked issuable snowplow and service ping events with project' do
let(:action) { described_class::ISSUE_DESIGNS_MODIFIED }
def track_action(params)
@ -217,7 +217,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context 'for Issue designs removed actions' do
it_behaves_like 'daily tracked issuable snowplow and service ping events with project' do
it_behaves_like 'tracked issuable snowplow and service ping events with project' do
let(:action) { described_class::ISSUE_DESIGNS_REMOVED }
def track_action(params)
@ -227,7 +227,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context 'for Issue due date changed actions' do
it_behaves_like 'daily tracked issuable snowplow and service ping events with project' do
it_behaves_like 'tracked issuable snowplow and service ping events with project' do
let(:action) { described_class::ISSUE_DUE_DATE_CHANGED }
def track_action(params)
@ -237,7 +237,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context 'for Issue time estimate changed actions' do
it_behaves_like 'daily tracked issuable snowplow and service ping events with project' do
it_behaves_like 'tracked issuable snowplow and service ping events with project' do
let(:action) { described_class::ISSUE_TIME_ESTIMATE_CHANGED }
def track_action(params)
@ -247,7 +247,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context 'for Issue time spent changed actions' do
it_behaves_like 'daily tracked issuable snowplow and service ping events with project' do
it_behaves_like 'tracked issuable snowplow and service ping events with project' do
let(:action) { described_class::ISSUE_TIME_SPENT_CHANGED }
def track_action(params)
@ -257,7 +257,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context 'for Issue comment added actions', :snowplow do
it_behaves_like 'daily tracked issuable snowplow and service ping events with project' do
it_behaves_like 'tracked issuable snowplow and service ping events with project' do
let(:action) { described_class::ISSUE_COMMENT_ADDED }
def track_action(params)
@ -267,7 +267,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context 'for Issue comment edited actions', :snowplow do
it_behaves_like 'daily tracked issuable snowplow and service ping events with project' do
it_behaves_like 'tracked issuable snowplow and service ping events with project' do
let(:action) { described_class::ISSUE_COMMENT_EDITED }
def track_action(params)
@ -277,7 +277,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context 'for Issue comment removed actions', :snowplow do
it_behaves_like 'daily tracked issuable snowplow and service ping events with project' do
it_behaves_like 'tracked issuable snowplow and service ping events with project' do
let(:action) { described_class::ISSUE_COMMENT_REMOVED }
def track_action(params)
@ -287,7 +287,7 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
context 'for Issue design comment removed actions' do
it_behaves_like 'daily tracked issuable snowplow and service ping events with project' do
it_behaves_like 'tracked issuable snowplow and service ping events with project' do
let(:action) { described_class::ISSUE_DESIGN_COMMENT_REMOVED }
def track_action(params)
@ -296,12 +296,14 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
end
it 'can return the count of actions per user deduplicated', :aggregate_failures do
described_class.track_issue_title_changed_action(author: user1, project: project)
described_class.track_issue_description_changed_action(author: user1, project: project)
described_class.track_issue_assignee_changed_action(author: user1, project: project)
it 'can return the count of actions per user deduplicated' do
travel_to(Date.today.beginning_of_week) do # because events aggregated by week we need to emit events in the same week
described_class.track_issue_title_changed_action(author: user1, project: project)
described_class.track_issue_description_changed_action(author: user1, project: project)
described_class.track_issue_assignee_changed_action(author: user1, project: project)
end
travel_to(2.days.ago) do
travel_to(Date.today.beginning_of_week + 2.days) do
described_class.track_issue_title_changed_action(author: user2, project: project)
described_class.track_issue_title_changed_action(author: user3, project: project)
described_class.track_issue_description_changed_action(author: user3, project: project)
@ -309,10 +311,9 @@ RSpec.describe Gitlab::UsageDataCounters::IssueActivityUniqueCounter, :clean_git
end
events = [described_class::ISSUE_TITLE_CHANGED, described_class::ISSUE_DESCRIPTION_CHANGED, described_class::ISSUE_ASSIGNEE_CHANGED]
today_count = Gitlab::UsageDataCounters::HLLRedisCounter.unique_events(event_names: events, start_date: time, end_date: time)
week_count = Gitlab::UsageDataCounters::HLLRedisCounter.unique_events(event_names: events, start_date: time - 5.days, end_date: 1.day.since(time))
week_count = Gitlab::UsageDataCounters::HLLRedisCounter.unique_events(event_names: events, start_date: time.beginning_of_week,
end_date: time + 1.week)
expect(today_count).to eq(1)
expect(week_count).to eq(3)
end
end

View File

@ -0,0 +1,124 @@
# frozen_string_literal: true
require 'spec_helper'
require_migration!
RSpec.describe MigrateDailyRedisHllEventsToWeeklyAggregation, :migration, :clean_gitlab_redis_cache, feature_category: :service_ping do
it 'calls HLLRedisCounter.known_events to get list of events' do
expect(Gitlab::UsageDataCounters::HLLRedisCounter).to receive(:known_events).and_call_original.at_least(1).time
migrate!
end
describe '#redis_key' do
let(:date) { Date.today }
context 'with daily aggregation' do
let(:date_formatted) { date.strftime('%G-%j') }
let(:event) { { aggregation: 'daily', name: 'wiki_action' } }
it 'returns correct key' do
existing_key = "#{date_formatted}-{hll_counters}_wiki_action"
expect(described_class.new.redis_key(event, date, event[:aggregation])).to eq(existing_key)
end
end
context 'with weekly aggregation' do
let(:event) { { aggregation: 'weekly', name: 'wiki_action' } }
it 'returns correct key' do
existing_key = Gitlab::UsageDataCounters::HLLRedisCounter.send(:redis_key, event, date)
expect(described_class.new.redis_key(event, date, event[:aggregation])).to eq(existing_key)
end
end
end
context 'with weekly events' do
let(:events) { [{ aggregation: 'weekly', name: 'wiki_action' }] }
before do
allow(Gitlab::UsageDataCounters::HLLRedisCounter).to receive(:known_events).and_return(events)
end
it 'does not migrate weekly events' do
Gitlab::Redis::SharedState.with do |redis|
expect(redis).not_to receive(:pfmerge)
expect(redis).not_to receive(:expire)
end
migrate!
end
end
context 'with daily events' do
let(:daily_expiry) { Gitlab::UsageDataCounters::HLLRedisCounter::DEFAULT_DAILY_KEY_EXPIRY_LENGTH }
let(:weekly_expiry) { Gitlab::UsageDataCounters::HLLRedisCounter::DEFAULT_WEEKLY_KEY_EXPIRY_LENGTH }
it 'doesnt override events from migrated keys (code deployed before migration)' do
events = [{ aggregation: 'daily', name: 'users_viewing_analytics' },
{ aggregation: 'weekly', name: 'users_viewing_analytics' }]
allow(Gitlab::UsageDataCounters::HLLRedisCounter).to receive(:known_events).and_return(events)
day = (Date.today - 1.week).beginning_of_week
daily_event = events.first
key_daily1 = Gitlab::UsageDataCounters::HLLRedisCounter.send(:redis_key, daily_event, day)
Gitlab::Redis::HLL.add(key: key_daily1, value: 1, expiry: daily_expiry)
key_daily2 = Gitlab::UsageDataCounters::HLLRedisCounter.send(:redis_key, daily_event, day + 2.days)
Gitlab::Redis::HLL.add(key: key_daily2, value: 2, expiry: daily_expiry)
key_daily3 = Gitlab::UsageDataCounters::HLLRedisCounter.send(:redis_key, daily_event, day + 5.days)
Gitlab::Redis::HLL.add(key: key_daily3, value: 3, expiry: daily_expiry)
# the same event but with weekly aggregation and pre-Redis migration
weekly_event = events.second
key_weekly = Gitlab::UsageDataCounters::HLLRedisCounter.send(:redis_key, weekly_event, day + 5.days)
Gitlab::Redis::HLL.add(key: key_weekly, value: 3, expiry: weekly_expiry)
migrate!
expect(Gitlab::Redis::HLL.count(keys: key_weekly)).to eq(3)
end
it 'migrates with correct parameters', :aggregate_failures do
events = [{ aggregation: 'daily', name: 'users_viewing_analytics_group_devops_adoption' }]
allow(Gitlab::UsageDataCounters::HLLRedisCounter).to receive(:known_events).and_return(events)
event = events.first.dup.tap { |e| e[:aggregation] = 'weekly' }
# For every day in the last 30 days, add a value to the daily key with daily expiry (including today)
31.times do |i|
key = Gitlab::UsageDataCounters::HLLRedisCounter.send(:redis_key, event, Date.today - i.days)
Gitlab::Redis::HLL.add(key: key, value: i, expiry: daily_expiry)
end
migrate!
new_key = Gitlab::UsageDataCounters::HLLRedisCounter.send(:redis_key, event, Date.today)
# for the current week we should have value eq to the day of the week (ie. 1 for Monday, 2 for Tuesday, etc.)
first_week_days = Date.today.cwday
expect(Gitlab::Redis::HLL.count(keys: new_key)).to eq(first_week_days)
expect(with_redis { |r| r.ttl(new_key) }).to be_within(600).of(weekly_expiry)
full_weeks = (31 - first_week_days) / 7
# for the next full weeks we should have value eq to 7 (ie. 7 days in a week)
(1..full_weeks).each do |i|
new_key = Gitlab::UsageDataCounters::HLLRedisCounter.send(:redis_key, event, Date.today - i.weeks)
expect(Gitlab::Redis::HLL.count(keys: new_key)).to eq(7)
expect(with_redis { |r| r.ttl(new_key) }).to be_within(600).of(weekly_expiry)
end
# for the last week we should have value eq to amount of rest of the days affected
last_week_days = 31 - ((full_weeks * 7) + first_week_days)
unless last_week_days.zero?
last_week = full_weeks + 1
new_key = Gitlab::UsageDataCounters::HLLRedisCounter.send(:redis_key, event, Date.today - last_week.weeks)
expect(Gitlab::Redis::HLL.count(keys: new_key)).to eq(last_week_days)
expect(with_redis { |r| r.ttl(new_key) }).to be_within(600).of(weekly_expiry)
end
end
end
def with_redis(&block)
Gitlab::Redis::SharedState.with(&block)
end
end

View File

@ -889,24 +889,15 @@ RSpec.describe Ci::Runner, type: :model, feature_category: :runner do
describe '#status', :freeze_time do
let(:runner) { build(:ci_runner, :instance, created_at: 3.months.ago) }
let(:legacy_mode) {}
subject { runner.status(legacy_mode) }
subject { runner.status }
context 'never connected' do
before do
runner.contacted_at = nil
end
context 'with legacy_mode enabled' do
let(:legacy_mode) { '14.5' }
it { is_expected.to eq(:stale) }
end
context 'with legacy_mode disabled' do
it { is_expected.to eq(:stale) }
end
it { is_expected.to eq(:stale) }
context 'created recently' do
before do
@ -923,15 +914,7 @@ RSpec.describe Ci::Runner, type: :model, feature_category: :runner do
runner.active = false
end
context 'with legacy_mode enabled' do
let(:legacy_mode) { '14.5' }
it { is_expected.to eq(:paused) }
end
context 'with legacy_mode disabled' do
it { is_expected.to eq(:online) }
end
it { is_expected.to eq(:online) }
end
context 'contacted 1s ago' do
@ -955,15 +938,7 @@ RSpec.describe Ci::Runner, type: :model, feature_category: :runner do
runner.contacted_at = 3.months.ago
end
context 'with legacy_mode enabled' do
let(:legacy_mode) { '14.5' }
it { is_expected.to eq(:stale) }
end
context 'with legacy_mode disabled' do
it { is_expected.to eq(:stale) }
end
it { is_expected.to eq(:stale) }
end
end

View File

@ -2153,6 +2153,59 @@ RSpec.describe User, feature_category: :user_profile do
end
end
describe '#remember_me!' do
let(:user) { create(:user) }
context 'when remember me application setting is enabled' do
before do
stub_application_setting(remember_me_enabled: true)
end
it 'sets rememberable attributes' do
expect(user.remember_created_at).to be_nil
user.remember_me!
expect(user.remember_created_at).not_to be_nil
end
end
context 'when remember me application setting is not enabled' do
before do
stub_application_setting(remember_me_enabled: false)
end
it 'sets rememberable attributes' do
expect(user.remember_created_at).to be_nil
user.remember_me!
expect(user.remember_created_at).to be_nil
end
end
end
describe '#forget_me!' do
let(:user) { create(:user) }
context 'when remember me application setting is disabled' do
before do
stub_application_setting(remember_me_enabled: true)
end
it 'allows user to be forgotten when previously remembered' do
user.remember_me!
expect(user.remember_created_at).not_to be_nil
stub_application_setting(remember_me_enabled: false)
user.forget_me!
expect(user.remember_created_at).to be_nil
end
end
end
describe '#disable_two_factor!' do
it 'clears all 2FA-related fields' do
user = create(:user, :two_factor)

View File

@ -268,8 +268,8 @@ RSpec.describe API::Ci::Runner, :clean_gitlab_redis_shared_state, feature_catego
it 'tracks code_intelligence usage ping' do
tracking_params = {
event_names: 'i_source_code_code_intelligence',
start_date: Date.yesterday,
end_date: Date.today
start_date: Date.today.beginning_of_week,
end_date: 1.week.from_now
}
expect { authorize_artifacts_with_token_in_headers(artifact_type: :lsif) }

View File

@ -476,20 +476,12 @@ RSpec.describe 'Query.runner(id)', feature_category: :runner_fleet do
let_it_be(:stale_runner) { create(:ci_runner, description: 'Stale runner 1', created_at: 3.months.ago) }
let_it_be(:never_contacted_instance_runner) { create(:ci_runner, description: 'Missing runner 1', created_at: 1.month.ago, contacted_at: nil) }
let(:status_fragment) do
%(
status
legacyStatusWithExplicitVersion: status(legacyMode: "14.5")
newStatus: status(legacyMode: null)
)
end
let(:query) do
%(
query {
staleRunner: runner(id: "#{stale_runner.to_global_id}") { #{status_fragment} }
pausedRunner: runner(id: "#{inactive_instance_runner.to_global_id}") { #{status_fragment} }
neverContactedInstanceRunner: runner(id: "#{never_contacted_instance_runner.to_global_id}") { #{status_fragment} }
staleRunner: runner(id: "#{stale_runner.to_global_id}") { status }
pausedRunner: runner(id: "#{inactive_instance_runner.to_global_id}") { status }
neverContactedInstanceRunner: runner(id: "#{never_contacted_instance_runner.to_global_id}") { status }
}
)
end
@ -499,56 +491,19 @@ RSpec.describe 'Query.runner(id)', feature_category: :runner_fleet do
stale_runner_data = graphql_data_at(:stale_runner)
expect(stale_runner_data).to match a_hash_including(
'status' => 'STALE',
'legacyStatusWithExplicitVersion' => 'STALE',
'newStatus' => 'STALE'
'status' => 'STALE'
)
paused_runner_data = graphql_data_at(:paused_runner)
expect(paused_runner_data).to match a_hash_including(
'status' => 'OFFLINE',
'legacyStatusWithExplicitVersion' => 'OFFLINE',
'newStatus' => 'OFFLINE'
'status' => 'OFFLINE'
)
never_contacted_instance_runner_data = graphql_data_at(:never_contacted_instance_runner)
expect(never_contacted_instance_runner_data).to match a_hash_including(
'status' => 'NEVER_CONTACTED',
'legacyStatusWithExplicitVersion' => 'NEVER_CONTACTED',
'newStatus' => 'NEVER_CONTACTED'
'status' => 'NEVER_CONTACTED'
)
end
context 'when disable_runner_graphql_legacy_mode is enabled' do
before do
stub_feature_flags(disable_runner_graphql_legacy_mode: false)
end
it 'retrieves status fields with expected values' do
post_graphql(query, current_user: user)
stale_runner_data = graphql_data_at(:stale_runner)
expect(stale_runner_data).to match a_hash_including(
'status' => 'STALE',
'legacyStatusWithExplicitVersion' => 'STALE',
'newStatus' => 'STALE'
)
paused_runner_data = graphql_data_at(:paused_runner)
expect(paused_runner_data).to match a_hash_including(
'status' => 'PAUSED',
'legacyStatusWithExplicitVersion' => 'PAUSED',
'newStatus' => 'OFFLINE'
)
never_contacted_instance_runner_data = graphql_data_at(:never_contacted_instance_runner)
expect(never_contacted_instance_runner_data).to match a_hash_including(
'status' => 'NEVER_CONTACTED',
'legacyStatusWithExplicitVersion' => 'NEVER_CONTACTED',
'newStatus' => 'NEVER_CONTACTED'
)
end
end
end
describe 'for multiple runners' do

View File

@ -99,7 +99,7 @@ RSpec.describe DesignManagement::DeleteDesignsService, feature_category: :design
rescue StandardError
nil
end
.not_to change { redis_hll.unique_events(event_names: event, start_date: 1.day.ago, end_date: 1.day.from_now) }
.not_to change { redis_hll.unique_events(event_names: event, start_date: Date.today, end_date: 1.week.from_now) }
begin
run_service

View File

@ -6,13 +6,14 @@ RSpec.describe EventCreateService, :clean_gitlab_redis_cache, :clean_gitlab_redi
include SnowplowHelpers
let(:service) { described_class.new }
let(:dates) { { start_date: Date.today.beginning_of_week, end_date: Date.today.next_week } }
let_it_be(:user, reload: true) { create :user }
let_it_be(:project) { create(:project) }
shared_examples 'it records the event in the event counter' do
specify do
tracking_params = { event_names: event_action, start_date: Date.yesterday, end_date: Date.today }
tracking_params = { event_names: event_action, **dates }
expect { subject }
.to change { Gitlab::UsageDataCounters::HLLRedisCounter.unique_events(**tracking_params) }
@ -22,7 +23,7 @@ RSpec.describe EventCreateService, :clean_gitlab_redis_cache, :clean_gitlab_redi
shared_examples 'it records a git write event' do
specify do
tracking_params = { event_names: 'git_write_action', start_date: Date.yesterday, end_date: Date.today }
tracking_params = { event_names: 'git_write_action', **dates }
expect { subject }
.to change { Gitlab::UsageDataCounters::HLLRedisCounter.unique_events(**tracking_params) }

View File

@ -151,7 +151,9 @@ RSpec.describe Notes::CreateService, feature_category: :team_planning do
.and_call_original
expect do
execute_create_service
end.to change { counter.unique_events(event_names: event, start_date: 1.day.ago, end_date: 1.day.from_now) }.by(1)
end.to change {
counter.unique_events(event_names: event, start_date: Date.today.beginning_of_week, end_date: 1.week.from_now)
}.by(1)
end
it 'does not track merge request usage data' do

View File

@ -38,7 +38,9 @@ RSpec.describe Notes::DestroyService, feature_category: :team_planning do
.and_call_original
expect do
service_action
end.to change { counter.unique_events(event_names: property, start_date: 1.day.ago, end_date: 1.day.from_now) }.by(1)
end.to change {
counter.unique_events(event_names: property, start_date: Date.today.beginning_of_week, end_date: 1.week.from_now)
}.by(1)
end
it_behaves_like 'issue_edit snowplow tracking' do

View File

@ -65,7 +65,7 @@ RSpec.describe Notes::UpdateService, feature_category: :team_planning do
.and_call_original
expect do
update_note(note: 'new text')
end.to change { counter.unique_events(event_names: event, start_date: 1.day.ago, end_date: 1.day.from_now) }.by(1)
end.to change { counter.unique_events(event_names: event, start_date: Date.today.beginning_of_week, end_date: 1.week.from_now) }.by(1)
end
it_behaves_like 'issue_edit snowplow tracking' do

View File

@ -39,4 +39,10 @@ module SessionHelpers
def get_ttl(key)
Gitlab::Redis::Sessions.with { |redis| redis.ttl(key) }
end
def expire_session
get_session_keys.each do |key|
::Gitlab::Redis::Sessions.with { |redis| redis.expire(key, -1) }
end
end
end

View File

@ -1,11 +1,11 @@
# frozen_string_literal: true
RSpec.shared_examples 'a daily tracked issuable snowplow and service ping events for given event params' do
RSpec.shared_examples 'tracked issuable snowplow and service ping events for given event params' do
before do
stub_application_setting(usage_ping_enabled: true)
end
def count_unique(date_from: 1.minute.ago, date_to: 1.minute.from_now)
def count_unique(date_from: Date.today.beginning_of_week, date_to: 1.week.from_now)
Gitlab::UsageDataCounters::HLLRedisCounter.unique_events(event_names: action, start_date: date_from, end_date: date_to)
end
@ -29,8 +29,8 @@ RSpec.shared_examples 'a daily tracked issuable snowplow and service ping events
end
end
RSpec.shared_examples 'daily tracked issuable snowplow and service ping events with project' do
it_behaves_like 'a daily tracked issuable snowplow and service ping events for given event params' do
RSpec.shared_examples 'tracked issuable snowplow and service ping events with project' do
it_behaves_like 'tracked issuable snowplow and service ping events for given event params' do
let(:context) do
Gitlab::Tracking::ServicePingContext
.new(data_source: :redis_hll, event: event_property)
@ -42,8 +42,8 @@ RSpec.shared_examples 'daily tracked issuable snowplow and service ping events w
end
end
RSpec.shared_examples 'a daily tracked issuable snowplow and service ping events with namespace' do
it_behaves_like 'a daily tracked issuable snowplow and service ping events for given event params' do
RSpec.shared_examples 'tracked issuable snowplow and service ping events with namespace' do
it_behaves_like 'tracked issuable snowplow and service ping events for given event params' do
let(:context) do
Gitlab::Tracking::ServicePingContext
.new(data_source: :redis_hll, event: event_property)

View File

@ -1115,10 +1115,10 @@
resolved "https://registry.yarnpkg.com/@gitlab/svgs/-/svgs-3.45.0.tgz#7f1ac23be1ab8cd27449036fd8415da146c07a0a"
integrity sha512-ygEl+ljiXfxWomk0w0i9ke9ug6CH+1i572aqRedc5Ws5L6FJ77N/AHQ6uYrd2/ecnyuXRRwiYfa3Rdcs8Ss/HQ==
"@gitlab/ui@62.9.0":
version "62.9.0"
resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-62.9.0.tgz#f72878441b68e9f6400465d6aab5ec13ec11e792"
integrity sha512-eO+t587EXHjg2jAN5eUbIX3SHuPOWjt2EU/X2944zBAsB3sQtYLWJzsGCan7rVV/p0DjshDxSg4A2FGAQCDCLg==
"@gitlab/ui@62.9.1":
version "62.9.1"
resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-62.9.1.tgz#0660d8c6d159e3d11690a73ad5c2833306bb5a15"
integrity sha512-6SqEAcFLqk4V1S/8rlvTG1Wj6uAPiX+GNuQaWXJ++5SlP+2XlzBJBr+udymtgn8ZAsCc9vKTzVo5PW2XZ6UjAA==
dependencies:
"@popperjs/core" "^2.11.2"
bootstrap-vue "2.23.1"