Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
9bfe01f361
commit
39e728a681
|
|
@ -1 +1 @@
|
|||
7207df70c6dcd76de3ef92993b57b33c7ab5eb8a
|
||||
90d4f1b1a6f42d95d35bfd21267fda5621ac9a90
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
5.2.0
|
||||
5.3.0
|
||||
|
|
|
|||
2
Gemfile
2
Gemfile
|
|
@ -432,7 +432,7 @@ gem 'prometheus-client-mmap', '~> 1.1', '>= 1.1.1', require: 'prometheus/client'
|
|||
gem 'async', '~> 2.12.1', require: false # rubocop:disable Gemfile/MissingFeatureCategory -- This is general utility gem
|
||||
|
||||
# Security report schemas used to validate CI job artifacts of security jobs
|
||||
gem 'gitlab-security_report_schemas', '0.1.2.min15.0.0.max15.2.0', feature_category: :vulnerability_management
|
||||
gem 'gitlab-security_report_schemas', '0.1.2.min15.0.0.max15.2.1', feature_category: :vulnerability_management
|
||||
|
||||
# OpenTelemetry
|
||||
group :opentelemetry do
|
||||
|
|
|
|||
|
|
@ -236,7 +236,7 @@
|
|||
{"name":"gitlab-markup","version":"1.9.0","platform":"ruby","checksum":"7eda045a08ec2d110084252fa13a8c9eac8bdac0e302035ca7db4b82bcbd7ed4"},
|
||||
{"name":"gitlab-net-dns","version":"0.9.2","platform":"ruby","checksum":"f726d978479d43810819f12a45c0906d775a07e34df111bbe693fffbbef3059d"},
|
||||
{"name":"gitlab-sdk","version":"0.3.1","platform":"ruby","checksum":"48ba49084f4ab92df7c7ef9f347020d9dfdf6ed9c1e782b67264e98ffe6ea710"},
|
||||
{"name":"gitlab-security_report_schemas","version":"0.1.2.min15.0.0.max15.2.0","platform":"ruby","checksum":"c40afe378b52539f610f67394dafe47376bd2f0588d217ff6c25d12b52d2a663"},
|
||||
{"name":"gitlab-security_report_schemas","version":"0.1.2.min15.0.0.max15.2.1","platform":"ruby","checksum":"300037487ec9d51a814f648514ff521cb82b94fc51d9fe53389175b36ac680ae"},
|
||||
{"name":"gitlab-styles","version":"12.0.1","platform":"ruby","checksum":"d8a302b0ab0e1f18e2d11501760f1b85c5e70b5e5ca628828a0786c7984ed133"},
|
||||
{"name":"gitlab_chronic_duration","version":"0.12.0","platform":"ruby","checksum":"0d766944d415b5c831f176871ee8625783fc0c5bfbef2d79a3a616f207ffc16d"},
|
||||
{"name":"gitlab_omniauth-ldap","version":"2.2.0","platform":"ruby","checksum":"bb4d20acb3b123ed654a8f6a47d3fac673ece7ed0b6992edb92dca14bad2838c"},
|
||||
|
|
|
|||
|
|
@ -762,7 +762,7 @@ GEM
|
|||
activesupport (>= 5.2.0)
|
||||
rake (~> 13.0)
|
||||
snowplow-tracker (~> 0.8.0)
|
||||
gitlab-security_report_schemas (0.1.2.min15.0.0.max15.2.0)
|
||||
gitlab-security_report_schemas (0.1.2.min15.0.0.max15.2.1)
|
||||
activesupport (>= 6, < 8)
|
||||
json_schemer (~> 2.3.0)
|
||||
gitlab-styles (12.0.1)
|
||||
|
|
@ -2083,7 +2083,7 @@ DEPENDENCIES
|
|||
gitlab-schema-validation!
|
||||
gitlab-sdk (~> 0.3.0)
|
||||
gitlab-secret_detection!
|
||||
gitlab-security_report_schemas (= 0.1.2.min15.0.0.max15.2.0)
|
||||
gitlab-security_report_schemas (= 0.1.2.min15.0.0.max15.2.1)
|
||||
gitlab-sidekiq-fetcher!
|
||||
gitlab-styles (~> 12.0.1)
|
||||
gitlab-topology-service-client (~> 0.1)!
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@
|
|||
{"name":"gitlab-markup","version":"1.9.0","platform":"ruby","checksum":"7eda045a08ec2d110084252fa13a8c9eac8bdac0e302035ca7db4b82bcbd7ed4"},
|
||||
{"name":"gitlab-net-dns","version":"0.9.2","platform":"ruby","checksum":"f726d978479d43810819f12a45c0906d775a07e34df111bbe693fffbbef3059d"},
|
||||
{"name":"gitlab-sdk","version":"0.3.1","platform":"ruby","checksum":"48ba49084f4ab92df7c7ef9f347020d9dfdf6ed9c1e782b67264e98ffe6ea710"},
|
||||
{"name":"gitlab-security_report_schemas","version":"0.1.2.min15.0.0.max15.2.0","platform":"ruby","checksum":"c40afe378b52539f610f67394dafe47376bd2f0588d217ff6c25d12b52d2a663"},
|
||||
{"name":"gitlab-security_report_schemas","version":"0.1.2.min15.0.0.max15.2.1","platform":"ruby","checksum":"300037487ec9d51a814f648514ff521cb82b94fc51d9fe53389175b36ac680ae"},
|
||||
{"name":"gitlab-styles","version":"12.0.1","platform":"ruby","checksum":"d8a302b0ab0e1f18e2d11501760f1b85c5e70b5e5ca628828a0786c7984ed133"},
|
||||
{"name":"gitlab_chronic_duration","version":"0.12.0","platform":"ruby","checksum":"0d766944d415b5c831f176871ee8625783fc0c5bfbef2d79a3a616f207ffc16d"},
|
||||
{"name":"gitlab_omniauth-ldap","version":"2.2.0","platform":"ruby","checksum":"bb4d20acb3b123ed654a8f6a47d3fac673ece7ed0b6992edb92dca14bad2838c"},
|
||||
|
|
|
|||
|
|
@ -772,7 +772,7 @@ GEM
|
|||
activesupport (>= 5.2.0)
|
||||
rake (~> 13.0)
|
||||
snowplow-tracker (~> 0.8.0)
|
||||
gitlab-security_report_schemas (0.1.2.min15.0.0.max15.2.0)
|
||||
gitlab-security_report_schemas (0.1.2.min15.0.0.max15.2.1)
|
||||
activesupport (>= 6, < 8)
|
||||
json_schemer (~> 2.3.0)
|
||||
gitlab-styles (12.0.1)
|
||||
|
|
@ -2110,7 +2110,7 @@ DEPENDENCIES
|
|||
gitlab-schema-validation!
|
||||
gitlab-sdk (~> 0.3.0)
|
||||
gitlab-secret_detection!
|
||||
gitlab-security_report_schemas (= 0.1.2.min15.0.0.max15.2.0)
|
||||
gitlab-security_report_schemas (= 0.1.2.min15.0.0.max15.2.1)
|
||||
gitlab-sidekiq-fetcher!
|
||||
gitlab-styles (~> 12.0.1)
|
||||
gitlab-topology-service-client (~> 0.1)!
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ module WorkItems
|
|||
milestone: { milestone: [:project, :group] },
|
||||
subscribed: [:assignees, :award_emoji, { notes: [:author, :award_emoji] }],
|
||||
award_emoji: { award_emoji: :awardable },
|
||||
due_date: :dates_source,
|
||||
start_date: :dates_source,
|
||||
closing_merge_requests: { merge_requests_closing_issues: { merge_request: [:target_project, :author] } }
|
||||
}
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,14 +1,11 @@
|
|||
.row.empty-state.labels
|
||||
.col-12
|
||||
.svg-content.svg-150{ data: { testid: 'label-svg-content' } }
|
||||
= image_tag 'illustrations/empty-state/empty-labels-md.svg'
|
||||
.col-12
|
||||
.text-content
|
||||
%h4= _("Labels can be applied to issues and merge requests to categorize them.")
|
||||
%p= _("You can also star a label to make it a priority label.")
|
||||
.text-center
|
||||
- if can?(current_user, :admin_label, @project)
|
||||
= link_button_to _('New label'), new_project_label_path(@project), title: _('New label'), id: 'new_label_link', variant: :confirm
|
||||
= link_button_to _('Generate a default set of labels'), generate_project_labels_path(@project), method: :post, title: _('Generate a default set of labels'), id: 'generate_labels_link', variant: :confirm, category: :secondary
|
||||
- if can?(current_user, :admin_label, @group)
|
||||
= link_button_to _('New label'), new_group_label_path(@group), title: _('New label'), id: 'new_label_link', variant: :confirm
|
||||
= render Pajamas::EmptyStateComponent.new(svg_path: 'illustrations/empty-state/empty-labels-add-md.svg',
|
||||
title: _("Labels can be applied to issues and merge requests to categorize them")) do |c|
|
||||
|
||||
- c.with_description do
|
||||
= _("You can also star a label to make it a priority label.")
|
||||
.gl-mt-5.gl-flex.gl-gap-3.gl-flex-wrap.gl-justify-center
|
||||
- if can?(current_user, :admin_label, @project)
|
||||
= link_button_to _('New label'), new_project_label_path(@project), title: _('New label'), id: 'new_label_link', variant: :confirm
|
||||
= link_button_to _('Generate a default set of labels'), generate_project_labels_path(@project), method: :post, title: _('Generate a default set of labels'), id: 'generate_labels_link', variant: :confirm, category: :secondary
|
||||
- if can?(current_user, :admin_label, @group)
|
||||
= link_button_to _('New label'), new_group_label_path(@group), title: _('New label'), id: 'new_label_link', variant: :confirm
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
name: prompt_migration_fix_code
|
||||
feature_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/475047
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/167399
|
||||
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/496750
|
||||
milestone: '17.5'
|
||||
group: group::custom models
|
||||
type: experiment
|
||||
default_enabled: false
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
name: go_get_handle_401_error
|
||||
feature_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/493732
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/167640
|
||||
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/496539
|
||||
milestone: '17.5'
|
||||
group: group::source code
|
||||
type: gitlab_com_derisk
|
||||
default_enabled: false
|
||||
|
|
@ -757,6 +757,8 @@
|
|||
- 1
|
||||
- - search_zoekt_initial_indexing_event
|
||||
- 1
|
||||
- - search_zoekt_lost_node_event
|
||||
- 1
|
||||
- - search_zoekt_namespace_indexer
|
||||
- 1
|
||||
- - search_zoekt_namespace_initial_indexing
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
migration_job_name: BackfillCiBuildsRunnerSessionProjectId
|
||||
description: Backfills sharding key `ci_builds_runner_session.project_id` from `p_ci_builds`.
|
||||
feature_category: runner
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/167634
|
||||
milestone: '17.5'
|
||||
queued_migration_version: 20240930144643
|
||||
finalize_after: '2024-10-22'
|
||||
finalized_by: # version of the migration that finalized this BBM
|
||||
|
|
@ -4,7 +4,8 @@ classes:
|
|||
- Ci::BuildRunnerSession
|
||||
feature_categories:
|
||||
- runner
|
||||
description: Store build-related runner session. Data is removed after the respective job transitions from running to any state.
|
||||
description: Store build-related runner session. Data is removed after the respective
|
||||
job transitions from running to any state.
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/6208
|
||||
milestone: '11.1'
|
||||
gitlab_schema: gitlab_ci
|
||||
|
|
@ -18,3 +19,4 @@ desired_sharding_key:
|
|||
sharding_key: project_id
|
||||
belongs_to: build
|
||||
foreign_key_name: fk_rails_70707857d3_p
|
||||
desired_sharding_key_migration_job_name: BackfillCiBuildsRunnerSessionProjectId
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddProjectIdToCiBuildsRunnerSession < Gitlab::Database::Migration[2.2]
|
||||
milestone '17.5'
|
||||
|
||||
def change
|
||||
add_column :ci_builds_runner_session, :project_id, :bigint
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class IndexCiBuildsRunnerSessionOnProjectId < Gitlab::Database::Migration[2.2]
|
||||
milestone '17.5'
|
||||
disable_ddl_transaction!
|
||||
|
||||
INDEX_NAME = 'index_ci_builds_runner_session_on_project_id'
|
||||
|
||||
def up
|
||||
add_concurrent_index :ci_builds_runner_session, :project_id, name: INDEX_NAME
|
||||
end
|
||||
|
||||
def down
|
||||
remove_concurrent_index_by_name :ci_builds_runner_session, INDEX_NAME
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddCiBuildsRunnerSessionProjectIdTrigger < Gitlab::Database::Migration[2.2]
|
||||
milestone '17.5'
|
||||
|
||||
def up
|
||||
install_sharding_key_assignment_trigger(
|
||||
table: :ci_builds_runner_session,
|
||||
sharding_key: :project_id,
|
||||
parent_table: :p_ci_builds,
|
||||
parent_sharding_key: :project_id,
|
||||
foreign_key: :build_id
|
||||
)
|
||||
end
|
||||
|
||||
def down
|
||||
remove_sharding_key_assignment_trigger(
|
||||
table: :ci_builds_runner_session,
|
||||
sharding_key: :project_id,
|
||||
parent_table: :p_ci_builds,
|
||||
parent_sharding_key: :project_id,
|
||||
foreign_key: :build_id
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class QueueBackfillCiBuildsRunnerSessionProjectId < Gitlab::Database::Migration[2.2]
|
||||
milestone '17.5'
|
||||
restrict_gitlab_migration gitlab_schema: :gitlab_ci
|
||||
|
||||
MIGRATION = "BackfillCiBuildsRunnerSessionProjectId"
|
||||
DELAY_INTERVAL = 2.minutes
|
||||
BATCH_SIZE = 1000
|
||||
SUB_BATCH_SIZE = 100
|
||||
|
||||
def up
|
||||
queue_batched_background_migration(
|
||||
MIGRATION,
|
||||
:ci_builds_runner_session,
|
||||
:id,
|
||||
:project_id,
|
||||
:p_ci_builds,
|
||||
:project_id,
|
||||
:build_id,
|
||||
job_interval: DELAY_INTERVAL,
|
||||
batch_size: BATCH_SIZE,
|
||||
sub_batch_size: SUB_BATCH_SIZE
|
||||
)
|
||||
end
|
||||
|
||||
def down
|
||||
delete_batched_background_migration(
|
||||
MIGRATION,
|
||||
:ci_builds_runner_session,
|
||||
:id,
|
||||
[
|
||||
:project_id,
|
||||
:p_ci_builds,
|
||||
:project_id,
|
||||
:build_id
|
||||
]
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1 @@
|
|||
15875b22bda9b9bfaedf0307133ae7fe2457afd97354c7802fbff085d4b7986a
|
||||
|
|
@ -0,0 +1 @@
|
|||
b838586b920d690a9281775417a18c2ab6326258bf5dd5298c82f6b5c655204b
|
||||
|
|
@ -0,0 +1 @@
|
|||
36e73986fdb23fa5dcbce209a40e633d3f8b05d4f6c16eacec4be2dd68fba91b
|
||||
|
|
@ -0,0 +1 @@
|
|||
1938a7329e5f216c004d265cb8b84eac9e1b9c3d8b4c87caa8db759bd71a85d7
|
||||
|
|
@ -1177,6 +1177,22 @@ RETURN NEW;
|
|||
END
|
||||
$$;
|
||||
|
||||
CREATE FUNCTION trigger_388de55cd36c() RETURNS trigger
|
||||
LANGUAGE plpgsql
|
||||
AS $$
|
||||
BEGIN
|
||||
IF NEW."project_id" IS NULL THEN
|
||||
SELECT "project_id"
|
||||
INTO NEW."project_id"
|
||||
FROM "p_ci_builds"
|
||||
WHERE "p_ci_builds"."id" = NEW."build_id";
|
||||
END IF;
|
||||
|
||||
RETURN NEW;
|
||||
|
||||
END
|
||||
$$;
|
||||
|
||||
CREATE FUNCTION trigger_3d1a58344b29() RETURNS trigger
|
||||
LANGUAGE plpgsql
|
||||
AS $$
|
||||
|
|
@ -8169,7 +8185,8 @@ CREATE TABLE ci_builds_runner_session (
|
|||
certificate character varying,
|
||||
"authorization" character varying,
|
||||
build_id bigint NOT NULL,
|
||||
partition_id bigint NOT NULL
|
||||
partition_id bigint NOT NULL,
|
||||
project_id bigint
|
||||
);
|
||||
|
||||
CREATE SEQUENCE ci_builds_runner_session_id_seq
|
||||
|
|
@ -27892,6 +27909,8 @@ CREATE UNIQUE INDEX index_ci_builds_runner_session_on_build_id ON ci_builds_runn
|
|||
|
||||
CREATE UNIQUE INDEX index_ci_builds_runner_session_on_partition_id_build_id ON ci_builds_runner_session USING btree (partition_id, build_id);
|
||||
|
||||
CREATE INDEX index_ci_builds_runner_session_on_project_id ON ci_builds_runner_session USING btree (project_id);
|
||||
|
||||
CREATE INDEX index_ci_daily_build_group_report_results_on_group_id ON ci_daily_build_group_report_results USING btree (group_id);
|
||||
|
||||
CREATE INDEX index_ci_daily_build_group_report_results_on_last_pipeline_id ON ci_daily_build_group_report_results USING btree (last_pipeline_id);
|
||||
|
|
@ -33420,6 +33439,8 @@ CREATE TRIGGER trigger_30209d0fba3e BEFORE INSERT OR UPDATE ON alert_management_
|
|||
|
||||
CREATE TRIGGER trigger_3691f9f6a69f BEFORE INSERT OR UPDATE ON remote_development_agent_configs FOR EACH ROW EXECUTE FUNCTION trigger_3691f9f6a69f();
|
||||
|
||||
CREATE TRIGGER trigger_388de55cd36c BEFORE INSERT OR UPDATE ON ci_builds_runner_session FOR EACH ROW EXECUTE FUNCTION trigger_388de55cd36c();
|
||||
|
||||
CREATE TRIGGER trigger_3d1a58344b29 BEFORE INSERT OR UPDATE ON alert_management_alert_assignees FOR EACH ROW EXECUTE FUNCTION trigger_3d1a58344b29();
|
||||
|
||||
CREATE TRIGGER trigger_3e067fa9bfe3 BEFORE INSERT OR UPDATE ON incident_management_timeline_event_tag_links FOR EACH ROW EXECUTE FUNCTION trigger_3e067fa9bfe3();
|
||||
|
|
|
|||
|
|
@ -185,13 +185,14 @@ To set up GitLab and its components to accommodate up to 200 RPS or 10,000 users
|
|||
to handle the load balancing of the GitLab application services nodes.
|
||||
1. [Configure the internal load balancer](#configure-the-internal-load-balancer)
|
||||
to handle the load balancing of GitLab application internal connections.
|
||||
1. [Configure Consul](#configure-consul).
|
||||
1. [Configure Consul](#configure-consul) for service discovery and health checking.
|
||||
1. [Configure PostgreSQL](#configure-postgresql), the database for GitLab.
|
||||
1. [Configure PgBouncer](#configure-pgbouncer).
|
||||
1. [Configure Redis](#configure-redis).
|
||||
1. [Configure PgBouncer](#configure-pgbouncer) for database connection pooling and management.
|
||||
1. [Configure Redis](#configure-redis), which stores session data, temporary
|
||||
cache information, and background job queues.
|
||||
1. [Configure Gitaly Cluster](#configure-gitaly-cluster),
|
||||
provides access to the Git repositories.
|
||||
1. [Configure Sidekiq](#configure-sidekiq).
|
||||
1. [Configure Sidekiq](#configure-sidekiq) for background job processing.
|
||||
1. [Configure the main GitLab Rails application](#configure-gitlab-rails)
|
||||
to run Puma, Workhorse, GitLab Shell, and to serve all frontend
|
||||
requests (which include UI, API, and Git over HTTP/SSH).
|
||||
|
|
|
|||
|
|
@ -185,13 +185,14 @@ To set up GitLab and its components to accommodate up to 500 RPS or 25,000 users
|
|||
to handle the load balancing of the GitLab application services nodes.
|
||||
1. [Configure the internal load balancer](#configure-the-internal-load-balancer)
|
||||
to handle the load balancing of GitLab application internal connections.
|
||||
1. [Configure Consul](#configure-consul).
|
||||
1. [Configure Consul](#configure-consul) for service discovery and health checking.
|
||||
1. [Configure PostgreSQL](#configure-postgresql), the database for GitLab.
|
||||
1. [Configure PgBouncer](#configure-pgbouncer).
|
||||
1. [Configure Redis](#configure-redis).
|
||||
1. [Configure PgBouncer](#configure-pgbouncer) for database connection pooling and management.
|
||||
1. [Configure Redis](#configure-redis), which stores session data, temporary
|
||||
cache information, and background job queues.
|
||||
1. [Configure Gitaly Cluster](#configure-gitaly-cluster),
|
||||
provides access to the Git repositories.
|
||||
1. [Configure Sidekiq](#configure-sidekiq).
|
||||
1. [Configure Sidekiq](#configure-sidekiq) for background job processing.
|
||||
1. [Configure the main GitLab Rails application](#configure-gitlab-rails)
|
||||
to run Puma, Workhorse, GitLab Shell, and to serve all frontend
|
||||
requests (which include UI, API, and Git over HTTP/SSH).
|
||||
|
|
|
|||
|
|
@ -127,9 +127,11 @@ To set up GitLab and its components to accommodate up to 40 RPS or 2,000 users:
|
|||
1. [Configure the external load balancing node](#configure-the-external-load-balancer)
|
||||
to handle the load balancing of the GitLab application services nodes.
|
||||
1. [Configure PostgreSQL](#configure-postgresql), the database for GitLab.
|
||||
1. [Configure Redis](#configure-redis).
|
||||
1. [Configure Redis](#configure-redis), which stores session data, temporary
|
||||
cache information, and background job queues.
|
||||
1. [Configure Gitaly](#configure-gitaly), which provides access to the Git
|
||||
repositories.
|
||||
1. [Configure Sidekiq](#configure-sidekiq) for background job processing.
|
||||
1. [Configure the main GitLab Rails application](#configure-gitlab-rails)
|
||||
to run Puma, Workhorse, GitLab Shell, and to serve all frontend
|
||||
requests (which include UI, API, and Git over HTTP/SSH).
|
||||
|
|
|
|||
|
|
@ -180,13 +180,14 @@ To set up GitLab and its components to accommodate up to 60 RPS or 3,000 users:
|
|||
to handle the load balancing of the GitLab application services nodes.
|
||||
1. [Configure the internal load balancer](#configure-the-internal-load-balancer)
|
||||
to handle the load balancing of GitLab application internal connections.
|
||||
1. [Configure Consul](#configure-consul).
|
||||
1. [Configure Consul](#configure-consul) for service discovery and health checking.
|
||||
1. [Configure PostgreSQL](#configure-postgresql), the database for GitLab.
|
||||
1. [Configure PgBouncer](#configure-pgbouncer).
|
||||
1. [Configure Redis](#configure-redis).
|
||||
1. [Configure PgBouncer](#configure-pgbouncer) for database connection pooling and management.
|
||||
1. [Configure Redis](#configure-redis), which stores session data, temporary
|
||||
cache information, and background job queues.
|
||||
1. [Configure Gitaly Cluster](#configure-gitaly-cluster),
|
||||
provides access to the Git repositories.
|
||||
1. [Configure Sidekiq](#configure-sidekiq).
|
||||
1. [Configure Sidekiq](#configure-sidekiq) for background job processing.
|
||||
1. [Configure the main GitLab Rails application](#configure-gitlab-rails)
|
||||
to run Puma, Workhorse, GitLab Shell, and to serve all frontend
|
||||
requests (which include UI, API, and Git over HTTP/SSH).
|
||||
|
|
|
|||
|
|
@ -184,13 +184,14 @@ To set up GitLab and its components to accommodate up to 1000 RPS or 50,000 user
|
|||
to handle the load balancing of the GitLab application services nodes.
|
||||
1. [Configure the internal load balancer](#configure-the-internal-load-balancer)
|
||||
to handle the load balancing of GitLab application internal connections.
|
||||
1. [Configure Consul](#configure-consul).
|
||||
1. [Configure Consul](#configure-consul) for service discovery and health checking.
|
||||
1. [Configure PostgreSQL](#configure-postgresql), the database for GitLab.
|
||||
1. [Configure PgBouncer](#configure-pgbouncer).
|
||||
1. [Configure Redis](#configure-redis).
|
||||
1. [Configure PgBouncer](#configure-pgbouncer) for database connection pooling and management.
|
||||
1. [Configure Redis](#configure-redis), which stores session data, temporary
|
||||
cache information, and background job queues.
|
||||
1. [Configure Gitaly Cluster](#configure-gitaly-cluster),
|
||||
provides access to the Git repositories.
|
||||
1. [Configure Sidekiq](#configure-sidekiq).
|
||||
1. [Configure Sidekiq](#configure-sidekiq) for background job processing.
|
||||
1. [Configure the main GitLab Rails application](#configure-gitlab-rails)
|
||||
to run Puma, Workhorse, GitLab Shell, and to serve all frontend
|
||||
requests (which include UI, API, and Git over HTTP/SSH).
|
||||
|
|
|
|||
|
|
@ -180,13 +180,14 @@ To set up GitLab and its components to accommodate up to 100 RPS or 5,000 users:
|
|||
to handle the load balancing of the GitLab application services nodes.
|
||||
1. [Configure the internal load balancer](#configure-the-internal-load-balancer)
|
||||
to handle the load balancing of GitLab application internal connections.
|
||||
1. [Configure Consul](#configure-consul).
|
||||
1. [Configure Consul](#configure-consul) for service discovery and health checking.
|
||||
1. [Configure PostgreSQL](#configure-postgresql), the database for GitLab.
|
||||
1. [Configure PgBouncer](#configure-pgbouncer).
|
||||
1. [Configure Redis](#configure-redis).
|
||||
1. [Configure PgBouncer](#configure-pgbouncer) for database connection pooling and management.
|
||||
1. [Configure Redis](#configure-redis), which stores session data, temporary
|
||||
cache information, and background job queues.
|
||||
1. [Configure Gitaly Cluster](#configure-gitaly-cluster),
|
||||
provides access to the Git repositories.
|
||||
1. [Configure Sidekiq](#configure-sidekiq).
|
||||
1. [Configure Sidekiq](#configure-sidekiq) for background job processing.
|
||||
1. [Configure the main GitLab Rails application](#configure-gitlab-rails)
|
||||
to run Puma, Workhorse, GitLab Shell, and to serve all frontend
|
||||
requests (which include UI, API, and Git over HTTP/SSH).
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ Supported attributes:
|
|||
|--------------|---------|----------|----------------------------------|
|
||||
| `token` | string | Yes | Token that should be identified. |
|
||||
|
||||
If successful, returns [`200`](../rest/index.md#status-codes) and information about the token.
|
||||
If successful, returns [`200`](../rest/troubleshooting.md#status-codes) and information about the token.
|
||||
|
||||
Can return the following status codes:
|
||||
|
||||
|
|
|
|||
|
|
@ -122,10 +122,10 @@ Supported attributes:
|
|||
|
||||
If successful, returns:
|
||||
|
||||
- [`200`](rest/index.md#status-codes) if the feature is enabled.
|
||||
- [`403`](rest/index.md#status-codes) if the feature is disabled.
|
||||
- [`200`](rest/troubleshooting.md#status-codes) if the feature is enabled.
|
||||
- [`403`](rest/troubleshooting.md#status-codes) if the feature is disabled.
|
||||
|
||||
Additionally, returns a [`404`](rest/index.md#status-codes) if the path is empty or the project does not exist.
|
||||
Additionally, returns a [`404`](rest/troubleshooting.md#status-codes) if the path is empty or the project does not exist.
|
||||
|
||||
Example request:
|
||||
|
||||
|
|
|
|||
|
|
@ -29540,7 +29540,8 @@ Response of security policy creation.
|
|||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| <a id="policyprojectcreatederrormessage"></a>`errorMessage` | [`String`](#string) | Error message in case status is :error. |
|
||||
| <a id="policyprojectcreatederrormessage"></a>`errorMessage` **{warning-solid}** | [`String`](#string) | **Deprecated** in GitLab 17.5. Use errors instead. |
|
||||
| <a id="policyprojectcreatederrors"></a>`errors` | [`[String!]`](#string) | Error messages in case status is :error. |
|
||||
| <a id="policyprojectcreatedproject"></a>`project` | [`Project`](#project) | Security Policy Project that was created. |
|
||||
| <a id="policyprojectcreatedstatus"></a>`status` | [`PolicyProjectCreatedStatus`](#policyprojectcreatedstatus) | Status of the creation of the security policy project. |
|
||||
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ Example request:
|
|||
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/uploads/1"
|
||||
```
|
||||
|
||||
If successful, returns [`200`](rest/index.md#status-codes) and the uploaded file in the response body.
|
||||
If successful, returns [`200`](rest/troubleshooting.md#status-codes) and the uploaded file in the response body.
|
||||
|
||||
## Download an uploaded file by secret and filename
|
||||
|
||||
|
|
@ -109,7 +109,7 @@ Example request:
|
|||
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/uploads/648d97c6eef5fc5df8d1004565b3ee5a/sample.jpg"
|
||||
```
|
||||
|
||||
If successful, returns [`200`](rest/index.md#status-codes) and the uploaded file in the response body.
|
||||
If successful, returns [`200`](rest/troubleshooting.md#status-codes) and the uploaded file in the response body.
|
||||
|
||||
## Delete an uploaded file by ID
|
||||
|
||||
|
|
@ -134,7 +134,7 @@ Example request:
|
|||
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/uploads/1"
|
||||
```
|
||||
|
||||
If successful, returns [`204`](rest/index.md#status-codes) status code without any response body.
|
||||
If successful, returns [`204`](rest/troubleshooting.md#status-codes) status code without any response body.
|
||||
|
||||
## Delete an uploaded file by secret and filename
|
||||
|
||||
|
|
@ -160,4 +160,4 @@ Example request:
|
|||
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/uploads/648d97c6eef5fc5df8d1004565b3ee5a/sample.jpg"
|
||||
```
|
||||
|
||||
If successful, returns [`204`](rest/index.md#status-codes) status code without any response body.
|
||||
If successful, returns [`204`](rest/troubleshooting.md#status-codes) status code without any response body.
|
||||
|
|
|
|||
|
|
@ -1561,7 +1561,7 @@ Parameters:
|
|||
| `include_service_accounts` | boolean | yes (see description) | Include service account users. Either this value or `include_saml_users` must be `true`. |
|
||||
| `search` | string | no | Search users by name, email, username. |
|
||||
|
||||
If successful, returns [`200 OK`](../api/rest/index.md#status-codes) and the
|
||||
If successful, returns [`200 OK`](../api/rest/troubleshooting.md#status-codes) and the
|
||||
following response attributes:
|
||||
|
||||
Example response:
|
||||
|
|
@ -1724,7 +1724,7 @@ POST /groups/:id/tokens/revoke
|
|||
| `id` | integer or string | Yes | The ID or [URL-encoded path of the group](rest/index.md#namespaced-paths). |
|
||||
| `token` | string | Yes | The plaintext token. |
|
||||
|
||||
If successful, returns [`200 OK`](rest/index.md#status-codes) and
|
||||
If successful, returns [`200 OK`](rest/troubleshooting.md#status-codes) and
|
||||
a JSON representation of the token. The attributes returned will vary by
|
||||
token type.
|
||||
|
||||
|
|
|
|||
|
|
@ -1372,7 +1372,7 @@ curl --request DELETE \
|
|||
--url "https://gitlab.example.com/api/v4/projects/4/issues/85"
|
||||
```
|
||||
|
||||
If successful, returns [`204 No Content`](rest/index.md#status-codes).
|
||||
If successful, returns [`204 No Content`](rest/troubleshooting.md#status-codes).
|
||||
|
||||
## Reorder an issue
|
||||
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ Supported attributes:
|
|||
|:----------|:--------|:---------|:-------------------------------------|
|
||||
| `member_role_id` | integer | yes | The ID of the member role. |
|
||||
|
||||
If successful, returns [`204`](rest/index.md#status-codes) and an empty response.
|
||||
If successful, returns [`204`](rest/troubleshooting.md#status-codes) and an empty response.
|
||||
|
||||
Example request:
|
||||
|
||||
|
|
@ -368,7 +368,7 @@ DELETE /groups/:id/member_roles/:member_role_id
|
|||
| `id` | integer/string | yes | The ID or [URL-encoded path of the group](rest/index.md#namespaced-paths) of the group. |
|
||||
| `member_role_id` | integer | yes | The ID of the member role. |
|
||||
|
||||
If successful, returns [`204`](rest/index.md#status-codes) and an empty response.
|
||||
If successful, returns [`204`](rest/troubleshooting.md#status-codes) and an empty response.
|
||||
|
||||
Example request:
|
||||
|
||||
|
|
|
|||
|
|
@ -276,7 +276,7 @@ Supported attributes:
|
|||
| `with_labels_details` | boolean | No | If `true`, response returns more details for each label in labels field: `:name`, `:color`, `:description`, `:description_html`, `:text_color`. Default is `false`. |
|
||||
| `with_merge_status_recheck` | boolean | No | If `true`, this projection requests (but does not guarantee) the asynchronous recalculation of the `merge_status` field. Default is `false`. In GitLab 15.11 and later, enable the `restrict_merge_status_recheck` feature [flag](../administration/feature_flags.md) to ignore this attribute when requested by users without at least the Developer role. |
|
||||
|
||||
If successful, returns [`200 OK`](rest/index.md#status-codes) and the following
|
||||
If successful, returns [`200 OK`](rest/troubleshooting.md#status-codes) and the following
|
||||
response attributes:
|
||||
|
||||
| Attribute | Type | Description |
|
||||
|
|
@ -1032,7 +1032,7 @@ Supported attributes:
|
|||
| `id` | integer or string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-paths). |
|
||||
| `merge_request_iid` | integer | Yes | Internal ID of the merge request. |
|
||||
|
||||
If successful, returns [`200 OK`](rest/index.md#status-codes) and the following
|
||||
If successful, returns [`200 OK`](rest/troubleshooting.md#status-codes) and the following
|
||||
response attributes:
|
||||
|
||||
| Attribute | Type | Description |
|
||||
|
|
@ -1546,7 +1546,7 @@ Supported attributes:
|
|||
| `per_page` | integer | No | The number of results per page. Defaults to 20. |
|
||||
| `unidiff` | boolean | No | Present diffs in the [unified diff](https://www.gnu.org/software/diffutils/manual/html_node/Detailed-Unified.html) format. Default is false. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/130610) in GitLab 16.5. |
|
||||
|
||||
If successful, returns [`200 OK`](rest/index.md#status-codes) and the
|
||||
If successful, returns [`200 OK`](rest/troubleshooting.md#status-codes) and the
|
||||
following response attributes:
|
||||
|
||||
| Attribute | Type | Description |
|
||||
|
|
@ -2510,7 +2510,7 @@ Supported attributes:
|
|||
| `id` | integer or string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-paths). |
|
||||
| `merge_request_iid` | integer | Yes | Internal ID of the merge request. |
|
||||
|
||||
If successful, returns [`200 OK`](rest/index.md#status-codes) and the following
|
||||
If successful, returns [`200 OK`](rest/troubleshooting.md#status-codes) and the following
|
||||
response attributes when you use the GitLab issue tracker:
|
||||
|
||||
| Attribute | Type | Description |
|
||||
|
|
@ -2545,7 +2545,7 @@ response attributes when you use the GitLab issue tracker:
|
|||
| `[].web_url` | string | Web URL of the issue. |
|
||||
| `[].weight` | integer | Weight of the issue. |
|
||||
|
||||
If successful, returns [`200 OK`](rest/index.md#status-codes) and the following
|
||||
If successful, returns [`200 OK`](rest/troubleshooting.md#status-codes) and the following
|
||||
response attributes when you use an external issue tracker, like Jira:
|
||||
|
||||
| Attribute | Type | Description |
|
||||
|
|
@ -3263,7 +3263,7 @@ Supported attributes:
|
|||
| `version_id` | integer | Yes | ID of the merge request diff version. |
|
||||
| `unidiff` | boolean | No | Present diffs in the [unified diff](https://www.gnu.org/software/diffutils/manual/html_node/Detailed-Unified.html) format. Default is false. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/130610) in GitLab 16.5. |
|
||||
|
||||
If successful, returns [`200 OK`](rest/index.md#status-codes) and the following
|
||||
If successful, returns [`200 OK`](rest/troubleshooting.md#status-codes) and the following
|
||||
response attributes:
|
||||
|
||||
| Attribute | Type | Description |
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ Supported attributes:
|
|||
| --------- | -------------- | -------- | ---------------------------------------- |
|
||||
| `id` | integer/string | Yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-paths) |
|
||||
|
||||
If successful, returns [`200`](rest/index.md#status-codes) and the following
|
||||
If successful, returns [`200`](rest/troubleshooting.md#status-codes) and the following
|
||||
response attributes:
|
||||
|
||||
| Attribute | Type | Description |
|
||||
|
|
@ -123,7 +123,7 @@ Supported attributes:
|
|||
| `pages_unique_domain_enabled` | boolean | No | Whether to use unique domain |
|
||||
| `pages_https_only` | boolean | No | Whether to force HTTPs |
|
||||
|
||||
If successful, returns [`200`](rest/index.md#status-codes) and the following
|
||||
If successful, returns [`200`](rest/troubleshooting.md#status-codes) and the following
|
||||
response attributes:
|
||||
|
||||
| Attribute | Type | Description |
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ Supported attributes:
|
|||
|-------------------------------|-----------------|----------|--------------------------------|
|
||||
| `id` | integer/string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-paths). |
|
||||
|
||||
If successful, returns [`200`](rest/index.md#status-codes) and a list of container registry protection rules.
|
||||
If successful, returns [`200`](rest/troubleshooting.md#status-codes) and a list of container registry protection rules.
|
||||
|
||||
Can return the following status codes:
|
||||
|
||||
|
|
@ -91,7 +91,7 @@ Supported attributes:
|
|||
| `minimum_access_level_for_push` | string | No | Minimum GitLab access level to allow to push container images to the container registry. For example `maintainer`, `owner` or `admin`. Must be provided when `minimum_access_level_for_delete` is not set. |
|
||||
| `minimum_access_level_for_delete` | string | No | Minimum GitLab access level to allow to delete container images in the container registry. For example `maintainer`, `owner`, `admin`. Must be provided when `minimum_access_level_for_push` is not set. |
|
||||
|
||||
If successful, returns [`201`](rest/index.md#status-codes) and the created container registry protection rule.
|
||||
If successful, returns [`201`](rest/troubleshooting.md#status-codes) and the created container registry protection rule.
|
||||
|
||||
Can return the following status codes:
|
||||
|
||||
|
|
@ -136,7 +136,7 @@ Supported attributes:
|
|||
| `minimum_access_level_for_push` | string | No | Minimum GitLab access level to allow to push container images to the container registry. For example `maintainer`, `owner` or `admin`. Must be provided when `minimum_access_level_for_delete` is not set. To unset the value, use an empty string `""`. |
|
||||
| `minimum_access_level_for_delete` | string | No | Minimum GitLab access level to allow to delete container images in the container registry. For example `maintainer`, `owner`, `admin`. Must be provided when `minimum_access_level_for_push` is not set. To unset the value, use an empty string `""`. |
|
||||
|
||||
If successful, returns [`200`](rest/index.md#status-codes) and the updated protection rule.
|
||||
If successful, returns [`200`](rest/troubleshooting.md#status-codes) and the updated protection rule.
|
||||
|
||||
Can return the following status codes:
|
||||
|
||||
|
|
@ -176,7 +176,7 @@ Supported attributes:
|
|||
| `id` | integer/string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-paths). |
|
||||
| `protection_rule_id` | integer | Yes | ID of the container registry protection rule to be deleted. |
|
||||
|
||||
If successful, returns [`204 No Content`](rest/index.md#status-codes).
|
||||
If successful, returns [`204 No Content`](rest/troubleshooting.md#status-codes).
|
||||
|
||||
Can return the following status codes:
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ Supported attributes:
|
|||
|-----------|----------------|----------|-------------|
|
||||
| `id` | integer/string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-paths). |
|
||||
|
||||
If successful, returns [`200`](rest/index.md#status-codes) and the following response attributes:
|
||||
If successful, returns [`200`](rest/troubleshooting.md#status-codes) and the following response attributes:
|
||||
|
||||
| Attribute | Type | Description |
|
||||
|--------------------|---------|-------------|
|
||||
|
|
@ -69,7 +69,7 @@ Supported attributes:
|
|||
| `id` | integer/string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-paths). |
|
||||
| `enabled` | boolean | Yes | Indicates if the [**Limit access _to_ this project** setting](../ci/jobs/ci_job_token.md#add-a-group-or-project-to-the-job-token-allowlist) should be enabled. |
|
||||
|
||||
If successful, returns [`204`](rest/index.md#status-codes) and no response body.
|
||||
If successful, returns [`204`](rest/troubleshooting.md#status-codes) and no response body.
|
||||
|
||||
Example request:
|
||||
|
||||
|
|
@ -97,7 +97,7 @@ Supported attributes:
|
|||
|
||||
This endpoint supports [offset-based pagination](rest/index.md#offset-based-pagination).
|
||||
|
||||
If successful, returns [`200`](rest/index.md#status-codes) and a list of project with limited fields for each project.
|
||||
If successful, returns [`200`](rest/troubleshooting.md#status-codes) and a list of project with limited fields for each project.
|
||||
|
||||
Example request:
|
||||
|
||||
|
|
@ -163,7 +163,7 @@ Supported attributes:
|
|||
| `id` | integer/string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-paths). |
|
||||
| `target_project_id` | integer | Yes | The ID of the project added to the CI/CD job token inbound allowlist. |
|
||||
|
||||
If successful, returns [`201`](rest/index.md#status-codes) and the following response attributes:
|
||||
If successful, returns [`201`](rest/troubleshooting.md#status-codes) and the following response attributes:
|
||||
|
||||
| Attribute | Type | Description |
|
||||
|---------------------|---------|-------------|
|
||||
|
|
@ -204,7 +204,7 @@ Supported attributes:
|
|||
| `id` | integer/string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-paths). |
|
||||
| `target_project_id` | integer | Yes | The ID of the project that is removed from the CI/CD job token inbound allowlist. |
|
||||
|
||||
If successful, returns [`204`](rest/index.md#status-codes) and no response body.
|
||||
If successful, returns [`204`](rest/troubleshooting.md#status-codes) and no response body.
|
||||
|
||||
Example request:
|
||||
|
||||
|
|
@ -231,7 +231,7 @@ Supported attributes:
|
|||
|
||||
This endpoint supports [offset-based pagination](rest/index.md#offset-based-pagination).
|
||||
|
||||
If successful, returns [`200`](rest/index.md#status-codes) and a list of groups with limited fields for each project.
|
||||
If successful, returns [`200`](rest/troubleshooting.md#status-codes) and a list of groups with limited fields for each project.
|
||||
|
||||
Example request:
|
||||
|
||||
|
|
@ -269,7 +269,7 @@ Supported attributes:
|
|||
| `id` | integer/string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-paths). |
|
||||
| `target_group_id` | integer | Yes | The ID of the group added to the CI/CD job token groups allowlist. |
|
||||
|
||||
If successful, returns [`201`](rest/index.md#status-codes) and the following response attributes:
|
||||
If successful, returns [`201`](rest/troubleshooting.md#status-codes) and the following response attributes:
|
||||
|
||||
| Attribute | Type | Description |
|
||||
|---------------------|---------|-------------|
|
||||
|
|
@ -310,7 +310,7 @@ Supported attributes:
|
|||
| `id` | integer/string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-paths). |
|
||||
| `target_group_id` | integer | Yes | The ID of the group that is removed from the CI/CD job token groups allowlist. |
|
||||
|
||||
If successful, returns [`204`](rest/index.md#status-codes) and no response body.
|
||||
If successful, returns [`204`](rest/troubleshooting.md#status-codes) and no response body.
|
||||
|
||||
Example request:
|
||||
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ Supported attributes:
|
|||
| `id` | integer or string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-paths). |
|
||||
| `upload_id` | integer | Yes | ID of the upload. |
|
||||
|
||||
If successful, returns [`200`](rest/index.md#status-codes) and the uploaded file in the response body.
|
||||
If successful, returns [`200`](rest/troubleshooting.md#status-codes) and the uploaded file in the response body.
|
||||
|
||||
Example request:
|
||||
|
||||
|
|
@ -162,7 +162,7 @@ Supported attributes:
|
|||
| `secret` | string | Yes | 32-character secret of the upload. |
|
||||
| `filename` | string | Yes | Filename of the upload. |
|
||||
|
||||
If successful, returns [`200`](rest/index.md#status-codes) and the uploaded file in the response body.
|
||||
If successful, returns [`200`](rest/troubleshooting.md#status-codes) and the uploaded file in the response body.
|
||||
|
||||
Example request:
|
||||
|
||||
|
|
@ -191,7 +191,7 @@ Supported attributes:
|
|||
| `id` | integer or string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-paths). |
|
||||
| `upload_id` | integer | Yes | ID of the upload. |
|
||||
|
||||
If successful, returns [`204`](rest/index.md#status-codes) status code without any response body.
|
||||
If successful, returns [`204`](rest/troubleshooting.md#status-codes) status code without any response body.
|
||||
|
||||
Example request:
|
||||
|
||||
|
|
@ -221,7 +221,7 @@ Supported attributes:
|
|||
| `secret` | string | Yes | 32-character secret of the upload. |
|
||||
| `filename` | string | Yes | Filename of the upload. |
|
||||
|
||||
If successful, returns [`204`](rest/index.md#status-codes) status code without any response body.
|
||||
If successful, returns [`204`](rest/troubleshooting.md#status-codes) status code without any response body.
|
||||
|
||||
Example request:
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ Supported attributes:
|
|||
|-------------------------------|-----------------|----------|--------------------------------|
|
||||
| `id` | integer/string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-paths). |
|
||||
|
||||
If successful, returns [`200`](rest/index.md#status-codes) and a list of package protection rules.
|
||||
If successful, returns [`200`](rest/troubleshooting.md#status-codes) and a list of package protection rules.
|
||||
|
||||
Can return the following status codes:
|
||||
|
||||
|
|
@ -89,7 +89,7 @@ Supported attributes:
|
|||
| `package_type` | string | Yes | Package type protected by the protection rule. For example `npm`. |
|
||||
| `minimum_access_level_for_push` | string | Yes | Minimum GitLab access level able to push a package. Must be at least `maintainer`. For example `maintainer`, `owner` or `admin`. |
|
||||
|
||||
If successful, returns [`201`](rest/index.md#status-codes) and the created package protection rule.
|
||||
If successful, returns [`201`](rest/troubleshooting.md#status-codes) and the created package protection rule.
|
||||
|
||||
Can return the following status codes:
|
||||
|
||||
|
|
@ -132,7 +132,7 @@ Supported attributes:
|
|||
| `package_type` | string | No | Package type protected by the protection rule. For example `npm`. |
|
||||
| `minimum_access_level_for_push` | string | No | Minimum GitLab access level able to push a package. Must be at least `maintainer`. For example `maintainer`, `owner` or `admin`. |
|
||||
|
||||
If successful, returns [`200`](rest/index.md#status-codes) and the updated package protection rule.
|
||||
If successful, returns [`200`](rest/troubleshooting.md#status-codes) and the updated package protection rule.
|
||||
|
||||
Can return the following status codes:
|
||||
|
||||
|
|
@ -170,7 +170,7 @@ Supported attributes:
|
|||
| `id` | integer/string | Yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-paths). |
|
||||
| `package_protection_rule_id` | integer | Yes | ID of the package protection rule to be deleted. |
|
||||
|
||||
If successful, returns [`204 No Content`](rest/index.md#status-codes).
|
||||
If successful, returns [`204 No Content`](rest/troubleshooting.md#status-codes).
|
||||
|
||||
Can return the following status codes:
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ GET /projects/:id/releases
|
|||
| `sort` | string | no | The direction of the order. Either `desc` (default) for descending order or `asc` for ascending order. |
|
||||
| `include_html_description` | boolean | no | If `true`, a response includes HTML rendered Markdown of the release description. |
|
||||
|
||||
If successful, returns [`200 OK`](../../api/rest/index.md#status-codes) and the following
|
||||
If successful, returns [`200 OK`](../../api/rest/troubleshooting.md#status-codes) and the following
|
||||
response attributes:
|
||||
|
||||
| Attribute | Type | Description |
|
||||
|
|
@ -263,7 +263,7 @@ GET /projects/:id/releases/:tag_name
|
|||
| `tag_name` | string | yes | The Git tag the release is associated with. |
|
||||
| `include_html_description` | boolean | no | If `true`, a response includes HTML rendered Markdown of the release description. |
|
||||
|
||||
If successful, returns [`200 OK`](../../api/rest/index.md#status-codes) and the following
|
||||
If successful, returns [`200 OK`](../../api/rest/troubleshooting.md#status-codes) and the following
|
||||
response attributes:
|
||||
|
||||
| Attribute | Type | Description |
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ Supported attributes:
|
|||
| `id` | integer or string | Yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-paths). |
|
||||
| `mirror_id` | Integer | Yes | The remote mirror ID. |
|
||||
|
||||
If successful, returns [`204`](rest/index.md#status-codes).
|
||||
If successful, returns [`204`](rest/troubleshooting.md#status-codes).
|
||||
|
||||
Example request:
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,9 @@ notice:
|
|||
To make a REST API request:
|
||||
|
||||
- Submit a request to an API endpoint by using a REST API client.
|
||||
- The GitLab instance responds to the request. It returns a status code and if applicable, the requested data. The status code indicates the outcome of the request and is useful when [troubleshooting](#troubleshooting).
|
||||
- The GitLab instance responds to the request. It returns a status code and if applicable, the
|
||||
requested data. The status code indicates the outcome of the request and is useful when
|
||||
[troubleshooting](troubleshooting.md).
|
||||
|
||||
A REST API request must start with the root endpoint and the path.
|
||||
|
||||
|
|
@ -467,7 +469,7 @@ The correct encoding for the query parameter would be:
|
|||
|
||||
In some circumstances the API response may not be as you expect. Issues can include null values and
|
||||
redirection. If you receive a numeric status code in the response, see
|
||||
[Status codes](#status-codes).
|
||||
[Status codes](troubleshooting.md#status-codes).
|
||||
|
||||
### `null` vs `false`
|
||||
|
||||
|
|
@ -684,160 +686,3 @@ doesn't return the following headers:
|
|||
- `x-total`.
|
||||
- `x-total-pages`.
|
||||
- `rel="last"` `link`
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
When working with the REST API, you might encounter an issue.
|
||||
|
||||
To troubleshoot, refer to the REST API status codes. It might also help to include the HTTP response headers and exit code.
|
||||
|
||||
### Status codes
|
||||
|
||||
The GitLab REST API returns a status code with every response, according to context and action. The
|
||||
status code returned by a request can be useful when troubleshooting.
|
||||
|
||||
The following table gives an overview of how the API functions generally behave.
|
||||
|
||||
| Request type | Description |
|
||||
|:------------------------|:------------|
|
||||
| `GET` | Access one or more resources and return the result as JSON. |
|
||||
| `POST` | Returns `201 Created` if the resource is successfully created and return the newly created resource as JSON. |
|
||||
| `GET` / `PUT` / `PATCH` | Returns `200 OK` if the resource is accessed or modified successfully. The (modified) result is returned as JSON. |
|
||||
| `DELETE` | Returns `204 No Content` if the resource was deleted successfully or `202 Accepted` if the resource is scheduled to be deleted. |
|
||||
|
||||
The following table shows the possible return codes for API requests.
|
||||
|
||||
| Return values | Description |
|
||||
|:--------------------------|:------------|
|
||||
| `200 OK` | The `GET`, `PUT`, `PATCH` or `DELETE` request was successful, and the resource itself is returned as JSON. |
|
||||
| `201 Created` | The `POST` request was successful, and the resource is returned as JSON. |
|
||||
| `202 Accepted` | The `GET`, `PUT` or `DELETE` request was successful, and the resource is scheduled for processing. |
|
||||
| `204 No Content` | The server has successfully fulfilled the request, and there is no additional content to send in the response payload body. |
|
||||
| `301 Moved Permanently` | The resource has been definitively moved to the URL given by the `Location` headers. |
|
||||
| `304 Not Modified` | The resource hasn't been modified since the last request. |
|
||||
| `400 Bad Request` | A required attribute of the API request is missing. For example, the title of an issue is not given. |
|
||||
| `401 Unauthorized` | The user isn't authenticated. A valid [user token](#authentication) is necessary. |
|
||||
| `403 Forbidden` | The request isn't allowed. For example, the user isn't allowed to delete a project. |
|
||||
| `404 Not Found` | A resource couldn't be accessed. For example, an ID for a resource couldn't be found, or the user isn't authorized to access the resource. |
|
||||
| `405 Method Not Allowed` | The request isn't supported. |
|
||||
| `409 Conflict` | A conflicting resource already exists. For example, creating a project with a name that already exists. |
|
||||
| `412 Precondition Failed` | The request was denied. This can happen if the `If-Unmodified-Since` header is provided when trying to delete a resource, which was modified in between. |
|
||||
| `422 Unprocessable` | The entity couldn't be processed. |
|
||||
| `429 Too Many Requests` | The user exceeded the [application rate limits](../../administration/instance_limits.md#rate-limits). |
|
||||
| `500 Server Error` | While handling the request, something went wrong on the server. |
|
||||
| `503 Service Unavailable` | The server cannot handle the request because the server is temporarily overloaded. |
|
||||
|
||||
#### Status code 400
|
||||
|
||||
When working with the API you may encounter validation errors, in which case
|
||||
the API returns an HTTP `400` error.
|
||||
|
||||
Such errors appear in the following cases:
|
||||
|
||||
- A required attribute of the API request is missing (for example, the title of
|
||||
an issue isn't given).
|
||||
- An attribute did not pass the validation (for example, the user bio is too
|
||||
long).
|
||||
|
||||
When an attribute is missing, you receive something like:
|
||||
|
||||
```http
|
||||
HTTP/1.1 400 Bad Request
|
||||
Content-Type: application/json
|
||||
{
|
||||
"message":"400 (Bad request) \"title\" not given"
|
||||
}
|
||||
```
|
||||
|
||||
When a validation error occurs, error messages are different. They hold
|
||||
all details of validation errors:
|
||||
|
||||
```http
|
||||
HTTP/1.1 400 Bad Request
|
||||
Content-Type: application/json
|
||||
{
|
||||
"message": {
|
||||
"bio": [
|
||||
"is too long (maximum is 255 characters)"
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This makes error messages more machine-readable. The format can be described as
|
||||
follows:
|
||||
|
||||
```json
|
||||
{
|
||||
"message": {
|
||||
"<property-name>": [
|
||||
"<error-message>",
|
||||
"<error-message>",
|
||||
...
|
||||
],
|
||||
"<embed-entity>": {
|
||||
"<property-name>": [
|
||||
"<error-message>",
|
||||
"<error-message>",
|
||||
...
|
||||
],
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Include HTTP response headers
|
||||
|
||||
The HTTP response headers can provide extra information when troubleshooting.
|
||||
|
||||
To include HTTP response headers in the response, use the `--include` option:
|
||||
|
||||
```shell
|
||||
curl --include "https://gitlab.example.com/api/v4/projects"
|
||||
HTTP/2 200
|
||||
...
|
||||
```
|
||||
|
||||
### Include HTTP exit code
|
||||
|
||||
The HTTP exit code in the API response can provide extra information when troubleshooting.
|
||||
|
||||
To include the HTTP exit code, include the `--fail` option:
|
||||
|
||||
```shell
|
||||
curl --fail "https://gitlab.example.com/api/v4/does-not-exist"
|
||||
curl: (22) The requested URL returned error: 404
|
||||
```
|
||||
|
||||
### Requests detected as spam
|
||||
|
||||
REST API requests can be detected as spam. If a request is detected as spam and:
|
||||
|
||||
- A CAPTCHA service is not configured, an error response is returned. For example:
|
||||
|
||||
```json
|
||||
{"message":{"error":"Your snippet has been recognized as spam and has been discarded."}}
|
||||
```
|
||||
|
||||
- A CAPTCHA service is configured, you receive a response with:
|
||||
- `needs_captcha_response` set to `true`.
|
||||
- The `spam_log_id` and `captcha_site_key` fields set.
|
||||
|
||||
For example:
|
||||
|
||||
```json
|
||||
{"needs_captcha_response":true,"spam_log_id":42,"captcha_site_key":"REDACTED","message":{"error":"Your snippet has been recognized as spam. Please, change the content or solve the reCAPTCHA to proceed."}}
|
||||
```
|
||||
|
||||
- Use the `captcha_site_key` to obtain a CAPTCHA response value using the appropriate CAPTCHA API.
|
||||
Only [Google reCAPTCHA v2](https://developers.google.com/recaptcha/docs/display) is supported.
|
||||
- Resubmit the request with the `X-GitLab-Captcha-Response` and `X-GitLab-Spam-Log-Id` headers set.
|
||||
|
||||
```shell
|
||||
export CAPTCHA_RESPONSE="<CAPTCHA response obtained from CAPTCHA service>"
|
||||
export SPAM_LOG_ID="<spam_log_id obtained from initial REST response>"
|
||||
curl --request POST --header "PRIVATE-TOKEN: $PRIVATE_TOKEN" --header "X-GitLab-Captcha-
|
||||
Response: $CAPTCHA_RESPONSE" --header "X-GitLab-Spam-Log-Id: $SPAM_LOG_ID"
|
||||
"https://gitlab.example.com/api/v4/snippets?
|
||||
title=Title&file_name=FileName&content=Content&visibility=public"
|
||||
```
|
||||
|
|
|
|||
|
|
@ -0,0 +1,167 @@
|
|||
---
|
||||
stage: Foundations
|
||||
group: Import and Integrate
|
||||
description: Programmatic interaction with GitLab.
|
||||
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
||||
---
|
||||
|
||||
# REST API troubleshooting
|
||||
|
||||
DETAILS:
|
||||
**Tier:** Free, Premium, Ultimate
|
||||
**Offering:** GitLab.com, Self-managed, GitLab Dedicated
|
||||
|
||||
When working with the REST API, you might encounter an issue.
|
||||
|
||||
To troubleshoot, refer to the REST API status codes. It might also help to include the HTTP response headers and exit code.
|
||||
|
||||
## Status codes
|
||||
|
||||
The GitLab REST API returns a status code with every response, according to context and action. The
|
||||
status code returned by a request can be useful when troubleshooting.
|
||||
|
||||
The following table gives an overview of how the API functions generally behave.
|
||||
|
||||
| Request type | Description |
|
||||
|:------------------------|:------------|
|
||||
| `GET` | Access one or more resources and return the result as JSON. |
|
||||
| `POST` | Returns `201 Created` if the resource is successfully created and return the newly created resource as JSON. |
|
||||
| `GET` / `PUT` / `PATCH` | Returns `200 OK` if the resource is accessed or modified successfully. The (modified) result is returned as JSON. |
|
||||
| `DELETE` | Returns `204 No Content` if the resource was deleted successfully or `202 Accepted` if the resource is scheduled to be deleted. |
|
||||
|
||||
The following table shows the possible return codes for API requests.
|
||||
|
||||
| Return values | Description |
|
||||
|:--------------------------|:------------|
|
||||
| `200 OK` | The `GET`, `PUT`, `PATCH` or `DELETE` request was successful, and the resource itself is returned as JSON. |
|
||||
| `201 Created` | The `POST` request was successful, and the resource is returned as JSON. |
|
||||
| `202 Accepted` | The `GET`, `PUT` or `DELETE` request was successful, and the resource is scheduled for processing. |
|
||||
| `204 No Content` | The server has successfully fulfilled the request, and there is no additional content to send in the response payload body. |
|
||||
| `301 Moved Permanently` | The resource has been definitively moved to the URL given by the `Location` headers. |
|
||||
| `304 Not Modified` | The resource hasn't been modified since the last request. |
|
||||
| `400 Bad Request` | A required attribute of the API request is missing. For example, the title of an issue is not given. |
|
||||
| `401 Unauthorized` | The user isn't authenticated. A valid [user token](index.md#authentication) is necessary. |
|
||||
| `403 Forbidden` | The request isn't allowed. For example, the user isn't allowed to delete a project. |
|
||||
| `404 Not Found` | A resource couldn't be accessed. For example, an ID for a resource couldn't be found, or the user isn't authorized to access the resource. |
|
||||
| `405 Method Not Allowed` | The request isn't supported. |
|
||||
| `409 Conflict` | A conflicting resource already exists. For example, creating a project with a name that already exists. |
|
||||
| `412 Precondition Failed` | The request was denied. This can happen if the `If-Unmodified-Since` header is provided when trying to delete a resource, which was modified in between. |
|
||||
| `422 Unprocessable` | The entity couldn't be processed. |
|
||||
| `429 Too Many Requests` | The user exceeded the [application rate limits](../../administration/instance_limits.md#rate-limits). |
|
||||
| `500 Server Error` | While handling the request, something went wrong on the server. |
|
||||
| `503 Service Unavailable` | The server cannot handle the request because the server is temporarily overloaded. |
|
||||
|
||||
### Status code 400
|
||||
|
||||
When working with the API you may encounter validation errors, in which case
|
||||
the API returns an HTTP `400` error.
|
||||
|
||||
Such errors appear in the following cases:
|
||||
|
||||
- A required attribute of the API request is missing (for example, the title of
|
||||
an issue isn't given).
|
||||
- An attribute did not pass the validation (for example, the user bio is too
|
||||
long).
|
||||
|
||||
When an attribute is missing, you receive something like:
|
||||
|
||||
```http
|
||||
HTTP/1.1 400 Bad Request
|
||||
Content-Type: application/json
|
||||
{
|
||||
"message":"400 (Bad request) \"title\" not given"
|
||||
}
|
||||
```
|
||||
|
||||
When a validation error occurs, error messages are different. They hold
|
||||
all details of validation errors:
|
||||
|
||||
```http
|
||||
HTTP/1.1 400 Bad Request
|
||||
Content-Type: application/json
|
||||
{
|
||||
"message": {
|
||||
"bio": [
|
||||
"is too long (maximum is 255 characters)"
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This makes error messages more machine-readable. The format can be described as
|
||||
follows:
|
||||
|
||||
```json
|
||||
{
|
||||
"message": {
|
||||
"<property-name>": [
|
||||
"<error-message>",
|
||||
"<error-message>",
|
||||
...
|
||||
],
|
||||
"<embed-entity>": {
|
||||
"<property-name>": [
|
||||
"<error-message>",
|
||||
"<error-message>",
|
||||
...
|
||||
],
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Include HTTP response headers
|
||||
|
||||
The HTTP response headers can provide extra information when troubleshooting.
|
||||
|
||||
To include HTTP response headers in the response, use the `--include` option:
|
||||
|
||||
```shell
|
||||
curl --include "https://gitlab.example.com/api/v4/projects"
|
||||
HTTP/2 200
|
||||
...
|
||||
```
|
||||
|
||||
## Include HTTP exit code
|
||||
|
||||
The HTTP exit code in the API response can provide extra information when troubleshooting.
|
||||
|
||||
To include the HTTP exit code, include the `--fail` option:
|
||||
|
||||
```shell
|
||||
curl --fail "https://gitlab.example.com/api/v4/does-not-exist"
|
||||
curl: (22) The requested URL returned error: 404
|
||||
```
|
||||
|
||||
## Requests detected as spam
|
||||
|
||||
REST API requests can be detected as spam. If a request is detected as spam and:
|
||||
|
||||
- A CAPTCHA service is not configured, an error response is returned. For example:
|
||||
|
||||
```json
|
||||
{"message":{"error":"Your snippet has been recognized as spam and has been discarded."}}
|
||||
```
|
||||
|
||||
- A CAPTCHA service is configured, you receive a response with:
|
||||
- `needs_captcha_response` set to `true`.
|
||||
- The `spam_log_id` and `captcha_site_key` fields set.
|
||||
|
||||
For example:
|
||||
|
||||
```json
|
||||
{"needs_captcha_response":true,"spam_log_id":42,"captcha_site_key":"REDACTED","message":{"error":"Your snippet has been recognized as spam. Please, change the content or solve the reCAPTCHA to proceed."}}
|
||||
```
|
||||
|
||||
- Use the `captcha_site_key` to obtain a CAPTCHA response value using the appropriate CAPTCHA API.
|
||||
Only [Google reCAPTCHA v2](https://developers.google.com/recaptcha/docs/display) is supported.
|
||||
- Resubmit the request with the `X-GitLab-Captcha-Response` and `X-GitLab-Spam-Log-Id` headers set.
|
||||
|
||||
```shell
|
||||
export CAPTCHA_RESPONSE="<CAPTCHA response obtained from CAPTCHA service>"
|
||||
export SPAM_LOG_ID="<spam_log_id obtained from initial REST response>"
|
||||
curl --request POST --header "PRIVATE-TOKEN: $PRIVATE_TOKEN" --header "X-GitLab-Captcha-
|
||||
Response: $CAPTCHA_RESPONSE" --header "X-GitLab-Spam-Log-Id: $SPAM_LOG_ID"
|
||||
"https://gitlab.example.com/api/v4/snippets?
|
||||
title=Title&file_name=FileName&content=Content&visibility=public"
|
||||
```
|
||||
|
|
@ -30,7 +30,7 @@ Supported attributes:
|
|||
|:------------------|:--------|:---------|:----------------------|
|
||||
| `id` | integer/string | yes | The ID or [URL-encoded path of the group](rest/index.md#namespaced-paths) |
|
||||
|
||||
If successful, returns [`200`](rest/index.md#status-codes) and the following
|
||||
If successful, returns [`200`](rest/troubleshooting.md#status-codes) and the following
|
||||
response attributes:
|
||||
|
||||
| Attribute | Type | Description |
|
||||
|
|
@ -180,7 +180,7 @@ Supported attributes:
|
|||
|:----------|:---------------|:---------|:------------|
|
||||
| `id` | integer/string | yes | ID or [URL-encoded path of the group](rest/index.md#namespaced-paths). |
|
||||
|
||||
If successful, returns [`200`](rest/index.md#status-codes) and the following response attributes:
|
||||
If successful, returns [`200`](rest/troubleshooting.md#status-codes) and the following response attributes:
|
||||
|
||||
| Attribute | Type | Description |
|
||||
|:--------------------|:--------|:------------|
|
||||
|
|
@ -226,7 +226,7 @@ Supported attributes:
|
|||
| `id` | integer/string | yes | ID or [URL-encoded path of the group](rest/index.md#namespaced-paths). |
|
||||
| `saml_group_name` | string | yes | Name of the SAML group. |
|
||||
|
||||
If successful, returns [`200`](rest/index.md#status-codes) and the following response attributes:
|
||||
If successful, returns [`200`](rest/troubleshooting.md#status-codes) and the following response attributes:
|
||||
|
||||
| Attribute | Type | Description |
|
||||
|:-----------------|:--------|:------------|
|
||||
|
|
@ -267,7 +267,7 @@ Supported attributes:
|
|||
| `access_level` | integer | yes | [Role (`access_level`)](members.md#roles) for members of the SAML group. |
|
||||
| `member_role_id` | integer | no | [Member Role ID (`member_role_id`)](member_roles.md) for members of the SAML group. |
|
||||
|
||||
If successful, returns [`201`](rest/index.md#status-codes) and the following response attributes:
|
||||
If successful, returns [`201`](rest/troubleshooting.md#status-codes) and the following response attributes:
|
||||
|
||||
| Attribute | Type | Description |
|
||||
|:-----------------|:--------|:------------|
|
||||
|
|
@ -312,4 +312,4 @@ Example request:
|
|||
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/1/saml_group_links/saml-group-1"
|
||||
```
|
||||
|
||||
If successful, returns [`204`](rest/index.md#status-codes) status code without any response body.
|
||||
If successful, returns [`204`](rest/troubleshooting.md#status-codes) status code without any response body.
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ Supported attributes:
|
|||
|:------------------|:--------|:---------|:----------------------|
|
||||
| `id` | integer/string | Yes | The ID or [URL-encoded path of the group](rest/index.md#namespaced-paths) |
|
||||
|
||||
If successful, returns [`200`](rest/index.md#status-codes) and the following
|
||||
If successful, returns [`200`](rest/troubleshooting.md#status-codes) and the following
|
||||
response attributes:
|
||||
|
||||
| Attribute | Type | Description |
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ curl --header "PRIVATE-TOKEN: <your_access_token>" "https://primary.example.com/
|
|||
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://primary.example.com/api/v4/admin/search/mirations/BackfillProjectPermissionsInBlobsUsingPermutations"
|
||||
```
|
||||
|
||||
If successful, returns [`200`](rest/index.md#status-codes) and the following
|
||||
If successful, returns [`200`](rest/troubleshooting.md#status-codes) and the following
|
||||
response attributes:
|
||||
|
||||
| Attribute | Type | Description |
|
||||
|
|
|
|||
|
|
@ -192,3 +192,56 @@ Sample response:
|
|||
},
|
||||
...
|
||||
```
|
||||
|
||||
## Events Tracking API
|
||||
|
||||
Tracks internal events in GitLab. Requires a personal access token with the `api` or `ai_workflows` scope.
|
||||
|
||||
To track events to Snowplow, set the `send_to_snowplow` parameter to `true`.
|
||||
|
||||
Example request:
|
||||
|
||||
```shell
|
||||
curl --header "PRIVATE-TOKEN: <your_access_token>" \
|
||||
--header "Content-Type: application/json" \
|
||||
--request POST \
|
||||
--data '{
|
||||
"event": "mr_name_changed",
|
||||
"send_to_snowplow": true,
|
||||
"namespace_id": 1,
|
||||
"project_id": 1,
|
||||
"additional_properties": {
|
||||
"lang": "eng"
|
||||
}
|
||||
}' \
|
||||
"https://gitlab.example.com/api/v4/usage_data/track_event"
|
||||
```
|
||||
|
||||
If multiple events tracking is required, send an array of events to the `/track_events` endpoint:
|
||||
|
||||
```shell
|
||||
curl --header "PRIVATE-TOKEN: <your_access_token>" \
|
||||
--header "Content-Type: application/json" \
|
||||
--request POST \
|
||||
--data '{
|
||||
"events": [
|
||||
{
|
||||
"event": "mr_name_changed",
|
||||
"namespace_id": 1,
|
||||
"project_id": 1,
|
||||
"additional_properties": {
|
||||
"lang": "eng"
|
||||
}
|
||||
},
|
||||
{
|
||||
"event": "mr_name_changed",
|
||||
"namespace_id": 2,
|
||||
"project_id": 2,
|
||||
"additional_properties": {
|
||||
"lang": "eng"
|
||||
}
|
||||
}
|
||||
]
|
||||
}' \
|
||||
"https://gitlab.example.com/api/v4/usage_data/track_events"
|
||||
```
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ Get the GitLab public key for signing web commits.
|
|||
GET /web_commits/public_key
|
||||
```
|
||||
|
||||
If successful, returns [`200`](rest/index.md#status-codes) and the following
|
||||
If successful, returns [`200`](rest/troubleshooting.md#status-codes) and the following
|
||||
response attribute:
|
||||
|
||||
| Attribute | Type | Description |
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ Some examples of breaking changes are:
|
|||
- Changing the type of fields in the response. In a JSON response, this would be a change of any `Number`, `String`, `Boolean`, `Array`, or `Object` type to another type.
|
||||
- Adding a new **required** argument.
|
||||
- Changing authentication, authorization, or other header requirements.
|
||||
- Changing [any status code](../api/rest/index.md#status-codes) other than `500`.
|
||||
- Changing [any status code](../api/rest/troubleshooting.md#status-codes) other than `500`.
|
||||
|
||||
## What is not a breaking change
|
||||
|
||||
|
|
@ -125,7 +125,7 @@ Some examples of non-breaking changes:
|
|||
|
||||
- Any additive change, such as adding endpoints, non-required arguments, fields, or enum values.
|
||||
- Changes to error messages.
|
||||
- Changes from a `500` status code to [any supported status code](../api/rest/index.md#status-codes) (this is a bugfix).
|
||||
- Changes from a `500` status code to [any supported status code](../api/rest/troubleshooting.md#status-codes) (this is a bugfix).
|
||||
- Changes to the order of fields returned in a response.
|
||||
|
||||
## Experimental, beta, and generally available features
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ Supported attributes:
|
|||
| `attribute` | datatype | No | Detailed description. |
|
||||
| `attribute` | datatype | No | Detailed description. |
|
||||
|
||||
If successful, returns [`<status_code>`](rest/index.md#status-codes) and the following
|
||||
If successful, returns [`<status_code>`](rest/troubleshooting.md#status-codes) and the following
|
||||
response attributes:
|
||||
|
||||
| Attribute | Type | Description |
|
||||
|
|
@ -184,10 +184,10 @@ For example:
|
|||
## Response body description
|
||||
|
||||
Start the description with the following sentence, replacing `status code` with the
|
||||
relevant [HTTP status code](../../api/rest/index.md#status-codes), for example:
|
||||
relevant [HTTP status code](../../api/rest/troubleshooting.md#status-codes), for example:
|
||||
|
||||
```markdown
|
||||
If successful, returns [`200 OK`](../../api/rest/index.md#status-codes) and the
|
||||
If successful, returns [`200 OK`](../../api/rest/troubleshooting.md#status-codes) and the
|
||||
following response attributes:
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -363,5 +363,5 @@ onError(error) {
|
|||
```
|
||||
|
||||
Note that this prefixing must not be used for API responses. Instead follow the
|
||||
[REST API](../../../api/rest/index.md#status-code-400),
|
||||
[REST API](../../../api/rest/troubleshooting.md#status-code-400),
|
||||
or [GraphQL guides](../../api_graphql_styleguide.md#error-handling) on how to consume error objects.
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ Supported attributes:
|
|||
|--------------------------|----------|----------|-----------------------|
|
||||
| `gl_repository` | string | Yes | The `gl_repository` ID of the repository to query |
|
||||
|
||||
If successful, returns [`200`](../../api/rest/index.md#status-codes) and the following
|
||||
If successful, returns [`200`](../../api/rest/troubleshooting.md#status-codes) and the following
|
||||
response attributes:
|
||||
|
||||
| Attribute | Type | Description |
|
||||
|
|
|
|||
|
|
@ -564,6 +564,11 @@ describe('DeleteApplication', () => {
|
|||
});
|
||||
```
|
||||
|
||||
### Using Internal Events API
|
||||
|
||||
You can also use our API to track events from other systems connected to a GitLab instance.
|
||||
See the [Usage Data API documentation](../../../api/usage_data.md#events-tracking-api) for more information.
|
||||
|
||||
### Internal Events on other systems
|
||||
|
||||
Apart from the GitLab codebase, we are using Internal Events for the systems listed below.
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ To add this support, you must implement the following areas as applicable:
|
|||
for a feature which does not yet have support.
|
||||
1. [REST API](rest_api.md): The changes needed to add
|
||||
spam or CAPTCHA support to Grape REST API endpoints. Refer to the related
|
||||
[REST API documentation](../../api/rest/index.md#requests-detected-as-spam).
|
||||
[REST API documentation](../../api/rest/troubleshooting.md#requests-detected-as-spam).
|
||||
1. [GraphQL API](graphql_api.md): The changes needed to add spam or CAPTCHA support to GraphQL
|
||||
mutations. Refer to the related
|
||||
[GraphQL API documentation](../../api/graphql/index.md#resolve-mutations-detected-as-spam).
|
||||
|
|
@ -48,6 +48,6 @@ The possible values include:
|
|||
## Related topics
|
||||
|
||||
- [Spam and CAPTCHA support in the GraphQL API](../../api/graphql/index.md#resolve-mutations-detected-as-spam)
|
||||
- [Spam and CAPTCHA support in the REST API](../../api/rest/index.md#requests-detected-as-spam)
|
||||
- [Spam and CAPTCHA support in the REST API](../../api/rest/troubleshooting.md#requests-detected-as-spam)
|
||||
- [reCAPTCHA Spam and Anti-bot Protection](../../integration/recaptcha.md)
|
||||
- [Akismet and spam logs](../../integration/akismet.md)
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ The main steps are:
|
|||
- Raise a Grape `#error!` exception with a descriptive spam-specific error message.
|
||||
- Include the relevant information added as error fields to the response.
|
||||
For more details on these fields, refer to the section in the REST API documentation on
|
||||
[Resolve requests detected as spam](../../api/rest/index.md#requests-detected-as-spam).
|
||||
[Resolve requests detected as spam](../../api/rest/troubleshooting.md#requests-detected-as-spam).
|
||||
|
||||
NOTE:
|
||||
If you use the standard ApolloLink or Axios interceptor CAPTCHA support described
|
||||
|
|
|
|||
|
|
@ -56,6 +56,23 @@ To enable [exact code search](../../user/search/exact_code_search.md) in GitLab:
|
|||
1. Select the **Enable indexing for exact code search** and **Enable exact code search** checkboxes.
|
||||
1. Select **Save changes**.
|
||||
|
||||
## Delete offline nodes automatically
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- You must have administrator access to the instance.
|
||||
|
||||
You can automatically delete Zoekt nodes that are offline for more than 12 hours
|
||||
and their related indices, repositories, and tasks.
|
||||
|
||||
To delete offline nodes automatically:
|
||||
|
||||
1. On the left sidebar, at the bottom, select **Admin**.
|
||||
1. Select **Settings > Search**.
|
||||
1. Expand **Exact code search configuration**.
|
||||
1. Select the **Delete offline nodes automatically after 12 hours** checkbox.
|
||||
1. Select **Save changes**.
|
||||
|
||||
## Index root namespaces automatically
|
||||
|
||||
Prerequisites:
|
||||
|
|
|
|||
|
|
@ -581,6 +581,7 @@ Audit event types belong to the following product categories.
|
|||
| [`user_admin_status_updated`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/65168) | Adds an audit event when a user is either made an administrator, or removed as an administrator | **{check-circle}** Yes | **{check-circle}** Yes | GitLab [14.1](https://gitlab.com/gitlab-org/gitlab/-/issues/323905) | User |
|
||||
| [`user_auditor_status_updated`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/136456) | Adds an audit event when a user is either made an auditor, or removed as an auditor | **{check-circle}** Yes | **{check-circle}** Yes | GitLab [16.6](https://gitlab.com/gitlab-org/gitlab/-/issues/430235) | User |
|
||||
| [`user_email_address_updated`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/2103) | Adds an audit event when a user updates their email address | **{check-circle}** Yes | **{check-circle}** Yes | GitLab [10.1](https://gitlab.com/gitlab-org/gitlab-ee/issues/1370) | User |
|
||||
| [`user_name_updated`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/167484) | Event triggered on updating a user's name | **{check-circle}** Yes | **{check-circle}** Yes | GitLab [17.5](https://gitlab.com/gitlab-org/gitlab/-/issues/486532) | User |
|
||||
| [`user_profile_visiblity_updated`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/129149) | Triggered when user toggles private profile user setting | **{dotted-circle}** No | **{check-circle}** Yes | GitLab [16.3](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/129149) | User |
|
||||
| [`user_username_updated`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/106086) | Event triggered on updating a user's username | **{check-circle}** Yes | **{check-circle}** Yes | GitLab [15.7](https://gitlab.com/gitlab-org/gitlab/-/issues/369329) | User |
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,49 @@
|
|||
---
|
||||
stage: AI-powered
|
||||
group: AI Framework
|
||||
description: AI-powered features and functionality.
|
||||
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
|
||||
---
|
||||
|
||||
# Get started with GitLab Duo Code Suggestions
|
||||
|
||||
GitLab Duo is an AI-powered enhancement integrated into the GitLab DevSecOps platform, designed to boost productivity and efficiency. It leverages advanced large language models (LLMs) from Google Vertex AI and Anthropic Claude to provide various AI-driven features. These features operate independently, ensuring that the core functionality of GitLab remains unaffected even if an AI feature encounters issues.
|
||||
|
||||
GitLab Duo Code Suggestions helps you write code more efficiently by using generative AI to suggest code while you’re developing.
|
||||
|
||||
## Step 1: Understand how Code Suggestions works
|
||||
|
||||
Code Suggestions is made up of code completion and code generation. These are two distinct features that help developers write code more efficiently:
|
||||
|
||||
| | Code completion | Code generation |
|
||||
| :---- | :---- | :---- |
|
||||
| Purpose | Provides suggestions for completing the current line of code. | Generates new code based on a natural language comment. |
|
||||
| Trigger | Triggers when typing, usually with a short delay. | Triggers when pressing Enter after writing a comment that includes specific keywords. |
|
||||
| Scope | Limited to the current line or small block of code. | Can generate entire methods, functions, or even classes based on the context. |
|
||||
| Accuracy | More accurate for simple tasks and short blocks of code. | Can be more accurate for complex tasks and large blocks of code due to its ability to analyze context and use a larger language model. |
|
||||
| When to use | Use code completion for quick tasks, small code snippets, or when you need a slight boost in productivity. | Use code generation for more complex tasks, larger codebases, or when you want to write new code from scratch based on a natural language description. |
|
||||
|
||||
## Step 2: Supported languages, text editors and IDEs
|
||||
|
||||
To ensure your preferred tooling is supported, review the:
|
||||
|
||||
[Supported languages](../project/repository/code_suggestions/supported_extensions.md#supported-languages)
|
||||
[Supported editors](../project/repository/code_suggestions/supported_extensions.md#supported-editor-extensions)
|
||||
|
||||
## Step 3: Enable Code Suggestions
|
||||
|
||||
First, [purchase seats for GitLab Duo](../../subscriptions/subscription-add-ons.md#purchase-gitlab-duo-seats).
|
||||
|
||||
Then, assign seats to users to grant access to GitLab Duo for:
|
||||
|
||||
- [Self-managed](../../subscriptions/subscription-add-ons.md#for-self-managed)
|
||||
- [Dedicated](../../subscriptions/subscription-add-ons.md#for-self-managed)
|
||||
- [GitLab.com](../../subscriptions/subscription-add-ons.md#for-gitlabcom-1)
|
||||
|
||||
## Step 4: Using Code Suggestions
|
||||
|
||||
Follow the documentation to [use Code Suggestions](../project/repository/code_suggestions/index.md#use-code-suggestions).
|
||||
|
||||
## Step 5: Troubleshooting common challenges
|
||||
|
||||
[Troubleshoot](../project/repository/code_suggestions/troubleshooting.md) commonly faced challenges.
|
||||
|
|
@ -91,7 +91,6 @@ For example: `https://gitlab.com/gitlab-org/gitlab/-/issues/new?issuable_templat
|
|||
### Supported variables in merge request templates
|
||||
|
||||
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/89810) in GitLab 15.7.
|
||||
> - `merge_request_author` [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/152510) in GitLab 17.1.
|
||||
|
||||
NOTE:
|
||||
This feature is available only for
|
||||
|
|
@ -106,7 +105,6 @@ your merge request template with their values:
|
|||
| `%{co_authored_by}` | Names and emails of commit authors in a `Co-authored-by` Git commit trailer format. Limited to authors of 100 most recent commits in merge request. | `Co-authored-by: Zane Doe <zdoe@example.com>` <br> `Co-authored-by: Blake Smith <bsmith@example.com>` |
|
||||
| `%{first_commit}` | Full message of the first commit in merge request diff. | `Update README.md` |
|
||||
| `%{first_multiline_commit}` | Full message of the first commit that's not a merge commit and has more than one line in message body. Merge request title if all commits aren't multiline. | `Update README.md` <br><br> `Improved project description in readme file.` |
|
||||
| `%{merge_request_author}` | Name and email of the merge request author. | `Zane Doe <zdoe@example.com>` |
|
||||
| `%{source_branch}` | The name of the branch being merged. | `my-feature-branch` |
|
||||
| `%{target_branch}` | The name of the branch that the changes are applied to. | `main` |
|
||||
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ GitLab creates a squash commit message with this template:
|
|||
> - `reviewed_by` variable [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/378352) in GitLab 15.7.
|
||||
> - `local_reference` variable [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/199823) in GitLab 16.1.
|
||||
> - `source_project_id` variables [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/128553) in GitLab 16.3.
|
||||
> - `merge_request_author` variable [introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/152510) in GitLab 17.1.
|
||||
|
||||
Commit message templates support these variables:
|
||||
|
||||
|
|
@ -91,6 +92,7 @@ Commit message templates support these variables:
|
|||
| `%{reviewed_by}` | Line-separated list of the merge request reviewers, based on users who submit a review via batch comments, in a `Reviewed-by` Git commit trailer format. | `Reviewed-by: Sidney Jones <sjones@example.com>` <br> `Reviewed-by: Zhang Wei <zwei@example.com>` |
|
||||
| `%{approved_by}` | Line-separated list of the merge request approvers in a `Approved-by` Git commit trailer format. | `Approved-by: Sidney Jones <sjones@example.com>` <br> `Approved-by: Zhang Wei <zwei@example.com>` |
|
||||
| `%{merged_by}` | User who merged the merge request. | `Alex Garcia <agarcia@example.com>` |
|
||||
| `%{merge_request_author}` | Name and email of the merge request author. | `Zane Doe <zdoe@example.com>` |
|
||||
| `%{co_authored_by}` | Names and emails of commit authors in a `Co-authored-by` Git commit trailer format. Limited to authors of 100 most recent commits in merge request. | `Co-authored-by: Zane Doe <zdoe@example.com>` <br> `Co-authored-by: Blake Smith <bsmith@example.com>` |
|
||||
| `%{all_commits}` | Messages from all commits in the merge request. Limited to 100 most recent commits. Skips commit bodies exceeding 100 KiB and merge commit messages. | `* Feature introduced` <br><br> `This commit implements feature` <br> `Changelog:added` <br><br> `* Bug fixed` <br><br> `* Documentation improved` <br><br>`This commit introduced better docs.`|
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ module API
|
|||
documentation: { example: 1234 }
|
||||
optional :additional_properties, type: Hash, desc: 'Additional properties to be tracked',
|
||||
documentation: { example: { label: 'login_button', value: 1 } }
|
||||
optional :send_to_snowplow, type: Boolean, desc: 'Send the tracked event to Snowplow',
|
||||
documentation: { example: true, default: false }
|
||||
end
|
||||
|
||||
def process_event(params)
|
||||
|
|
@ -27,12 +29,13 @@ module API
|
|||
namespace_id = params[:namespace_id]
|
||||
project_id = params[:project_id]
|
||||
additional_properties = params.fetch(:additional_properties, {}).symbolize_keys
|
||||
send_snowplow_event = !!params[:send_to_snowplow]
|
||||
|
||||
Gitlab::Tracking::AiTracking.track_event(event_name, additional_properties.merge(user: current_user))
|
||||
|
||||
track_event(
|
||||
event_name,
|
||||
send_snowplow_event: false,
|
||||
send_snowplow_event: send_snowplow_event,
|
||||
user: current_user,
|
||||
namespace_id: namespace_id,
|
||||
project_id: project_id,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Gitlab
|
||||
module BackgroundMigration
|
||||
class BackfillCiBuildsRunnerSessionProjectId < BackfillDesiredShardingKeyJob
|
||||
operation_name :backfill_ci_builds_runner_session_project_id
|
||||
feature_category :runner
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -131,6 +131,10 @@ module Gitlab
|
|||
def can_read_project?(request, project)
|
||||
return true if project.public?
|
||||
|
||||
if Feature.enabled?(:go_get_handle_401_error, Feature.current_request) && !has_basic_credentials?(request)
|
||||
return false
|
||||
end
|
||||
|
||||
login, password = user_name_and_password(request)
|
||||
auth_result = Gitlab::Auth.find_for_git_client(login, password, project: project, request: request)
|
||||
|
||||
|
|
|
|||
|
|
@ -18131,6 +18131,9 @@ msgstr ""
|
|||
msgid "Delete label: %{labelName}"
|
||||
msgstr ""
|
||||
|
||||
msgid "Delete offline nodes automatically after %{label}"
|
||||
msgstr ""
|
||||
|
||||
msgid "Delete pipeline"
|
||||
msgstr ""
|
||||
|
||||
|
|
@ -31626,7 +31629,7 @@ msgstr ""
|
|||
msgid "Labels"
|
||||
msgstr ""
|
||||
|
||||
msgid "Labels can be applied to issues and merge requests to categorize them."
|
||||
msgid "Labels can be applied to issues and merge requests to categorize them"
|
||||
msgstr ""
|
||||
|
||||
msgid "Labels can be applied to issues and merge requests. Group labels are available for any project within the group."
|
||||
|
|
|
|||
|
|
@ -10,10 +10,6 @@ module QA
|
|||
element 'create-new-label-button'
|
||||
end
|
||||
|
||||
view 'app/views/shared/empty_states/_labels.html.haml' do
|
||||
element 'label-svg-content'
|
||||
end
|
||||
|
||||
view 'app/views/shared/empty_states/_priority_labels.html.haml' do
|
||||
element 'label-svg-content'
|
||||
end
|
||||
|
|
|
|||
|
|
@ -68,6 +68,15 @@ tests = [
|
|||
]
|
||||
},
|
||||
|
||||
{
|
||||
explanation: 'https://gitlab.com/gitlab-org/gitlab/-/issues/466068#note_1987902951',
|
||||
changed_file: 'ee/lib/audit_events/strategies/instance/amazon_s3_destination_strategy.rb',
|
||||
expected: %w[
|
||||
ee/spec/lib/audit_events/strategies/instance/amazon_s3_destination_strategy_spec.rb
|
||||
ee/spec/lib/audit_events/external_destination_streamer_spec.rb
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
explanation: 'Tooling should map to respective spec',
|
||||
changed_file: 'tooling/danger/specs/project_factory_suggestion.rb',
|
||||
|
|
@ -461,6 +470,52 @@ tests = [
|
|||
ee/spec/requests/api/graphql/remote_development/workspace/with_id_arg_spec.rb
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
explanation: 'https://gitlab.com/gitlab-org/gitlab/-/issues/466068#note_1987834618',
|
||||
changed_file: 'ee/app/replicators/geo/ci_secure_file_replicator.rb',
|
||||
expected: %w[
|
||||
ee/spec/replicators/geo/ci_secure_file_replicator_spec.rb
|
||||
ee/spec/models/geo_node_status_spec.rb
|
||||
]
|
||||
},
|
||||
|
||||
# Why is it commented out?
|
||||
#
|
||||
# We cannot uncomment this, as this "spec" would fail as soon as we add/remove a file in
|
||||
# the "spec/features" folder hierarchy that would contain the word navbar/sidebar.
|
||||
#
|
||||
# {
|
||||
# explanation: 'https://gitlab.com/gitlab-org/gitlab/-/issues/466068#note_1988359861',
|
||||
# changed_file: 'lib/sidebars/projects/menus/issues_menu.rb',
|
||||
# expected: %w[
|
||||
# spec/features/boards/sidebar_spec.rb
|
||||
# spec/features/dashboard/navbar_spec.rb
|
||||
# spec/features/explore/navbar_spec.rb
|
||||
# spec/features/groups/navbar_spec.rb
|
||||
# spec/features/projects/navbar_spec.rb
|
||||
# spec/lib/sidebars/projects/menus/issues_menu_spec.rb
|
||||
# ]
|
||||
# },
|
||||
|
||||
# Why is it commented out?
|
||||
#
|
||||
# We cannot uncomment this, as this "spec" would fail as soon as we add/remove a file in
|
||||
# the "spec/features" folder hierarchy that would contain the word navbar/sidebar.
|
||||
#
|
||||
# {
|
||||
# explanation: 'https://gitlab.com/gitlab-org/gitlab/-/issues/466068#note_1988359861',
|
||||
# changed_file: 'ee/lib/sidebars/groups/menus/epics_menu.rb',
|
||||
# expected: %w[
|
||||
# ee/spec/features/boards/sidebar_spec.rb
|
||||
# ee/spec/features/dashboard/navbar_spec.rb
|
||||
# ee/spec/features/groups/navbar_spec.rb
|
||||
# ee/spec/features/merge_request/sidebar_spec.rb
|
||||
# ee/spec/features/projects/navbar_spec.rb
|
||||
# ee/spec/lib/sidebars/groups/menus/epics_menu_spec.rb
|
||||
# ]
|
||||
# },
|
||||
|
||||
{
|
||||
explanation: 'Run database dictionary related specs on db/docs changes.',
|
||||
changed_file: 'db/docs/design_management_repositories.yml',
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ RSpec.describe 'Database schema', feature_category: :database do
|
|||
ci_builds: %w[project_id runner_id user_id erased_by_id trigger_request_id partition_id auto_canceled_by_partition_id execution_config_id upstream_pipeline_partition_id],
|
||||
ci_builds_metadata: %w[partition_id project_id build_id],
|
||||
ci_build_needs: %w[project_id],
|
||||
ci_builds_runner_session: %w[project_id],
|
||||
ci_daily_build_group_report_results: %w[partition_id],
|
||||
ci_deleted_objects: %w[project_id],
|
||||
ci_job_artifacts: %w[partition_id project_id job_id],
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ RSpec.describe 'User reverts a merge request', :js, feature_category: :code_revi
|
|||
project.update!(merge_requests_ff_only_enabled: true)
|
||||
end
|
||||
|
||||
it 'reverts a merge request', :sidekiq_might_not_need_inline do
|
||||
it 'reverts a merge request', :sidekiq_might_not_need_inline, quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/454303' do
|
||||
revert_commit
|
||||
|
||||
Sidekiq::Worker.skipping_transaction_check do
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
RSpec.describe Gitlab::BackgroundMigration::BackfillCiBuildsRunnerSessionProjectId,
|
||||
feature_category: :runner,
|
||||
schema: 20240930144640,
|
||||
migration: :gitlab_ci do
|
||||
include_examples 'desired sharding key backfill job' do
|
||||
let(:batch_table) { :ci_builds_runner_session }
|
||||
let(:backfill_column) { :project_id }
|
||||
let(:backfill_via_table) { :p_ci_builds }
|
||||
let(:backfill_via_column) { :project_id }
|
||||
let(:backfill_via_foreign_key) { :build_id }
|
||||
end
|
||||
end
|
||||
|
|
@ -60,6 +60,27 @@ RSpec.describe Gitlab::Middleware::Go, feature_category: :source_code_management
|
|||
it 'returns the 2-segment path' do
|
||||
expect_response_with_path(go, enabled_protocol, project.full_path)
|
||||
end
|
||||
|
||||
context 'when instance does not allow password authentication for Git over HTTP(S)' do
|
||||
before do
|
||||
stub_application_setting(password_authentication_enabled_for_git: false)
|
||||
end
|
||||
|
||||
it 'returns the 2-segment path' do
|
||||
expect_response_with_path(go, enabled_protocol, project.full_path)
|
||||
end
|
||||
|
||||
context 'when "go_get_handle_401_error" feature flag disabled' do
|
||||
before do
|
||||
stub_feature_flags(go_get_handle_401_error: false)
|
||||
end
|
||||
|
||||
it 'returns 401 error response' do
|
||||
response = go
|
||||
expect(response[0]).to eq(401)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'when authorization header is present but invalid' do
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'spec_helper'
|
||||
require_migration!
|
||||
|
||||
RSpec.describe QueueBackfillCiBuildsRunnerSessionProjectId, migration: :gitlab_ci, feature_category: :runner do
|
||||
let!(:batched_migration) { described_class::MIGRATION }
|
||||
|
||||
it 'schedules a new batched migration' do
|
||||
reversible_migration do |migration|
|
||||
migration.before -> {
|
||||
expect(batched_migration).not_to have_scheduled_batched_migration
|
||||
}
|
||||
|
||||
migration.after -> {
|
||||
expect(batched_migration).to have_scheduled_batched_migration(
|
||||
table_name: :ci_builds_runner_session,
|
||||
column_name: :id,
|
||||
interval: described_class::DELAY_INTERVAL,
|
||||
batch_size: described_class::BATCH_SIZE,
|
||||
sub_batch_size: described_class::SUB_BATCH_SIZE,
|
||||
gitlab_schema: :gitlab_ci,
|
||||
job_arguments: [
|
||||
:project_id,
|
||||
:p_ci_builds,
|
||||
:project_id,
|
||||
:build_id
|
||||
]
|
||||
)
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -206,6 +206,35 @@ RSpec.describe 'getting a work item list for a project', feature_category: :team
|
|||
end
|
||||
end
|
||||
|
||||
context 'when querying WorkItemWidgetStartAndDueDate' do
|
||||
let(:fields) do
|
||||
<<~GRAPHQL
|
||||
nodes {
|
||||
widgets {
|
||||
type
|
||||
... on WorkItemWidgetStartAndDueDate {
|
||||
dueDate
|
||||
startDate
|
||||
}
|
||||
}
|
||||
}
|
||||
GRAPHQL
|
||||
end
|
||||
|
||||
it 'avoids N+1 queries when we create more work items' do
|
||||
post_graphql(query, current_user: current_user) # warm-up
|
||||
|
||||
control = ActiveRecord::QueryRecorder.new do
|
||||
post_graphql(query, current_user: current_user)
|
||||
end
|
||||
|
||||
create_list(:work_item, 3, project: project)
|
||||
|
||||
expect { post_graphql(query, current_user: current_user) }
|
||||
.not_to exceed_query_limit(control)
|
||||
end
|
||||
end
|
||||
|
||||
context 'when the user does not have access to the item' do
|
||||
before do
|
||||
project.project_feature.update!(issues_access_level: ProjectFeature::PRIVATE)
|
||||
|
|
|
|||
|
|
@ -280,6 +280,75 @@ RSpec.describe API::UsageData, feature_category: :service_ping do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe 'send_to_snowplow param' do
|
||||
it 'does not send the event to snowplow when send_to_snowplow is false' do
|
||||
expect(Gitlab::InternalEvents).to receive(:track_event)
|
||||
.with(
|
||||
known_event,
|
||||
send_snowplow_event: false,
|
||||
user: user,
|
||||
namespace: namespace,
|
||||
project: project,
|
||||
additional_properties: additional_properties
|
||||
)
|
||||
|
||||
post api(endpoint, user), params: {
|
||||
event: known_event,
|
||||
namespace_id: namespace.id,
|
||||
project_id: project.id,
|
||||
additional_properties: additional_properties,
|
||||
send_to_snowplow: false
|
||||
}
|
||||
|
||||
expect(response).to have_gitlab_http_status(:ok)
|
||||
end
|
||||
|
||||
it 'sends event to Snowplow when send_to_snowplow is true' do
|
||||
expect(Gitlab::InternalEvents).to receive(:track_event)
|
||||
.with(
|
||||
known_event,
|
||||
send_snowplow_event: true,
|
||||
user: user,
|
||||
namespace: namespace,
|
||||
project: project,
|
||||
additional_properties: additional_properties
|
||||
)
|
||||
|
||||
post api(endpoint, user), params:
|
||||
{
|
||||
event: known_event,
|
||||
namespace_id: namespace.id,
|
||||
project_id: project.id,
|
||||
additional_properties: additional_properties,
|
||||
send_to_snowplow: true
|
||||
}
|
||||
|
||||
expect(response).to have_gitlab_http_status(:ok)
|
||||
end
|
||||
|
||||
it 'does not send event to Snowplow by default' do
|
||||
expect(Gitlab::InternalEvents).to receive(:track_event)
|
||||
.with(
|
||||
known_event,
|
||||
send_snowplow_event: false,
|
||||
user: user,
|
||||
namespace: namespace,
|
||||
project: project,
|
||||
additional_properties: additional_properties
|
||||
)
|
||||
|
||||
post api(endpoint, user), params:
|
||||
{
|
||||
event: known_event,
|
||||
namespace_id: namespace.id,
|
||||
project_id: project.id,
|
||||
additional_properties: additional_properties
|
||||
}
|
||||
|
||||
expect(response).to have_gitlab_http_status(:ok)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -305,16 +374,12 @@ RSpec.describe API::UsageData, feature_category: :service_ping do
|
|||
end
|
||||
|
||||
context 'with the amount events greater than the limit' do
|
||||
let(:params) do
|
||||
{
|
||||
events: Array.new(API::UsageData::MAXIMUM_TRACKED_EVENTS * 2) { { event: event } }
|
||||
}
|
||||
end
|
||||
let(:params) { { events: Array.new(API::UsageData::MAXIMUM_TRACKED_EVENTS * 2) { { event: event } } } }
|
||||
|
||||
it 'returns bad request' do
|
||||
expect(Gitlab::InternalEvents).not_to receive(:track_event)
|
||||
|
||||
post(api(endpoint, user), params: params)
|
||||
post api(endpoint, user), params: params
|
||||
|
||||
expect(response).to have_gitlab_http_status(:bad_request)
|
||||
end
|
||||
|
|
|
|||
14
tests.yml
14
tests.yml
|
|
@ -29,6 +29,10 @@ mapping:
|
|||
- source: 'ee/lib/gitlab/ci/config/(?<rest>.+)\.rb'
|
||||
test: 'ee/spec/lib/gitlab/ci/yaml_processor_spec.rb'
|
||||
|
||||
# See https://gitlab.com/gitlab-org/gitlab/-/issues/466068#note_1987902951
|
||||
- source: 'ee/lib/audit_events/strategies/(?<rest>.+)\.rb'
|
||||
test: 'ee/spec/lib/audit_events/external_destination_streamer_spec.rb'
|
||||
|
||||
# FOSS tooling should map to respective spec
|
||||
- source: 'tooling/(?<rest>.+)\.rb'
|
||||
test: 'spec/tooling/%{rest}_spec.rb'
|
||||
|
|
@ -208,3 +212,13 @@ mapping:
|
|||
- source: 'public/robots\.txt'
|
||||
test:
|
||||
- 'spec/requests/robots_txt_spec.rb'
|
||||
|
||||
# See https://gitlab.com/gitlab-org/gitlab/-/issues/466068#note_1987834618
|
||||
- source: 'ee/app/replicators/geo/(?<rest>.+)\.rb'
|
||||
test: 'ee/spec/models/geo_node_status_spec.rb'
|
||||
|
||||
# Any change to lib/sidebars/**/*.rb should map to specs that contain the words `sidebar` or `navbar`
|
||||
#
|
||||
# See https://gitlab.com/gitlab-org/gitlab/-/issues/466068#note_1988359861
|
||||
- source: '(?<prefix>ee/)?lib/sidebars/(?<rest>.+)\.rb'
|
||||
test: '%{prefix}spec/features/**/{navbar,sidebar}_spec.rb'
|
||||
|
|
|
|||
|
|
@ -79,9 +79,6 @@ internal/gitaly/smarthttp.go:84:19: Error return value of `stream.CloseSend` is
|
|||
internal/gitaly/smarthttp.go:97:1: exported: exported method SmartHTTPClient.UploadPack should have comment or be unexported (revive)
|
||||
internal/gitaly/smarthttp.go:113:20: Error return value of `waiter.Close` is not checked (errcheck)
|
||||
internal/headers/headers.go:10: internal/headers/headers.go:10: Line contains TODO/BUG/FIXME/NOTE/OPTIMIZE/HACK: "Fixme: Go back to 512 bytes once https:/..." (godox)
|
||||
internal/helper/exception/exception.go:11:14: SA1019: "gitlab.com/gitlab-org/labkit/correlation/raven" is deprecated: Use gitlab.com/gitlab-org/labkit/errortracking instead. (staticcheck)
|
||||
internal/helper/exception/exception.go:36:11: SA1019: correlation.SetExtra is deprecated: Use gitlab.com/gitlab-org/labkit/errortracking instead. (staticcheck)
|
||||
internal/httprs/httprs_test.go:13:2: dot-imports: should not use dot imports (revive)
|
||||
internal/imageresizer/image_resizer.go:1:1: package-comments: should have a package comment (revive)
|
||||
internal/imageresizer/image_resizer.go:30:6: exported: exported type Resizer should have comment or be unexported (revive)
|
||||
internal/imageresizer/image_resizer.go:141:1: exported: exported function NewResizer should have comment or be unexported (revive)
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@ require (
|
|||
github.com/alecthomas/chroma/v2 v2.14.0
|
||||
github.com/aws/aws-sdk-go v1.55.5
|
||||
github.com/aws/aws-sdk-go-v2 v1.31.0
|
||||
github.com/aws/aws-sdk-go-v2/config v1.27.36
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.34
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.22
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.63.0
|
||||
github.com/aws/aws-sdk-go-v2/config v1.27.37
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.35
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.23
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.63.1
|
||||
github.com/disintegration/imaging v1.6.2
|
||||
github.com/dlclark/regexp2 v1.11.4
|
||||
github.com/getsentry/raven-go v0.2.0
|
||||
|
|
@ -28,7 +28,6 @@ require (
|
|||
github.com/redis/go-redis/v9 v9.6.1
|
||||
github.com/sebest/xff v0.0.0-20210106013422-671bd2870b3a
|
||||
github.com/sirupsen/logrus v1.9.3
|
||||
github.com/smartystreets/goconvey v1.8.1
|
||||
github.com/stretchr/testify v1.9.0
|
||||
gitlab.com/gitlab-org/gitaly/v16 v16.11.10
|
||||
gitlab.com/gitlab-org/labkit v1.21.0
|
||||
|
|
@ -71,9 +70,9 @@ require (
|
|||
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.3.20 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.20 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.18 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.23.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.27.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.31.0 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.23.1 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.27.1 // indirect
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.31.1 // indirect
|
||||
github.com/aws/smithy-go v1.21.0 // indirect
|
||||
github.com/beevik/ntp v1.3.1 // indirect
|
||||
github.com/beorn7/perks v1.0.1 // indirect
|
||||
|
|
@ -96,12 +95,10 @@ require (
|
|||
github.com/google/wire v0.6.0 // indirect
|
||||
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
|
||||
github.com/googleapis/gax-go/v2 v2.13.0 // indirect
|
||||
github.com/gopherjs/gopherjs v1.17.2 // indirect
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
|
||||
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.0 // indirect
|
||||
github.com/hashicorp/yamux v0.1.2-0.20220728231024-8f49b6f63f18 // indirect
|
||||
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
||||
github.com/jtolds/gls v4.20.0+incompatible // indirect
|
||||
github.com/klauspost/compress v1.17.9 // indirect
|
||||
github.com/kylelemons/godebug v1.1.0 // indirect
|
||||
github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20210210170715-a8dfcb80d3a7 // indirect
|
||||
|
|
@ -123,7 +120,6 @@ require (
|
|||
github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46 // indirect
|
||||
github.com/shabbyrobe/gocovmerge v0.0.0-20230507112040-c3350d9342df // indirect
|
||||
github.com/shirou/gopsutil/v3 v3.21.12 // indirect
|
||||
github.com/smarty/assertions v1.15.0 // indirect
|
||||
github.com/tinylib/msgp v1.1.2 // indirect
|
||||
github.com/tklauser/go-sysconf v0.3.9 // indirect
|
||||
github.com/tklauser/numcpus v0.3.0 // indirect
|
||||
|
|
|
|||
|
|
@ -108,14 +108,14 @@ github.com/aws/aws-sdk-go-v2 v1.31.0 h1:3V05LbxTSItI5kUqNwhJrrrY1BAXxXt0sN0l72Qm
|
|||
github.com/aws/aws-sdk-go-v2 v1.31.0/go.mod h1:ztolYtaEUtdpf9Wftr31CJfLVjOnD/CVRkKOOYgF8hA=
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.5 h1:xDAuZTn4IMm8o1LnBZvmrL8JA1io4o3YWNXgohbf20g=
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.5/go.mod h1:wYSv6iDS621sEFLfKvpPE2ugjTuGlAG7iROg0hLOkfc=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.27.36 h1:4IlvHh6Olc7+61O1ktesh0jOcqmq/4WG6C2Aj5SKXy0=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.27.36/go.mod h1:IiBpC0HPAGq9Le0Xxb1wpAKzEfAQ3XlYgJLYKEVYcfw=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.34 h1:gmkk1l/cDGSowPRzkdxYi8edw+gN4HmVK151D/pqGNc=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.34/go.mod h1:4R9OEV3tgFMsok4ZeFpExn7zQaZRa9MRGFYnI/xC/vs=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.27.37 h1:xaoIwzHVuRWRHFI0jhgEdEGc8xE1l91KaeRDsWEIncU=
|
||||
github.com/aws/aws-sdk-go-v2/config v1.27.37/go.mod h1:S2e3ax9/8KnMSyRVNd3sWTKs+1clJ2f1U6nE0lpvQRg=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.35 h1:7QknrZhYySEB1lEXJxGAmuD5sWwys5ZXNr4m5oEz0IE=
|
||||
github.com/aws/aws-sdk-go-v2/credentials v1.17.35/go.mod h1:8Vy4kk7at4aPSmibr7K+nLTzG6qUQAUO4tW49fzUV4E=
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.14 h1:C/d03NAmh8C4BZXhuRNboF/DqhBkBCeDiJDcaqIT5pA=
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.14/go.mod h1:7I0Ju7p9mCIdlrfS+JCgqcYD0VXz/N4yozsox+0o078=
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.22 h1:MUD/42Etbj6sVZ0HpOe4G/4+wDF7ZJhqZXSqNKZokPM=
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.22/go.mod h1:wp0iN4VH1riPNX68N8MU+mz/7ggSeWc+zBhsdALp+zM=
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.23 h1:DIheXDgLzIUyZNB9BKM+9OGbvwbxitX0N6b6qNbMmNU=
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.23/go.mod h1:5QQZmD2ttfnDs7GzIjdQTcF2fo27mecoEIL63H8IDBE=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.18 h1:kYQ3H1u0ANr9KEKlGs/jTLrBFPo8P8NaH/w7A01NeeM=
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.18/go.mod h1:r506HmK5JDUh9+Mw4CfGJGSSoqIiLCndAuqXuhbv67Y=
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.18 h1:Z7IdFUONvTcvS7YuhtVxN99v2cCoHRXOS4mTr0B/pUc=
|
||||
|
|
@ -132,14 +132,14 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.20 h1:Xbwbmk44
|
|||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.20/go.mod h1:oAfOFzUB14ltPZj1rWwRc3d/6OgD76R8KlvU3EqM9Fg=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.18 h1:eb+tFOIl9ZsUe2259/BKPeniKuz4/02zZFH/i4Nf8Rg=
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.17.18/go.mod h1:GVCC2IJNJTmdlyEsSmofEy7EfJncP7DNnXDzRjJ5Keg=
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.63.0 h1:F6KG9CT7PPqAjnRxjKmYJopVnXPwjlzPI2FEgXHajNY=
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.63.0/go.mod h1:NLTqRLe3pUNu3nTEHI6XlHLKYmc8fbHUdMxAB6+s41Q=
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.23.0 h1:fHySkG0IGj2nepgGJPmmhZYL9ndnsq1Tvc6MeuVQCaQ=
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.23.0/go.mod h1:XRlMvmad0ZNL+75C5FYdMvbbLkd6qiqz6foR1nA1PXY=
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.27.0 h1:cU/OeQPNReyMj1JEBgjE29aclYZYtXcsPMXbTkVGMFk=
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.27.0/go.mod h1:FnvDM4sfa+isJ3kDXIzAB9GAwVSzFzSy97uZ3IsHo4E=
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.31.0 h1:GNVxIHBTi2EgwCxpNiozhNasMOK+ROUA2Z3X+cSBX58=
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.31.0/go.mod h1:yMWe0F+XG0DkRZK5ODZhG7BEFYhLXi2dqGsv6tX0cgI=
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.63.1 h1:TR96r56VwELV0qguNFCuz+/bEpRfnR3ZsS9/IG05C7Q=
|
||||
github.com/aws/aws-sdk-go-v2/service/s3 v1.63.1/go.mod h1:NLTqRLe3pUNu3nTEHI6XlHLKYmc8fbHUdMxAB6+s41Q=
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.23.1 h1:2jrVsMHqdLD1+PA4BA6Nh1eZp0Gsy3mFSB5MxDvcJtU=
|
||||
github.com/aws/aws-sdk-go-v2/service/sso v1.23.1/go.mod h1:XRlMvmad0ZNL+75C5FYdMvbbLkd6qiqz6foR1nA1PXY=
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.27.1 h1:0L7yGCg3Hb3YQqnSgBTZM5wepougtL1aEccdcdYhHME=
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.27.1/go.mod h1:FnvDM4sfa+isJ3kDXIzAB9GAwVSzFzSy97uZ3IsHo4E=
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.31.1 h1:8K0UNOkZiK9Uh3HIF6Bx0rcNCftqGCeKmOaR7Gp5BSo=
|
||||
github.com/aws/aws-sdk-go-v2/service/sts v1.31.1/go.mod h1:yMWe0F+XG0DkRZK5ODZhG7BEFYhLXi2dqGsv6tX0cgI=
|
||||
github.com/aws/smithy-go v1.21.0 h1:H7L8dtDRk0P1Qm6y0ji7MCYMQObJ5R9CRpyPhRUkLYA=
|
||||
github.com/aws/smithy-go v1.21.0/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg=
|
||||
github.com/beevik/ntp v1.3.1 h1:Y/srlT8L1yQr58kyPWFPZIxRL8ttx2SRIpVYJqZIlAM=
|
||||
|
|
@ -320,8 +320,6 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+
|
|||
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
||||
github.com/googleapis/gax-go/v2 v2.13.0 h1:yitjD5f7jQHhyDsnhKEBU52NdvvdSeGzlAnDPT0hH1s=
|
||||
github.com/googleapis/gax-go/v2 v2.13.0/go.mod h1:Z/fvTZXF8/uw7Xu5GuslPw+bplx6SS338j1Is2S+B7A=
|
||||
github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25dO0g=
|
||||
github.com/gopherjs/gopherjs v1.17.2/go.mod h1:pRRIvn/QzFLrKfvEz3qUuEhtE/zLCWfreZ6J5gM2i+k=
|
||||
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
|
||||
github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
github.com/gregjones/httpcache v0.0.0-20170920190843-316c5e0ff04e/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
|
||||
|
|
@ -354,8 +352,6 @@ github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2E
|
|||
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
|
||||
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
||||
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
|
||||
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
|
||||
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
||||
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA=
|
||||
|
|
@ -446,10 +442,6 @@ github.com/shirou/gopsutil/v3 v3.21.12/go.mod h1:BToYZVTlSVlfazpDDYFnsVZLaoRG+g8
|
|||
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
||||
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
|
||||
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
|
||||
github.com/smarty/assertions v1.15.0 h1:cR//PqUBUiQRakZWqBiFFQ9wb8emQGDb0HeGdqGByCY=
|
||||
github.com/smarty/assertions v1.15.0/go.mod h1:yABtdzeQs6l1brC900WlRNwj6ZR55d7B+E8C6HtKdec=
|
||||
github.com/smartystreets/goconvey v1.8.1 h1:qGjIddxOk4grTu9JPOU31tVfq3cNdBlNa5sSznIX1xY=
|
||||
github.com/smartystreets/goconvey v1.8.1/go.mod h1:+/u4qLyY6x1jReYOp7GOM2FSt8aP9CzCZL03bI28W60=
|
||||
github.com/spf13/afero v0.0.0-20170901052352-ee1bd8ee15a1/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
|
||||
github.com/spf13/afero v1.2.1/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
|
||||
github.com/spf13/cast v1.1.0/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg=
|
||||
|
|
|
|||
|
|
@ -7,12 +7,13 @@ import (
|
|||
|
||||
raven "github.com/getsentry/raven-go"
|
||||
|
||||
//lint:ignore SA1019 this was recently deprecated. Update workhorse to use labkit errortracking package.
|
||||
correlation "gitlab.com/gitlab-org/labkit/correlation/raven"
|
||||
"gitlab.com/gitlab-org/labkit/correlation"
|
||||
|
||||
"gitlab.com/gitlab-org/labkit/log"
|
||||
)
|
||||
|
||||
const ravenSentryExtraKey = "gitlab.CorrelationID"
|
||||
|
||||
var ravenHeaderBlacklist = []string{
|
||||
"Authorization",
|
||||
"Private-Token",
|
||||
|
|
@ -32,8 +33,9 @@ func Track(r *http.Request, err error, fields log.Fields) {
|
|||
CleanHeaders(r)
|
||||
interfaces = append(interfaces, raven.NewHttp(r))
|
||||
|
||||
//lint:ignore SA1019 this was recently deprecated. Update workhorse to use labkit errortracking package.
|
||||
extra = correlation.SetExtra(r.Context(), extra)
|
||||
if correlationID := correlation.ExtractFromContext(r.Context()); correlationID != "" {
|
||||
extra[ravenSentryExtraKey] = correlationID
|
||||
}
|
||||
}
|
||||
|
||||
exception := &raven.Exception{
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
type fakeResponseWriter struct {
|
||||
|
|
@ -57,7 +57,6 @@ func (f *fakeRoundTripper) RoundTrip(r *http.Request) (*http.Response, error) {
|
|||
}
|
||||
|
||||
if f.downgradeZeroToNoRange {
|
||||
// There are implementations that downgrades bytes=0- to a normal un-ranged GET
|
||||
if r.Header.Get("Range") == "bytes=0-" {
|
||||
r.Header.Del("Range")
|
||||
}
|
||||
|
|
@ -82,7 +81,7 @@ func newRSFactory(flags int) RSFactory {
|
|||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
if removeErr := os.Remove(tmp.Name()); removeErr != nil {
|
||||
if os.Remove(tmp.Name()) != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -109,38 +108,35 @@ func newRSFactory(flags int) RSFactory {
|
|||
}
|
||||
|
||||
func TestHttpWebServer(t *testing.T) {
|
||||
Convey("Scenario: testing WebServer", t, func() {
|
||||
dir := t.TempDir()
|
||||
dir := t.TempDir()
|
||||
|
||||
err := os.WriteFile(filepath.Join(dir, "file"), make([]byte, 10000), 0755)
|
||||
So(err, ShouldBeNil)
|
||||
err := os.WriteFile(filepath.Join(dir, "file"), make([]byte, 10000), 0755)
|
||||
require.NoError(t, err)
|
||||
|
||||
server := httptest.NewServer(http.FileServer(http.Dir(dir)))
|
||||
server := httptest.NewServer(http.FileServer(http.Dir(dir)))
|
||||
defer server.Close()
|
||||
|
||||
Convey("When requesting /file", func() {
|
||||
res, err := http.Get(server.URL + "/file")
|
||||
defer func() { _ = res.Body.Close() }()
|
||||
So(err, ShouldBeNil)
|
||||
res, err := http.Get(server.URL + "/file")
|
||||
require.NoError(t, err)
|
||||
defer res.Body.Close()
|
||||
|
||||
stream := NewHTTPReadSeeker(res)
|
||||
So(stream, ShouldNotBeNil)
|
||||
stream := NewHTTPReadSeeker(res)
|
||||
require.NotNil(t, stream)
|
||||
|
||||
Convey("Can read 100 bytes from start of file", func() {
|
||||
t.Run("Can read 100 bytes from start of file", func(t *testing.T) {
|
||||
n, err := stream.Read(make([]byte, 100))
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, 100, n)
|
||||
|
||||
t.Run("When seeking 4KiB forward", func(t *testing.T) {
|
||||
pos, err := stream.Seek(4096, io.SeekCurrent)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, int64(4096+100), pos)
|
||||
|
||||
t.Run("Can read 100 bytes", func(t *testing.T) {
|
||||
n, err := stream.Read(make([]byte, 100))
|
||||
So(err, ShouldBeNil)
|
||||
So(n, ShouldEqual, 100)
|
||||
|
||||
Convey("When seeking 4KiB forward", func() {
|
||||
pos, err := stream.Seek(4096, io.SeekCurrent)
|
||||
So(err, ShouldBeNil)
|
||||
So(pos, ShouldEqual, 4096+100)
|
||||
|
||||
Convey("Can read 100 bytes", func() {
|
||||
n, err := stream.Read(make([]byte, 100))
|
||||
So(err, ShouldBeNil)
|
||||
So(n, ShouldEqual, 100)
|
||||
})
|
||||
})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, 100, n)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
@ -165,98 +161,109 @@ func TestHttpReaderSeeker(t *testing.T) {
|
|||
}
|
||||
|
||||
func testHTTPReaderSeeker(t *testing.T, newRS RSFactory) {
|
||||
Convey("Scenario: testing HttpReaderSeeker", t, func() {
|
||||
Convey("Read should start at the beginning", func() {
|
||||
r := newRS()
|
||||
So(r, ShouldNotBeNil)
|
||||
defer r.Close()
|
||||
buf := make([]byte, 4)
|
||||
n, err := io.ReadFull(r, buf)
|
||||
So(n, ShouldEqual, 4)
|
||||
So(err, ShouldBeNil)
|
||||
So(string(buf), ShouldEqual, "0000")
|
||||
})
|
||||
t.Run("Read should start at the beginning", func(t *testing.T) {
|
||||
r := newRS()
|
||||
require.NotNil(t, r)
|
||||
defer r.Close()
|
||||
|
||||
Convey("Seek w SEEK_SET should seek to right offset", func() {
|
||||
r := newRS()
|
||||
So(r, ShouldNotBeNil)
|
||||
defer r.Close()
|
||||
s, err := r.Seek(4*64, io.SeekStart)
|
||||
So(s, ShouldEqual, 4*64)
|
||||
So(err, ShouldBeNil)
|
||||
buf := make([]byte, 4)
|
||||
n, err := io.ReadFull(r, buf)
|
||||
So(n, ShouldEqual, 4)
|
||||
So(err, ShouldBeNil)
|
||||
So(string(buf), ShouldEqual, "0064")
|
||||
})
|
||||
buf := make([]byte, 4)
|
||||
n, err := io.ReadFull(r, buf)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, 4, n)
|
||||
require.Equal(t, "0000", string(buf))
|
||||
})
|
||||
|
||||
Convey("Read + Seek w SEEK_CUR should seek to right offset", func() {
|
||||
r := newRS()
|
||||
So(r, ShouldNotBeNil)
|
||||
defer r.Close()
|
||||
buf := make([]byte, 4)
|
||||
io.ReadFull(r, buf)
|
||||
s, err := r.Seek(4*64, io.SeekCurrent)
|
||||
So(s, ShouldEqual, 4*64+4)
|
||||
So(err, ShouldBeNil)
|
||||
n, err := io.ReadFull(r, buf)
|
||||
So(n, ShouldEqual, 4)
|
||||
So(err, ShouldBeNil)
|
||||
So(string(buf), ShouldEqual, "0065")
|
||||
})
|
||||
t.Run("Seek w SEEK_SET should seek to right offset", func(t *testing.T) {
|
||||
r := newRS()
|
||||
require.NotNil(t, r)
|
||||
defer r.Close()
|
||||
|
||||
Convey("Seek w SEEK_END should seek to right offset", func() {
|
||||
r := newRS()
|
||||
So(r, ShouldNotBeNil)
|
||||
defer r.Close()
|
||||
buf := make([]byte, 4)
|
||||
io.ReadFull(r, buf)
|
||||
s, err := r.Seek(4, io.SeekEnd)
|
||||
So(s, ShouldEqual, SZ*4-4)
|
||||
So(err, ShouldBeNil)
|
||||
n, err := io.ReadFull(r, buf)
|
||||
So(n, ShouldEqual, 4)
|
||||
So(err, ShouldBeNil)
|
||||
So(string(buf), ShouldEqual, fmt.Sprintf("%04d", SZ-1))
|
||||
})
|
||||
s, err := r.Seek(4*64, io.SeekStart)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, int64(4*64), s)
|
||||
|
||||
Convey("Short seek should consume existing request", func() {
|
||||
r := newRS()
|
||||
So(r, ShouldNotBeNil)
|
||||
defer r.Close()
|
||||
buf := make([]byte, 4)
|
||||
So(r.Requests, ShouldEqual, 0)
|
||||
io.ReadFull(r, buf)
|
||||
So(r.Requests, ShouldEqual, 1)
|
||||
s, err := r.Seek(shortSeekBytes, io.SeekCurrent)
|
||||
So(r.Requests, ShouldEqual, 1)
|
||||
So(s, ShouldEqual, shortSeekBytes+4)
|
||||
So(err, ShouldBeNil)
|
||||
n, err := io.ReadFull(r, buf)
|
||||
So(n, ShouldEqual, 4)
|
||||
So(err, ShouldBeNil)
|
||||
So(string(buf), ShouldEqual, "0257")
|
||||
So(r.Requests, ShouldEqual, 1)
|
||||
})
|
||||
buf := make([]byte, 4)
|
||||
n, err := io.ReadFull(r, buf)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, 4, n)
|
||||
require.Equal(t, "0064", string(buf))
|
||||
})
|
||||
|
||||
Convey("Long seek should do a new request", func() {
|
||||
r := newRS()
|
||||
So(r, ShouldNotBeNil)
|
||||
defer r.Close()
|
||||
buf := make([]byte, 4)
|
||||
So(r.Requests, ShouldEqual, 0)
|
||||
io.ReadFull(r, buf)
|
||||
So(r.Requests, ShouldEqual, 1)
|
||||
s, err := r.Seek(shortSeekBytes+1, io.SeekCurrent)
|
||||
So(r.Requests, ShouldEqual, 1)
|
||||
So(s, ShouldEqual, shortSeekBytes+4+1)
|
||||
So(err, ShouldBeNil)
|
||||
n, err := io.ReadFull(r, buf)
|
||||
So(n, ShouldEqual, 4)
|
||||
So(err, ShouldBeNil)
|
||||
So(string(buf), ShouldEqual, "2570")
|
||||
So(r.Requests, ShouldEqual, 2)
|
||||
})
|
||||
t.Run("Read + Seek w SEEK_CUR should seek to right offset", func(t *testing.T) {
|
||||
r := newRS()
|
||||
require.NotNil(t, r)
|
||||
defer r.Close()
|
||||
|
||||
buf := make([]byte, 4)
|
||||
io.ReadFull(r, buf)
|
||||
|
||||
s, err := r.Seek(4*64, io.SeekCurrent)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, int64(4*64+4), s)
|
||||
|
||||
n, err := io.ReadFull(r, buf)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, 4, n)
|
||||
require.Equal(t, "0065", string(buf))
|
||||
})
|
||||
|
||||
t.Run("Seek w SEEK_END should seek to right offset", func(t *testing.T) {
|
||||
r := newRS()
|
||||
require.NotNil(t, r)
|
||||
defer r.Close()
|
||||
|
||||
buf := make([]byte, 4)
|
||||
io.ReadFull(r, buf)
|
||||
|
||||
s, err := r.Seek(4, io.SeekEnd)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, int64(SZ*4-4), s)
|
||||
|
||||
n, err := io.ReadFull(r, buf)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, 4, n)
|
||||
require.Equal(t, fmt.Sprintf("%04d", SZ-1), string(buf))
|
||||
})
|
||||
|
||||
t.Run("Short seek should consume existing request", func(t *testing.T) {
|
||||
r := newRS()
|
||||
require.NotNil(t, r)
|
||||
defer r.Close()
|
||||
|
||||
buf := make([]byte, 4)
|
||||
require.Equal(t, 0, r.Requests)
|
||||
io.ReadFull(r, buf)
|
||||
require.Equal(t, 1, r.Requests)
|
||||
|
||||
s, err := r.Seek(shortSeekBytes, io.SeekCurrent)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, int64(shortSeekBytes+4), s)
|
||||
|
||||
n, err := io.ReadFull(r, buf)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, 4, n)
|
||||
require.Equal(t, "0257", string(buf))
|
||||
require.Equal(t, 1, r.Requests)
|
||||
})
|
||||
|
||||
t.Run("Long seek should do a new request", func(t *testing.T) {
|
||||
r := newRS()
|
||||
require.NotNil(t, r)
|
||||
defer r.Close()
|
||||
|
||||
buf := make([]byte, 4)
|
||||
require.Equal(t, 0, r.Requests)
|
||||
io.ReadFull(r, buf)
|
||||
require.Equal(t, 1, r.Requests)
|
||||
|
||||
s, err := r.Seek(shortSeekBytes+1, io.SeekCurrent)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, int64(shortSeekBytes+4+1), s)
|
||||
|
||||
n, err := io.ReadFull(r, buf)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, 4, n)
|
||||
require.Equal(t, "2570", string(buf))
|
||||
require.Equal(t, 2, r.Requests)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue