Add latest changes from gitlab-org/gitlab@master
This commit is contained in:
parent
b509e5036e
commit
58d551b146
|
|
@ -1 +1 @@
|
|||
992a949c0146091c019744392eaffaaa19405a7a
|
||||
7509a441f22277474a95dca141dc18bf6e1953be
|
||||
|
|
|
|||
2
Gemfile
2
Gemfile
|
|
@ -712,7 +712,7 @@ gem 'cvss-suite', '~> 3.0.1', require: 'cvss_suite' # rubocop:todo Gemfile/Missi
|
|||
gem 'arr-pm', '~> 0.0.12' # rubocop:todo Gemfile/MissingFeatureCategory
|
||||
|
||||
# Remote Development
|
||||
gem 'devfile', '~> 0.0.26.pre.alpha1', feature_category: :remote_development
|
||||
gem 'devfile', '~> 0.0.26.pre.alpha1', feature_category: :workspaces
|
||||
|
||||
# Apple plist parsing
|
||||
gem 'CFPropertyList', '~> 3.0.0' # rubocop:todo Gemfile/MissingFeatureCategory
|
||||
|
|
|
|||
|
|
@ -91,6 +91,7 @@ export default {
|
|||
showStatusChecks: { default: false },
|
||||
showApprovers: { default: false },
|
||||
showCodeOwners: { default: false },
|
||||
canAdminProtectedBranches: { default: false },
|
||||
},
|
||||
apollo: {
|
||||
// eslint-disable-next-line @gitlab/vue-no-undef-apollo-properties
|
||||
|
|
@ -437,7 +438,7 @@ export default {
|
|||
:users="mergeAccessLevels.users"
|
||||
:groups="mergeAccessLevels.groups"
|
||||
:empty-state-copy="$options.i18n.allowedToMergeEmptyState"
|
||||
is-edit-available
|
||||
:is-edit-available="canAdminProtectedBranches"
|
||||
data-testid="allowed-to-merge-content"
|
||||
@edit="openAllowedToMergeDrawer"
|
||||
/>
|
||||
|
|
@ -468,7 +469,7 @@ export default {
|
|||
:deploy-keys="pushAccessLevels.deployKeys"
|
||||
:empty-state-copy="$options.i18n.allowedToPushEmptyState"
|
||||
:help-text="$options.i18n.allowedToPushDescription"
|
||||
is-edit-available
|
||||
:is-edit-available="canAdminProtectedBranches"
|
||||
data-testid="allowed-to-push-content"
|
||||
@edit="openAllowedToPushAndMergeDrawer"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -16,6 +16,9 @@ export default {
|
|||
GlLink,
|
||||
},
|
||||
mixins: [glFeatureFlagsMixin()],
|
||||
inject: {
|
||||
canAdminProtectedBranches: { default: false },
|
||||
},
|
||||
props: {
|
||||
dataTestIdPrefix: {
|
||||
type: String,
|
||||
|
|
@ -71,12 +74,15 @@ export default {
|
|||
|
||||
return this.isProtected ? Boolean(this.description) : false;
|
||||
},
|
||||
canEditProtectionToggles() {
|
||||
return this.canAdminProtectedBranches && this.glFeatures.editBranchRules;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="glFeatures.editBranchRules">
|
||||
<div v-if="canEditProtectionToggles">
|
||||
<gl-toggle
|
||||
:label="label"
|
||||
:help="help"
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ export default function mountBranchRules(el, store) {
|
|||
showStatusChecks,
|
||||
showApprovers,
|
||||
showCodeOwners,
|
||||
canAdminProtectedBranches,
|
||||
} = el.dataset;
|
||||
|
||||
return new Vue({
|
||||
|
|
@ -43,6 +44,7 @@ export default function mountBranchRules(el, store) {
|
|||
showStatusChecks: parseBoolean(showStatusChecks),
|
||||
showApprovers: parseBoolean(showApprovers),
|
||||
showCodeOwners: parseBoolean(showCodeOwners),
|
||||
canAdminProtectedBranches: parseBoolean(canAdminProtectedBranches),
|
||||
},
|
||||
render(h) {
|
||||
return h(View);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,8 @@ module Projects
|
|||
branches_path: project_branches_path(project),
|
||||
show_status_checks: 'false',
|
||||
show_approvers: 'false',
|
||||
show_code_owners: 'false'
|
||||
show_code_owners: 'false',
|
||||
can_admin_protected_branches: can?(current_user, :admin_protected_branch, project).to_s
|
||||
}
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -48,10 +48,6 @@ class MergeRequestPolicy < IssuablePolicy
|
|||
enable :mark_note_as_internal
|
||||
end
|
||||
|
||||
rule { admin }.policy do
|
||||
enable :approve_merge_request
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def can_approve?
|
||||
|
|
|
|||
|
|
@ -250,7 +250,7 @@ domains:
|
|||
RemoteDevelopment:
|
||||
description:
|
||||
feature_categories:
|
||||
- remote_development
|
||||
- workspaces
|
||||
|
||||
Repositories:
|
||||
description: Git repositories and workflow including Gitaly client
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@
|
|||
- container_scanning
|
||||
- continuous_delivery
|
||||
- continuous_integration
|
||||
- custom_models
|
||||
- customersdot_and_quote_to_cash_integrations
|
||||
- database
|
||||
- dataops
|
||||
|
|
@ -87,6 +86,7 @@
|
|||
- metrics
|
||||
- mlops
|
||||
- mobile_devops
|
||||
- model_personalization
|
||||
- navigation
|
||||
- notifications
|
||||
- okr_management
|
||||
|
|
@ -109,7 +109,6 @@
|
|||
- redis
|
||||
- release_evidence
|
||||
- release_orchestration
|
||||
- remote_development
|
||||
- requirements_management
|
||||
- review_apps
|
||||
- runner
|
||||
|
|
@ -119,6 +118,7 @@
|
|||
- secrets_management
|
||||
- secure_artifacts
|
||||
- security_policy_management
|
||||
- self-hosted_models
|
||||
- service_desk
|
||||
- service_ping
|
||||
- settings
|
||||
|
|
@ -139,3 +139,4 @@
|
|||
- web_ide
|
||||
- webhooks
|
||||
- wiki
|
||||
- workspaces
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ table_name: ai_feature_settings
|
|||
classes:
|
||||
- Ai::FeatureSetting
|
||||
feature_categories:
|
||||
- custom_models
|
||||
- self-hosted_models
|
||||
description: The table links an AI feature with the self-hosted model
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/152380
|
||||
milestone: '17.1'
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ table_name: ai_self_hosted_models
|
|||
classes:
|
||||
- Ai::SelfHostedModel
|
||||
feature_categories:
|
||||
- custom_models
|
||||
- self-hosted_models
|
||||
description: An AI Self Hosted Model definition
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/151793
|
||||
milestone: '17.0'
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ table_name: ai_testing_terms_acceptances
|
|||
classes:
|
||||
- Ai::TestingTermsAcceptance
|
||||
feature_categories:
|
||||
- custom_models
|
||||
- self-hosted_models
|
||||
description: Records that an admin has accepted GitLab Testing Terms for an instance
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/155231
|
||||
milestone: '17.1'
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
---
|
||||
migration_job_name: RequeueResolveVulnerabilitiesForRemovedAnalyzers
|
||||
description: Resolves all detected vulnerabilities for removed analyzers.
|
||||
feature_category: static_application_security_testing
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/162691
|
||||
milestone: '17.4'
|
||||
queued_migration_version: 20240814085540
|
||||
# Replace with the approximate date you think it's best to ensure the completion of this BBM.
|
||||
finalize_after: '2024-09-22'
|
||||
finalized_by: # version of the migration that finalized this BBM
|
||||
|
|
@ -1,11 +1,10 @@
|
|||
---
|
||||
migration_job_name: ResolveVulnerabilitiesForRemovedAnalyzers
|
||||
description: Resolves all detected vulnerabilities for removed analyzers. No-oped and
|
||||
requeued in job RequeueResolveVulnerabilitiesForRemovedAnalyzers.
|
||||
description: Resolves all detected vulnerabilities for removed analyzers.
|
||||
feature_category: static_application_security_testing
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/157776
|
||||
milestone: '17.3'
|
||||
queued_migration_version: 20240805022839
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/162691
|
||||
milestone: '17.4'
|
||||
queued_migration_version: 20240814085540
|
||||
# Replace with the approximate date you think it's best to ensure the completion of this BBM.
|
||||
finalize_after: '2024-09-22'
|
||||
finalized_by: # version of the migration that finalized this BBM
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ table_name: remote_development_agent_configs
|
|||
classes:
|
||||
- RemoteDevelopment::RemoteDevelopmentAgentConfig
|
||||
feature_categories:
|
||||
- remote_development
|
||||
- workspaces
|
||||
description: Remote Development Cluster Agent Configuration
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/105783
|
||||
milestone: '16.0'
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ table_name: remote_development_namespace_cluster_agent_mappings
|
|||
classes:
|
||||
- RemoteDevelopment::RemoteDevelopmentNamespaceClusterAgentMapping
|
||||
feature_categories:
|
||||
- remote_development
|
||||
- workspaces
|
||||
description: >-
|
||||
This table records associations between Namespaces and Cluster Agents as a part of supporting group-cluster agent association
|
||||
in the context of Remote Development Workspaces
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ table_name: workspace_variables
|
|||
classes:
|
||||
- RemoteDevelopment::WorkspaceVariable
|
||||
feature_categories:
|
||||
- remote_development
|
||||
- workspaces
|
||||
description: Remote Development Workspace variables
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/129688
|
||||
milestone: '16.4'
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ table_name: workspaces
|
|||
classes:
|
||||
- RemoteDevelopment::Workspace
|
||||
feature_categories:
|
||||
- remote_development
|
||||
- workspaces
|
||||
description: Remote Development Workspaces
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/105783
|
||||
milestone: '16.0'
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ classes:
|
|||
- RemoteDevelopment::WorkspacesAgentConfig
|
||||
- Workspaces::WorkspacesAgentConfig
|
||||
feature_categories:
|
||||
- remote_development
|
||||
- workspaces
|
||||
description: Workspaces Cluster Agent Configs
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/163846
|
||||
milestone: '17.4'
|
||||
|
|
|
|||
|
|
@ -92,16 +92,19 @@ You need at least the Maintainer role to take ownership of a pipeline created by
|
|||
|
||||
## Troubleshooting
|
||||
|
||||
### Short refs are expanded to Full refs
|
||||
When working with pipeline schedules, you might encounter the following issues.
|
||||
|
||||
This behavior is normal and it introduced in order to enforce explicit resources.
|
||||
The API still accepts both `short` (e.g. `main`) and `full` (e.g. `refs/heads/main` or `refs/tags/main`) refs and expands any `short`
|
||||
ref provided, to a `full` ref.
|
||||
### Short refs are expanded to full refs
|
||||
|
||||
### Ambiguous Refs
|
||||
When you provide a short `ref` to the API, it is automatically expanded to a full `ref`. This behavior is intended and ensures explicit resource identification.
|
||||
|
||||
When a ref is being expanded, there can be cases where the full ref can't be automatically inferred.
|
||||
Such cases can be:
|
||||
The API accepts both short refs (such as `main`) and full refs (such as `refs/heads/main` or `refs/tags/main`).
|
||||
|
||||
- A `short` ref is provided (e.g. `main`) but **both** a branch and a tag exist with the provided `short` ref name
|
||||
- A `short` ref is provided, but **neither** a branch or tag with the provided `short` ref name exist
|
||||
### Ambiguous refs
|
||||
|
||||
In some cases, the API can't automatically expand a short `ref` to a full `ref`. This can happen when:
|
||||
|
||||
- You provide a short `ref` (such as `main`), but both a branch and a tag exist with that name.
|
||||
- You provide a short `ref`, but no branch or tag with that name exists.
|
||||
|
||||
To resolve this issue, provide the full `ref` to ensure the correct resource is identified.
|
||||
|
|
|
|||
|
|
@ -4398,6 +4398,8 @@ In this example:
|
|||
running the pipeline when using:
|
||||
- [Nested includes](includes.md#use-nested-includes).
|
||||
- [Compliance pipelines](../../user/group/compliance_pipelines.md).
|
||||
- `rules:exists` cannot search for the presence of [artifacts](../jobs/job_artifacts.md),
|
||||
because `rules` evaluation happens before jobs run and artifacts are fetched.
|
||||
|
||||
##### `rules:exists:paths`
|
||||
|
||||
|
|
|
|||
|
|
@ -525,6 +525,81 @@ To requeue a batched background migration, you must:
|
|||
- Update the `db/docs/batched_background_migration/*.yml` file from the original
|
||||
migration to include information about the requeue.
|
||||
|
||||
#### Example
|
||||
|
||||
**Original Migration:**
|
||||
|
||||
```ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
class QueueResolveVulnerabilitiesForRemovedAnalyzers < Gitlab::Database::Migration[2.2]
|
||||
milestone '17.3'
|
||||
|
||||
MIGRATION = "ResolveVulnerabilitiesForRemovedAnalyzers"
|
||||
|
||||
def up
|
||||
# no-op because there was a bug in the original migration, which has been
|
||||
# fixed by
|
||||
end
|
||||
|
||||
def down
|
||||
# no-op because there was a bug in the original migration, which has been
|
||||
# fixed in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/162527
|
||||
end
|
||||
end
|
||||
```
|
||||
|
||||
**Requeued migration:**
|
||||
|
||||
```ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
class RequeueResolveVulnerabilitiesForRemovedAnalyzers < Gitlab::Database::Migration[2.2]
|
||||
milestone '17.4'
|
||||
|
||||
restrict_gitlab_migration gitlab_schema: :gitlab_main
|
||||
|
||||
MIGRATION = "ResolveVulnerabilitiesForRemovedAnalyzers"
|
||||
DELAY_INTERVAL = 2.minutes
|
||||
BATCH_SIZE = 10_000
|
||||
SUB_BATCH_SIZE = 100
|
||||
|
||||
def up
|
||||
# Clear previous background migration execution from QueueResolveVulnerabilitiesForRemovedAnalyzers
|
||||
delete_batched_background_migration(MIGRATION, :vulnerability_reads, :id, [])
|
||||
|
||||
queue_batched_background_migration(
|
||||
MIGRATION,
|
||||
:vulnerability_reads,
|
||||
:id,
|
||||
job_interval: DELAY_INTERVAL,
|
||||
batch_size: BATCH_SIZE,
|
||||
sub_batch_size: SUB_BATCH_SIZE
|
||||
)
|
||||
end
|
||||
|
||||
def down
|
||||
delete_batched_background_migration(MIGRATION, :vulnerability_reads, :id, [])
|
||||
end
|
||||
end
|
||||
```
|
||||
|
||||
**Batched migration dictionary:**
|
||||
|
||||
The `milestone` and `queued_migration_version` should be the ones of requeued migration (in this eg: RequeueResolveVulnerabilitiesForRemovedAnalyzers).
|
||||
|
||||
```markdown
|
||||
---
|
||||
migration_job_name: ResolveVulnerabilitiesForRemovedAnalyzers
|
||||
description: Resolves all detected vulnerabilities for removed analyzers.
|
||||
feature_category: static_application_security_testing
|
||||
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/162691
|
||||
milestone: '17.4'
|
||||
queued_migration_version: 20240814085540
|
||||
finalize_after: '2024-09-22'
|
||||
finalized_by: # version of the migration that finalized this BBM
|
||||
```
|
||||
|
||||
### Batch over non-distinct columns
|
||||
|
||||
The default batching strategy provides an efficient way to iterate over primary key columns.
|
||||
|
|
|
|||
|
|
@ -15,3 +15,4 @@ This page is a work in progress. If you have access to the GitLab Slack workspac
|
|||
- [Migrating existing tracking to internal event tracking](migration.md)
|
||||
- [Event definition guide](event_definition_guide.md)
|
||||
- [Metric definition guide](metric_definition_guide.md)
|
||||
- [Local setup and debugging](local_setup_and_debugging.md)
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ info: Any user with at least the Maintainer role can merge updates to this conte
|
|||
# Local setup and debugging
|
||||
|
||||
NOTE:
|
||||
To track user interactions in the browser, Do-Not-Track (“DNT”) needs to be disabled. DNT is disabled by default for most browsers.
|
||||
To track user interactions in the browser, browser settings, such as privacy filters (e.g.
|
||||
AdBlock, uBlock), Do-Not-Track ("DNT"), and third-party cookies might need to be adjusted. [Read more about settings that affects tracking](https://snowplow.io/blog/how-many-visitors-block-your-tracking/).
|
||||
|
||||
Internal events are using a tool called Snowplow under the hood. To develop and test internal events, there are several tools to test frontend and backend events:
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ user.
|
|||
|
||||
A service account:
|
||||
|
||||
- Does not use a licensed seat, but is not available on [trial versions](https://gitlab.com/-/trial_registrations/new?glm_source=docs.gitlab.com?&glm_content=free-user-limit-faq/ee/user/free_user_limit.html).
|
||||
- Does not use a licensed seat, but is not available on [trial versions](https://gitlab.com/-/trial_registrations/new?glm_source=docs.gitlab.com?&glm_content=free-user-limit-faq/ee/user/free_user_limit.html) on GitLab.com. It is available on trial versions on GitLab self-managed.
|
||||
- Is not a:
|
||||
- Billable user.
|
||||
- Bot user.
|
||||
|
|
|
|||
|
|
@ -13,18 +13,7 @@ DETAILS:
|
|||
|
||||
When working with GitLab Duo Code Suggestions, you might encounter the following issues.
|
||||
|
||||
## Verify Code Suggestions status in Admin area
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- You must be an administrator of the instance.
|
||||
|
||||
You can verify that Code Suggestions is set up correctly on the server. Because you are checking this on the server side and not for a specific user, it does not guarantee that Code Suggestions will work for a specific user on client side.
|
||||
|
||||
1. On the left sidebar, at the bottom, select **Admin**.
|
||||
1. Select **GitLab Duo Pro**.
|
||||
|
||||
A flash message with Code Suggestions check status is displayed at the top of the page.
|
||||
You can run a [health check](../../../gitlab_duo/turn_on_off.md) to test if your instance meets the requirements to run Code Suggestions.
|
||||
|
||||
## Suggestions are not displayed
|
||||
|
||||
|
|
|
|||
|
|
@ -66,6 +66,9 @@ for an existing project to match new global push rules:
|
|||
|
||||
Use these rules to validate users who make commits.
|
||||
|
||||
NOTE:
|
||||
These push rules apply only to commits and not [tags](tags/index.md).
|
||||
|
||||
- **Reject unverified users**: Users must have a [confirmed email address](../../../security/user_email_confirmation.md).
|
||||
- **Check whether the commit author is a GitLab user**: The commit author and committer must have an email address that's been verified by GitLab.
|
||||
- **Commit author's email**: Both the author's and committer's email addresses must match the regular expression.
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ module Gitlab
|
|||
module BackgroundMigration
|
||||
class BackfillRemoteDevelopmentAgentConfigsProjectId < BackfillDesiredShardingKeyJob
|
||||
operation_name :backfill_remote_development_agent_configs_project_id
|
||||
feature_category :remote_development
|
||||
feature_category :workspaces
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ module Gitlab
|
|||
# that have remote development module enabled
|
||||
# For more details, check: https://gitlab.com/gitlab-org/gitlab/-/issues/454411
|
||||
class BackfillRootNamespaceClusterAgentMappings < BatchedMigrationJob
|
||||
feature_category :remote_development
|
||||
feature_category :workspaces
|
||||
|
||||
def perform; end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ module Gitlab
|
|||
module BackgroundMigration
|
||||
# No op on ce
|
||||
class BackfillWorkspacePersonalAccessToken < BatchedMigrationJob
|
||||
feature_category :remote_development
|
||||
feature_category :workspaces
|
||||
def perform; end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ module Gitlab
|
|||
module BackgroundMigration
|
||||
class BackfillWorkspaceVariablesProjectId < BackfillDesiredShardingKeyJob
|
||||
operation_name :backfill_workspace_variables_project_id
|
||||
feature_category :remote_development
|
||||
feature_category :workspaces
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ module Gitlab
|
|||
module BackgroundMigration
|
||||
# No op on ce
|
||||
class UpdateWorkspacesConfigVersion < BatchedMigrationJob
|
||||
feature_category :remote_development
|
||||
feature_category :workspaces
|
||||
def perform; end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ module Gitlab
|
|||
module BackgroundMigration
|
||||
# No op on ce
|
||||
class UpdateWorkspacesConfigVersion3 < BatchedMigrationJob
|
||||
feature_category :remote_development
|
||||
feature_category :workspaces
|
||||
def perform; end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -4,12 +4,9 @@ module Gitlab
|
|||
module Database
|
||||
module MigrationHelpers
|
||||
module Swapping
|
||||
include ::Gitlab::Database::SchemaHelpers
|
||||
include ::Gitlab::Database::MigrationHelpers::V2
|
||||
|
||||
def reset_trigger_function(function_name)
|
||||
execute("ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL")
|
||||
end
|
||||
|
||||
def swap_columns(table, column1, column2)
|
||||
::Gitlab::Database::Migrations::SwapColumns.new(
|
||||
migration_context: self,
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@ module Gitlab
|
|||
SQL
|
||||
end
|
||||
|
||||
def reset_trigger_function(function_name)
|
||||
execute("ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL")
|
||||
end
|
||||
|
||||
def function_exists?(name)
|
||||
!!connection.select_value("SELECT 1 FROM pg_proc WHERE proname = '#{name}'")
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
require 'spec_helper'
|
||||
|
||||
RSpec.describe 'Canonical link', feature_category: :remote_development do
|
||||
RSpec.describe 'Canonical link', feature_category: :workspaces do
|
||||
include Features::CanonicalLinkHelpers
|
||||
|
||||
let_it_be(:user) { create(:user) }
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ describe('ProtectionToggle', () => {
|
|||
|
||||
describe('when user can edit', () => {
|
||||
beforeEach(() => {
|
||||
createComponent();
|
||||
createComponent({ provided: { canAdminProtectedBranches: true } });
|
||||
});
|
||||
|
||||
it('renders the toggle', () => {
|
||||
|
|
@ -53,15 +53,44 @@ describe('ProtectionToggle', () => {
|
|||
});
|
||||
|
||||
it('renders the toggle description, when protection is on', () => {
|
||||
createComponent({ props: { isProtected: true, description: 'Some description' } });
|
||||
createComponent({
|
||||
props: { isProtected: true, description: 'Some description' },
|
||||
provided: { canAdminProtectedBranches: true },
|
||||
});
|
||||
|
||||
expect(wrapper.findComponent(GlSprintf).exists()).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('when user can not edit', () => {
|
||||
beforeEach(() => {
|
||||
createComponent({ provided: { canAdminProtectedBranches: false } });
|
||||
});
|
||||
|
||||
it('renders the icon instead of the toggle', () => {
|
||||
expect(findIcon().exists()).toBe(true);
|
||||
});
|
||||
|
||||
it('does not render the toggle description when not provided', () => {
|
||||
expect(wrapper.findComponent(GlSprintf).exists()).toBe(false);
|
||||
});
|
||||
|
||||
it('renders the toggle description, when protection is on', () => {
|
||||
createComponent({
|
||||
props: { isProtected: true, description: 'Some description' },
|
||||
provided: { canAdminProtectedBranches: false },
|
||||
});
|
||||
|
||||
expect(wrapper.text()).toContain('Some description');
|
||||
});
|
||||
});
|
||||
|
||||
describe('when glFeatures.editBranchRules is false', () => {
|
||||
beforeEach(() => {
|
||||
createComponent({ glFeatures: { editBranchRules: false } });
|
||||
createComponent({
|
||||
glFeatures: { editBranchRules: false },
|
||||
provided: { canAdminProtectedBranches: true },
|
||||
});
|
||||
});
|
||||
|
||||
it('does not render the toggle even for users with edit privileges', () => {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,8 @@ RSpec.describe Projects::Settings::BranchRulesHelper, feature_category: :source_
|
|||
branches_path: project_branches_path(project),
|
||||
show_status_checks: 'false',
|
||||
show_approvers: 'false',
|
||||
show_code_owners: 'false'
|
||||
show_code_owners: 'false',
|
||||
can_admin_protected_branches: 'false'
|
||||
})
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
require 'spec_helper'
|
||||
|
||||
RSpec.describe Gitlab::BackgroundMigration::BackfillRemoteDevelopmentAgentConfigsProjectId,
|
||||
feature_category: :remote_development,
|
||||
feature_category: :workspaces,
|
||||
schema: 20240530122155 do
|
||||
include_examples 'desired sharding key backfill job' do
|
||||
let(:batch_table) { :remote_development_agent_configs }
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
require 'spec_helper'
|
||||
|
||||
RSpec.describe Gitlab::BackgroundMigration::BackfillWorkspaceVariablesProjectId,
|
||||
feature_category: :remote_development,
|
||||
feature_category: :workspaces,
|
||||
schema: 20240419035356 do
|
||||
include_examples 'desired sharding key backfill job' do
|
||||
let(:batch_table) { :workspace_variables }
|
||||
|
|
|
|||
|
|
@ -13,30 +13,6 @@ RSpec.describe Gitlab::Database::MigrationHelpers::Swapping, feature_category: :
|
|||
|
||||
let(:service_instance) { instance_double('Gitlab::Database::Migrations::SwapColumns', execute: nil) }
|
||||
|
||||
describe '#reset_trigger_function' do
|
||||
let(:trigger_function_name) { 'existing_trigger_function' }
|
||||
|
||||
before do
|
||||
connection.execute(<<~SQL)
|
||||
CREATE FUNCTION #{trigger_function_name}() RETURNS trigger
|
||||
LANGUAGE plpgsql
|
||||
AS $$
|
||||
BEGIN
|
||||
NEW."bigint_column" := NEW."integer_column";
|
||||
RETURN NEW;
|
||||
END;
|
||||
$$;
|
||||
SQL
|
||||
end
|
||||
|
||||
it 'resets' do
|
||||
recorder = ActiveRecord::QueryRecorder.new do
|
||||
migration_context.reset_trigger_function(trigger_function_name)
|
||||
end
|
||||
expect(recorder.log).to include(/ALTER FUNCTION "existing_trigger_function" RESET ALL/)
|
||||
end
|
||||
end
|
||||
|
||||
describe '#swap_columns' do
|
||||
let(:table) { :ci_pipeline_variables }
|
||||
let(:column1) { :pipeline_id }
|
||||
|
|
|
|||
|
|
@ -0,0 +1,37 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
RSpec.describe Gitlab::Database::SchemaHelpers, feature_category: :database do
|
||||
let(:connection) { ApplicationRecord.connection }
|
||||
let(:migration_context) do
|
||||
ActiveRecord::Migration
|
||||
.new
|
||||
.extend(described_class)
|
||||
.extend(Gitlab::Database::MigrationHelpers)
|
||||
end
|
||||
|
||||
describe '#reset_trigger_function' do
|
||||
let(:trigger_function_name) { 'existing_trigger_function' }
|
||||
|
||||
before do
|
||||
connection.execute(<<~SQL)
|
||||
CREATE FUNCTION #{trigger_function_name}() RETURNS trigger
|
||||
LANGUAGE plpgsql
|
||||
AS $$
|
||||
BEGIN
|
||||
NEW."bigint_column" := NEW."integer_column";
|
||||
RETURN NEW;
|
||||
END;
|
||||
$$;
|
||||
SQL
|
||||
end
|
||||
|
||||
it 'resets' do
|
||||
recorder = ActiveRecord::QueryRecorder.new do
|
||||
migration_context.reset_trigger_function(trigger_function_name)
|
||||
end
|
||||
expect(recorder.log).to include(/ALTER FUNCTION "existing_trigger_function" RESET ALL/)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
require 'spec_helper'
|
||||
require_migration!
|
||||
|
||||
RSpec.describe QueueBackfillWorkspaceVariablesProjectId, feature_category: :remote_development do
|
||||
RSpec.describe QueueBackfillWorkspaceVariablesProjectId, feature_category: :workspaces do
|
||||
let!(:batched_migration) { described_class::MIGRATION }
|
||||
|
||||
it 'schedules a new batched migration' do
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
require 'spec_helper'
|
||||
require_migration!
|
||||
|
||||
RSpec.describe QueueBackfillRemoteDevelopmentAgentConfigsProjectId, feature_category: :remote_development do
|
||||
RSpec.describe QueueBackfillRemoteDevelopmentAgentConfigsProjectId, feature_category: :workspaces do
|
||||
let!(:batched_migration) { described_class::MIGRATION }
|
||||
|
||||
it 'schedules a new batched migration' do
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
require 'spec_helper'
|
||||
require_migration!
|
||||
|
||||
RSpec.describe QueueBackfillRootNamespaceClusterAgentMappingsAgain, feature_category: :remote_development do
|
||||
RSpec.describe QueueBackfillRootNamespaceClusterAgentMappingsAgain, feature_category: :workspaces do
|
||||
let!(:batched_migration) { described_class::MIGRATION }
|
||||
|
||||
it 'schedules a new batched migration' do
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
require 'spec_helper'
|
||||
require_migration!
|
||||
|
||||
RSpec.describe CapWorkspacesMaxTerminationToOneYear, feature_category: :remote_development do
|
||||
RSpec.describe CapWorkspacesMaxTerminationToOneYear, feature_category: :workspaces do
|
||||
let(:user) { table(:users).create!(name: 'test', email: 'test@example.com', projects_limit: 5) }
|
||||
let(:namespace) { table(:namespaces).create!(name: 'name', path: 'path') }
|
||||
let(:project) { table(:projects).create!(namespace_id: namespace.id, project_namespace_id: namespace.id) }
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ RSpec.describe MergeRequestPolicy, feature_category: :code_review_workflow do
|
|||
let_it_be(:reporter) { create(:user) }
|
||||
let_it_be(:developer) { create(:user) }
|
||||
let_it_be(:non_team_member) { create(:user) }
|
||||
let_it_be(:admin) { create(:user, :admin) }
|
||||
let_it_be(:bot) { create(:user, :project_bot) }
|
||||
|
||||
def permissions(user, merge_request)
|
||||
|
|
@ -69,18 +68,6 @@ RSpec.describe MergeRequestPolicy, feature_category: :code_review_workflow do
|
|||
end
|
||||
end
|
||||
|
||||
shared_examples_for 'an admin' do
|
||||
let(:subject) { permissions(user, merge_request) }
|
||||
|
||||
context 'when admin mode is enabled', :enable_admin_mode do
|
||||
it { is_expected.to be_allowed(:approve_merge_request) }
|
||||
end
|
||||
|
||||
context 'when admin mode is disabled' do
|
||||
it { is_expected.to be_disallowed(:approve_merge_request) }
|
||||
end
|
||||
end
|
||||
|
||||
context 'when user is a direct project member' do
|
||||
let(:project) { create(:project, :public) }
|
||||
|
||||
|
|
@ -182,12 +169,6 @@ RSpec.describe MergeRequestPolicy, feature_category: :code_review_workflow do
|
|||
it_behaves_like 'a user with full access'
|
||||
end
|
||||
|
||||
describe 'an admin' do
|
||||
let(:user) { admin }
|
||||
|
||||
it_behaves_like 'an admin'
|
||||
end
|
||||
|
||||
describe 'a bot' do
|
||||
let(:subject) { permissions(bot, merge_request) }
|
||||
|
||||
|
|
@ -295,12 +276,6 @@ RSpec.describe MergeRequestPolicy, feature_category: :code_review_workflow do
|
|||
end
|
||||
end
|
||||
|
||||
describe 'an admin' do
|
||||
let(:user) { admin }
|
||||
|
||||
it_behaves_like 'an admin'
|
||||
end
|
||||
|
||||
context 'and merge requests are private' do
|
||||
before do
|
||||
project.update!(visibility_level: Gitlab::VisibilityLevel::PUBLIC)
|
||||
|
|
@ -325,12 +300,6 @@ RSpec.describe MergeRequestPolicy, feature_category: :code_review_workflow do
|
|||
it_behaves_like 'a user with full access'
|
||||
end
|
||||
|
||||
describe 'an admin' do
|
||||
let(:user) { admin }
|
||||
|
||||
it_behaves_like 'an admin'
|
||||
end
|
||||
|
||||
describe 'a bot' do
|
||||
let(:subject) { permissions(bot, merge_request) }
|
||||
|
||||
|
|
@ -362,12 +331,6 @@ RSpec.describe MergeRequestPolicy, feature_category: :code_review_workflow do
|
|||
it_behaves_like 'a user with full access'
|
||||
end
|
||||
|
||||
describe 'an admin' do
|
||||
let(:user) { admin }
|
||||
|
||||
it_behaves_like 'an admin'
|
||||
end
|
||||
|
||||
describe 'a bot' do
|
||||
let(:subject) { permissions(bot, merge_request) }
|
||||
|
||||
|
|
@ -421,12 +384,6 @@ RSpec.describe MergeRequestPolicy, feature_category: :code_review_workflow do
|
|||
is_expected.to be_allowed(:reset_merge_request_approvals)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'an admin' do
|
||||
let(:user) { admin }
|
||||
|
||||
it_behaves_like 'an admin'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -457,12 +414,6 @@ RSpec.describe MergeRequestPolicy, feature_category: :code_review_workflow do
|
|||
is_expected.not_to be_allowed(:reset_merge_request_approvals)
|
||||
end
|
||||
end
|
||||
|
||||
describe 'an admin' do
|
||||
let(:user) { admin }
|
||||
|
||||
it_behaves_like 'an admin'
|
||||
end
|
||||
end
|
||||
|
||||
context 'when merge requests are disabled' do
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ require 'fast_spec_helper'
|
|||
|
||||
require_relative '../../../spec/support/matchers/result_matchers'
|
||||
|
||||
RSpec.describe 'result matchers', feature_category: :remote_development do
|
||||
RSpec.describe 'result matchers', feature_category: :workspaces do
|
||||
include ResultMatchers
|
||||
|
||||
it 'works with value asserted via argument' do
|
||||
|
|
|
|||
Loading…
Reference in New Issue