Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2025-07-15 09:07:59 +00:00
parent b9b0bdc404
commit d720dd102d
54 changed files with 1992 additions and 1988 deletions

View File

@ -222,7 +222,6 @@ export default {
'app/assets/javascripts/wikis/wiki_notes/components/placeholder_note.vue',
'app/assets/javascripts/wikis/wiki_notes/components/wiki_discussion.vue',
'app/assets/javascripts/wikis/wiki_notes/components/wiki_notes_app.vue',
'ee/app/assets/javascripts/admin/subscriptions/show/components/subscription_breakdown.vue',
'ee/app/assets/javascripts/ai/components/duo_chat_feedback_modal.vue',
'ee/app/assets/javascripts/ai/components/user_feedback.vue',
'ee/app/assets/javascripts/analytics/analytics_dashboards/components/visualizations/dora_chart.vue',

View File

@ -130,6 +130,8 @@ config/bounded_contexts.yml @fabiopitino @grzesiek @stanhu @cwoolley-gitlab @tku
/.gitlab/ci/reports.gitlab-ci.yml @gl-dx/pipeline-maintainers @gitlab-com/gl-security/appsec
/.gitlab/ci/review-apps/qa.gitlab-ci.yml @gl-dx/pipeline-maintainers @gl-dx/maintainers
/.gitlab/ci/test-on-gdk/ @gl-dx/pipeline-maintainers @gl-dx/maintainers
/.gitlab/ci/release-environments.gitlab-ci.yml @gl-dx/pipeline-maintainers @gitlab-org/delivery
/.gitlab/ci/release-environments/ @gl-dx/pipeline-maintainers @gitlab-org/delivery
/gems/gem.gitlab-ci.yml
[Tooling] @gl-dx/tooling-maintainers

View File

@ -1 +1 @@
886a296a3cc0e2c8e1d401c1ef33dfc214148542
56c389ee230df185af98ba3eb40c1eaab4f8cae0

View File

@ -26,6 +26,10 @@ import TrainingProviderList from './training_provider_list.vue';
export default {
i18n,
components: {
ApplySecurityLabels: () =>
import(
'ee_component/security_configuration/security_labels/components/apply_security_labels.vue'
),
AutoDevOpsAlert,
AutoDevOpsEnabledAlert,
FeatureCard,
@ -113,6 +117,11 @@ export default {
shouldShowVulnerabilityArchives() {
return this.glFeatures?.vulnerabilityArchival;
},
shouldShowSecurityLabels() {
return (
window.gon?.licensed_features?.securityLabels && this.glFeatures?.securityContextLabels
);
},
},
methods: {
getComponentName(feature) {
@ -260,6 +269,13 @@ export default {
</section-layout>
<vulnerability-archives v-if="shouldShowVulnerabilityArchives" />
</gl-tab>
<gl-tab
v-if="shouldShowSecurityLabels"
:title="s__('SecurityLabels|Security labels')"
query-param-value="security-labels"
>
<apply-security-labels />
</gl-tab>
</gl-tabs>
</article>
</template>

View File

@ -80,7 +80,7 @@ module Clusters
end
def model_name
self.class.name.underscore.tr('/', '_')
::Gitlab::Utils::ClassNameConverter.new(self.class).string_representation
end
private

View File

@ -14,6 +14,10 @@ module Ci
validates :project, presence: true
validates :pipeline, presence: true
def logs_url
Gitlab::Routing.url_helpers.project_pipeline_url(project, pipeline)
end
end
end
end

View File

@ -54,6 +54,6 @@ module Measurable
end
def service_class
self.class.name.underscore.tr('/', '_')
::Gitlab::Utils::ClassNameConverter.new(self.class).string_representation
end
end

View File

@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/474407
milestone: '17.3'
type: development
group: group::knowledge
default_enabled: false
default_enabled: true

View File

@ -1,8 +0,0 @@
---
name: allow_anonymous_searches
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/138975
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/434218
milestone: '16.7'
type: ops
group: group::global search
default_enabled: true

View File

@ -86,7 +86,12 @@ scope format: false do
get '/blame/*id', to: 'blame#show', as: :blame
get '/commits', to: 'commits#commits_root', as: :commits_root
get '/commits/*id/signatures', to: 'commits#signatures', as: :signatures
# this route conflicts with branch names that end with /signatures
# to avoid this issue we ensure that #signatures only responds to json requests
# and also is not a commit pagination request, based on the 'offset' param presence
get '/commits/*id/signatures', to: 'commits#signatures', as: :signatures, constraints: ->(request) do
request.format == :json && !request.params[:offset]
end
get '/commits/*id', to: 'commits#show', as: :commits
post '/create_dir/*id', to: 'tree#create_dir', as: :create_dir

View File

@ -5,32 +5,10 @@ class MigrateAnonymousSearchesFlagToApplicationSettingsV2 < Gitlab::Database::Mi
milestone '18.1'
def up
# rubocop:disable Gitlab/FeatureFlagWithoutActor -- Does not execute in user context
anonymous_searches_allowed = Feature.enabled?(:allow_anonymous_searches) # rubocop:disable Migration/PreventFeatureFlagsUsage -- helper is buggy right now will be fixed in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/190841
# rubocop:enable Gitlab/FeatureFlagWithoutActor
sql = <<~SQL
UPDATE application_settings
SET search = jsonb_set(
COALESCE(search, '{}'::jsonb),
'{anonymous_searches_allowed}',
to_jsonb(#{anonymous_searches_allowed})
),
updated_at = NOW()
WHERE id = (SELECT MAX(id) FROM application_settings)
SQL
execute(sql)
# Marking migration as no-op, after required stop.
end
def down
sql = <<~SQL
UPDATE application_settings
SET search = search - 'anonymous_searches_allowed',
updated_at = NOW()
WHERE id = (SELECT MAX(id) FROM application_settings)
SQL
execute(sql)
# Marking migration as no-op, after required stop.
end
end

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -43,7 +43,7 @@ To monitor [strong consistency](_index.md#strong-consistency), you can use the f
- `gitaly_hook_transaction_voting_delay_seconds`, the client-side delay introduced by waiting for
the transaction to be committed.
To monitor [repository verification](_index.md#repository-verification), use the following Prometheus metrics:
To monitor [repository verification](configure.md#repository-verification), use the following Prometheus metrics:
- `gitaly_praefect_verification_jobs_dequeued_total`, the number of verification jobs picked up by the
worker.

View File

@ -16,8 +16,8 @@ You can add and replace Gitaly nodes on a Gitaly Cluster.
To add a new Gitaly node:
1. Install the new Gitaly node by following the [documentation](_index.md#gitaly).
1. Add the new node to your [Praefect configuration](_index.md#praefect) under `praefect['virtual_storages']`.
1. Install the new Gitaly node by following the [documentation](configure.md#gitaly).
1. Add the new node to your [Praefect configuration](configure.md#praefect) under `praefect['virtual_storages']`.
1. Reconfigure and restart Praefect by running following commands:
```shell
@ -30,8 +30,8 @@ The replication behavior depends on your replication factor setting.
#### Custom replication factor
If a custom replication factor is set, Praefect doesn't automatically replicate existing repositories to the new Gitaly node. You must set the
[replication factor](_index.md#configure-replication-factor) for each repository using the `set-replication-factor` Praefect command. New repositories are replicated based on
the [replication factor](_index.md#configure-replication-factor).
[replication factor](configure.md#configure-replication-factor) for each repository using the `set-replication-factor` Praefect command. New repositories are replicated based on
the [replication factor](configure.md#configure-replication-factor).
#### Default replication factor
@ -46,17 +46,17 @@ You can replace an existing Gitaly node with a new node with either the same nam
#### With a node with the same name
To use the same name for the replacement node, use [repository verifier](_index.md#enable-deletions) to scan the storage and remove dangling metadata records.
[Manually prioritize verification](_index.md#prioritize-verification-manually) of the replaced storage to speed up the process.
To use the same name for the replacement node, use [repository verifier](configure.md#enable-deletions) to scan the storage and remove dangling metadata records.
[Manually prioritize verification](configure.md#prioritize-verification-manually) of the replaced storage to speed up the process.
#### With a node with a different name
The steps use a different name for the replacement node for a Gitaly Cluster depend on if a [replication factor](_index.md#configure-replication-factor)
The steps use a different name for the replacement node for a Gitaly Cluster depend on if a [replication factor](configure.md#configure-replication-factor)
is set.
##### Replication factor set
If a custom replication factor is set, use [`praefect set-replication-factor`](_index.md#configure-replication-factor) to set the replication factor per repository again to get
If a custom replication factor is set, use [`praefect set-replication-factor`](configure.md#configure-replication-factor) to set the replication factor per repository again to get
new storage assigned.
For example, if two nodes in the virtual storage have a replication factor of 2 and a new node (`gitaly-3`) is added, you should increase the replication
@ -70,12 +70,12 @@ current assignments: gitaly-1, gitaly-2, gitaly-3
This ensures that the repository is replicated to the new node and the `repository_assignments` table gets updated with the name of new Gitaly node.
If the [default replication factor](_index.md#configure-replication-factor) is set, new nodes are not automatically included in replication.
If the [default replication factor](configure.md#configure-replication-factor) is set, new nodes are not automatically included in replication.
You must follow the steps described previously.
After you [verify](#check-for-data-loss) that repository is successfully replicated to the new node:
1. Remove the `gitaly-1` node from the [Praefect configuration](_index.md#praefect) under `praefect['virtual_storages']`.
1. Remove the `gitaly-1` node from the [Praefect configuration](configure.md#praefect) under `praefect['virtual_storages']`.
1. Reconfigure and restart Praefect:
```shell
@ -475,7 +475,7 @@ sudo -u git -- /opt/gitlab/embedded/bin/praefect -config /var/opt/gitlab/praefec
- `-replica-path` is the relative path on physical storage. Can start with [`@cluster` or match `relative_path`](../../repository_storage_paths.md#gitaly-cluster-storage).
- `-authoritative-storage` is the storage we want Praefect to treat as the primary. Required if
[per-repository replication](_index.md#configure-replication-factor) is set as the replication strategy.
[per-repository replication](configure.md#configure-replication-factor) is set as the replication strategy.
- `-replicate-immediately` causes the command to replicate the repository to its secondaries immediately.
Otherwise, replication jobs are scheduled for execution in the database and are picked up by a Praefect background process.

View File

@ -108,7 +108,7 @@ Some common reasons for the Praefect database to experience elevated CPU usage i
- Prometheus metrics scrapes [running an expensive query](https://gitlab.com/gitlab-org/gitaly/-/issues/3796). Set
`praefect['configuration'][:prometheus_exclude_database_from_default_metrics] = true` in `gitlab.rb`.
- [Read distribution caching](_index.md#reads-distribution-caching) is disabled, increasing the number of queries made to the
- [Read distribution caching](configure.md#reads-distribution-caching) is disabled, increasing the number of queries made to the
database when user traffic is high. Ensure read distribution caching is enabled.
## Determine primary Gitaly node
@ -202,7 +202,7 @@ For each replica, the following metadata is available:
| `Generation` | Latest confirmed generation of the replica. It indicates:<br><br>- The replica is fully up to date if the generation matches the repository's generation.<br>- The replica is outdated if the replica's generation is less than the repository's generation.<br>- `replica not yet created` if the replica does not yet exist at all on the storage. |
| `Healthy` | Indicates whether the Gitaly node that is hosting this replica is considered healthy by the consensus of Praefect nodes. |
| `Valid Primary` | Indicates whether the replica is fit to serve as the primary node. If the repository's primary is not a valid primary, a failover occurs on the next write to the repository if there is another replica that is a valid primary. A replica is a valid primary if:<br><br>- It is stored on a healthy Gitaly node.<br>- It is fully up to date.<br>- It is not targeted by a pending deletion job from decreasing replication factor.<br>- It is assigned. |
| `Verified At` | Indicates last successful verification of the replica by the [verification worker](_index.md#repository-verification). If the replica has not yet been verified, `unverified` is displayed in place of the last successful verification time. Introduced in GitLab 15.0. |
| `Verified At` | Indicates last successful verification of the replica by the [verification worker](configure.md#repository-verification). If the replica has not yet been verified, `unverified` is displayed in place of the last successful verification time. Introduced in GitLab 15.0. |
### Command fails with 'repository not found'
@ -261,8 +261,8 @@ praefect sql-migrate: OK (applied 21 migrations)
## Requests fail with 'repository scoped: invalid Repository' errors
This indicates that the virtual storage name used in the
[Praefect configuration](_index.md#praefect) does not match the storage name used in
[`gitaly['configuration'][:storage][<index>][:name]` setting](_index.md#gitaly) for GitLab.
[Praefect configuration](configure.md#praefect) does not match the storage name used in
[`gitaly['configuration'][:storage][<index>][:name]` setting](configure.md#gitaly) for GitLab.
Resolve this by matching the virtual storage names used in Praefect and GitLab configuration.

View File

@ -107,7 +107,7 @@ For more examples of a question you can ask, see
| Feature | Available on GitLab Duo Self-Hosted | GitLab version | Status |
| -------------------------------------------------------------------------------------------------------------- | ------------------------------------------- | ---------------------- | --- |
| [GitLab Duo for the CLI](../../editor_extensions/gitlab_cli/_index.md#gitlab-duo-for-the-cli) | {{< icon name="check-circle-filled" >}} Yes | GitLab 18.1.2 and later | Beta |
| [GitLab Duo Agent Platform](../../user/duo_agent_platform/_index.md) | {{< icon name="dash-circle" >}} No | GitLab 17.4 and later | Not applicable |
| [GitLab Duo Agent Platform](../../user/duo_agent_platform/_index.md) | {{< icon name="dash-circle" >}} No | Not applicable | Not applicable |
| [Vulnerability Resolution](../../user/application_security/vulnerabilities/_index.md#vulnerability-resolution) | {{< icon name="check-circle-filled" >}} Yes | GitLab 18.1.2 and later | Beta |
| [AI Impact Dashboard](../../user/analytics/ai_impact_analytics.md) | {{< icon name="check-circle-filled" >}} Yes | GitLab 17.9 and later | Beta |

View File

@ -225,7 +225,7 @@ The following metrics can be controlled by feature flags:
## Praefect metrics
You can [configure Praefect](../../gitaly/praefect/_index.md#praefect) to report metrics. For information
You can [configure Praefect](../../gitaly/praefect/configure.md#praefect) to report metrics. For information
on available metrics, see [Monitoring Gitaly Cluster (Praefect)](../../gitaly/praefect/monitoring.md).
## Sidekiq metrics

View File

@ -59,7 +59,7 @@ To move databases from one instance to another:
/opt/gitlab/embedded/bin/psql -h $DST_PGHOST -U $DST_PGUSER -f gitlabhq_production.sql postgres
```
1. Optional. If you migrate from a database that doesn't use PgBouncer to a database that does, you must manually add a [`pg_shadow_lookup` function](../gitaly/praefect/_index.md#manual-database-setup) to the application database (usually `gitlabhq_production`).
1. Optional. If you migrate from a database that doesn't use PgBouncer to a database that does, you must manually add a [`pg_shadow_lookup` function](../gitaly/praefect/configure.md#manual-database-setup) to the application database (usually `gitlabhq_production`).
1. Configure the GitLab application servers with the appropriate connection details
for your destination PostgreSQL instance in your `/etc/gitlab/gitlab.rb` file:

View File

@ -1406,7 +1406,7 @@ the details of each Gitaly node that makes up the cluster. Each storage is also
and this name is used in several areas of the configuration. In this guide, the name of the storage will be
`default`. Also, this guide is geared towards new installs, if upgrading an existing environment
to use Gitaly Cluster, you might have to use a different name.
Refer to the [Praefect documentation](../gitaly/praefect/_index.md#praefect) for more information.
Refer to the [Praefect documentation](../gitaly/praefect/configure.md#praefect) for more information.
The following IPs will be used as an example:

View File

@ -1414,7 +1414,7 @@ the details of each Gitaly node that makes up the cluster. Each storage is also
and this name is used in several areas of the configuration. In this guide, the name of the storage will be
`default`. Also, this guide is geared towards new installs, if upgrading an existing environment
to use Gitaly Cluster, you might have to use a different name.
Refer to the [Praefect documentation](../gitaly/praefect/_index.md#praefect) for more information.
Refer to the [Praefect documentation](../gitaly/praefect/configure.md#praefect) for more information.
The following IPs will be used as an example:

View File

@ -1240,7 +1240,7 @@ the details of each Gitaly node that makes up the cluster. Each storage is also
and this name is used in several areas of the configuration. In this guide, the name of the storage will be
`default`. Also, this guide is geared towards new installs, if upgrading an existing environment
to use Gitaly Cluster, you might have to use a different name.
Refer to the [Praefect documentation](../gitaly/praefect/_index.md#praefect) for more information.
Refer to the [Praefect documentation](../gitaly/praefect/configure.md#praefect) for more information.
The following IPs will be used as an example:

View File

@ -1419,7 +1419,7 @@ the details of each Gitaly node that makes up the cluster. Each storage is also
and this name is used in several areas of the configuration. In this guide, the name of the storage will be
`default`. Also, this guide is geared towards new installs, if upgrading an existing environment
to use Gitaly Cluster, you might have to use a different name.
Refer to the [Praefect documentation](../gitaly/praefect/_index.md#praefect) for more information.
Refer to the [Praefect documentation](../gitaly/praefect/configure.md#praefect) for more information.
The following IPs will be used as an example:

View File

@ -1245,7 +1245,7 @@ the details of each Gitaly node that makes up the cluster. Each storage is also
and this name is used in several areas of the configuration. In this guide, the name of the storage is
`default`. Also, this guide is geared towards new installs, if upgrading an existing environment
to use Gitaly Cluster, you might have to use a different name.
Refer to the [Praefect documentation](../gitaly/praefect/_index.md#praefect) for more information.
Refer to the [Praefect documentation](../gitaly/praefect/configure.md#praefect) for more information.
The following IPs are used as an example:

View File

@ -434,7 +434,7 @@ architectures are designed to have enough memory in most cases to avoid the need
### Praefect PostgreSQL
[Praefect requires its own database server](../gitaly/praefect/_index.md#postgresql). To achieve full HA, a third-party PostgreSQL database solution is required.
[Praefect requires its own database server](../gitaly/praefect/configure.md#postgresql). To achieve full HA, a third-party PostgreSQL database solution is required.
We hope to offer a built-in solution for these restrictions in the future. In the meantime, a non-HA PostgreSQL server
can be set up using the Linux package as the specifications reflect. For more details, see the following issues:

View File

@ -272,6 +272,7 @@ the user's SCIM identity is reactivated and their GitLab instance access is rest
{{< history >}}
- [Introduced](https://gitlab.com/groups/gitlab-org/-/epics/15990) in GitLab 18.0 [with a flag](../../administration/feature_flags/_index.md) named `self_managed_scim_group_sync`. Disabled by default.
- [Enabled on GitLab Self-Managed](https://gitlab.com/gitlab-org/gitlab/-/issues/553662) by default in GitLab 18.2.
{{< /history >}}

View File

@ -183,6 +183,12 @@ This field returns a [connection](#connections). It accepts the
four standard [pagination arguments](#pagination-arguments):
`before: String`, `after: String`, `first: Int`, and `last: Int`.
#### Arguments
| Name | Type | Description |
| ---- | ---- | ----------- |
| <a id="queryaicatalogitemsitemtype"></a>`itemType` | [`AiCatalogItemType`](#aicatalogitemtype) | Type of items to retrieve. |
### `Query.aiChatContextPresets`
Get available GitLab Duo Chat context presets for the current user for a specific URL.
@ -27678,6 +27684,7 @@ GitLab Duo Agent Platform session.
| <a id="duoworkflowgoal"></a>`goal` | [`String`](#string) | Goal of the session. |
| <a id="duoworkflowhumanstatus"></a>`humanStatus` | [`String!`](#string) | Human-readable status of the session. |
| <a id="duoworkflowid"></a>`id` | [`ID!`](#id) | ID of the session. |
| <a id="duoworkflowlastexecutorlogsurl"></a>`lastExecutorLogsUrl` | [`String`](#string) | URL to the latest executor logs of the workflow. |
| <a id="duoworkflowmcpenabled"></a>`mcpEnabled` | [`Boolean`](#boolean) | Has MCP been enabled for the namespace. |
| <a id="duoworkflowpreapprovedagentprivilegesnames"></a>`preApprovedAgentPrivilegesNames` | [`[String!]`](#string) | Privileges pre-approved for the agent during execution. |
| <a id="duoworkflowproject"></a>`project` | [`Project!`](#project) | Project that the session is in. |

View File

@ -184,7 +184,7 @@ To disable instance runners for a project:
1. On the left sidebar, select **Search or go to** and find your project.
1. Select **Settings > CI/CD**.
1. Expand **Runners**.
1. In the **Instance runners** area, enable the **Turn runners for this project** toggle.
1. In the **Instance runners** area, turn off the **Turn on runners for this project** toggle.
Instance runners are automatically disabled for a project:

View File

@ -95,8 +95,8 @@ enhancement. They are responsible for:
[assigned to the DevOps stage group](https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments)
that is delivering the new feature or feature enhancements.
The first merge request where a feature can be tested should include the
documentation, even if the feature is behind a feature flag.
When possible, the merge request with the code should include the
documentation.
For more information, see the [guidelines](feature_flags.md).
The author of this MR, either a frontend or backend developer, should write the documentation.

View File

@ -18,7 +18,7 @@ This is a partial list of the [RSpec metadata](https://rspec.info/features/3-12/
| `:external_ai_provider` | The test requires an environment that is integrated with a real external AI provider. |
| `:feature_flag` | The test uses a feature flag and therefore requires an administrator account to run. When `scope` is set to `:global`, the test will be skipped on all live .com environments. Otherwise, it will be skipped only on Canary, Production, and Pre-production. See [testing with feature flags](feature_flags.md) for more details. |
| `:geo` | The test requires two GitLab Geo instances - a primary and a secondary - to be spun up. |
| `:gitaly_cluster` | The test runs against a GitLab instance where repositories are stored on redundant Gitaly nodes behind a Praefect node. All nodes are [separate containers](../../../../administration/gitaly/praefect/_index.md#requirements). Tests that use this tag have a longer setup time since there are three additional containers that need to be started. |
| `:gitaly_cluster` | The test runs against a GitLab instance where repositories are stored on redundant Gitaly nodes behind a Praefect node. All nodes are [separate containers](../../../../administration/gitaly/praefect/configure.md#requirements). Tests that use this tag have a longer setup time since there are three additional containers that need to be started. |
| `:github` | The test requires a GitHub personal access token. |
| `:group_saml` | The test requires a GitLab instance that has SAML SSO enabled for the group. Interacts with an external SAML identity provider. Paired with the `:orchestrated` tag. |
| `:instance_saml` | The test requires a GitLab instance that has SAML SSO enabled for the instance. Interacts with an external SAML identity provider. Paired with the `:orchestrated` tag. |

View File

@ -225,7 +225,7 @@ for offline environments.
### Configure NTP
Gitaly Cluster assumes `pool.ntp.org` is accessible. If `pool.ntp.org` is not accessible, [customize the time server setting](../../administration/gitaly/praefect/_index.md#customize-time-server-setting) on the Gitaly
Gitaly Cluster assumes `pool.ntp.org` is accessible. If `pool.ntp.org` is not accessible, [customize the time server setting](../../administration/gitaly/praefect/configure.md#customize-time-server-setting) on the Gitaly
and Praefect servers so they can use an accessible NTP server.
On offline instances, the [GitLab Geo check Rake task](../../administration/geo/replication/troubleshooting/common.md#can-geo-detect-the-current-site-correctly)

View File

@ -205,7 +205,7 @@ if you can't upgrade to 15.11.12 and later.
[issue 393216](https://gitlab.com/gitlab-org/gitlab/-/issues/393216).
- The second [bug fix](https://gitlab.com/gitlab-org/gitlab/-/issues/394760) ensures it is possible to upgrade directly from 15.4.x.
- As part of the [CI Partitioning effort](../../architecture/blueprints/ci_data_decay/pipeline_partitioning.md), a [new Foreign Key](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/107547) was added to `ci_builds_needs`. On GitLab instances with large CI tables, adding this constraint can take longer than usual.
- Praefect's metadata verifier [invalid metadata deletion behavior](../../administration/gitaly/praefect/_index.md#enable-deletions) is now enabled by default.
- Praefect's metadata verifier [invalid metadata deletion behavior](../../administration/gitaly/praefect/configure.md#enable-deletions) is now enabled by default.
The metadata verifier processes replica records in the Praefect database and verifies the replicas actually exist on the Gitaly nodes. If the replica doesn't exist, its
metadata record is deleted. This enables Praefect to fix situations where a replica has a metadata record indicating it's fine but, in reality, it doesn't exist on disk.
@ -216,7 +216,7 @@ if you can't upgrade to 15.11.12 and later.
unavailable repositories in the metrics and `praefect dataloss` sub-command because of the replica records being removed. If you encounter such repositories, remove
the repository using `praefect remove-repository` to remove the repository's remaining records.
You can find repositories with invalid metadata records prior in GitLab 15.0 and later by searching for the log records outputted by the verifier. [Read more about repository verification, and to see an example log entry](../../administration/gitaly/praefect/_index.md#repository-verification).
You can find repositories with invalid metadata records prior in GitLab 15.0 and later by searching for the log records outputted by the verifier. [Read more about repository verification, and to see an example log entry](../../administration/gitaly/praefect/configure.md#repository-verification).
- Praefect configuration changes significantly for Linux package instances in GitLab 16.0. You can begin migrating to the new structure in GitLab 15.9 while backwards compatibility is
maintained in the lead up to GitLab 16.0. [Read more about this change](gitlab_16_changes.md#praefect-configuration-structure-change).
@ -741,7 +741,7 @@ potentially cause downtime.
- GitLab 15.4.0 includes a [batched background migration](../background_migrations.md#batched-background-migrations) to [remove incorrect values from `expire_at` in `ci_job_artifacts` table](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/89318).
This migration might take hours or days to complete on larger GitLab instances.
- By default, Gitaly and Praefect nodes use the time server at `pool.ntp.org`. If your instance can not connect to `pool.ntp.org`,
[configure the `NTP_HOST` variable](../../administration/gitaly/praefect/_index.md#customize-time-server-setting) otherwise, there can be `ntp: read udp ... i/o timeout` errors
[configure the `NTP_HOST` variable](../../administration/gitaly/praefect/configure.md#customize-time-server-setting) otherwise, there can be `ntp: read udp ... i/o timeout` errors
in the logs and the output of `gitlab-rake gitlab:gitaly:check`. However, if the Gitaly hosts' times are in sync, these errors can be ignored.
- GitLab 15.4.0 introduced a default [Sidekiq routing rule](../../administration/sidekiq/processing_specific_job_classes.md#routing-rules) that routes all jobs to the `default` queue. For instances using [queue selectors](https://archives.docs.gitlab.com/17.0/ee/administration/sidekiq/processing_specific_job_classes.html#queue-selectors-deprecated), this causes [performance problems](https://gitlab.com/gitlab-com/gl-infra/scalability/-/issues/1991) as some Sidekiq processes will be idle.
- The default routing rule has been reverted in 15.4.5, so upgrading to that version or later will return to the previous behavior.

View File

@ -1313,7 +1313,7 @@ Migrate by moving your existing configuration under the new structure. `git_data
If you are running Gitaly cluster, [migrate Praefect to the new configuration structure **first**](#praefect-configuration-structure-change).
Once this change is tested, proceed with your Gitaly nodes.
If Gitaly is misconfigured as part of the configuration structure change, [repository verification](../../administration/gitaly/praefect/_index.md#repository-verification)
If Gitaly is misconfigured as part of the configuration structure change, [repository verification](../../administration/gitaly/praefect/configure.md#repository-verification)
will [delete metadata required for Gitaly cluster to work](https://gitlab.com/gitlab-org/gitaly/-/issues/5529).
To protect against configuration mistakes, temporarily disable repository verification in Praefect.
@ -1331,7 +1331,7 @@ To protect against configuration mistakes, temporarily disable repository verifi
1. Apply the change with `gitlab-ctl reconfigure`.
1. Test Git repository functionality in GitLab.
1. Remove the old keys from the configuration once migrated, and then re-run `gitlab-ctl reconfigure`.
1. Recommended, if you're running Gitaly Cluster. Reinstate Praefect [repository verification](../../administration/gitaly/praefect/_index.md#repository-verification)
1. Recommended, if you're running Gitaly Cluster. Reinstate Praefect [repository verification](../../administration/gitaly/praefect/configure.md#repository-verification)
by removing `verification_interval: 0`.
The new structure is documented in the following script with the old keys described in a comment above the new keys.
@ -1505,7 +1505,7 @@ Migrate by moving your existing configuration under the new structure. The new s
Migrate Praefect to the new configuration structure **first**.
Once this change is tested, [proceed with your Gitaly nodes](#gitaly-configuration-structure-change).
If Gitaly is misconfigured as part of the configuration structure change, [repository verification](../../administration/gitaly/praefect/_index.md#repository-verification)
If Gitaly is misconfigured as part of the configuration structure change, [repository verification](../../administration/gitaly/praefect/configure.md#repository-verification)
will [delete metadata required for Gitaly cluster to work](https://gitlab.com/gitlab-org/gitaly/-/issues/5529).
To protect against configuration mistakes, temporarily disable repository verification in Praefect.

View File

@ -556,7 +556,7 @@ The OpenSSL 3 upgrade has been postponed to GitLab 17.7.0.
Then run `gitlab-ctl reconfigure`.
ALPN enforcement has been disabled again in [GitLab 17.5.5 and other versions](../../administration/gitaly/praefect/_index.md#alpn-enforcement).
ALPN enforcement has been disabled again in [GitLab 17.5.5 and other versions](../../administration/gitaly/praefect/configure.md#alpn-enforcement).
Upgrading to one of those versions removes the need to set `GRPC_ENFORCE_ALPN_ENABLED`.
## 17.3.0

View File

@ -191,7 +191,7 @@ In the future this functionality may be changed, [refer to this Epic](https://gi
{{< alert type="note" >}}
This section focuses exclusively on the Praefect component, not its [required PostgreSQL database](../administration/gitaly/praefect/_index.md#postgresql). The [GitLab Linux package does not offer HA](https://gitlab.com/groups/gitlab-org/-/epics/7814) and subsequently Zero Downtime support for the Praefect database. A third party database solution is required to avoid downtime.
This section focuses exclusively on the Praefect component, not its [required PostgreSQL database](../administration/gitaly/praefect/configure.md#postgresql). The [GitLab Linux package does not offer HA](https://gitlab.com/groups/gitlab-org/-/epics/7814) and subsequently Zero Downtime support for the Praefect database. A third party database solution is required to avoid downtime.
{{< /alert >}}

View File

@ -0,0 +1,21 @@
# frozen_string_literal: true
module Gitlab
module Utils
# Converts a class into the string representation of its name
# Example: `ClassNameConverter.new(Ci::SecureFile).string_representation` returns "ci_secure_file"
class ClassNameConverter
def initialize(klass)
@klass = klass
end
def string_representation
klass.name.underscore.tr('/', '_')
end
private
attr_reader :klass
end
end
end

View File

@ -56277,6 +56277,9 @@ msgstr ""
msgid "SecurityLabels|Security labels"
msgstr ""
msgid "SecurityLabels|Security labels help classify and organize your projects. Labels are managed at the group level. You can add or remove labels to this project as needed."
msgstr ""
msgid "SecurityLabels|Selection type"
msgstr ""

View File

@ -1,35 +1,34 @@
# frozen_string_literal: true
# This script deletes all projects directly under a group specified by ENV['TOP_LEVEL_GROUP_NAME']
# This script deletes all projects directly under all 'gitlab-e2e-sandbox-group-<#0-7>' groups OR a group specified by
# ENV['TOP_LEVEL_GROUP_NAME']
# - If `dry_run` is true the script will list projects to be deleted, but it won't delete them
# Required environment variables: GITLAB_QA_ACCESS_TOKEN and GITLAB_ADDRESS
# Optional environment variables: TOP_LEVEL_GROUP_NAME (default: 'gitlab-e2e-sandbox-group-<current weekday #>'),
# CLEANUP_ALL_E2E_SANDBOX_GROUPS (default: false),
# Optional environment variables: TOP_LEVEL_GROUP_NAME,
# PERMANENTLY_DELETE (default: false),
# DELETE_BEFORE (default: 1 day ago)
# DELETE_BEFORE - YYYY-MM-DD, YYYY-MM-DD HH:MM:SS, or YYYY-MM-DDT00:00:00Z
# - Set TOP_LEVEL_GROUP_NAME to the name of the e2e sandbox group that you would like to delete projects under.
# - Set CLEANUP_ALL_E2E_SANDBOX_GROUPS to true if you would like to delete projects under all
# 'gitlab-e2e-sandbox-group-*' groups. Otherwise, this will fall back to TOP_LEVEL_GROUP_NAME.
# Otherwise, this will fall back to deleting projects under all top level groups.
# - Set PERMANENTLY_DELETE to true if you would like to permanently delete subgroups on an environment with
# deletion protection enabled. Otherwise, subgroups will remain available during the retention period specified
# in admin settings. On environments with deletion protection disabled, subgroups will always be permanently deleted.
# - Set DELETE_BEFORE to only delete projects that were created before a given date, otherwise defaults to 1 day ago
# - Set DELETE_BEFORE to only delete projects that were created before a given date, otherwise defaults to 2 hours ago
# Run `rake delete_projects`
module QA
module Tools
class DeleteProjects < DeleteResourceBase
# @example mark projects for deletion under 'gitlab-e2e-sandbox-group-<current weekday #>' older than 1 day
# @example mark projects for deletion that are older than 2 hours under all gitlab-e2e-sandbox-group-<#0-7> groups
# GITLAB_ADDRESS=<address> \
# GITLAB_QA_ACCESS_TOKEN=<token> bundle exec rake delete_projects
#
# @example permanently delete projects older than 1 day under all gitlab-e2e-sandbox-group-* groups
# @example permanently delete projects older than 2 hours under all gitlab-e2e-sandbox-group-<#0-7> groups
# GITLAB_ADDRESS=<address> \
# GITLAB_QA_ACCESS_TOKEN=<token> \
# CLEANUP_ALL_E2E_SANDBOX_GROUPS=true \
# PERMANENTLY_DELETE=true bundle exec rake delete_projects
#
# @example mark projects for deletion under 'gitlab-e2e-sandbox-group-2' created before 2023-01-01
@ -48,14 +47,14 @@ module QA
end
def run
if ENV['CLEANUP_ALL_E2E_SANDBOX_GROUPS']
if ENV['TOP_LEVEL_GROUP_NAME']
group_id = fetch_group_id(@api_client, ENV['TOP_LEVEL_GROUP_NAME'])
results = delete_projects(group_id)
else
results = SANDBOX_GROUPS.flat_map do |name|
group_id = fetch_group_id(@api_client, name)
delete_projects(group_id)
end.compact
else
group_id = fetch_group_id(@api_client)
results = delete_projects(group_id)
end
log_results(results)

View File

@ -12,7 +12,8 @@ module QA
ITEMS_PER_PAGE = '100'
PAGE_CUTOFF = '10'
SANDBOX_GROUPS = %w[gitlab-e2e-sandbox-group-1
SANDBOX_GROUPS = %w[gitlab-e2e-sandbox-group-0
gitlab-e2e-sandbox-group-1
gitlab-e2e-sandbox-group-2
gitlab-e2e-sandbox-group-3
gitlab-e2e-sandbox-group-4
@ -27,7 +28,7 @@ module QA
@api_client = Runtime::API::Client.new(ENV['GITLAB_ADDRESS'],
personal_access_token: ENV['GITLAB_QA_ACCESS_TOKEN'])
@delete_before = Date.parse(ENV['DELETE_BEFORE'] || (Date.today - 1).to_s)
@delete_before = Time.parse(ENV['DELETE_BEFORE'] || (Time.now - (2 * 3600)).to_s).utc.iso8601(3)
@dry_run = dry_run
@permanently_delete = !!(ENV['PERMANENTLY_DELETE'].to_s =~ /true|1|y/i)
@type = nil
@ -164,7 +165,7 @@ module QA
).url
if response.code == HTTP_STATUS_OK
resources.concat(parse_body(response).select { |r| Date.parse(r[:created_at]) < @delete_before })
resources.concat(parse_body(response).select { |r| Time.parse(r[:created_at]) < @delete_before })
else
logger.error("Request for #{@type} returned (#{response.code}): `#{response}` ")
exit 1 if fatal_response?(response.code)

View File

@ -1,36 +1,33 @@
# frozen_string_literal: true
# This script deletes all subgroups of a group specified by ENV['TOP_LEVEL_GROUP_NAME']
# - If `dry_run` is true the script will list groups to be deleted, but it won't delete them
# This script deletes all subgroups of all 'gitlab-e2e-sandbox-group-<#0-7>' groups OR all subgroups of a group
# specified by ENV['TOP_LEVEL_GROUP_NAME']
# - If `dry_run` is true the script will list subgroups to be deleted, but it won't delete them
# Required environment variables: GITLAB_QA_ACCESS_TOKEN and GITLAB_ADDRESS
# Optional environment variables: TOP_LEVEL_GROUP_NAME (default: 'gitlab-e2e-sandbox-group-<current weekday #>'),
# CLEANUP_ALL_E2E_SANDBOX_GROUPS (default: false),
# Optional environment variables: TOP_LEVEL_GROUP_NAME,
# PERMANENTLY_DELETE (default: false),
# DELETE_BEFORE (default: 1 day ago)
# - Set TOP_LEVEL_GROUP_NAME to override the default group name determination logic.
# If not set, the default group name will be:
# - All 'gitlab-e2e-sandbox-group-*' groups when CLEANUP_ALL_E2E_SANDBOX_GROUPS is true
# - 'gitlab-e2e-sandbox-group-<current weekday #>' when CLEANUP_ALL_E2E_SANDBOX_GROUPS is false
# DELETE_BEFORE - YYYY-MM-DD, YYYY-MM-DD HH:MM:SS, or YYYY-MM-DDT00:00:00Z
# - Set TOP_LEVEL_GROUP_NAME to only delete subgroups under the given group.
# If not set, subgroups of all 'gitlab-e2e-sandbox-group-<#0-7>' groups will be deleted.
# - Set PERMANENTLY_DELETE to true if you would like to permanently delete subgroups on an environment with
# deletion protection enabled. Otherwise, subgroups will remain available during the retention period specified
# in admin settings. On environments with deletion protection disabled, subgroups will always be permanently deleted.
# - Set DELETE_BEFORE to only delete snippets that were created before a given date, otherwise defaults to 1 day ago
# - Set DELETE_BEFORE to only delete snippets that were created before a given date, otherwise defaults to 2 hours ago
# Run `rake delete_subgroups`
module QA
module Tools
class DeleteSubgroups < DeleteResourceBase
# @example mark subgroups for deletion that are older than 1 day under 'gitlab-e2e-sandbox-group-<current weekday #>'
# @example mark subgroups for deletion that are older than 2 hours under all gitlab-e2e-sandbox-group-<#0-7> groups
# GITLAB_ADDRESS=<address> \
# GITLAB_QA_ACCESS_TOKEN=<token> bundle exec rake delete_subgroups
#
# @example permanently delete subgroups older than 1 day under all gitlab-e2e-sandbox-group-* groups
# @example permanently delete subgroups older than 2 hours under all gitlab-e2e-sandbox-group-<#0-7> groups
# GITLAB_ADDRESS=<address> \
# GITLAB_QA_ACCESS_TOKEN=<token> \
# CLEANUP_ALL_E2E_SANDBOX_GROUPS=true \
# PERMANENTLY_DELETE=true bundle exec rake delete_subgroups
#
# @example mark subgroups for deletion under 'gitlab-e2e-sandbox-group-2' created before 2023-01-01
@ -49,14 +46,14 @@ module QA
end
def run
if ENV['CLEANUP_ALL_E2E_SANDBOX_GROUPS'] && !ENV['TOP_LEVEL_GROUP_NAME']
if ENV['TOP_LEVEL_GROUP_NAME']
group_id = fetch_group_id(@api_client, ENV['TOP_LEVEL_GROUP_NAME'])
results = delete_subgroups(group_id)
else
results = SANDBOX_GROUPS.flat_map do |name|
group_id = fetch_group_id(@api_client, name)
delete_subgroups(group_id)
end.compact
else
group_id = fetch_group_id(@api_client)
results = delete_subgroups(group_id)
end
log_results(results)

View File

@ -6,15 +6,15 @@
# Required environment variables: GITLAB_QA_ACCESS_TOKEN and GITLAB_ADDRESS
# - GITLAB_QA_ACCESS_TOKEN should have API access and belong to the user whose snippets will be deleted
# Optional environment variables: DELETE_BEFORE (default: 1 day ago)
# - Set DELETE_BEFORE to only delete snippets that were created before a given date, otherwise defaults to 1 day ago
# Optional environment variables: DELETE_BEFORE - YYYY-MM-DD, YYYY-MM-DD HH:MM:SS, or YYYY-MM-DDT00:00:00Z
# - Set DELETE_BEFORE to only delete snippets that were created before a given date, otherwise defaults to 2 hours ago
# Run `rake delete_test_snippets`
module QA
module Tools
class DeleteTestSnippets < DeleteResourceBase
# @example delete snippets older than 1 day for the user associated with the given access token
# @example delete snippets older than 2 hours for the user associated with the given access token
# GITLAB_ADDRESS=<address> \
# GITLAB_QA_ACCESS_TOKEN=<token> bundle exec rake delete_test_snippets
#

View File

@ -8,8 +8,8 @@
# Required environment variables: GITLAB_QA_ACCESS_TOKEN and GITLAB_ADDRESS
# - GITLAB_QA_ACCESS_TOKEN should have API access and belong to the user whose keys will be deleted
# Optional environment variables: DELETE_BEFORE (default: 1 day ago)
# - Set DELETE_BEFORE to only delete snippets that were created before a given date, otherwise defaults to 1 day ago
# Optional environment variables: DELETE_BEFORE - YYYY-MM-DD, YYYY-MM-DD HH:MM:SS, or YYYY-MM-DDT00:00:00Z
# - Set DELETE_BEFORE to only delete snippets that were created before a given date, otherwise defaults to 2 hours ago
# Run `rake delete_test_ssh_keys`

View File

@ -7,8 +7,8 @@
# Required environment variables: GITLAB_QA_ADMIN_ACCESS_TOKEN, GITLAB_QA_ACCESS_TOKEN, and GITLAB_ADDRESS
# - GITLAB_QA_ADMIN_ACCESS_TOKEN must have admin API access
# Optional environment variables: DELETE_BEFORE (default: 1 day ago)
# - Set DELETE_BEFORE to only delete users that were created before a given date, otherwise defaults to 1 day ago
# Optional environment variables: DELETE_BEFORE - YYYY-MM-DD, YYYY-MM-DD HH:MM:SS, or YYYY-MM-DDT00:00:00Z
# - Set DELETE_BEFORE to only delete users that were created before a given date, otherwise defaults to 2 hours ago
# Run `rake delete_test_users`

View File

@ -4,15 +4,16 @@
# - If `dry_run` is true the script will list groups to be deleted, but it won't delete them
# Required environment variables: GITLAB_QA_ACCESS_TOKEN, GITLAB_ADDRESS
# Optional environment variables: DELETE_BEFORE
# - Set DELETE_BEFORE to delete only groups that were created before the given date (default: 1 day ago)
# Optional environment variables: DELETE_BEFORE - YYYY-MM-DD, YYYY-MM-DD HH:MM:SS, or YYYY-MM-DDT00:00:00Z
# - Set DELETE_BEFORE to delete only groups that were created before the given date (default: 2 hours ago)
# Run `rake delete_user_groups`
module QA
module Tools
class DeleteUserGroups < DeleteResourceBase
EXCLUDE_GROUPS = %w[gitlab-e2e-sandbox-group-1
EXCLUDE_GROUPS = %w[gitlab-e2e-sandbox-group-0
gitlab-e2e-sandbox-group-1
gitlab-e2e-sandbox-group-2
gitlab-e2e-sandbox-group-3
gitlab-e2e-sandbox-group-4
@ -30,7 +31,7 @@ module QA
qa-perf-testing
remote-development].freeze
# @example - delete user groups older than 1 day
# @example - delete user groups older than 2 hours
# GITLAB_ADDRESS=<address> \
# GITLAB_QA_ACCESS_TOKEN=<token> \
# bundle exec rake delete_user_groups

View File

@ -8,8 +8,8 @@
# OR
# - USER_ID to the id of the user whose projects are to be deleted.
# Optional environment variables: DELETE_BEFORE
# - Set DELETE_BEFORE to delete only projects that were created before the given date (default: 1 day ago)
# Optional environment variables: DELETE_BEFORE - YYYY-MM-DD, YYYY-MM-DD HH:MM:SS, or YYYY-MM-DDT00:00:00Z
# - Set DELETE_BEFORE to delete only projects that were created before the given date (default: 2 hours ago)
# Run `rake delete_user_projects`
@ -26,7 +26,7 @@ module QA
gitlab-qa-user5
gitlab-qa-user6].freeze
# @example - delete the given users projects older than 3 days
# @example - delete the given users projects older than 2 hours
# GITLAB_ADDRESS=<address> \
# GITLAB_QA_ACCESS_TOKEN=<token> \
# USER_ID=<id> bundle exec rake delete_user_projects

View File

@ -5,9 +5,7 @@ module QA
module Lib
module Group
include Support::API
def fetch_group_id(api_client, name = ENV['TOP_LEVEL_GROUP_NAME'])
group_name = name || "gitlab-e2e-sandbox-group-#{Time.now.wday + 1}"
def fetch_group_id(api_client, group_name)
logger.info("Fetching group #{group_name}...")
group_search_response = get Runtime::API::Request.new(api_client, "/groups/#{group_name}").url

View File

@ -1,53 +0,0 @@
# frozen_string_literal: true
require 'spec_helper'
require_migration!
RSpec.describe MigrateAnonymousSearchesFlagToApplicationSettingsV2, feature_category: :global_search do
let!(:application_setting) { table(:application_settings).create! }
describe '#down' do
let(:migration) { described_class.new }
context 'when search settings is already set' do
it 'removes the global search settings' do
migration.up
expected_search = application_setting.reload.search
expected_search.delete('anonymous_searches_allowed')
expect { migration.down }.to change { application_setting.reload.search }.to(expected_search)
end
end
end
describe '#up' do
context 'when ff is enabled' do
it 'migrates search from the feature flags in the application_settings successfully' do
search_settings = application_setting.reload.search
expected_settings = { 'anonymous_searches_allowed' => true }
expected_search = search_settings.merge(expected_settings)
expect { migrate! }.to change {
application_setting.reload.search
}.to eq(expected_search)
end
end
context 'when both ff are disabled' do
before do
stub_feature_flags(allow_anonymous_searches: false)
end
it 'migrates search from the feature flags in the application_settings successfully' do
search_settings = application_setting.reload.search
expected_settings = {
'anonymous_searches_allowed' => false
}
expected_search = search_settings.merge(expected_settings)
expect { migrate! }.to change {
application_setting.reload.search
}.to eq(expected_search)
end
end
end
end

View File

@ -47,4 +47,13 @@ RSpec.describe Ci::Workloads::Workload, feature_category: :continuous_integratio
let!(:model) { create(:ci_workload, project: parent) }
end
end
describe '#logs_url' do
it 'returns the pipeline url' do
allow(Gitlab::Routing).to receive_message_chain(:url_helpers, :project_pipeline_url)
.with(workload.project, workload.pipeline).and_return('log-url')
expect(workload.logs_url).to eq('log-url')
end
end
end

View File

@ -263,7 +263,7 @@ RSpec.describe 'Bulk update work items', feature_category: :team_planning do
}
end
it 'updates all specified attributes' do
it 'updates all specified attributes', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/553628' do
expect do
post_graphql_mutation(mutation, current_user: current_user)
updatable_work_items.each(&:reload)

View File

@ -412,6 +412,25 @@ RSpec.describe 'project routing', feature_category: :groups_and_projects do
it 'to #show' do
expect(get('/gitlab/gitlabhq/-/commits/master.atom')).to route_to('projects/commits#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master.atom')
expect(get('/gitlab/gitlabhq/-/commits/master')).to route_to('projects/commits#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master')
expect(get('/gitlab/gitlabhq/-/commits/master?format=json')).to route_to('projects/commits#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'master', format: 'json')
# complex branch name without encoding (incorrect format)
expect(get('/gitlab/gitlabhq/-/commits/feature/name')).to route_to('projects/commits#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature/name')
expect(get('/gitlab/gitlabhq/-/commits/feature/name?format=json')).to route_to('projects/commits#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature/name', format: 'json')
# complex branch name with encoding
expect(get('/gitlab/gitlabhq/-/commits/feature%2Fname')).to route_to('projects/commits#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature/name')
expect(get('/gitlab/gitlabhq/-/commits/feature%2Fname?format=json')).to route_to('projects/commits#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature/name', format: 'json')
# collision with signatures route
expect(get('/gitlab/gitlabhq/-/commits/feature/signatures')).to route_to('projects/commits#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature/signatures')
expect(get('/gitlab/gitlabhq/-/commits/feature/signatures?format=json&offset=40')).to route_to('projects/commits#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature/signatures', format: 'json', offset: '40')
end
it 'to #signatures' do
expect(get('/gitlab/gitlabhq/-/commits/feature/signatures?format=json')).to route_to('projects/commits#signatures', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature', format: 'json')
expect(get('/gitlab/gitlabhq/-/commits/feature%2Fsignatures/signatures?format=json')).to route_to('projects/commits#signatures', namespace_id: 'gitlab', project_id: 'gitlabhq', id: 'feature/signatures', format: 'json')
end
it_behaves_like 'redirecting a legacy path', "/gitlab/gitlabhq/commits/master", "/gitlab/gitlabhq/-/commits/master"

View File

@ -741,7 +741,7 @@ RSpec.shared_examples 'a deployable job' do
end
def factory_type
described_class.name.underscore.tr('/', '_')
::Gitlab::Utils::ClassNameConverter.new(described_class).string_representation
end
end
# rubocop:enable Layout/LineLength

View File

@ -29,6 +29,6 @@ RSpec.shared_examples 'a deployable job in EE' do
end
def factory_type
described_class.name.underscore.tr('/', '_')
::Gitlab::Utils::ClassNameConverter.new(described_class).string_representation
end
end

View File

@ -272,6 +272,6 @@ RSpec.shared_examples 'a model including Escalatable' do
private
def factory_from_class(klass)
klass.name.underscore.tr('/', '_')
::Gitlab::Utils::ClassNameConverter.new(klass).string_representation
end
end

View File

@ -27,6 +27,6 @@ RSpec.shared_examples 'measurable service' do
end
def described_class_name
described_class.name.underscore.tr('/', '_')
::Gitlab::Utils::ClassNameConverter.new(described_class).string_representation
end
end