Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2025-01-21 03:37:30 +00:00
parent c232c17b46
commit f578519bce
16 changed files with 70 additions and 55 deletions

View File

@ -10,11 +10,11 @@ import {
} from '@gitlab/ui';
import HelpPageLink from '~/vue_shared/components/help_page_link/help_page_link.vue';
import createProtectionRepositoryRuleMutation from '~/packages_and_registries/settings/project/graphql/mutations/create_container_protection_repository_rule.mutation.graphql';
import { s__, __ } from '~/locale';
const GRAPHQL_ACCESS_LEVEL_VALUE_MAINTAINER = 'MAINTAINER';
const GRAPHQL_ACCESS_LEVEL_VALUE_OWNER = 'OWNER';
const GRAPHQL_ACCESS_LEVEL_VALUE_ADMIN = 'ADMIN';
import {
MinimumAccessLevelOptions,
GRAPHQL_ACCESS_LEVEL_VALUE_MAINTAINER,
} from '~/packages_and_registries/settings/project/constants';
import { s__ } from '~/locale';
export default {
components: {
@ -66,13 +66,6 @@ export default {
minimumAccessLevelForPush: this.protectionRuleFormData.minimumAccessLevelForPush,
};
},
minimumAccessLevelOptions() {
return [
{ value: GRAPHQL_ACCESS_LEVEL_VALUE_MAINTAINER, text: __('Maintainer') },
{ value: GRAPHQL_ACCESS_LEVEL_VALUE_OWNER, text: __('Owner') },
{ value: GRAPHQL_ACCESS_LEVEL_VALUE_ADMIN, text: __('Admin') },
];
},
},
methods: {
submit() {
@ -115,6 +108,7 @@ export default {
this.$emit('cancel');
},
},
minimumAccessLevelOptions: MinimumAccessLevelOptions,
};
</script>
@ -161,7 +155,7 @@ export default {
<gl-form-select
id="input-minimum-access-level-for-push"
v-model="protectionRuleFormData.minimumAccessLevelForPush"
:options="minimumAccessLevelOptions"
:options="$options.minimumAccessLevelOptions"
:disabled="isFieldDisabled"
/>
</gl-form-group>

View File

@ -16,6 +16,7 @@ import getContainerPotectionRepositoryRulesQuery from '~/packages_and_registries
import ContainerProtectionRepositoryRuleForm from '~/packages_and_registries/settings/project/components/container_protection_repository_rule_form.vue';
import deleteContainerProtectionRepositoryRuleMutation from '~/packages_and_registries/settings/project/graphql/mutations/delete_container_protection_repository_rule.mutation.graphql';
import updateContainerRegistryProtectionRuleMutation from '~/packages_and_registries/settings/project/graphql/mutations/update_container_protection_repository_rule.mutation.graphql';
import { MinimumAccessLevelOptions } from '~/packages_and_registries/settings/project/constants';
import { s__, __ } from '~/locale';
const PAGINATION_DEFAULT_PER_PAGE = 10;
@ -242,11 +243,7 @@ export default {
tdClass: '!gl-align-middle gl-text-right',
},
],
minimumAccessLevelOptions: [
{ value: 'MAINTAINER', text: __('Maintainer') },
{ value: 'OWNER', text: __('Owner') },
{ value: 'ADMIN', text: __('Admin') },
],
minimumAccessLevelOptions: MinimumAccessLevelOptions,
modal: { id: 'delete-protection-rule-confirmation-modal' },
modalActionPrimary: {
text: s__('ContainerRegistry|Delete container protection rule'),

View File

@ -1,10 +1,9 @@
<script>
import { GlFormGroup, GlForm, GlFormInput, GlFormSelect, GlLink, GlSprintf } from '@gitlab/ui';
import { __ } from '~/locale';
const GRAPHQL_ACCESS_LEVEL_VALUE_MAINTAINER = 'MAINTAINER';
const GRAPHQL_ACCESS_LEVEL_VALUE_OWNER = 'OWNER';
const GRAPHQL_ACCESS_LEVEL_VALUE_ADMIN = 'ADMIN';
import {
MinimumAccessLevelOptions,
GRAPHQL_ACCESS_LEVEL_VALUE_MAINTAINER,
} from '~/packages_and_registries/settings/project/constants';
export default {
components: {
@ -25,11 +24,7 @@ export default {
},
};
},
minimumAccessLevelOptions: [
{ value: GRAPHQL_ACCESS_LEVEL_VALUE_MAINTAINER, text: __('Maintainer') },
{ value: GRAPHQL_ACCESS_LEVEL_VALUE_OWNER, text: __('Owner') },
{ value: GRAPHQL_ACCESS_LEVEL_VALUE_ADMIN, text: __('Admin') },
],
minimumAccessLevelOptions: MinimumAccessLevelOptions,
};
</script>

View File

@ -16,7 +16,7 @@ import ContainerProtectionTagRuleForm from '~/packages_and_registries/settings/p
import getContainerProtectionTagRulesQuery from '~/packages_and_registries/settings/project/graphql/queries/get_container_protection_tag_rules.query.graphql';
import deleteContainerProtectionTagRuleMutation from '~/packages_and_registries/settings/project/graphql/mutations/delete_container_protection_tag_rule.mutation.graphql';
import { __, s__ } from '~/locale';
import { MinimumAccessLevelOptions } from '~/packages_and_registries/settings/project/constants';
import { MinimumAccessLevelText } from '~/packages_and_registries/settings/project/constants';
const MAX_LIMIT = 5;
const I18N_MINIMUM_ACCESS_LEVEL_TO_PUSH = s__('ContainerRegistry|Minimum access level to push');
@ -91,9 +91,9 @@ export default {
return {
id: protectionRule.id,
minimumAccessLevelForPush:
MinimumAccessLevelOptions[protectionRule.minimumAccessLevelForPush],
MinimumAccessLevelText[protectionRule.minimumAccessLevelForPush],
minimumAccessLevelForDelete:
MinimumAccessLevelOptions[protectionRule.minimumAccessLevelForDelete],
MinimumAccessLevelText[protectionRule.minimumAccessLevelForDelete],
tagNamePattern: protectionRule.tagNamePattern,
};
});

View File

@ -17,6 +17,7 @@ import { getPackageTypeLabel } from '~/packages_and_registries/package_registry/
import deletePackagesProtectionRuleMutation from '~/packages_and_registries/settings/project/graphql/mutations/delete_packages_protection_rule.mutation.graphql';
import updatePackagesProtectionRuleMutation from '~/packages_and_registries/settings/project/graphql/mutations/update_packages_protection_rule.mutation.graphql';
import PackagesProtectionRuleForm from '~/packages_and_registries/settings/project/components/packages_protection_rule_form.vue';
import { MinimumAccessLevelOptions } from '~/packages_and_registries/settings/project/constants';
import { s__, __ } from '~/locale';
const PAGINATION_DEFAULT_PER_PAGE = 10;
@ -239,11 +240,7 @@ export default {
tdClass: '!gl-align-middle gl-text-right',
},
],
minimumAccessLevelOptions: [
{ value: 'MAINTAINER', text: __('Maintainer') },
{ value: 'OWNER', text: __('Owner') },
{ value: 'ADMIN', text: s__('AdminUsers|Administrator') },
],
minimumAccessLevelOptions: MinimumAccessLevelOptions,
modal: { id: 'delete-package-protection-rule-confirmation-modal' },
modalActionPrimary: {
text: s__('PackageRegistry|Delete package protection rule'),

View File

@ -117,12 +117,22 @@ export const OLDER_THAN_OPTIONS = [
{ key: 'NINETY_DAYS', variable: 90, default: true },
];
export const MinimumAccessLevelOptions = {
MAINTAINER: __('Maintainer'),
OWNER: __('Owner'),
ADMIN: __('Admin'),
const GRAPHQL_ACCESS_LEVEL_VALUE_ADMIN = 'ADMIN';
export const GRAPHQL_ACCESS_LEVEL_VALUE_MAINTAINER = 'MAINTAINER';
const GRAPHQL_ACCESS_LEVEL_VALUE_OWNER = 'OWNER';
export const MinimumAccessLevelText = {
[GRAPHQL_ACCESS_LEVEL_VALUE_ADMIN]: s__('AdminUsers|Administrator'),
[GRAPHQL_ACCESS_LEVEL_VALUE_MAINTAINER]: __('Maintainer'),
[GRAPHQL_ACCESS_LEVEL_VALUE_OWNER]: __('Owner'),
};
export const MinimumAccessLevelOptions = [
{ value: GRAPHQL_ACCESS_LEVEL_VALUE_MAINTAINER, text: __('Maintainer') },
{ value: GRAPHQL_ACCESS_LEVEL_VALUE_OWNER, text: __('Owner') },
{ value: GRAPHQL_ACCESS_LEVEL_VALUE_ADMIN, text: s__('AdminUsers|Administrator') },
];
export const FETCH_SETTINGS_ERROR_MESSAGE = s__(
'ContainerRegistry|Something went wrong while fetching the cleanup policy.',
);

View File

@ -4,7 +4,7 @@ description: >-
Removes ci_runner_machines_687967fa8a records that don't have a matching ci_runners_e59bb2812d record.
This can happen because there was a period in time where a FK didn't exist.
feature_category: fleet_visibility
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/176702
milestone: '17.9'
queued_migration_version: 20250113164152
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/172422
milestone: '17.8'
queued_migration_version: 20241231094025
finalized_by: # version of the migration that finalized this BBM

View File

@ -0,0 +1,12 @@
---
migration_job_name: RequeueDeleteOrphanedPartitionedCiRunnerMachineRecords
description: >-
This migration re-queues the job to remove ci_runner_machines_687967fa8a records
that don't have a matching ci_runners_e59bb2812d record, this time running also
for self-managed environments.
This can happen because there was a period in time where a FK didn't exist.
feature_category: fleet_visibility
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/177774
milestone: '17.9'
queued_migration_version: 20250113164152
finalized_by: # version of the migration that finalized this BBM

View File

@ -2,7 +2,6 @@
# This migration then deletes all ci_runner_machines_687967fa8a records
# that don't have a matching ci_runners_e59bb2812d record
# rubocop:disable BackgroundMigration/DictionaryFile -- There is no corresponding BBM dictionary
class RequeueDeleteOrphanedPCiRunnerMachineRecordsOnDotCom < Gitlab::Database::Migration[2.2]
milestone '17.8'
@ -35,4 +34,3 @@ class RequeueDeleteOrphanedPCiRunnerMachineRecordsOnDotCom < Gitlab::Database::M
delete_batched_background_migration(MIGRATION, :ci_runner_machines_687967fa8a, :runner_id, [])
end
end
# rubocop:enable BackgroundMigration/DictionaryFile

View File

@ -5,7 +5,7 @@ class RequeueDeleteOrphanedPartitionedCiRunnerMachineRecords < Gitlab::Database:
restrict_gitlab_migration gitlab_schema: :gitlab_ci
MIGRATION = "DeleteOrphanedPartitionedCiRunnerMachineRecords"
MIGRATION = "RequeueDeleteOrphanedPartitionedCiRunnerMachineRecords"
DELAY_INTERVAL = 2.minutes
BATCH_SIZE = 1000
SUB_BATCH_SIZE = 100

View File

@ -15,7 +15,7 @@ You can analyze your users' GitLab activities over time.
How do you interpret the user cohorts table? Let's review an example with the
following user cohorts:
![User cohort example](img/cohorts_v13_9_a.png)
![User cohort table showing retention and inactivity metrics, highlighting March and April 2020.](img/cohorts_v13_9_a.png)
For the cohort of March 2020, three users were added to this server and have
been active since this month. One month later (April 2020), two users are still

View File

@ -0,0 +1,12 @@
# frozen_string_literal: true
module Gitlab
module BackgroundMigration
# rubocop: disable Migration/BatchedMigrationBaseClass -- DeleteOrphanedPartitionedCiRunnerMachineRecords inherits from BatchedMigrationJob.
class RequeueDeleteOrphanedPartitionedCiRunnerMachineRecords < DeleteOrphanedPartitionedCiRunnerMachineRecords
operation_name :requeue_delete_orphaned_partitioned_ci_runner_machine_records
feature_category :fleet_visibility
end
# rubocop: enable Migration/BatchedMigrationBaseClass
end
end

View File

@ -3639,9 +3639,6 @@ msgstr ""
msgid "Adjust how frequently the GitLab UI polls for updates."
msgstr ""
msgid "Admin"
msgstr ""
msgid "Admin Mode"
msgstr ""

View File

@ -46,7 +46,7 @@ def parse_options
opts.on('--debug', 'Enable debug mode') do |v|
options[:debug] = v
end
opts.on('-t', '--task=TASK', 'Set task') do |v|
opts.on('-t', '--task=[up|down]', 'Set task - "up" to migrate forward, "down" to rollback') do |v|
options[:task] = v
end
end.parse!
@ -125,6 +125,9 @@ def execute
puts "$ #{cmd}"
raise "Migration #{version} failed" unless system(cmd)
end
else
puts 'Invalid task. Use --task=[up|down]'
exit 1
end
end
# rubocop:enable Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity

View File

@ -337,7 +337,7 @@ describe('Container protection repository rules project settings', () => {
.findAllComponents('option')
.wrappers.map((w) => w.text());
expect(accessLevelOptions).toEqual(['Maintainer', 'Owner', 'Admin']);
expect(accessLevelOptions).toEqual(['Maintainer', 'Owner', 'Administrator']);
});
describe('when value changes', () => {

View File

@ -21,7 +21,7 @@ import ContainerProtectionTagRules from '~/packages_and_registries/settings/proj
import ContainerProtectionTagRuleForm from '~/packages_and_registries/settings/project/components/container_protection_tag_rule_form.vue';
import getContainerProtectionTagRulesQuery from '~/packages_and_registries/settings/project/graphql/queries/get_container_protection_tag_rules.query.graphql';
import deleteContainerProtectionTagRuleMutation from '~/packages_and_registries/settings/project/graphql/mutations/delete_container_protection_tag_rule.mutation.graphql';
import { MinimumAccessLevelOptions } from '~/packages_and_registries/settings/project/constants';
import { MinimumAccessLevelText } from '~/packages_and_registries/settings/project/constants';
Vue.use(VueApollo);
@ -216,10 +216,10 @@ describe('ContainerProtectionTagRules', () => {
tagRules.forEach((protectionRule, i) => {
expect(findTableRowCell(i, 0).text()).toBe(protectionRule.tagNamePattern);
expect(findTableRowCell(i, 1).text()).toBe(
MinimumAccessLevelOptions[protectionRule.minimumAccessLevelForPush],
MinimumAccessLevelText[protectionRule.minimumAccessLevelForPush],
);
expect(findTableRowCell(i, 2).text()).toBe(
MinimumAccessLevelOptions[protectionRule.minimumAccessLevelForDelete],
MinimumAccessLevelText[protectionRule.minimumAccessLevelForDelete],
);
});
});