Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2023-06-14 21:10:36 +00:00
parent 14160fad80
commit beabc7d164
35 changed files with 693 additions and 210 deletions

View File

@ -1,6 +1,6 @@
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import KeepLatestArtifactCheckbox from '~/artifacts_settings/keep_latest_artifact_checkbox.vue';
import KeepLatestArtifactToggle from '~/artifacts_settings/keep_latest_artifact_toggle.vue';
import createDefaultClient from '~/lib/graphql';
Vue.use(VueApollo);
@ -26,7 +26,7 @@ export default (containerId = 'js-artifacts-settings-app') => {
helpPagePath,
},
render(createElement) {
return createElement(KeepLatestArtifactCheckbox);
return createElement(KeepLatestArtifactToggle);
},
});
};

View File

@ -1,5 +1,5 @@
<script>
import { GlAlert, GlFormCheckbox, GlLink } from '@gitlab/ui';
import { GlAlert, GlToggle, GlLink } from '@gitlab/ui';
import { __ } from '~/locale';
import UpdateKeepLatestArtifactProjectSetting from './graphql/mutations/update_keep_latest_artifact_project_setting.mutation.graphql';
import GetKeepLatestArtifactProjectSetting from './graphql/queries/get_keep_latest_artifact_project_setting.query.graphql';
@ -13,12 +13,12 @@ export default {
enabledHelpText: __(
'The latest artifacts created by jobs in the most recent successful pipeline will be stored.',
),
helpLinkText: __('More information'),
checkboxText: __('Keep artifacts from most recent successful jobs'),
helpLinkText: __('Learn more.'),
labelText: __('Keep artifacts from most recent successful jobs'),
},
components: {
GlAlert,
GlFormCheckbox,
GlToggle,
GlLink,
},
inject: {
@ -95,10 +95,16 @@ export default {
@dismiss="isAlertDismissed = true"
>{{ errorMessage }}</gl-alert
>
<gl-form-checkbox v-model="keepLatestArtifact" @change="updateSetting"
><strong class="gl-mr-3">{{ $options.i18n.checkboxText }}</strong>
<gl-link :href="helpPagePath">{{ $options.i18n.helpLinkText }}</gl-link>
<template v-if="!$apollo.loading" #help>{{ helpText }}</template>
</gl-form-checkbox>
<gl-toggle
v-model="keepLatestArtifact"
:is-loading="$apollo.loading"
:label="$options.i18n.labelText"
@change="updateSetting"
>
<template #help>
{{ helpText }}
<gl-link :href="helpPagePath">{{ $options.i18n.helpLinkText }}</gl-link>
</template>
</gl-toggle>
</div>
</template>

View File

@ -0,0 +1,19 @@
# frozen_string_literal: true
module GoogleCloud
class EnableVisionAiService < ::GoogleCloud::BaseService
def execute
gcp_project_ids = unique_gcp_project_ids
if gcp_project_ids.empty?
error("No GCP projects found. Configure a service account or GCP_PROJECT_ID ci variable.")
else
gcp_project_ids.each do |gcp_project_id|
google_api_client.enable_vision_api(gcp_project_id)
end
success({ gcp_project_ids: gcp_project_ids })
end
end
end
end

View File

@ -0,0 +1,195 @@
# frozen_string_literal: true
class SwapNotesIdToBigintForGitlabDotCom < Gitlab::Database::Migration[2.1]
include Gitlab::Database::MigrationHelpers::ConvertToBigint
disable_ddl_transaction!
TABLE_NAME = 'notes'
PK_INDEX_NAME = 'index_notes_on_id_convert_to_bigint'
SECONDARY_INDEXES = [
{
original_name: :index_notes_on_author_id_and_created_at_and_id,
temporary_name: :index_notes_on_author_id_created_at_id_convert_to_bigint,
columns: [:author_id, :created_at, :id_convert_to_bigint],
options: {}
},
{
original_name: :index_notes_on_id_where_confidential,
temporary_name: :index_notes_on_id_convert_to_bigint_where_confidential,
columns: [:id_convert_to_bigint],
options: { where: 'confidential = true' }
},
{
original_name: :index_notes_on_id_where_internal,
temporary_name: :index_notes_on_id_convert_to_bigint_where_internal,
columns: [:id_convert_to_bigint],
options: { where: 'internal = true' }
},
{
original_name: :index_notes_on_project_id_and_id_and_system_false,
temporary_name: :index_notes_on_project_id_id_convert_to_bigint_system_false,
columns: [:project_id, :id_convert_to_bigint],
options: { where: 'NOT system' }
},
{
original_name: :note_mentions_temp_index,
temporary_name: :note_mentions_temp_index_convert_to_bigint,
columns: [:id_convert_to_bigint, :noteable_type],
options: { where: "note ~~ '%@%'::text" }
}
]
REFERENCING_FOREIGN_KEYS = [
[:todos, :fk_91d1f47b13, :note_id, :cascade],
[:incident_management_timeline_events, :fk_d606a2a890, :promoted_from_note_id, :nullify],
[:system_note_metadata, :fk_d83a918cb1, :note_id, :cascade],
[:diff_note_positions, :fk_rails_13c7212859, :note_id, :cascade],
[:epic_user_mentions, :fk_rails_1c65976a49, :note_id, :cascade],
[:suggestions, :fk_rails_33b03a535c, :note_id, :cascade],
[:issue_user_mentions, :fk_rails_3861d9fefa, :note_id, :cascade],
[:note_diff_files, :fk_rails_3d66047aeb, :diff_note_id, :cascade],
[:snippet_user_mentions, :fk_rails_4d3f96b2cb, :note_id, :cascade],
[:design_user_mentions, :fk_rails_8de8c6d632, :note_id, :cascade],
[:vulnerability_user_mentions, :fk_rails_a18600f210, :note_id, :cascade],
[:commit_user_mentions, :fk_rails_a6760813e0, :note_id, :cascade],
[:merge_request_user_mentions, :fk_rails_c440b9ea31, :note_id, :cascade],
[:note_metadata, :fk_rails_d853224d37, :note_id, :cascade],
[:alert_management_alert_user_mentions, :fk_rails_eb2de0cdef, :note_id, :cascade],
[:timelogs, :fk_timelogs_note_id, :note_id, :nullify]
]
def up
return unless should_run?
swap
end
def down
return unless should_run?
swap
add_concurrent_index TABLE_NAME, :id_convert_to_bigint, unique: true, name: PK_INDEX_NAME
REFERENCING_FOREIGN_KEYS.each do |(from_table, name, column, on_delete)|
temporary_name = "#{name}_tmp"
add_concurrent_foreign_key(
from_table,
TABLE_NAME,
column: column,
target_column: :id_convert_to_bigint,
name: temporary_name,
on_delete: on_delete,
reverse_lock_order: true,
validate: false)
end
end
def swap
# Copy existing indexes from the original column to the new column
create_indexes
# Copy existing FKs from the original column to the new column
create_referencing_foreign_keys
# Remove existing FKs from the referencing tables, so we don't have to lock on them when we drop the existing PK
replace_referencing_foreign_keys
with_lock_retries(raise_on_exhaustion: true) do
# Swap the original and new column names
execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN id TO id_tmp"
execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN id_convert_to_bigint TO id"
execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN id_tmp TO id_convert_to_bigint"
# Reset the function so PG drops the plan cache for the incorrect integer type
function_name = Gitlab::Database::UnidirectionalCopyTrigger
.on_table(TABLE_NAME, connection: connection)
.name(:id, :id_convert_to_bigint)
execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL"
# Swap defaults of the two columns, and change ownership of the sequence to the new id
execute "ALTER SEQUENCE notes_id_seq OWNED BY #{TABLE_NAME}.id"
change_column_default TABLE_NAME, :id, -> { "nextval('notes_id_seq'::regclass)" }
change_column_default TABLE_NAME, :id_convert_to_bigint, 0
# Swap the PK constraint from the original column to the new column.
# We deliberately don't CASCADE here because the old FKs should be removed already
execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT notes_pkey"
rename_index TABLE_NAME, PK_INDEX_NAME, 'notes_pkey'
execute "ALTER TABLE #{TABLE_NAME} ADD CONSTRAINT notes_pkey PRIMARY KEY USING INDEX notes_pkey"
# Remove old column indexes and change new column indexes to have the original names
rename_secondary_indexes # rubocop:disable Migration/WithLockRetriesDisallowedMethod
end
end
private
def should_run?
com_or_dev_or_test_but_not_jh?
end
def create_indexes
add_concurrent_index TABLE_NAME, :id_convert_to_bigint, unique: true, name: PK_INDEX_NAME
SECONDARY_INDEXES.each do |index_definition|
options = index_definition[:options]
options[:name] = index_definition[:temporary_name]
add_concurrent_index(TABLE_NAME, index_definition[:columns], options)
end
end
def rename_secondary_indexes
SECONDARY_INDEXES.each do |index_definition|
remove_index(TABLE_NAME, name: index_definition[:original_name], if_exists: true) # rubocop:disable Migration/RemoveIndex
rename_index(TABLE_NAME, index_definition[:temporary_name], index_definition[:original_name])
end
end
def create_referencing_foreign_keys
REFERENCING_FOREIGN_KEYS.each do |(from_table, name, column, on_delete)|
# Don't attempt to create the FK if one already exists from the table to the new column
# The check in `add_concurrent_foreign_key` already checks for this, but it looks for the foreign key
# with the new name only (containing the `_tmp` suffix).
#
# Since we might partially rename FKs and re-run the migration, we also have to check and see if a FK exists
# on those columns that might not match the `_tmp` name.
next if foreign_key_exists?(
from_table, TABLE_NAME, column: column,
primary_key: :id_convert_to_bigint, name: name)
temporary_name = "#{name}_tmp"
add_concurrent_foreign_key(
from_table,
TABLE_NAME,
column: column,
target_column: :id_convert_to_bigint,
name: temporary_name,
on_delete: on_delete,
reverse_lock_order: true)
end
end
def replace_referencing_foreign_keys
REFERENCING_FOREIGN_KEYS.each do |(from_table, name, column, _)|
# Don't attempt to replace the FK unless it exists and points at the original column.
# This could happen if the migration is re-run due to failing midway.
next unless foreign_key_exists?(from_table, TABLE_NAME, column: column, primary_key: :id, name: name)
with_lock_retries(raise_on_exhaustion: true) do
temporary_name = "#{name}_tmp"
# Explicitly lock table in order of parent, child to attempt to avoid deadlocks
execute "LOCK TABLE #{TABLE_NAME}, #{from_table} IN ACCESS EXCLUSIVE MODE"
remove_foreign_key(from_table, TABLE_NAME, column: column, primary_key: :id, name: name)
rename_constraint(from_table, temporary_name, name)
end
end
end
end

View File

@ -0,0 +1 @@
29516b4b02e3feda356c99c7e0b3a1011de830c38781ad61ce4cb3650559e1ee

View File

@ -18859,7 +18859,7 @@ CREATE SEQUENCE note_metadata_note_id_seq
ALTER SEQUENCE note_metadata_note_id_seq OWNED BY note_metadata.note_id;
CREATE TABLE notes (
id integer NOT NULL,
id_convert_to_bigint integer DEFAULT 0 NOT NULL,
note text,
noteable_type character varying,
author_id integer,
@ -18887,7 +18887,7 @@ CREATE TABLE notes (
confidential boolean,
last_edited_at timestamp with time zone,
internal boolean DEFAULT false NOT NULL,
id_convert_to_bigint bigint DEFAULT 0 NOT NULL
id bigint NOT NULL
);
CREATE SEQUENCE notes_id_seq
@ -31875,8 +31875,6 @@ CREATE INDEX index_notes_on_created_at ON notes USING btree (created_at);
CREATE INDEX index_notes_on_discussion_id ON notes USING btree (discussion_id);
CREATE UNIQUE INDEX index_notes_on_id_convert_to_bigint ON notes USING btree (id_convert_to_bigint);
CREATE INDEX index_notes_on_id_where_confidential ON notes USING btree (id) WHERE (confidential = true);
CREATE INDEX index_notes_on_id_where_internal ON notes USING btree (id) WHERE (internal = true);
@ -35657,9 +35655,6 @@ ALTER TABLE ONLY protected_tags
ALTER TABLE ONLY todos
ADD CONSTRAINT fk_91d1f47b13 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE;
ALTER TABLE ONLY todos
ADD CONSTRAINT fk_91d1f47b13_tmp FOREIGN KEY (note_id) REFERENCES notes(id_convert_to_bigint) ON DELETE CASCADE NOT VALID;
ALTER TABLE ONLY dast_site_profiles_builds
ADD CONSTRAINT fk_94e80df60e FOREIGN KEY (dast_site_profile_id) REFERENCES dast_site_profiles(id) ON DELETE CASCADE;
@ -35963,9 +35958,6 @@ ALTER TABLE ONLY ci_sources_pipelines
ALTER TABLE ONLY incident_management_timeline_events
ADD CONSTRAINT fk_d606a2a890 FOREIGN KEY (promoted_from_note_id) REFERENCES notes(id) ON DELETE SET NULL;
ALTER TABLE ONLY incident_management_timeline_events
ADD CONSTRAINT fk_d606a2a890_tmp FOREIGN KEY (promoted_from_note_id) REFERENCES notes(id_convert_to_bigint) ON DELETE SET NULL NOT VALID;
ALTER TABLE ONLY lists
ADD CONSTRAINT fk_d6cf4279f7 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;
@ -35987,9 +35979,6 @@ ALTER TABLE ONLY ci_pipelines
ALTER TABLE ONLY system_note_metadata
ADD CONSTRAINT fk_d83a918cb1 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE;
ALTER TABLE ONLY system_note_metadata
ADD CONSTRAINT fk_d83a918cb1_tmp FOREIGN KEY (note_id) REFERENCES notes(id_convert_to_bigint) ON DELETE CASCADE NOT VALID;
ALTER TABLE ONLY sbom_occurrences
ADD CONSTRAINT fk_d857c6edc1 FOREIGN KEY (component_id) REFERENCES sbom_components(id) ON DELETE CASCADE;
@ -36314,9 +36303,6 @@ ALTER TABLE ONLY bulk_imports
ALTER TABLE ONLY diff_note_positions
ADD CONSTRAINT fk_rails_13c7212859 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE;
ALTER TABLE ONLY diff_note_positions
ADD CONSTRAINT fk_rails_13c7212859_tmp FOREIGN KEY (note_id) REFERENCES notes(id_convert_to_bigint) ON DELETE CASCADE NOT VALID;
ALTER TABLE ONLY analytics_cycle_analytics_aggregations
ADD CONSTRAINT fk_rails_13c8374c7a FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@ -36380,9 +36366,6 @@ ALTER TABLE ONLY board_assignees
ALTER TABLE ONLY epic_user_mentions
ADD CONSTRAINT fk_rails_1c65976a49 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE;
ALTER TABLE ONLY epic_user_mentions
ADD CONSTRAINT fk_rails_1c65976a49_tmp FOREIGN KEY (note_id) REFERENCES notes(id_convert_to_bigint) ON DELETE CASCADE NOT VALID;
ALTER TABLE ONLY approver_groups
ADD CONSTRAINT fk_rails_1cdcbd7723 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@ -36542,9 +36525,6 @@ ALTER TABLE ONLY alert_management_alert_metric_images
ALTER TABLE ONLY suggestions
ADD CONSTRAINT fk_rails_33b03a535c FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE;
ALTER TABLE ONLY suggestions
ADD CONSTRAINT fk_rails_33b03a535c_tmp FOREIGN KEY (note_id) REFERENCES notes(id_convert_to_bigint) ON DELETE CASCADE NOT VALID;
ALTER TABLE ONLY requirements
ADD CONSTRAINT fk_rails_33fed8aa4e FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL;
@ -36575,9 +36555,6 @@ ALTER TABLE ONLY packages_debian_project_distribution_keys
ALTER TABLE ONLY issue_user_mentions
ADD CONSTRAINT fk_rails_3861d9fefa FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE;
ALTER TABLE ONLY issue_user_mentions
ADD CONSTRAINT fk_rails_3861d9fefa_tmp FOREIGN KEY (note_id) REFERENCES notes(id_convert_to_bigint) ON DELETE CASCADE NOT VALID;
ALTER TABLE ONLY namespace_settings
ADD CONSTRAINT fk_rails_3896d4fae5 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE;
@ -36605,9 +36582,6 @@ ALTER TABLE ONLY cluster_groups
ALTER TABLE ONLY note_diff_files
ADD CONSTRAINT fk_rails_3d66047aeb FOREIGN KEY (diff_note_id) REFERENCES notes(id) ON DELETE CASCADE;
ALTER TABLE ONLY note_diff_files
ADD CONSTRAINT fk_rails_3d66047aeb_tmp FOREIGN KEY (diff_note_id) REFERENCES notes(id_convert_to_bigint) ON DELETE CASCADE NOT VALID;
ALTER TABLE ONLY snippet_user_mentions
ADD CONSTRAINT fk_rails_3e00189191 FOREIGN KEY (snippet_id) REFERENCES snippets(id) ON DELETE CASCADE;
@ -36713,9 +36687,6 @@ ALTER TABLE ONLY scim_identities
ALTER TABLE ONLY snippet_user_mentions
ADD CONSTRAINT fk_rails_4d3f96b2cb FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE;
ALTER TABLE ONLY snippet_user_mentions
ADD CONSTRAINT fk_rails_4d3f96b2cb_tmp FOREIGN KEY (note_id) REFERENCES notes(id_convert_to_bigint) ON DELETE CASCADE NOT VALID;
ALTER TABLE ONLY protected_environment_approval_rules
ADD CONSTRAINT fk_rails_4e554f96f5 FOREIGN KEY (protected_environment_id) REFERENCES protected_environments(id) ON DELETE CASCADE;
@ -37148,9 +37119,6 @@ ALTER TABLE ONLY approval_merge_request_rules_approved_approvers
ALTER TABLE ONLY design_user_mentions
ADD CONSTRAINT fk_rails_8de8c6d632 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE;
ALTER TABLE ONLY design_user_mentions
ADD CONSTRAINT fk_rails_8de8c6d632_tmp FOREIGN KEY (note_id) REFERENCES notes(id_convert_to_bigint) ON DELETE CASCADE NOT VALID;
ALTER TABLE ONLY clusters_kubernetes_namespaces
ADD CONSTRAINT fk_rails_8df789f3ab FOREIGN KEY (environment_id) REFERENCES environments(id) ON DELETE SET NULL;
@ -37277,9 +37245,6 @@ ALTER TABLE ONLY project_aliases
ALTER TABLE ONLY vulnerability_user_mentions
ADD CONSTRAINT fk_rails_a18600f210 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE;
ALTER TABLE ONLY vulnerability_user_mentions
ADD CONSTRAINT fk_rails_a18600f210_tmp FOREIGN KEY (note_id) REFERENCES notes(id_convert_to_bigint) ON DELETE CASCADE NOT VALID;
ALTER TABLE ONLY dependency_proxy_packages_settings
ADD CONSTRAINT fk_rails_a248d0c26f FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@ -37310,9 +37275,6 @@ ALTER TABLE ONLY cluster_projects
ALTER TABLE ONLY commit_user_mentions
ADD CONSTRAINT fk_rails_a6760813e0 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE;
ALTER TABLE ONLY commit_user_mentions
ADD CONSTRAINT fk_rails_a6760813e0_tmp FOREIGN KEY (note_id) REFERENCES notes(id_convert_to_bigint) ON DELETE CASCADE NOT VALID;
ALTER TABLE ONLY vulnerability_identifiers
ADD CONSTRAINT fk_rails_a67a16c885 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
@ -37523,9 +37485,6 @@ ALTER TABLE ONLY project_wiki_repositories
ALTER TABLE ONLY merge_request_user_mentions
ADD CONSTRAINT fk_rails_c440b9ea31 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE;
ALTER TABLE ONLY merge_request_user_mentions
ADD CONSTRAINT fk_rails_c440b9ea31_tmp FOREIGN KEY (note_id) REFERENCES notes(id_convert_to_bigint) ON DELETE CASCADE NOT VALID;
ALTER TABLE ONLY user_achievements
ADD CONSTRAINT fk_rails_c44f5b3b25 FOREIGN KEY (achievement_id) REFERENCES achievements(id) ON DELETE CASCADE;
@ -37643,9 +37602,6 @@ ALTER TABLE ONLY packages_rpm_metadata
ALTER TABLE ONLY note_metadata
ADD CONSTRAINT fk_rails_d853224d37 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE;
ALTER TABLE ONLY note_metadata
ADD CONSTRAINT fk_rails_d853224d37_tmp FOREIGN KEY (note_id) REFERENCES notes(id_convert_to_bigint) ON DELETE CASCADE NOT VALID;
ALTER TABLE ONLY merge_request_reviewers
ADD CONSTRAINT fk_rails_d9fec24b9d FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE;
@ -37790,9 +37746,6 @@ ALTER TABLE ONLY protected_branch_unprotect_access_levels
ALTER TABLE ONLY alert_management_alert_user_mentions
ADD CONSTRAINT fk_rails_eb2de0cdef FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE;
ALTER TABLE ONLY alert_management_alert_user_mentions
ADD CONSTRAINT fk_rails_eb2de0cdef_tmp FOREIGN KEY (note_id) REFERENCES notes(id_convert_to_bigint) ON DELETE CASCADE NOT VALID;
ALTER TABLE ONLY snippet_statistics
ADD CONSTRAINT fk_rails_ebc283ccf1 FOREIGN KEY (snippet_id) REFERENCES snippets(id) ON DELETE CASCADE;
@ -37943,9 +37896,6 @@ ALTER TABLE ONLY timelogs
ALTER TABLE ONLY timelogs
ADD CONSTRAINT fk_timelogs_note_id FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE SET NULL;
ALTER TABLE ONLY timelogs
ADD CONSTRAINT fk_timelogs_note_id_tmp FOREIGN KEY (note_id) REFERENCES notes(id_convert_to_bigint) ON DELETE SET NULL NOT VALID;
ALTER TABLE ONLY u2f_registrations
ADD CONSTRAINT fk_u2f_registrations_user_id FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE;

View File

@ -57,6 +57,91 @@ When downloading packages as dependencies in downstream projects, many requests
Packages API. You may therefore reach enforced user and IP rate limits. To address this issue, you
can define specific rate limits for the Packages API. For more details, see [Package Registry Rate Limits](../../user/admin_area/settings/package_registry_rate_limits.md).
## Enable or disable the Package Registry
The Package Registry is enabled by default. To disable it:
::Tabs
:::TabTitle Linux package (Omnibus)
1. Edit `/etc/gitlab/gitlab.rb`:
```ruby
# Change to true to enable packages - enabled by default if not defined
gitlab_rails['packages_enabled'] = false
```
1. Save the file and reconfigure GitLab:
```shell
sudo gitlab-ctl reconfigure
```
:::TabTitle Helm chart (Kubernetes)
1. Export the Helm values:
```shell
helm get values gitlab > gitlab_values.yaml
```
1. Edit `gitlab_values.yaml`:
```yaml
global:
appConfig:
packages:
enabled: false
```
1. Save the file and apply the new values:
```shell
helm upgrade -f gitlab_values.yaml gitlab gitlab/gitlab
```
:::TabTitle Docker
1. Edit `docker-compose.yml`:
```yaml
version: "3.6"
services:
gitlab:
environment:
GITLAB_OMNIBUS_CONFIG: |
gitlab_rails['packages_enabled'] = false
```
1. Save the file and restart GitLab:
```shell
docker compose up -d
```
:::TabTitle Self-compiled (source)
1. Edit `/home/git/gitlab/config/gitlab.yml`:
```yaml
production: &base
packages:
enabled: false
```
1. Save the file and restart GitLab:
```shell
# For systems running systemd
sudo systemctl restart gitlab.target
# For systems running SysV init
sudo service gitlab restart
```
::EndTabs
## Change the storage path
By default, the packages are stored locally, but you can change the default

View File

@ -22,7 +22,7 @@ Supported attributes:
| Attribute | Type | Required | Description |
|:------------------|:--------|:---------|:----------------------|
| `id` | integer | Yes | Group ID for the group to return SAML identities. |
| `id` | integer/string | yes | The ID or [URL-encoded path of the group](rest/index.md#namespaced-path-encoding) |
If successful, returns [`200`](rest/index.md#status-codes) and the following
response attributes:
@ -49,6 +49,36 @@ Example response:
]
```
## Get a single SAML identity
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/123591) in GitLab 16.1.
```plaintext
GET /groups/:id/saml/:uid
```
Supported attributes:
| Attribute | Type | Required | Description |
| --------- | -------------- | -------- | ------------------------- |
| `id` | integer/string | yes | The ID or [URL-encoded path of the group](rest/index.md#namespaced-path-encoding) |
| `uid` | string | yes | External UID of the user. |
Example request:
```shell
curl --location --request GET "https://gitlab.example.com/api/v4/groups/33/saml/sydney_jones" --header "<PRIVATE TOKEN>"
```
Example response:
```json
{
"extern_uid": "4",
"user_id": 48
}
```
## Update `extern_uid` field for a SAML identity
Update `extern_uid` field for a SAML identity:
@ -58,13 +88,14 @@ Update `extern_uid` field for a SAML identity:
| `id/externalId` | `extern_uid` |
```plaintext
PATCH groups/:groups_id/saml/:uid
PATCH /groups/:id/saml/:uid
```
Parameters:
Supported attributes:
| Attribute | Type | Required | Description |
| --------- | ------ | -------- | ------------------------- |
| `id` | integer/string | yes | The ID or [URL-encoded path of the group](rest/index.md#namespaced-path-encoding) |
| `uid` | string | yes | External UID of the user. |
Example request:

View File

@ -28,7 +28,7 @@ Supported attributes:
| Attribute | Type | Required | Description |
|:------------------|:--------|:---------|:----------------------|
| `id` | integer | Yes | Return SCIM identities for the given group ID. |
| `id` | integer/string | Yes | The ID or [URL-encoded path of the group](rest/index.md#namespaced-path-encoding) |
If successful, returns [`200`](rest/index.md#status-codes) and the following
response attributes:
@ -58,6 +58,37 @@ curl --location --request GET "https://gitlab.example.com/api/v4/groups/33/scim/
--header "PRIVATE-TOKEN: <PRIVATE-TOKEN>"
```
## Get a single SCIM identity
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/123591) in GitLab 16.1.
```plaintext
GET /groups/:id/scim/:uid
```
Supported attributes:
| Attribute | Type | Required | Description |
| --------- | ------- | -------- | ------------------------- |
| `id` | integer | yes | The ID or [URL-encoded path of the group](rest/index.md#namespaced-path-encoding) |
| `uid` | string | yes | External UID of the user. |
Example request:
```shell
curl --location --request GET "https://gitlab.example.com/api/v4/groups/33/scim/sydney_jones" --header "<PRIVATE TOKEN>"
```
Example response:
```json
{
"extern_uid": "4",
"user_id": 48,
"active": true
}
```
## Update `extern_uid` field for a SCIM identity
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/227841) in GitLab 15.5.
@ -76,6 +107,7 @@ Parameters:
| Attribute | Type | Required | Description |
| --------- | ------ | -------- | ------------------------- |
| `id` | integer/string | yes | The ID or [URL-encoded path of the group](rest/index.md#namespaced-path-encoding) |
| `uid` | string | yes | External UID of the user. |
Example request:

View File

@ -36,8 +36,8 @@ you must enable CRM features for the subgroup.
To enable customer relations management in a group or subgroup:
1. On the top bar, select **Main menu > Groups** and find your group or subgroup.
1. On the left sidebar, select **Settings > General**.
1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your group or subgroup.
1. Select **Settings > General**.
1. Expand the **Permissions and group features** section.
1. Select **Customer relations is enabled**.
1. Select **Save changes**.
@ -52,8 +52,8 @@ Prerequisites:
To view a group's contacts:
1. On the top bar, select **Main menu > Groups** and find your group.
1. On the left sidebar, select **Customer relations > Contacts**.
1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your group.
1. Select **Plan > Customer contacts**.
![Contacts list](crm_contacts_v14_10.png)
@ -65,8 +65,8 @@ Prerequisites:
To create a contact:
1. On the top bar, select **Main menu > Groups** and find your group.
1. On the left sidebar, select **Customer relations > Contacts**.
1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your group.
1. Select **Plan > Customer contacts**.
1. Select **New contact**.
1. Complete all required fields.
1. Select **Create new contact**.
@ -82,8 +82,8 @@ Prerequisites:
To edit an existing contact:
1. On the top bar, select **Main menu > Groups** and find your group.
1. On the left sidebar, select **Customer relations > Contacts**.
1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your group.
1. Select **Plan > Customer contacts**.
1. Next to the contact you wish to edit, select **Edit** (**{pencil}**).
1. Edit the required fields.
1. Select **Save changes**.
@ -100,8 +100,8 @@ Each contact can be in one of two states:
To change the state of a contact:
1. On the top bar, select **Main menu > Groups** and find your group.
1. On the left sidebar, select **Customer relations > Contacts**.
1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your group.
1. Select **Plan > Customer contacts**.
1. Next to the contact you wish to edit, select **Edit** (**{pencil}**).
1. Select or clear the **Active** checkbox.
1. Select **Save changes**.
@ -116,8 +116,8 @@ Prerequisites:
To view a group's organizations:
1. On the top bar, select **Main menu > Groups** and find your group.
1. On the left sidebar, select **Customer relations > Organizations**.
1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your group.
1. Select **Plan > Customer organizations**.
![Organizations list](crm_organizations_v14_10.png)
@ -129,8 +129,8 @@ Prerequisites:
To create an organization:
1. On the top bar, select **Main menu > Groups** and find your group.
1. On the left sidebar, select **Customer relations > Organizations**.
1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your group.
1. Select **Plan > Customer organizations**.
1. Select **New organization**.
1. Complete all required fields.
1. Select **Create new organization**.
@ -146,8 +146,8 @@ Prerequisites:
To edit an existing organization:
1. On the top bar, select **Main menu > Groups** and find your group.
1. On the left sidebar, select **Customer relations > Organizations**.
1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your group.
1. Select **Plan > Customer organizations**.
1. Next to the organization you wish to edit, select **Edit** (**{pencil}**).
1. Edit the required fields.
1. Select **Save changes**.
@ -168,8 +168,8 @@ Prerequisites:
To view a contact's issues, select a contact from the issue sidebar, or:
1. On the top bar, select **Main menu > Groups** and find your group.
1. On the left sidebar, select **Customer relations > Contacts**.
1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your group.
1. Select **Plan > Customer contacts**.
1. Next to the contact whose issues you wish to view, select **View issues** (**{issues}**).
### View issues linked to an organization
@ -180,8 +180,8 @@ Prerequisites:
To view an organization's issues:
1. On the top bar, select **Main menu > Groups** and find your group.
1. On the left sidebar, select **Customer relations > Organizations**.
1. On the left sidebar, at the top, select **Search GitLab** (**{search}**) to find your group.
1. Select **Plan > Customer organizations**.
1. Next to the organization whose issues you wish to view, select **View issues** (**{issues}**).
### View contacts linked to an issue

View File

@ -3,8 +3,9 @@
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Pages/Brunch.gitlab-ci.yml
# Full project: https://gitlab.com/pages/brunch
image: node:4.2.2
default:
# Full project: https://gitlab.com/pages/brunch
image: node:4.2.2
pages:
cache:

View File

@ -3,8 +3,9 @@
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Pages/Doxygen.gitlab-ci.yml
# Full project: https://gitlab.com/pages/doxygen
image: alpine
default:
# Full project: https://gitlab.com/pages/doxygen
image: alpine
pages:
script:

View File

@ -3,13 +3,14 @@
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Pages/Gatsby.gitlab-ci.yml
image: node:latest
default:
image: node:latest
# This folder is cached between builds
# https://docs.gitlab.com/ee/ci/yaml/index.html#cache
cache:
paths:
- node_modules/
# This folder is cached between builds
# https://docs.gitlab.com/ee/ci/yaml/index.html#cache
cache:
paths:
- node_modules/
pages:
script:

View File

@ -3,8 +3,9 @@
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Pages/Harp.gitlab-ci.yml
# Full project: https://gitlab.com/pages/harp
image: node:4.2.2
default:
# Full project: https://gitlab.com/pages/harp
image: node:4.2.2
pages:
cache:

View File

@ -3,8 +3,9 @@
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Pages/Hexo.gitlab-ci.yml
# Full project: https://gitlab.com/pages/hexo
image: node:10.15.3
default:
# Full project: https://gitlab.com/pages/hexo
image: node:10.15.3
pages:
script:

View File

@ -3,12 +3,13 @@
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Pages/Hyde.gitlab-ci.yml
# Full project: https://gitlab.com/pages/hyde
image: python:2.7
default:
# Full project: https://gitlab.com/pages/hyde
image: python:2.7
cache:
paths:
- vendor/
cache:
paths:
- vendor/
test:
stage: test

View File

@ -13,20 +13,21 @@
#
# HowTo at: https://jorge.aguilera.gitlab.io/howtojbake/
image: java:8
default:
image: java:8
# We use SDKMan as tool for managing versions
before_script:
- apt-get update -qq && apt-get install -y -qq unzip zip
- curl -sSL https://get.sdkman.io | bash
- echo sdkman_auto_answer=true > /root/.sdkman/etc/config
- source /root/.sdkman/bin/sdkman-init.sh
- sdk install jbake $JBAKE_VERSION < /dev/null
- sdk use jbake $JBAKE_VERSION
variables:
JBAKE_VERSION: 2.5.1
# We use SDKMan as tool for managing versions
before_script:
- apt-get update -qq && apt-get install -y -qq unzip zip
- curl -sSL https://get.sdkman.io | bash
- echo sdkman_auto_answer=true > /root/.sdkman/etc/config
- source /root/.sdkman/bin/sdkman-init.sh
- sdk install jbake $JBAKE_VERSION < /dev/null
- sdk use jbake $JBAKE_VERSION
# This build job produced the output directory of your site
pages:
environment: production

View File

@ -3,18 +3,19 @@
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Pages/Jekyll.gitlab-ci.yml
# Template project: https://gitlab.com/pages/jekyll
# Docs: https://docs.gitlab.com/ee/pages/
image: ruby:2.6
default:
# Template project: https://gitlab.com/pages/jekyll
# Docs: https://docs.gitlab.com/ee/pages/
image: ruby:2.6
before_script:
- gem install bundler
- bundle install
variables:
JEKYLL_ENV: production
LC_ALL: C.UTF-8
before_script:
- gem install bundler
- bundle install
test:
stage: test
script:

View File

@ -7,29 +7,30 @@
#
# Full project: https://github.com/tightenco/jigsaw
image: php:7.2
default:
image: php:7.2
# These folders are cached between builds
cache:
paths:
- vendor/
- node_modules/
# These folders are cached between builds
cache:
paths:
- vendor/
- node_modules/
before_script:
# Update packages
- apt-get update -yqq
# Install dependencies
- apt-get install -yqq gnupg zlib1g-dev libpng-dev
# Install Node 8
- curl -sL https://deb.nodesource.com/setup_8.x | bash -
- apt-get install -yqq nodejs
# Install php extensions
- docker-php-ext-install zip
# Install Composer and project dependencies
- curl -sS https://getcomposer.org/installer | php
- php composer.phar install
# Install Node dependencies
- npm install
before_script:
# Update packages
- apt-get update -yqq
# Install dependencies
- apt-get install -yqq gnupg zlib1g-dev libpng-dev
# Install Node 8
- curl -sL https://deb.nodesource.com/setup_8.x | bash -
- apt-get install -yqq nodejs
# Install php extensions
- docker-php-ext-install zip
# Install Composer and project dependencies
- curl -sS https://getcomposer.org/installer | php
- php composer.phar install
# Install Node dependencies
- npm install
pages:
script:

View File

@ -3,8 +3,9 @@
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Pages/Lektor.gitlab-ci.yml
# Full project: https://gitlab.com/pages/hyde
image: python:2.7
default:
# Full project: https://gitlab.com/pages/hyde
image: python:2.7
pages:
script:

View File

@ -3,8 +3,9 @@
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Pages/Metalsmith.gitlab-ci.yml
# Full project: https://gitlab.com/pages/metalsmith
image: node:4.2.2
default:
# Full project: https://gitlab.com/pages/metalsmith
image: node:4.2.2
pages:
cache:

View File

@ -3,12 +3,13 @@
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Pages/Middleman.gitlab-ci.yml
# Full project: https://gitlab.com/pages/middleman
image: ruby:2.6
default:
# Full project: https://gitlab.com/pages/middleman
image: ruby:2.6
cache:
paths:
- vendor
cache:
paths:
- vendor
test:
script:

View File

@ -3,8 +3,9 @@
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Pages/Nanoc.gitlab-ci.yml
# Full project: https://gitlab.com/pages/nanoc
image: ruby:2.6
default:
# Full project: https://gitlab.com/pages/nanoc
image: ruby:2.6
pages:
script:

View File

@ -3,8 +3,9 @@
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Pages/Octopress.gitlab-ci.yml
# Full project: https://gitlab.com/pages/octopress
image: ruby:2.6
default:
# Full project: https://gitlab.com/pages/octopress
image: ruby:2.6
pages:
script:

View File

@ -3,8 +3,9 @@
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Pages/Pelican.gitlab-ci.yml
# Full project: https://gitlab.com/pages/pelican
image: python:2.7-alpine
default:
# Full project: https://gitlab.com/pages/pelican
image: python:2.7-alpine
pages:
script:

View File

@ -3,7 +3,13 @@
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Pages/SwaggerUI.gitlab-ci.yml
image: node:10-alpine
default:
image: node:10-alpine
# These folders are cached between builds
cache:
paths:
- ./node_modules
# specify the location of the Open API Specification files within your project
# and the filename of the specification that you would like to display by default
@ -11,11 +17,6 @@ variables:
DOCS_FOLDER: "api-docs"
SPEC_TO_DISPLAY: "my-project_specification_0.0.1.json"
# These folders are cached between builds
cache:
paths:
- ./node_modules
# publishes all files from the $DOCS_FOLDER together with the static version of SwaggerUI
# sets the specification file named in $SPEC_TO_DISPLAY to be displayed by default
pages:

View File

@ -8,18 +8,19 @@
#
# There is a more opinionated template which we suggest the users to abide,
# which is the lib/gitlab/ci/templates/Terraform.gitlab-ci.yml
image:
name: "$CI_TEMPLATE_REGISTRY_HOST/gitlab-org/terraform-images/releases/1.4:v1.0.0"
default:
image:
name: "$CI_TEMPLATE_REGISTRY_HOST/gitlab-org/terraform-images/releases/1.4:v1.0.0"
cache:
key: "${TF_ROOT}"
paths:
- ${TF_ROOT}/.terraform/
variables:
TF_ROOT: ${CI_PROJECT_DIR} # The relative path to the root directory of the Terraform project
TF_STATE_NAME: default # The name of the state file used by the GitLab Managed Terraform state backend
cache:
key: "${TF_ROOT}"
paths:
- ${TF_ROOT}/.terraform/
.terraform:fmt: &terraform_fmt
stage: validate
script:

View File

@ -9,18 +9,19 @@
# There is a more opinionated template which we suggest the users to abide,
# which is the lib/gitlab/ci/templates/Terraform.latest.gitlab-ci.yml
image:
name: "$CI_TEMPLATE_REGISTRY_HOST/gitlab-org/terraform-images/stable:latest"
default:
image:
name: "$CI_TEMPLATE_REGISTRY_HOST/gitlab-org/terraform-images/stable:latest"
cache:
key: "${TF_ROOT}"
paths:
- ${TF_ROOT}/.terraform/
variables:
TF_ROOT: ${CI_PROJECT_DIR} # The relative path to the root directory of the Terraform project
TF_STATE_NAME: default # The name of the state file used by the GitLab Managed Terraform state backend
cache:
key: "${TF_ROOT}"
paths:
- ${TF_ROOT}/.terraform/
.terraform:fmt: &terraform_fmt
stage: validate
script:

View File

@ -123,6 +123,10 @@ module GoogleApi
enable_service(gcp_project_id, 'servicenetworking.googleapis.com')
end
def enable_vision_api(gcp_project_id)
enable_service(gcp_project_id, 'vision.googleapis.com')
end
def revoke_authorizations
uri = URI(REVOKE_URL)
Gitlab::HTTP.post(uri, body: { 'token' => access_token })

View File

@ -1,32 +1,57 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`Keep latest artifact checkbox when application keep latest artifact setting is enabled sets correct setting value in checkbox with query result 1`] = `
exports[`Keep latest artifact toggle when application keep latest artifact setting is enabled sets correct setting value in toggle with query result 1`] = `
<div>
<!---->
<b-form-checkbox-stub
checked="true"
class="gl-form-checkbox"
id="4"
value="true"
<div
class="gl-toggle-wrapper gl-display-flex gl-mb-0 gl-flex-direction-column"
data-testid="toggle-wrapper"
>
<strong
class="gl-mr-3"
<span
class="gl-toggle-label gl-flex-shrink-0 gl-mb-3"
data-testid="toggle-label"
id="toggle-label-4"
>
Keep artifacts from most recent successful jobs
</strong>
</span>
<gl-link-stub
href="/help/ci/pipelines/job_artifacts"
>
More information
</gl-link-stub>
<!---->
<p
class="help-text"
<!---->
<button
aria-checked="true"
aria-describedby="toggle-help-2"
aria-labelledby="toggle-label-4"
class="gl-flex-shrink-0 gl-toggle is-checked"
role="switch"
type="button"
>
<span
class="toggle-icon"
>
<gl-icon-stub
name="mobile-issue-close"
size="16"
/>
</span>
</button>
<span
class="gl-help-label"
data-testid="toggle-help"
id="toggle-help-2"
>
The latest artifacts created by jobs in the most recent successful pipeline will be stored.
</p>
</b-form-checkbox-stub>
<gl-link-stub
href="/help/ci/pipelines/job_artifacts"
>
Learn more.
</gl-link-stub>
</span>
</div>
</div>
`;

View File

@ -1,4 +1,4 @@
import { GlFormCheckbox, GlLink } from '@gitlab/ui';
import { GlToggle, GlLink } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
import VueApollo from 'vue-apollo';
@ -7,7 +7,7 @@ import createMockApollo from 'helpers/mock_apollo_helper';
import UpdateKeepLatestArtifactProjectSetting from '~/artifacts_settings/graphql/mutations/update_keep_latest_artifact_project_setting.mutation.graphql';
import GetKeepLatestArtifactApplicationSetting from '~/artifacts_settings/graphql/queries/get_keep_latest_artifact_application_setting.query.graphql';
import GetKeepLatestArtifactProjectSetting from '~/artifacts_settings/graphql/queries/get_keep_latest_artifact_project_setting.query.graphql';
import KeepLatestArtifactCheckbox from '~/artifacts_settings/keep_latest_artifact_checkbox.vue';
import KeepLatestArtifactToggle from '~/artifacts_settings/keep_latest_artifact_toggle.vue';
Vue.use(VueApollo);
@ -34,7 +34,7 @@ const keepLatestArtifactMockResponse = {
},
};
describe('Keep latest artifact checkbox', () => {
describe('Keep latest artifact toggle', () => {
let wrapper;
let apolloProvider;
let requestHandlers;
@ -42,7 +42,7 @@ describe('Keep latest artifact checkbox', () => {
const fullPath = 'gitlab-org/gitlab';
const helpPagePath = '/help/ci/pipelines/job_artifacts';
const findCheckbox = () => wrapper.findComponent(GlFormCheckbox);
const findToggle = () => wrapper.findComponent(GlToggle);
const findHelpLink = () => wrapper.findComponent(GlLink);
const createComponent = (handlers) => {
@ -68,13 +68,13 @@ describe('Keep latest artifact checkbox', () => {
[UpdateKeepLatestArtifactProjectSetting, requestHandlers.keepLatestArtifactMutationHandler],
]);
wrapper = shallowMount(KeepLatestArtifactCheckbox, {
wrapper = shallowMount(KeepLatestArtifactToggle, {
provide: {
fullPath,
helpPagePath,
},
stubs: {
GlFormCheckbox,
GlToggle,
},
apolloProvider,
});
@ -89,13 +89,13 @@ describe('Keep latest artifact checkbox', () => {
createComponent();
});
it('displays the checkbox and the help link', () => {
expect(findCheckbox().exists()).toBe(true);
it('displays the toggle and the help link', () => {
expect(findToggle().exists()).toBe(true);
expect(findHelpLink().exists()).toBe(true);
});
it('calls mutation on artifact setting change with correct payload', () => {
findCheckbox().vm.$emit('change', false);
findToggle().vm.$emit('change', false);
expect(requestHandlers.keepLatestArtifactMutationHandler).toHaveBeenCalledWith({
fullPath,
@ -110,12 +110,12 @@ describe('Keep latest artifact checkbox', () => {
await waitForPromises();
});
it('sets correct setting value in checkbox with query result', () => {
it('sets correct setting value in toggle with query result', () => {
expect(wrapper.element).toMatchSnapshot();
});
it('checkbox is enabled when application setting is enabled', () => {
expect(findCheckbox().attributes('disabled')).toBeUndefined();
it('toggle is enabled when application setting is enabled', () => {
expect(findToggle().attributes('disabled')).toBeUndefined();
});
});
});

View File

@ -254,6 +254,18 @@ RSpec.describe GoogleApi::CloudPlatform::Client do
end
end
describe '#enable_visionai' do
subject { client.enable_vision_api(gcp_project_id) }
it 'calls Google Api ServiceUsageService' do
expect_any_instance_of(Google::Apis::ServiceusageV1::ServiceUsageService)
.to receive(:enable_service)
.with("projects/#{gcp_project_id}/services/vision.googleapis.com")
.and_return(operation)
is_expected.to eq(operation)
end
end
describe '#revoke_authorizations' do
subject { client.revoke_authorizations }

View File

@ -0,0 +1,66 @@
# frozen_string_literal: true
require 'spec_helper'
require_migration!
RSpec.describe SwapNotesIdToBigintForGitlabDotCom, feature_category: :database do
describe '#up' do
before do
# A we call `schema_migrate_down!` before each example, and for this migration
# `#down` is same as `#up`, we need to ensure we start from the expected state.
connection = described_class.new.connection
connection.execute('ALTER TABLE notes ALTER COLUMN id TYPE integer')
connection.execute('ALTER TABLE notes ALTER COLUMN id_convert_to_bigint TYPE bigint')
end
# rubocop: disable RSpec/AnyInstanceOf
it 'swaps the integer and bigint columns for GitLab.com, dev, or test' do
allow_any_instance_of(described_class).to receive(:com_or_dev_or_test_but_not_jh?).and_return(true)
notes = table(:notes)
disable_migrations_output do
reversible_migration do |migration|
migration.before -> {
notes.reset_column_information
expect(notes.columns.find { |c| c.name == 'id' }.sql_type).to eq('integer')
expect(notes.columns.find { |c| c.name == 'id_convert_to_bigint' }.sql_type).to eq('bigint')
}
migration.after -> {
notes.reset_column_information
expect(notes.columns.find { |c| c.name == 'id' }.sql_type).to eq('bigint')
expect(notes.columns.find { |c| c.name == 'id_convert_to_bigint' }.sql_type).to eq('integer')
}
end
end
end
it 'is a no-op for other instances' do
allow_any_instance_of(described_class).to receive(:com_or_dev_or_test_but_not_jh?).and_return(false)
notes = table(:notes)
disable_migrations_output do
reversible_migration do |migration|
migration.before -> {
notes.reset_column_information
expect(notes.columns.find { |c| c.name == 'id' }.sql_type).to eq('integer')
expect(notes.columns.find { |c| c.name == 'id_convert_to_bigint' }.sql_type).to eq('bigint')
}
migration.after -> {
notes.reset_column_information
expect(notes.columns.find { |c| c.name == 'id' }.sql_type).to eq('integer')
expect(notes.columns.find { |c| c.name == 'id_convert_to_bigint' }.sql_type).to eq('bigint')
}
end
end
end
# rubocop: enable RSpec/AnyInstanceOf
end
end

View File

@ -0,0 +1,38 @@
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe GoogleCloud::EnableVisionAiService, feature_category: :deployment_management do
describe 'when a project does not have any gcp projects' do
let_it_be(:project) { create(:project) }
it 'returns error' do
result = described_class.new(project).execute
message = 'No GCP projects found. Configure a service account or GCP_PROJECT_ID ci variable.'
expect(result[:status]).to eq(:error)
expect(result[:message]).to eq(message)
end
end
describe 'when a project has 3 gcp projects' do
let_it_be(:project) { create(:project) }
before do
project.variables.build(environment_scope: 'production', key: 'GCP_PROJECT_ID', value: 'prj-prod')
project.variables.build(environment_scope: 'staging', key: 'GCP_PROJECT_ID', value: 'prj-staging')
project.save!
end
it 'enables cloud run, artifacts registry and cloud build', :aggregate_failures do
expect_next_instance_of(GoogleApi::CloudPlatform::Client) do |instance|
expect(instance).to receive(:enable_vision_api).with('prj-prod')
expect(instance).to receive(:enable_vision_api).with('prj-staging')
end
result = described_class.new(project).execute
expect(result[:status]).to eq(:success)
end
end
end

View File

@ -47,7 +47,8 @@ RSpec.shared_examples 'labels sidebar widget' do
end
end
it 'adds first label by pressing enter when search' do
it 'adds first label by pressing enter when search',
quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/414877' do
within(labels_widget) do
page.within('[data-testid="value-wrapper"]') do
expect(page).not_to have_content(development.name)