Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2023-09-06 18:09:15 +00:00
parent 74739c4b9e
commit f011d78ffe
104 changed files with 588 additions and 303 deletions

View File

@ -713,7 +713,6 @@ Layout/LineLength:
- 'danger/z_metadata/Dangerfile'
- 'ee/app/controllers/admin/elasticsearch_controller.rb'
- 'ee/app/controllers/admin/geo/application_controller.rb'
- 'ee/app/controllers/admin/geo/projects_controller.rb'
- 'ee/app/controllers/admin/licenses_controller.rb'
- 'ee/app/controllers/concerns/audit_events/date_range.rb'
- 'ee/app/controllers/concerns/credentials_inventory_actions.rb'
@ -1304,7 +1303,6 @@ Layout/LineLength:
- 'ee/lib/tasks/gitlab/seed/metrics.rake'
- 'ee/lib/world.rb'
- 'ee/spec/controllers/admin/elasticsearch_controller_spec.rb'
- 'ee/spec/controllers/admin/geo/projects_controller_spec.rb'
- 'ee/spec/controllers/admin/impersonations_controller_spec.rb'
- 'ee/spec/controllers/admin/licenses_controller_spec.rb'
- 'ee/spec/controllers/admin/projects_controller_spec.rb'

View File

@ -6,7 +6,6 @@ RSpec/ContextWording:
- 'ee/spec/controllers/admin/audit_logs_controller_spec.rb'
- 'ee/spec/controllers/admin/dev_ops_report_controller_spec.rb'
- 'ee/spec/controllers/admin/emails_controller_spec.rb'
- 'ee/spec/controllers/admin/geo/projects_controller_spec.rb'
- 'ee/spec/controllers/admin/licenses_controller_spec.rb'
- 'ee/spec/controllers/admin/push_rules_controller_spec.rb'
- 'ee/spec/controllers/admin/users_controller_spec.rb'

View File

@ -357,7 +357,6 @@ Style/ClassAndModuleChildren:
- 'ee/app/controllers/admin/geo/application_controller.rb'
- 'ee/app/controllers/admin/geo/designs_controller.rb'
- 'ee/app/controllers/admin/geo/nodes_controller.rb'
- 'ee/app/controllers/admin/geo/projects_controller.rb'
- 'ee/app/controllers/admin/geo/replicables_controller.rb'
- 'ee/app/controllers/admin/geo/settings_controller.rb'
- 'ee/app/controllers/admin/licenses_controller.rb'

View File

@ -160,7 +160,6 @@ Style/FormatString:
- 'ee/app/components/namespaces/free_user_cap/usage_quota_trial_alert_component.rb'
- 'ee/app/controllers/admin/elasticsearch_controller.rb'
- 'ee/app/controllers/admin/geo/application_controller.rb'
- 'ee/app/controllers/admin/geo/projects_controller.rb'
- 'ee/app/controllers/admin/licenses_controller.rb'
- 'ee/app/controllers/concerns/audit_events/date_range.rb'
- 'ee/app/controllers/ee/projects/issues_controller.rb'

View File

@ -389,7 +389,6 @@ Style/IfUnlessModifier:
- 'ee/app/controllers/admin/elasticsearch_controller.rb'
- 'ee/app/controllers/admin/emails_controller.rb'
- 'ee/app/controllers/admin/geo/application_controller.rb'
- 'ee/app/controllers/admin/geo/projects_controller.rb'
- 'ee/app/controllers/admin/geo/settings_controller.rb'
- 'ee/app/controllers/admin/push_rules_controller.rb'
- 'ee/app/controllers/concerns/credentials_inventory_actions.rb'

View File

@ -2,53 +2,6 @@
# Cop supports --autocorrect.
Style/PercentLiteralDelimiters:
Exclude:
- 'app/models/bulk_imports/file_transfer/group_config.rb'
- 'app/models/bulk_imports/file_transfer/project_config.rb'
- 'app/models/ci/build.rb'
- 'app/models/ci/build_runner_session.rb'
- 'app/models/ci/pipeline.rb'
- 'app/models/clusters/platforms/kubernetes.rb'
- 'app/models/commit.rb'
- 'app/models/concerns/clusters/agents/authorizations/ci_access/config_scopes.rb'
- 'app/models/concerns/diff_positionable_note.rb'
- 'app/models/concerns/enums/prometheus_metric.rb'
- 'app/models/concerns/issuable.rb'
- 'app/models/concerns/issue_available_features.rb'
- 'app/models/concerns/mentionable/reference_regexes.rb'
- 'app/models/concerns/noteable.rb'
- 'app/models/concerns/resolvable_note.rb'
- 'app/models/concerns/with_uploads.rb'
- 'app/models/container_registry/event.rb'
- 'app/models/deploy_token.rb'
- 'app/models/description_version.rb'
- 'app/models/design_management.rb'
- 'app/models/diff_note.rb'
- 'app/models/discussion_note.rb'
- 'app/models/draft_note.rb'
- 'app/models/environment.rb'
- 'app/models/event.rb'
- 'app/models/instance_configuration.rb'
- 'app/models/integrations/asana.rb'
- 'app/models/integrations/assembla.rb'
- 'app/models/integrations/base_issue_tracker.rb'
- 'app/models/integrations/base_monitoring.rb'
- 'app/models/integrations/base_slash_commands.rb'
- 'app/models/integrations/base_third_party_wiki.rb'
- 'app/models/integrations/buildkite.rb'
- 'app/models/integrations/campfire.rb'
- 'app/models/integrations/datadog.rb'
- 'app/models/integrations/drone_ci.rb'
- 'app/models/integrations/emails_on_push.rb'
- 'app/models/integrations/external_wiki.rb'
- 'app/models/integrations/jenkins.rb'
- 'app/models/integrations/jira.rb'
- 'app/models/integrations/packagist.rb'
- 'app/models/integrations/pivotaltracker.rb'
- 'app/models/integrations/pushover.rb'
- 'app/models/integrations/teamcity.rb'
- 'app/models/integrations/zentao.rb'
- 'app/models/issuable_severity.rb'
- 'app/models/issue.rb'
- 'app/models/lfs_download_object.rb'
- 'app/models/namespace.rb'
- 'app/models/namespace/root_storage_statistics.rb'

View File

@ -1 +1 @@
f6193a424bcc235e906bc1ae82737b4ed58ec8fd
638126d9b6839f340c151f55d66ec5742223c901

View File

@ -101,7 +101,7 @@ gem 'rqrcode-rails3', '~> 0.1.7'
gem 'attr_encrypted', '~> 3.2.4', path: 'vendor/gems/attr_encrypted'
# GitLab Pages
gem 'validates_hostname', '~> 1.0.11'
gem 'validates_hostname', '~> 1.0.13'
gem 'rubyzip', '~> 2.3.2', require: 'zip'
# GitLab Pages letsencrypt support
gem 'acme-client', '~> 2.0'
@ -334,7 +334,7 @@ gem 'terser', '1.0.2'
gem 'click_house-client', path: 'gems/click_house-client', require: 'click_house/client'
gem 'addressable', '~> 2.8'
gem 'tanuki_emoji', '~> 0.6'
gem 'tanuki_emoji', '~> 0.7'
gem 'gon', '~> 6.4.0'
gem 'request_store', '~> 1.5.1'
gem 'base32', '~> 0.3.0'

View File

@ -299,7 +299,7 @@
{"name":"http-form_data","version":"2.3.0","platform":"ruby","checksum":"cc4eeb1361d9876821e31d7b1cf0b68f1cf874b201d27903480479d86448a5f3"},
{"name":"httparty","version":"0.21.0","platform":"ruby","checksum":"00ef7bf9a71f30a3bff88edeb5b16a34bea883ab67c246b3f0db2d6794fe1214"},
{"name":"httpclient","version":"2.8.3","platform":"ruby","checksum":"2951e4991214464c3e92107e46438527d23048e634f3aee91c719e0bdfaebda6"},
{"name":"i18n","version":"1.12.0","platform":"ruby","checksum":"91e3cc1b97616d308707eedee413d82ee021d751c918661fb82152793e64aced"},
{"name":"i18n","version":"1.14.1","platform":"ruby","checksum":"9d03698903547c060928e70a9bc8b6b87fda674453cda918fc7ab80235ae4a61"},
{"name":"i18n_data","version":"0.13.1","platform":"ruby","checksum":"e5aa99b09a69b463bb0443fc1f9540351a49f3d1541c5e91316bafa035c63f66"},
{"name":"icalendar","version":"2.8.0","platform":"ruby","checksum":"e404f970c7572bdebf6f09f9890970b68aab400ba9e609dc7d46098f28d0ee87"},
{"name":"ice_cube","version":"0.16.4","platform":"ruby","checksum":"da117e5de24bdc33931be629f9b55048641924442c7e9b72fedc05e5592531b7"},
@ -617,7 +617,7 @@
{"name":"sys-filesystem","version":"1.4.3","platform":"ruby","checksum":"390919de89822ad6d3ba3daf694d720be9d83ed95cdf7adf54d4573c98b17421"},
{"name":"sysexits","version":"1.2.0","platform":"ruby","checksum":"598241c4ae57baa403c125182dfdcc0d1ac4c0fb606dd47fbed57e4aaf795662"},
{"name":"table_print","version":"1.5.7","platform":"ruby","checksum":"436664281f93387b882335795e16cfeeb839ad0c785ff7f9110fc0f17c68b5cb"},
{"name":"tanuki_emoji","version":"0.6.0","platform":"ruby","checksum":"4ce91aefed2d076b73fba3eff50e89660c3d25691787a9fe4c0dfabb4218c12a"},
{"name":"tanuki_emoji","version":"0.7.0","platform":"ruby","checksum":"d10df452d8087b2c6a0eecb888609315d47bb30bb9e17c11441869cf24aae987"},
{"name":"telesign","version":"2.2.4","platform":"ruby","checksum":"dcc6e96ea7bcb4da1e2ae786bfe7a4d670a4b5f94ae95dfcdde77d547c544c42"},
{"name":"telesignenterprise","version":"2.2.2","platform":"ruby","checksum":"f147a03263a8c2fe0a0db1a7a9454a6ee37d9e8abd58eaca305bdd8081f9f1b3"},
{"name":"temple","version":"0.8.2","platform":"ruby","checksum":"c12071214346c606dbd219b4117276d04a9f2c20d65e66a66b2c4ec18efc1f18"},
@ -668,7 +668,7 @@
{"name":"valid_email","version":"0.1.3","platform":"ruby","checksum":"b81452b51b64c4beb67913f68db52c20ecb4d73d45512f5b282ab4a3f4416570"},
{"name":"validate_email","version":"0.1.6","platform":"ruby","checksum":"9dfe9016d527b17a8d3a6e95e4dc50a125400eef899d13d4cc2a254393f82ee4"},
{"name":"validate_url","version":"1.0.15","platform":"ruby","checksum":"72fe164c0713d63a9970bd6700bea948babbfbdcec392f2342b6704042f57451"},
{"name":"validates_hostname","version":"1.0.11","platform":"ruby","checksum":"d506bae0342ec14c920eb319e057fc1886c321a59b85b4b6e966ee4b88fab8c3"},
{"name":"validates_hostname","version":"1.0.13","platform":"ruby","checksum":"eac40178cc0b4f727df9cc6a5cb5bc2550718ad8d9bb3728df9aba6354bdda19"},
{"name":"version_gem","version":"1.1.0","platform":"ruby","checksum":"6b009518020db57f51ec7b410213fae2bf692baea9f1b51770db97fbc93d9a80"},
{"name":"version_sorter","version":"2.3.0","platform":"ruby","checksum":"2147f2a1a3804fbb8f60d268b7d7c1ec717e6dd727ffe2c165b4e05e82efe1da"},
{"name":"view_component","version":"3.5.0","platform":"ruby","checksum":"c3e3cdf5abb2383157684d76cfb153d23bfc9834a7defa82441edab54635e8af"},

View File

@ -872,7 +872,7 @@ GEM
mini_mime (>= 1.0.0)
multi_xml (>= 0.5.2)
httpclient (2.8.3)
i18n (1.12.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
i18n_data (0.13.1)
icalendar (2.8.0)
@ -1568,7 +1568,7 @@ GEM
ffi (~> 1.1)
sysexits (1.2.0)
table_print (1.5.7)
tanuki_emoji (0.6.0)
tanuki_emoji (0.7.0)
telesign (2.2.4)
net-http-persistent (>= 3.0.0, < 5.0)
telesignenterprise (2.2.2)
@ -1660,7 +1660,7 @@ GEM
validate_url (1.0.15)
activemodel (>= 3.0.0)
public_suffix
validates_hostname (1.0.11)
validates_hostname (1.0.13)
activerecord (>= 3.0)
activesupport (>= 3.0)
version_gem (1.1.0)
@ -2020,7 +2020,7 @@ DEPENDENCIES
stackprof (~> 0.2.25)
state_machines-activerecord (~> 0.8.0)
sys-filesystem (~> 1.4.3)
tanuki_emoji (~> 0.6)
tanuki_emoji (~> 0.7)
telesignenterprise (~> 2.2)
terser (= 1.0.2)
test-prof (~> 1.2.2)
@ -2034,7 +2034,7 @@ DEPENDENCIES
unf (~> 0.1.4)
unleash (~> 3.2.2)
valid_email (~> 0.1)
validates_hostname (~> 1.0.11)
validates_hostname (~> 1.0.13)
version_sorter (~> 2.3)
view_component (~> 3.5.0)
vite_rails

View File

@ -203,11 +203,6 @@ export default {
required: false,
default: () => [],
},
eeIsOkrsEnabled: {
type: Boolean,
required: false,
default: false,
},
},
data() {
return {
@ -1024,14 +1019,11 @@ export default {
>
{{ $options.i18n.editIssues }}
</gl-button>
<gl-button
v-if="showNewIssueLink && !eeIsOkrsEnabled"
:href="newIssuePath"
variant="confirm"
>
{{ $options.i18n.newIssueLabel }}
</gl-button>
<slot name="new-objective-button"></slot>
<slot name="new-issuable-button">
<gl-button v-if="showNewIssueLink" :href="newIssuePath" variant="confirm">
{{ $options.i18n.newIssueLabel }}
</gl-button>
</slot>
<new-resource-dropdown
v-if="showNewIssueDropdown"
:query="$options.searchProjectsQuery"

View File

@ -10,12 +10,13 @@ import { initBlobRefSwitcher } from './under_topbar';
export const initSearchApp = () => {
syntaxHighlight(document.querySelectorAll('.js-search-results'));
const query = queryToObject(window.location.search, { gatherArrays: true });
const { navigationJsonParsed: navigation } = sidebarInitState() || {};
const { navigationJsonParsed: navigation, searchType } = sidebarInitState() || {};
const store = createStore({
query,
navigation,
useSidebarNavigation: gon.use_new_navigation,
searchType,
});
initTopbar(store);

View File

@ -5,7 +5,13 @@ import ScopeLegacyNavigation from '~/search/sidebar/components/scope_legacy_navi
import ScopeSidebarNavigation from '~/search/sidebar/components/scope_sidebar_navigation.vue';
import SidebarPortal from '~/super_sidebar/components/sidebar_portal.vue';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { SCOPE_ISSUES, SCOPE_MERGE_REQUESTS, SCOPE_BLOB, SCOPE_PROJECTS } from '../constants';
import {
SCOPE_ISSUES,
SCOPE_MERGE_REQUESTS,
SCOPE_BLOB,
SCOPE_PROJECTS,
SEARCH_TYPE_ADVANCED,
} from '../constants';
import IssuesFilters from './issues_filters.vue';
import MergeRequestsFilters from './merge_requests_filters.vue';
import BlobsFilters from './blobs_filters.vue';
@ -25,7 +31,7 @@ export default {
mixins: [glFeatureFlagsMixin()],
computed: {
// useSidebarNavigation refers to whether the new left sidebar navigation is enabled
...mapState(['useSidebarNavigation']),
...mapState(['useSidebarNavigation', 'searchType']),
...mapGetters(['currentScope']),
showIssuesFilters() {
return this.currentScope === SCOPE_ISSUES;
@ -34,7 +40,7 @@ export default {
return this.currentScope === SCOPE_MERGE_REQUESTS;
},
showBlobFilters() {
return this.currentScope === SCOPE_BLOB;
return this.currentScope === SCOPE_BLOB && this.searchType === SEARCH_TYPE_ADVANCED;
},
showProjectsFilters() {
// for now the feature flag is here. Since we have only one filter in projects scope

View File

@ -19,3 +19,7 @@ export const ONLY_SHOW_MD = ['gl-display-none', 'gl-md-display-block'];
export const TRACKING_ACTION_CLICK = 'search:filters:click';
export const TRACKING_LABEL_APPLY = 'Apply Filters';
export const TRACKING_LABEL_RESET = 'Reset Filters';
export const SEARCH_TYPE_BASIC = 'basic';
export const SEARCH_TYPE_ADVANCED = 'advanced';
export const SEARCH_TYPE_ZOEKT = 'zoekt';

View File

@ -8,9 +8,11 @@ export const sidebarInitState = () => {
const el = document.getElementById('js-search-sidebar');
if (!el) return {};
const { navigationJson } = el.dataset;
const { navigationJson, searchType } = el.dataset;
const navigationJsonParsed = JSON.parse(navigationJson);
return { navigationJsonParsed };
return { navigationJsonParsed, searchType };
};
export const initSidebar = (store) => {

View File

@ -1,7 +1,7 @@
import { cloneDeep } from 'lodash';
import { GROUPS_LOCAL_STORAGE_KEY, PROJECTS_LOCAL_STORAGE_KEY } from './constants';
const createState = ({ query, navigation, useSidebarNavigation }) => ({
const createState = ({ query, navigation, useSidebarNavigation, searchType }) => ({
urlQuery: cloneDeep(query),
query,
groups: [],
@ -21,6 +21,7 @@ const createState = ({ query, navigation, useSidebarNavigation }) => ({
data: [],
},
searchLabelString: '',
searchType,
});
export default createState;

View File

@ -6,6 +6,13 @@ import { SIDEBAR_PINS_EXPANDED_COOKIE, SIDEBAR_COOKIE_EXPIRATION } from '../cons
import MenuSection from './menu_section.vue';
import NavItem from './nav_item.vue';
const AMBIGUOUS_SETTINGS = {
ci_cd: s__('Navigation|CI/CD settings'),
merge_request_settings: s__('Navigation|Merge requests settings'),
monitor: s__('Navigation|Monitor settings'),
repository: s__('Navigation|Repository settings'),
};
export default {
i18n: {
pinned: s__('Navigation|Pinned'),
@ -32,7 +39,7 @@ export default {
data() {
return {
expanded: getCookie(SIDEBAR_PINS_EXPANDED_COOKIE) !== 'false',
draggableItems: this.items,
draggableItems: this.renameSettings(this.items),
};
},
computed: {
@ -58,7 +65,7 @@ export default {
});
},
items(newItems) {
this.draggableItems = newItems;
this.draggableItems = this.renameSettings(newItems);
},
},
methods: {
@ -71,6 +78,12 @@ export default {
event.oldIndex < event.newIndex,
);
},
renameSettings(items) {
return items.map((i) => {
const title = AMBIGUOUS_SETTINGS[i.id] || i.title;
return { ...i, title };
});
},
},
};
</script>

View File

@ -95,7 +95,7 @@ export default {
return Boolean(this.issuable.externalTracker);
},
isIssuableUrlExternal() {
return isExternal(this.webUrl);
return isExternal(this.webUrl ?? '');
},
reference() {
return this.issuable.reference || `${this.issuableSymbol}${this.issuable.iid}`;

View File

@ -36,6 +36,7 @@ export const WORK_ITEM_TYPE_ENUM_REQUIREMENTS = 'REQUIREMENTS';
export const WORK_ITEM_TYPE_ENUM_OBJECTIVE = 'OBJECTIVE';
export const WORK_ITEM_TYPE_ENUM_KEY_RESULT = 'KEY_RESULT';
export const WORK_ITEM_TYPE_VALUE_EPIC = 'Epic';
export const WORK_ITEM_TYPE_VALUE_INCIDENT = 'Incident';
export const WORK_ITEM_TYPE_VALUE_ISSUE = 'Issue';
export const WORK_ITEM_TYPE_VALUE_TASK = 'Task';

View File

@ -0,0 +1,11 @@
query groupWorkItemTypes($fullPath: ID!) {
workspace: group(fullPath: $fullPath) {
id
workItemTypes {
nodes {
id
name
}
}
}
}

View File

@ -67,6 +67,10 @@ export default {
:tabs="$options.issuableListTabs"
@dismiss-alert="error = undefined"
>
<template #nav-actions>
<slot name="nav-actions"></slot>
</template>
<template #timeframe="{ issuable = {} }">
<issue-card-time-info :issue="issuable" />
</template>
@ -78,5 +82,9 @@ export default {
<template #statistics="{ issuable = {} }">
<issue-card-statistics :issue="issuable" />
</template>
<template #list-body>
<slot name="list-body"></slot>
</template>
</issuable-list>
</template>

View File

@ -2,7 +2,7 @@ import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
import { parseBoolean } from '~/lib/utils/common_utils';
import WorkItemsListApp from './components/work_items_list_app.vue';
import WorkItemsListApp from 'ee_else_ce/work_items/list/components/work_items_list_app.vue';
export const mountWorkItemsListApp = () => {
const el = document.querySelector('.js-work-items-list-root');
@ -13,7 +13,12 @@ export const mountWorkItemsListApp = () => {
Vue.use(VueApollo);
const { fullPath, hasIssuableHealthStatusFeature, hasIssueWeightsFeature } = el.dataset;
const {
fullPath,
hasEpicsFeature,
hasIssuableHealthStatusFeature,
hasIssueWeightsFeature,
} = el.dataset;
return new Vue({
el,
@ -23,6 +28,7 @@ export const mountWorkItemsListApp = () => {
}),
provide: {
fullPath,
hasEpicsFeature: parseBoolean(hasEpicsFeature),
hasIssuableHealthStatusFeature: parseBoolean(hasIssuableHealthStatusFeature),
hasIssueWeightsFeature: parseBoolean(hasIssueWeightsFeature),
},

View File

@ -208,6 +208,7 @@ class Notify < ApplicationMailer
headers["#{prefix}-ID"] = object.id
headers["#{prefix}-IID"] = object.iid if object.respond_to?(:iid)
headers["#{prefix}-State"] = object.state if object.respond_to?(:state)
end
def add_project_headers

View File

@ -3,7 +3,7 @@
module BulkImports
module FileTransfer
class GroupConfig < BaseConfig
SKIPPED_RELATIONS = %w(members).freeze
SKIPPED_RELATIONS = %w[members].freeze
def import_export_yaml
::Gitlab::ImportExport.group_config_file

View File

@ -3,10 +3,10 @@
module BulkImports
module FileTransfer
class ProjectConfig < BaseConfig
SKIPPED_RELATIONS = %w(
SKIPPED_RELATIONS = %w[
project_members
group_members
).freeze
].freeze
LFS_OBJECTS_RELATION = 'lfs_objects'
REPOSITORY_BUNDLE_RELATION = 'repository'

View File

@ -165,7 +165,7 @@ module Ci
scope :with_live_trace, -> { where('EXISTS (?)', Ci::BuildTraceChunk.where("#{quoted_table_name}.id = #{Ci::BuildTraceChunk.quoted_table_name}.build_id").select(1)) }
scope :with_stale_live_trace, -> { with_live_trace.finished_before(12.hours.ago) }
scope :finished_before, -> (date) { finished.where('finished_at < ?', date) }
scope :license_management_jobs, -> { where(name: %i(license_management license_scanning)) } # handle license rename https://gitlab.com/gitlab-org/gitlab/issues/8911
scope :license_management_jobs, -> { where(name: %i[license_management license_scanning]) } # handle license rename https://gitlab.com/gitlab-org/gitlab/issues/8911
# WARNING: This scope could lead to performance implications for large size of tables `ci_builds` and ci_runners`.
# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/123131
scope :with_runner_type, -> (runner_type) { joins(:runner).where(runner: { runner_type: runner_type }) }
@ -495,14 +495,7 @@ module Ci
Gitlab::Ci::Variables::Collection.new.tap do |variables|
break variables unless persisted? && persisted_environment.present?
if ::Feature.enabled?(:support_ci_environment_variables_in_job_rules, project)
variables.append(key: 'CI_ENVIRONMENT_SLUG', value: environment_slug)
else
variables.concat(persisted_environment.predefined_variables)
variables.append(key: 'CI_ENVIRONMENT_ACTION', value: environment_action)
variables.append(key: 'CI_ENVIRONMENT_TIER', value: environment_tier)
end
variables.append(key: 'CI_ENVIRONMENT_SLUG', value: environment_slug)
# Here we're passing unexpanded environment_url for runner to expand,
# and we need to make sure that CI_ENVIRONMENT_NAME and

View File

@ -20,7 +20,7 @@ module Ci
partitionable scope: :build
validates :build, presence: true
validates :url, public_url: { schemes: %w(https) }
validates :url, public_url: { schemes: %w[https] }
def terminal_specification
wss_url = Gitlab::UrlHelpers.as_wss(Addressable::URI.escape(url))

View File

@ -162,7 +162,7 @@ module Ci
validates :status, presence: { unless: :importing? }
validate :valid_commit_sha, unless: :importing?
validates :source, exclusion: { in: %w(unknown), unless: :importing? }, on: :create
validates :source, exclusion: { in: %w[unknown], unless: :importing? }, on: :create
after_create :keep_around_commits, unless: :importing?
after_find :observe_age_in_minutes, unless: :importing?

View File

@ -8,7 +8,7 @@ module Clusters
include ReactiveCaching
include NullifyIfBlank
RESERVED_NAMESPACES = %w(gitlab-managed-apps).freeze
RESERVED_NAMESPACES = %w[gitlab-managed-apps].freeze
REQUIRED_K8S_MIN_VERSION = 23
IGNORED_CONNECTION_EXCEPTIONS = [

View File

@ -432,7 +432,7 @@ class Commit
end
def cherry_pick_message(user)
%{#{message}\n\n#{cherry_pick_description(user)}}
%(#{message}\n\n#{cherry_pick_description(user)})
end
def revert_description(user)
@ -444,7 +444,7 @@ class Commit
end
def revert_message(user)
%{Revert "#{title.strip}"\n\n#{revert_description(user)}}
%(Revert "#{title.strip}"\n\n#{revert_description(user)})
end
def reverts_commit?(commit, user)

View File

@ -17,7 +17,7 @@ module Clusters
class_methods do
def available_ci_access_fields(_project)
%w(agent)
%w[agent]
end
end
end

View File

@ -14,7 +14,7 @@ module DiffPositionableNote
validates :position, json_schema: { filename: "position", hash_conversion: true }
end
%i(original_position position change_position).each do |meth|
%i[original_position position change_position].each do |meth|
define_method "#{meth}=" do |new_position|
if new_position.is_a?(String)
new_position = begin

View File

@ -30,37 +30,37 @@ module Enums
# built-in groups
nginx_ingress_vts: {
group_title: _('Response metrics (NGINX Ingress VTS)'),
required_metrics: %w(nginx_upstream_responses_total nginx_upstream_response_msecs_avg),
required_metrics: %w[nginx_upstream_responses_total nginx_upstream_response_msecs_avg],
priority: 10
}.freeze,
nginx_ingress: {
group_title: _('Response metrics (NGINX Ingress)'),
required_metrics: %w(nginx_ingress_controller_requests nginx_ingress_controller_ingress_upstream_latency_seconds_sum),
required_metrics: %w[nginx_ingress_controller_requests nginx_ingress_controller_ingress_upstream_latency_seconds_sum],
priority: 10
}.freeze,
ha_proxy: {
group_title: _('Response metrics (HA Proxy)'),
required_metrics: %w(haproxy_frontend_http_requests_total haproxy_frontend_http_responses_total),
required_metrics: %w[haproxy_frontend_http_requests_total haproxy_frontend_http_responses_total],
priority: 10
}.freeze,
aws_elb: {
group_title: _('Response metrics (AWS ELB)'),
required_metrics: %w(aws_elb_request_count_sum aws_elb_latency_average aws_elb_httpcode_backend_5_xx_sum),
required_metrics: %w[aws_elb_request_count_sum aws_elb_latency_average aws_elb_httpcode_backend_5_xx_sum],
priority: 10
}.freeze,
nginx: {
group_title: _('Response metrics (NGINX)'),
required_metrics: %w(nginx_server_requests nginx_server_requestMsec),
required_metrics: %w[nginx_server_requests nginx_server_requestMsec],
priority: 10
}.freeze,
kubernetes: {
group_title: _('System metrics (Kubernetes)'),
required_metrics: %w(container_memory_usage_bytes container_cpu_usage_seconds_total),
required_metrics: %w[container_memory_usage_bytes container_cpu_usage_seconds_total],
priority: 5
}.freeze,
cluster_health: {
group_title: _('Cluster Health'),
required_metrics: %w(container_memory_usage_bytes container_cpu_usage_seconds_total),
required_metrics: %w[container_memory_usage_bytes container_cpu_usage_seconds_total],
priority: 10
}.freeze
}.merge(custom_group_details).freeze

View File

@ -33,7 +33,7 @@ module Issuable
TITLE_HTML_LENGTH_MAX = 800
DESCRIPTION_LENGTH_MAX = 1.megabyte
DESCRIPTION_HTML_LENGTH_MAX = 5.megabytes
SEARCHABLE_FIELDS = %w(title description).freeze
SEARCHABLE_FIELDS = %w[title description].freeze
MAX_NUMBER_OF_ASSIGNEES_OR_REVIEWERS = 200
STATE_ID_MAP = {
@ -412,14 +412,14 @@ module Issuable
sort = sort.to_s
grouping_columns = [arel_table[:id]]
if %w(milestone_due_desc milestone_due_asc milestone).include?(sort)
if %w[milestone_due_desc milestone_due_asc milestone].include?(sort)
milestone_table = Milestone.arel_table
grouping_columns << milestone_table[:id]
grouping_columns << milestone_table[:due_date]
elsif %w(merged_at_desc merged_at_asc merged_at).include?(sort)
elsif %w[merged_at_desc merged_at_asc merged_at].include?(sort)
grouping_columns << MergeRequest::Metrics.arel_table[:id]
grouping_columns << MergeRequest::Metrics.arel_table[:merged_at]
elsif %w(closed_at_desc closed_at_asc closed_at).include?(sort)
elsif %w[closed_at_desc closed_at_asc closed_at].include?(sort)
grouping_columns << MergeRequest::Metrics.arel_table[:id]
grouping_columns << MergeRequest::Metrics.arel_table[:latest_closed_at]
end

View File

@ -10,10 +10,10 @@ module IssueAvailableFeatures
# EE only features are listed on EE::IssueAvailableFeatures
def available_features_for_issue_types
{
assignee: %w(issue incident),
confidentiality: %w(issue incident),
time_tracking: %w(issue incident),
move_and_clone: %w(issue incident)
assignee: %w[issue incident],
confidentiality: %w[issue incident],
time_tracking: %w[issue incident],
move_and_clone: %w[issue incident]
}.with_indifferent_access
end
end

View File

@ -28,7 +28,7 @@ module Mentionable
def self.external_pattern
strong_memoize(:external_pattern) do
issue_pattern = Integrations::BaseIssueTracker.base_reference_pattern
link_patterns = URI::DEFAULT_PARSER.make_regexp(%w(http https))
link_patterns = URI::DEFAULT_PARSER.make_regexp(%w[http https])
reference_pattern(link_patterns, issue_pattern)
end
end

View File

@ -12,17 +12,17 @@ module Noteable
class_methods do
# `Noteable` class names that support replying to individual notes.
def replyable_types
%w(Issue MergeRequest)
%w[Issue MergeRequest]
end
# `Noteable` class names that support resolvable notes.
def resolvable_types
%w(Issue MergeRequest DesignManagement::Design)
%w[Issue MergeRequest DesignManagement::Design]
end
# `Noteable` class names that support creating/forwarding individual notes.
def email_creatable_types
%w(Issue)
%w[Issue]
end
end

View File

@ -4,7 +4,7 @@ module ResolvableNote
extend ActiveSupport::Concern
# Names of all subclasses of `Note` that can be resolvable.
RESOLVABLE_TYPES = %w(DiffNote DiscussionNote).freeze
RESOLVABLE_TYPES = %w[DiffNote DiscussionNote].freeze
included do
belongs_to :resolved_by, class_name: "User"

View File

@ -22,7 +22,7 @@ module WithUploads
# Currently there is no simple way how to select only not-mounted
# uploads, it should be all FileUploaders so we select them by
# `uploader` class
FILE_UPLOADERS = %w(PersonalFileUploader NamespaceFileUploader FileUploader).freeze
FILE_UPLOADERS = %w[PersonalFileUploader NamespaceFileUploader FileUploader].freeze
included do
around_destroy :ignore_uploads_table_in_transaction

View File

@ -4,25 +4,25 @@ module ContainerRegistry
class Event
include Gitlab::Utils::StrongMemoize
ALLOWED_ACTIONS = %w(push delete).freeze
ALLOWED_ACTIONS = %w[push delete].freeze
PUSH_ACTION = 'push'
DELETE_ACTION = 'delete'
EVENT_TRACKING_CATEGORY = 'container_registry:notification'
EVENT_PREFIX = 'i_container_registry'
ALLOWED_ACTOR_TYPES = %w(
ALLOWED_ACTOR_TYPES = %w[
personal_access_token
build
gitlab_or_ldap
).freeze
].freeze
TRACKABLE_ACTOR_EVENTS = %w(
TRACKABLE_ACTOR_EVENTS = %w[
push_tag
delete_tag
push_repository
delete_repository
create_repository
).freeze
].freeze
attr_reader :event

View File

@ -8,8 +8,8 @@ class DeployToken < ApplicationRecord
add_authentication_token_field :token, encrypted: :required
AVAILABLE_SCOPES = %i(read_repository read_registry write_registry
read_package_registry write_package_registry).freeze
AVAILABLE_SCOPES = %i[read_repository read_registry write_registry
read_package_registry write_package_registry].freeze
GITLAB_DEPLOY_TOKEN_NAME = 'gitlab-deploy-token'
REQUIRED_DEPENDENCY_PROXY_SCOPES = %i[read_registry write_registry].freeze

View File

@ -9,7 +9,7 @@ class DescriptionVersion < ApplicationRecord
delegate :resource_parent, to: :issuable
def self.issuable_attrs
%i(issue merge_request).freeze
%i[issue merge_request].freeze
end
def issuable

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
module DesignManagement
DESIGN_IMAGE_SIZES = %w(v432x230).freeze
DESIGN_IMAGE_SIZES = %w[v432x230].freeze
def self.designs_directory
'designs'

View File

@ -9,7 +9,7 @@ class DiffNote < Note
include Gitlab::Utils::StrongMemoize
def self.noteable_types
%w(MergeRequest Commit DesignManagement::Design)
%w[MergeRequest Commit DesignManagement::Design]
end
validates :original_position, presence: true

View File

@ -9,7 +9,7 @@ class DiscussionNote < Note
# Names of all implementers of `Noteable` that support discussions.
def self.noteable_types
%w(MergeRequest Issue Commit Snippet)
%w[MergeRequest Issue Commit Snippet]
end
validates :noteable_type, inclusion: { in: noteable_types }

View File

@ -5,8 +5,8 @@ class DraftNote < ApplicationRecord
include Sortable
include ShaAttribute
PUBLISH_ATTRS = %i(noteable_id noteable_type type note).freeze
DIFF_ATTRS = %i(position original_position change_position commit_id).freeze
PUBLISH_ATTRS = %i[noteable_id noteable_type type note].freeze
DIFF_ATTRS = %i[position original_position change_position commit_id].freeze
sha_attribute :commit_id

View File

@ -107,11 +107,11 @@ class Environment < ApplicationRecord
scope :deployed_and_updated_before, -> (project_id, before) do
# this query joins deployments and filters out any environment that has recent deployments
joins = %{
joins = %(
LEFT JOIN "deployments" on "deployments".environment_id = "environments".id
AND "deployments".project_id = #{project_id}
AND "deployments".updated_at >= #{connection.quote(before)}
}
)
Environment.joins(joins)
.where(project_id: project_id, updated_at: ...before)
.group('id', 'deployments.id')
@ -192,7 +192,7 @@ class Environment < ApplicationRecord
end
event :stop_complete do
transition %i(available stopping) => :stopped
transition %i[available stopping] => :stopped
end
state :available

View File

@ -69,7 +69,7 @@ class Event < ApplicationRecord
# If the association for "target" defines an "author" association we want to
# eager-load this so Banzai & friends don't end up performing N+1 queries to
# get the authors of notes, issues, etc. (likewise for "noteable").
incs = %i(author noteable work_item_type).select do |a|
incs = %i[author noteable work_item_type].select do |a|
reflections['events'].active_record.reflect_on_association(a)
end
@ -137,7 +137,7 @@ class Event < ApplicationRecord
where(
'action IN (?) OR (target_type IN (?) AND action IN (?))',
[actions[:pushed], actions[:commented]],
%w(MergeRequest Issue WorkItem), [actions[:created], actions[:closed], actions[:merged]]
%w[MergeRequest Issue WorkItem], [actions[:created], actions[:closed], actions[:merged]]
)
end

View File

@ -3,7 +3,7 @@
require 'resolv'
class InstanceConfiguration
SSH_ALGORITHMS = %w(DSA ECDSA ED25519 RSA).freeze
SSH_ALGORITHMS = %w[DSA ECDSA ED25519 RSA].freeze
SSH_ALGORITHMS_PATH = '/etc/ssh/'
CACHE_KEY = 'instance_configuration'
EXPIRATION_TIME = 24.hours

View File

@ -37,7 +37,7 @@ module Integrations
end
def self.supported_events
%w(push)
%w[push]
end
def client

View File

@ -28,7 +28,7 @@ module Integrations
end
def self.supported_events
%w(push)
%w[push]
end
def execute(data)

View File

@ -88,7 +88,7 @@ module Integrations
end
def self.supported_events
%w(push)
%w[push]
end
def execute(data)

View File

@ -9,7 +9,7 @@ module Integrations
attribute :category, default: 'monitoring'
def self.supported_events
%w()
%w[]
end
def can_query?

View File

@ -13,7 +13,7 @@ module Integrations
end
def self.supported_events
%w()
%w[]
end
def testable?

View File

@ -9,7 +9,7 @@ module Integrations
after_commit :cache_project_has_integration
def self.supported_events
%w()
%w[]
end
private

View File

@ -29,7 +29,7 @@ module Integrations
validates :token, presence: true, if: :activated?
def self.supported_events
%w(push merge_request tag_push)
%w[push merge_request tag_push]
end
# This is a stub method to work with deprecated API response

View File

@ -62,7 +62,7 @@ module Integrations
end
def self.supported_events
%w(push)
%w[push]
end
def execute(data)

View File

@ -40,7 +40,7 @@ module Integrations
ERB::Util.html_escape(
s_('DatadogIntegration|%{linkOpen}API key%{linkClose} used for authentication with Datadog.')
) % {
linkOpen: %{<a href="#{URL_API_KEYS_DOCS}" target="_blank" rel="noopener noreferrer">}.html_safe,
linkOpen: %(<a href="#{URL_API_KEYS_DOCS}" target="_blank" rel="noopener noreferrer">).html_safe,
linkClose: '</a>'.html_safe
}
end,

View File

@ -43,7 +43,7 @@ module Integrations
end
def self.supported_events
%w(push merge_request tag_push)
%w[push merge_request tag_push]
end
def commit_status_path(sha, ref)

View File

@ -52,7 +52,7 @@ module Integrations
end
def self.supported_events
%w(push tag_push)
%w[push tag_push]
end
def initialize_properties

View File

@ -47,7 +47,7 @@ module Integrations
end
def self.supported_events
%w()
%w[]
end
end
end

View File

@ -66,7 +66,7 @@ module Integrations
end
def self.supported_events
%w(push merge_request tag_push)
%w[push merge_request tag_push]
end
def title

View File

@ -126,7 +126,7 @@ module Integrations
# When these are false GitLab does not create cross reference
# comments on Jira except when an issue gets transitioned.
def self.supported_events
%w(commit merge_request)
%w[commit merge_request]
end
# {PROJECT-KEY}-{NUMBER} Examples: JIRA-1, PROJECT-1

View File

@ -42,7 +42,7 @@ module Integrations
end
def self.supported_events
%w(push merge_request tag_push)
%w[push merge_request tag_push]
end
def execute(data)

View File

@ -38,7 +38,7 @@ module Integrations
end
def self.supported_events
%w(push)
%w[push]
end
def execute(data)

View File

@ -47,19 +47,19 @@ module Integrations
[
['Device default sound', nil],
['Pushover (default)', 'pushover'],
%w(Bike bike),
%w(Bugle bugle),
%w[Bike bike],
%w[Bugle bugle],
['Cash Register', 'cashregister'],
%w(Classical classical),
%w(Cosmic cosmic),
%w(Falling falling),
%w(Gamelan gamelan),
%w(Incoming incoming),
%w(Intermission intermission),
%w(Magic magic),
%w(Mechanical mechanical),
%w[Classical classical],
%w[Cosmic cosmic],
%w[Falling falling],
%w[Gamelan gamelan],
%w[Incoming incoming],
%w[Intermission intermission],
%w[Magic magic],
%w[Mechanical mechanical],
['Piano Bar', 'pianobar'],
%w(Siren siren),
%w[Siren siren],
['Space Alarm', 'spacealarm'],
['Tug Boat', 'tugboat'],
['Alien Alarm (long)', 'alien'],
@ -84,7 +84,7 @@ module Integrations
end
def self.supported_events
%w(push)
%w[push]
end
def execute(data)

View File

@ -43,7 +43,7 @@ module Integrations
end
def supported_events
%w(push merge_request)
%w[push merge_request]
end
end

View File

@ -86,7 +86,7 @@ module Integrations
end
def self.supported_events
%w()
%w[]
end
private

View File

@ -11,11 +11,11 @@ class IssuableSeverity < ApplicationRecord
}.freeze
SEVERITY_QUICK_ACTION_PARAMS = {
unknown: %w(Unknown 0),
low: %w(Low S4 4),
medium: %w(Medium S3 3),
high: %w(High S2 2),
critical: %w(Critical S1 1)
unknown: %w[Unknown 0],
low: %w[Low S4 4],
medium: %w[Medium S3 3],
high: %w[High S2 2],
critical: %w[Critical S1 1]
}.freeze
belongs_to :issue

View File

@ -47,10 +47,10 @@ class Issue < ApplicationRecord
#
# This should be kept consistent with the enums used for the GraphQL issue list query in
# https://gitlab.com/gitlab-org/gitlab/-/blob/1379c2d7bffe2a8d809f23ac5ef9b4114f789c07/app/assets/javascripts/issues/list/constants.js#L154-158
TYPES_FOR_LIST = %w(issue incident test_case task objective key_result).freeze
TYPES_FOR_LIST = %w[issue incident test_case task objective key_result].freeze
# Types of issues that should be displayed on issue board lists
TYPES_FOR_BOARD_LIST = %w(issue incident).freeze
TYPES_FOR_BOARD_LIST = %w[issue incident].freeze
# This default came from the enum `issue_type` column. Defined as default in the DB
DEFAULT_ISSUE_TYPE = :issue
@ -783,7 +783,7 @@ class Issue < ApplicationRecord
# TODO: https://gitlab.com/gitlab-org/gitlab/-/work_items/393126
return unless project
Issues::SearchData.upsert({ namespace_id: namespace_id, project_id: project_id, issue_id: id, search_vector: search_vector }, unique_by: %i(project_id issue_id))
Issues::SearchData.upsert({ namespace_id: namespace_id, project_id: project_id, issue_id: id, search_vector: search_vector }, unique_by: %i[project_id issue_id])
end
def ensure_metrics!

View File

@ -23,6 +23,6 @@
#js-search-topbar{ data: { "group-initial-json": group_attributes.to_json, "project-initial-json": project_attributes.to_json, "elasticsearch-enabled": @search_service_presenter.advanced_search_enabled?.to_s, "default-branch-name": @project&.default_branch } }
.results.gl-md-display-flex.gl-mt-0
#js-search-sidebar{ class: search_bar_classes, data: { navigation_json: search_navigation_json } }
#js-search-sidebar{ class: search_bar_classes, data: { navigation_json: search_navigation_json, search_type: search_service.search_type } }
- if @search_term
= render 'search/results'

View File

@ -229,6 +229,7 @@ module Gitlab
content
sharedSecret
redirect
question
)
# This config option can be removed after Rails 7.1 by https://gitlab.com/gitlab-org/gitlab/-/issues/416270

View File

@ -1,8 +0,0 @@
---
name: support_ci_environment_variables_in_job_rules
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/128694
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/421377
milestone: '16.4'
type: development
group: group::environments
default_enabled: false

View File

@ -0,0 +1,25 @@
# frozen_string_literal: true
class UpdatePackageMetadataSyncSetting < Gitlab::Database::Migration[2.1]
restrict_gitlab_migration gitlab_schema: :gitlab_main
class ApplicationSetting < MigrationRecord
end
FULLY_ENABLED_SYNC = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].freeze
def up
application_setting = ApplicationSetting.last
return unless application_setting
# Check if the setting still has a default value and it wasn't updated manually by the admin
return unless application_setting.package_metadata_purl_types == []
# Update setting to enable all package types to sync
application_setting.update(package_metadata_purl_types: FULLY_ENABLED_SYNC)
end
def down
# no op
end
end

View File

@ -0,0 +1,38 @@
# frozen_string_literal: true
class ExtendPushRulesRegexLimits < Gitlab::Database::Migration[2.1]
disable_ddl_transaction!
REGEX_COLUMNS = %i[
force_push_regex
delete_branch_regex
commit_message_regex
author_email_regex
file_name_regex
branch_name_regex
].freeze
LONG_REGEX_COLUMNS = %i[commit_message_negative_regex]
def up
REGEX_COLUMNS.each do |column_name|
add_check_constraint :push_rules, "char_length(#{column_name}) <= 511", "#{column_name}_size_constraint",
validate: false
end
LONG_REGEX_COLUMNS.each do |column_name|
add_check_constraint :push_rules, "char_length(#{column_name}) <= 2047", "#{column_name}_size_constraint",
validate: false
end
end
def down
REGEX_COLUMNS.each do |column_name|
remove_check_constraint :push_rules, "#{column_name}_size_constraint"
end
LONG_REGEX_COLUMNS.each do |column_name|
remove_check_constraint :push_rules, "#{column_name}_size_constraint"
end
end
end

View File

@ -0,0 +1,25 @@
# frozen_string_literal: true
class ValidatePushRulesConstraints < Gitlab::Database::Migration[2.1]
disable_ddl_transaction!
REGEX_COLUMNS = %i[
force_push_regex
delete_branch_regex
commit_message_regex
commit_message_negative_regex
author_email_regex
file_name_regex
branch_name_regex
].freeze
def up
REGEX_COLUMNS.each do |column_name|
validate_check_constraint :push_rules, "#{column_name}_size_constraint"
end
end
def down
# No op
end
end

View File

@ -0,0 +1,17 @@
# frozen_string_literal: true
class RemovePushRulesRegexLimits < Gitlab::Database::Migration[2.1]
def up
change_column :push_rules, :force_push_regex, :string, limit: nil
change_column :push_rules, :delete_branch_regex, :string, limit: nil
change_column :push_rules, :commit_message_regex, :string, limit: nil
change_column :push_rules, :commit_message_negative_regex, :string, limit: nil
change_column :push_rules, :author_email_regex, :string, limit: nil
change_column :push_rules, :file_name_regex, :string, limit: nil
change_column :push_rules, :branch_name_regex, :string, limit: nil
end
def down
# No op
end
end

View File

@ -0,0 +1,11 @@
# frozen_string_literal: true
class UpdateDefaultValuePm < Gitlab::Database::Migration[2.1]
disable_ddl_transaction!
FULLY_ENABLED_SYNC = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].freeze
def change
change_column_default :application_settings, :package_metadata_purl_types, from: [], to: FULLY_ENABLED_SYNC
end
end

View File

@ -0,0 +1 @@
1583a9581ec2905781f4a5bb7715c7da784d6772eb6b6d8ecb05cad53f13b8c9

View File

@ -0,0 +1 @@
913b2384ea76d9169020253dacf14a51ccb7ebbaee9c9bc62b0e0473734ed981

View File

@ -0,0 +1 @@
3469c47c0cd4c86c7d1c9da450493a882d3a5f371fb7b78f49af64a837f989fb

View File

@ -0,0 +1 @@
5756f155e295263ea8376b9161c523f9ee39628be289d1939c220852abd4d098

View File

@ -0,0 +1 @@
02b0d2f9133db9378d2511144c4cff91a5d2ea9dce30eed371122dec342d547b

View File

@ -11913,7 +11913,7 @@ CREATE TABLE application_settings (
encrypted_product_analytics_configurator_connection_string bytea,
encrypted_product_analytics_configurator_connection_string_iv bytea,
silent_mode_enabled boolean DEFAULT false NOT NULL,
package_metadata_purl_types smallint[] DEFAULT '{}'::smallint[],
package_metadata_purl_types smallint[] DEFAULT '{1,2,3,4,5,6,7,8,9,10,11,12}'::smallint[],
ci_max_includes integer DEFAULT 150 NOT NULL,
remember_me_enabled boolean DEFAULT true NOT NULL,
encrypted_anthropic_api_key bytea,
@ -22188,7 +22188,14 @@ CREATE TABLE push_rules (
regexp_uses_re2 boolean DEFAULT true,
commit_message_negative_regex character varying,
reject_non_dco_commits boolean,
commit_committer_name_check boolean DEFAULT false NOT NULL
commit_committer_name_check boolean DEFAULT false NOT NULL,
CONSTRAINT author_email_regex_size_constraint CHECK ((char_length((author_email_regex)::text) <= 511)),
CONSTRAINT branch_name_regex_size_constraint CHECK ((char_length((branch_name_regex)::text) <= 511)),
CONSTRAINT commit_message_negative_regex_size_constraint CHECK ((char_length((commit_message_negative_regex)::text) <= 2047)),
CONSTRAINT commit_message_regex_size_constraint CHECK ((char_length((commit_message_regex)::text) <= 511)),
CONSTRAINT delete_branch_regex_size_constraint CHECK ((char_length((delete_branch_regex)::text) <= 511)),
CONSTRAINT file_name_regex_size_constraint CHECK ((char_length((file_name_regex)::text) <= 511)),
CONSTRAINT force_push_regex_size_constraint CHECK ((char_length((force_push_regex)::text) <= 511))
);
CREATE SEQUENCE push_rules_id_seq

View File

@ -481,6 +481,7 @@ listed in the descriptions of the relevant settings.
| `pypi_package_requests_forwarding` **(PREMIUM ALL)** | boolean | no | Use pypi.org as a default remote repository when the package is not found in the GitLab Package Registry for PyPI. |
| `outbound_local_requests_whitelist` | array of strings | no | Define a list of trusted domains or IP addresses to which local requests are allowed when local requests for webhooks and integrations are disabled.
| `package_registry_allow_anyone_to_pull_option` | boolean | no | Enable to [allow anyone to pull from Package Registry](../user/packages/package_registry/index.md#allow-anyone-to-pull-from-package-registry) visible and changeable.
| `package_metadata_purl_types` **(ULTIMATE SELF)** | array of integers | no | List of [package registry metadata to sync](../administration/settings/security_and_compliance.md#choose-package-registry-metadata-to-sync). See [the list](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/models/concerns/enums/package_metadata.rb#L5) of the available values.
| `pages_domain_verification_enabled` | boolean | no | Require users to prove ownership of custom domains. Domain verification is an essential security measure for public GitLab sites. Users are required to demonstrate they control a domain before it is enabled. |
| `password_authentication_enabled_for_git` | boolean | no | Enable authentication for Git over HTTP(S) via a GitLab account password. Default is `true`. |
| `password_authentication_enabled_for_web` | boolean | no | Enable authentication for the web interface via a GitLab account password. Default is `true`. |

View File

@ -0,0 +1,54 @@
---
stage: enablement
group: Tenant Scale
description: 'Cells: CI/CD Catalog'
---
<!-- vale gitlab.FutureTense = NO -->
This document is a work-in-progress and represents a very early state of the Cells design.
Significant aspects are not documented, though we expect to add them in the future.
This is one possible architecture for Cells, and we intend to contrast this with alternatives before deciding which approach to implement.
This documentation will be kept even if we decide not to implement this so that we can document the reasons for not choosing this approach.
# Cells: CI/CD Catalog
The [CI/CD pipeline components catalog](../../ci_pipeline_components/index.md) is a currently experimental feature that aims at helping users reuse pipeline configurations.
Potentially, there are several aspects of the CI/CD catalog that might be affected by Cells:
1. Namespace catalog, exists today as an experimental feature. With the introduction of Cells we would likely remove the namespace catalog and create a single Organization catalog, where all users would see all available published components in a single place (based on their permissions). This would replace today's offering, where users can have multiple catalogs which are bound to a namespace and completely isolated from each other.
1. The community catalog is supposed to allow users to search across different Organizations.
## 1. Definition
The [CI/CD pipeline components catalog](../../ci_pipeline_components/index.md) makes reusing pipeline configurations easier and more efficient.
It provides a way to discover and reuse pipeline constructs, allowing for a more streamlined experience.
There are several flavors of the CI/CD catalog:
1. [Namespace catalog (experimental)](../../../../ci/components/index.md): Bound to the top-level namespace (group or personal namespace). The namespace catalog aggregates all published components from Projects it contains. The number of top-level namespaces available in an Organization could potentially be the number of available catalogs.
1. Instance-wide component catalog (planned): Surfacing all the components that are scattered across an instance. All published components in a public or internal Project will be available in the instance-wide catalog. Only a single instance-wide catalog is planned per instance.
1. Community catalog (planned): Allow users to search all published components in different repositories across multiple namespaces. The original plan was to introduce a community catalog within self-managed customer that would act as an aggregator of all published components hosted in that instance.
## 2. Data flow
## 3. Proposal
Moving to Organizations is a great opportunity to improve the user experience and to reach parity for both self-managed and GitLab.com users.
- We introduce an Organization catalog which aggregates and surfaces all the published components that are hosted in a single Organization. The Organization catalog would make the namespace catalog obsolete.
- Once Organizations exist, GitLab.com users would need a community catalog to surface components across multiple Organizations. We need additional research to understand if such a solution is needed for self-managed customers as well.
## 4. Evaluation
Moving to a single Organization will improve the experience for users of the CI/CD component catalog.
Today we can have multiple catalogs based on the number of namespaces, making it difficult for users to surface information across an Organization.
### 4.1. Pros
- An Organization catalog will be one unified catalog serving as the single source of truth for an Organization.
- An Organization catalog would serve both self-managed and GitLab.com users, whereas the current plan was to introduce two types of catalogs: an instance-wide component catalog for self-managed and a community catalog for GitLab.com.
### 4.2. Cons
- A separate catalog that surfaces components across Organizations would need to be implemented to serve the wider community (community catalog). This catalog will be required for GitLab.com only, later on we can evaluate if a similar catalog is needed for self-managed customers.

View File

@ -338,6 +338,7 @@ Below is a list of known affected features with preliminary proposed solutions.
The following list of impacted features only represents placeholders that still require work to estimate the impact of Cells and develop solution proposals.
- [Cells: Agent for Kubernetes](impacted_features/agent-for-kubernetes.md)
- [Cells: CI/CD Catalog](impacted_features/ci-cd-catalog.md)
- [Cells: Data pipeline ingestion](impacted_features/data-pipeline-ingestion.md)
- [Cells: GitLab Pages](impacted_features/gitlab-pages.md)
- [Cells: Personal Access Tokens](impacted_features/personal-access-tokens.md)

View File

@ -8,32 +8,24 @@ description: Require approvals prior to deploying to a Protected Environment
# Deployment approvals **(PREMIUM ALL)**
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/343864) in GitLab 14.7 with a flag named `deployment_approvals`. Disabled by default.
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/347342) in GitLab 14.8.
> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/347342) in GitLab 14.8. Feature flag `deployment_approvals` removed.
It may be useful to require additional approvals before deploying to certain protected environments (for example, production). This pre-deployment approval requirement is useful to accommodate testing, security, or compliance processes that must happen before each deployment.
You can require additional approvals for deployments to protected
environments. Deployments are blocked until all required approvals are
given.
When a protected environment requires one or more approvals, all deployments to that environment become blocked and wait for the required approvals from the `Allowed to Deploy` list before running.
Use deployment approvals to accommodate testing,
security, or compliance processes. For example, you might want to
require approvals for deployments to production environments.
NOTE:
See the [epic](https://gitlab.com/groups/gitlab-org/-/epics/6832) for planned features.
## Configure deployment approvals
## Prerequisites
- Basic knowledge of [GitLab Environments and Deployments](index.md).
- Basic knowledge of [Protected Environments](protected_environments.md).
## Configure deployment approvals for a project
You can require approvals for deployments to protected environments in
a project.
To configure deployment approvals for a project:
1. [Create a deployment job](#create-a-deployment-job).
1. [Require approvals for a protected environment](#require-approvals-for-a-protected-environment).
### Create a deployment job
Create a deployment job in the `.gitlab-ci.yml` file of the desired project. The job does **not** need to be manual (`when: manual`).
Example:
1. Create a deployment job in the `.gitlab-ci.yml` file of your project:
```yaml
stages:
@ -47,22 +39,15 @@ Example:
name: ${CI_JOB_NAME}
```
### Require approvals for a protected environment
The job does not need to be manual (`when: manual`).
There are two ways to configure the approval requirements:
1. Add the required [approval rules](#multiple-approval-rules).
- [Unified approval setting](#unified-approval-setting-deprecated) ... You can define who can execute **and** approve deployments.
This is useful when there is no separation of duties between executors and approvers in your organization.
- [Multiple approval rules](#multiple-approval-rules) ... You can define who can execute **or** approve deployments.
This is useful when there is a separation of duties between executors and approvers in your organization.
NOTE:
Multiple approval rules is a more flexible option than the unified approval setting, thus both configurations shouldn't
co-exist and multiple approval rules takes the precedence over the unified approval setting if it happens.
The environments in your project require approval before deployment.
<!--- start_remove The following content will be removed on remove_date: '2024-05-22' -->
#### Unified approval setting (deprecated)
### Unified approval setting (deprecated)
> - UI configuration [removed](https://gitlab.com/gitlab-org/gitlab/-/issues/378447) in GitLab
> 15.11.
@ -94,7 +79,7 @@ Maintainer role.
<!--- end_remove -->
#### Multiple approval rules
### Multiple approval rules
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/345678) in GitLab 14.10 with a flag named `deployment_approval_rules`. Disabled by default.
> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/345678) in GitLab 15.0. [Feature flag `deployment_approval_rules`](https://gitlab.com/gitlab-org/gitlab/-/issues/345678) removed.
@ -128,7 +113,7 @@ NOTE:
To protect, update, or unprotect an environment, you must have at least the
Maintainer role.
#### Migrate to multiple approval rules
### Migrate to multiple approval rules
You can migrate a protected environment from unified approval rules to multiple
approval rules. Unified approval rules allow all entities that can deploy to an
@ -265,9 +250,9 @@ Use the [Deployments API](../../api/deployments.md#get-a-specific-deployment) to
- When the [multiple approval rules](#multiple-approval-rules) is configured:
- The `approval_summary` field contains the current approval status per rule.
## Related features
## Related topics
For details about other GitLab features aimed at protecting deployments, see [safe deployments](deployment_safety.md).
- [Deployment approvals feature epic](https://gitlab.com/groups/gitlab-org/-/epics/6832)
<!-- ## Troubleshooting

View File

@ -365,6 +365,10 @@ To delete a single or multiple group runners:
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/363012) in GitLab 15.1.
Prerequisite:
- You must have the Owner role for the group.
You can clean up group runners that have been inactive for more than three months.
Group runners are those that were created at the group level.

View File

@ -96,6 +96,20 @@ NOTE:
In [GitLab 14.9](https://gitlab.com/gitlab-org/gitlab/-/issues/351211) and later, projects in personal namespaces have a maximum role of Owner.
Because of a [known issue](https://gitlab.com/gitlab-org/gitlab/-/issues/219299) in GitLab 14.8 and earlier, projects in personal namespaces have a maximum role of Maintainer.
#### Guest role
A user with the Guest role in GitLab can view project plans, blockers and other
progress indicators. While unable to modify data they have not created, Guests
can contribute to a project by creating and linking project work items. Guests
can also view high-level project information such as:
- Analytics.
- Incident information.
- Issues and epics.
- Licenses.
For more information, see [project member permissions](../../user/permissions.md#project-members-permissions).
### Confidential issues
[Confidential issues](../../user/project/issues/confidential_issues.md) can be accessed

View File

@ -299,3 +299,23 @@ You might choose to do this if you are using an appliance like a Nexus Repositor
GitLab can't verify LFS objects. Pushes then fail if you have GitLab LFS support enabled.
To stop push failure, LFS support can be disabled in the [Project settings](../../../user/project/settings/index.md), which also disables GitLab LFS value-adds (Verifying LFS objects, UI integration for LFS).
### I/O timeout when pushing LFS objects
You might get an error that states:
```shell
LFS: Put "http://your-instance.com/root/project.git/gitlab-lfs/objects/cc29e205d04a4062d0fb131700e8bfc8e54c44d0176a8dca22f40b24ef26d325/15": read tcp your-instance-ip:54544->your-instance-ip:443: i/o timeout
error: failed to push some refs to 'ssh://your-instance.com:2222/root/project.git'
```
When network conditions are unstable, the Git LFS client might time out when trying to upload files
if network conditions are unstable.
The workaround is to set the client activity timeout a higher value.
For example, to set the timeout to 60 seconds:
```shell
git config lfs.activitytimeout 60
```

View File

@ -368,20 +368,21 @@ a merge request or an issue.
The following table lists all GitLab-specific email headers:
| Header | Description |
| ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `List-Id` | The path of the project in an RFC 2919 mailing list identifier. You can use it for email organization with filters. |
| `X-GitLab-(Resource)-ID` | The ID of the resource the notification is for. The resource, for example, can be `Issue`, `MergeRequest`, `Commit`, or another such resource. |
| `X-GitLab-ConfidentialIssue` | The boolean value indicating issue confidentiality for notifications. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/222908) in GitLab 16.0. |
| `X-GitLab-Discussion-ID` | The ID of the thread the comment belongs to, in notification emails for comments. |
| `X-GitLab-Group-Id` | The group's ID. Only present on notification emails for [epics](../group/epics/index.md). |
| `X-GitLab-Group-Path` | The group's path. Only present on notification emails for [epics](../group/epics/index.md) |
| `X-GitLab-NotificationReason` | The reason for the notification. [See possible values.](#x-gitlab-notificationreason). |
| `X-GitLab-Pipeline-Id` | The ID of the pipeline the notification is for, in notification emails for pipelines. |
| `X-GitLab-Project-Id` | The project's ID. |
| `X-GitLab-Project-Path` | The project's path. |
| `X-GitLab-Project` | The name of the project the notification belongs to. |
| `X-GitLab-Reply-Key` | A unique token to support reply by email. |
| Header | Description |
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `List-Id` | The path of the project in an RFC 2919 mailing list identifier. You can use it for email organization with filters. |
| `X-GitLab-(Resource)-ID` | The ID of the resource the notification is for. The resource, for example, can be `Issue`, `MergeRequest`, `Commit`, or another such resource. |
| `X-GitLab-(Resource)-State` | The state of the resource the notification is for. The resource can be, for example, `Issue` or `MergeRequest`. The value can be `opened`, `closed`, `merged`, or `locked`. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/130967) in GitLab 16.4. |
| `X-GitLab-ConfidentialIssue` | The boolean value indicating issue confidentiality for notifications. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/222908) in GitLab 16.0. |
| `X-GitLab-Discussion-ID` | The ID of the thread the comment belongs to, in notification emails for comments. |
| `X-GitLab-Group-Id` | The group's ID. Only present on notification emails for [epics](../group/epics/index.md). |
| `X-GitLab-Group-Path` | The group's path. Only present on notification emails for [epics](../group/epics/index.md) |
| `X-GitLab-NotificationReason` | The reason for the notification. [See possible values.](#x-gitlab-notificationreason). |
| `X-GitLab-Pipeline-Id` | The ID of the pipeline the notification is for, in notification emails for pipelines. |
| `X-GitLab-Project-Id` | The project's ID. |
| `X-GitLab-Project-Path` | The project's path. |
| `X-GitLab-Project` | The name of the project the notification belongs to. |
| `X-GitLab-Reply-Key` | A unique token to support reply by email. |
### X-GitLab-NotificationReason

View File

@ -20,7 +20,7 @@ Code Suggestions are available:
- On [self-managed](self_managed.md) and [SaaS](saas.md).
- In VS Code, Microsoft Visual Studio, JetBrains IDEs, and Neovim. You must have the corresponding GitLab extension installed.
- In the GitLab WebIDE (GitLab SaaS only).
- In the GitLab WebIDE.
<div class="video-fallback">
<a href="https://www.youtube.com/watch?v=WnxBYxN2-p4">View an end-to-end demo of Code Suggestions in VS Code</a>.
@ -65,32 +65,32 @@ Suggestion quality for other languages and using natural language code comments
Editor support for languages is documented in the following table.
| Language | VS Code | JetBrains IDEs | Visual Studio | Neovim |
|---------------------------------|--------------------------------------------------------------|------------------------------|---------------|--------|
| C++ | ✓ | | ✓ | |
| C# | ✓ | ✓ | ✓ | |
| Go | ✓ | ✓ (IDEA Ultimate / GoLand) | ✓ | |
| Google SQL | | | ✓ | |
| Java | ✓ | ✓ | ✓ | |
| JavaScript | ✓ | ✓ | ✓ | |
| Kotlin | ✓ | ✓ | ✓ | |
| PHP | ✓ | ✓ (IDEA Ultimate) | ✓ | |
| Python | ✓ | ✓ | ✓ | ✓ |
| Ruby | ✓ | ✓ (IDEA Ultimate / RubyMine) | ✓ | ✓ |
| Rust | ✓ | ✓ | ✓ | |
| Scala | ✓ | ✓ | ✓ | |
| Swift | ✓ | ✓ | ✓ | |
| TypeScript | ✓ | ✓ | ✓ | |
| Google Cloud CLI | | | | |
| Kubernetes Resource Model (KRM) | | | | |
| Terraform | ✓ (Requires 3rd party extension providing Terraform support) | | | |
| Language | VS Code | JetBrains IDEs | Visual Studio | Neovim |
|------------------|------------------------|------------------------|------------------------|--------|
| C++ | **{check-circle}** Yes | **{dotted-circle}** No | **{check-circle}** Yes | **{check-circle}** Yes |
| C# | **{check-circle}** Yes | **{check-circle}** Yes | **{check-circle}** Yes | **{check-circle}** Yes |
| Go | **{check-circle}** Yes | **{check-circle}** Yes (IDEA Ultimate / GoLand) | **{check-circle}** Yes | **{check-circle}** Yes |
| Google SQL | **{dotted-circle}** No | **{dotted-circle}** No | **{check-circle}** Yes | **{check-circle}** Yes |
| Java | **{check-circle}** Yes | **{check-circle}** Yes | **{check-circle}** Yes | **{check-circle}** Yes |
| JavaScript | **{check-circle}** Yes | **{check-circle}** Yes | **{check-circle}** Yes | **{check-circle}** Yes |
| Kotlin | **{check-circle}** Yes | **{check-circle}** Yes | **{check-circle}** Yes | **{check-circle}** Yes |
| PHP | **{check-circle}** Yes | **{check-circle}** Yes (IDEA Ultimate) | **{check-circle}** Yes | **{check-circle}** Yes |
| Python | **{check-circle}** Yes | **{check-circle}** Yes | **{check-circle}** Yes | **{check-circle}** Yes |
| Ruby | **{check-circle}** Yes | **{check-circle}** Yes (IDEA Ultimate / RubyMine) | **{check-circle}** Yes | **{check-circle}** Yes |
| Rust | **{check-circle}** Yes | **{check-circle}** Yes | **{check-circle}** Yes | **{check-circle}** Yes |
| Scala | **{check-circle}** Yes | **{check-circle}** Yes | **{check-circle}** Yes | **{check-circle}** Yes |
| Swift | **{check-circle}** Yes | **{check-circle}** Yes | **{check-circle}** Yes | **{check-circle}** Yes |
| TypeScript | **{check-circle}** Yes | **{check-circle}** Yes | **{check-circle}** Yes | **{check-circle}** Yes |
| Google Cloud | **{dotted-circle}** No | **{dotted-circle}** No | **{dotted-circle}** No | **{dotted-circle}** No |
| Kubernetes Resource Model (KRM) | **{dotted-circle}** No | **{dotted-circle}** No | **{dotted-circle}** No | **{dotted-circle}** No |
| Terraform | **{check-circle}** Yes (Requires third-party extension providing Terraform support) | **{dotted-circle}** No | **{dotted-circle}** No | **{check-circle}** Yes (Requires third-party extension providing the `terraform` file type) |
## Supported editor extensions
Code Suggestions supports a variety of popular editors including:
- VS Code, using [the VS Code GitLab Workflow extension](https://marketplace.visualstudio.com/items?itemName=GitLab.gitlab-workflow).
- [GitLab WebIDE (VS Code in the Cloud)](../../../project/web_ide/index.md), with no additional configuration (GitLab SaaS only).
- [GitLab WebIDE (VS Code in the Cloud)](../../../project/web_ide/index.md), with no additional configuration.
- Microsoft Visual Studio, using the [Visual Studio GitLab extension](https://marketplace.visualstudio.com/items?itemName=GitLab.GitLabExtensionForVisualStudio).
- JetBrains IDEs, using the [GitLab plugin](https://plugins.jetbrains.com/plugin/22325-gitlab).
- Neovim, using the [`gitlab.vim` plugin](https://gitlab.com/gitlab-org/editor-extensions/gitlab.vim).

View File

@ -3,7 +3,7 @@
module Constraints
class ActivityPubConstrainer
def matches?(request)
mime_types.any? { |m| request.headers['Accept'].include?(m) }
mime_types.any? { |m| request.headers.fetch('Accept', '').include?(m) }
end
private

View File

@ -137,16 +137,11 @@ module Gitlab
variables.append(key: 'CI_NODE_INDEX', value: job.options[:instance].to_s) if job.options&.include?(:instance)
variables.append(key: 'CI_NODE_TOTAL', value: ci_node_total_value(job).to_s)
if ::Feature.enabled?(:support_ci_environment_variables_in_job_rules, project)
if environment.present?
variables.append(key: 'CI_ENVIRONMENT_NAME', value: environment)
variables.append(key: 'CI_ENVIRONMENT_ACTION', value: job.environment_action)
variables.append(key: 'CI_ENVIRONMENT_TIER', value: job.environment_tier)
variables.append(key: 'CI_ENVIRONMENT_URL', value: job.environment_url) if job.environment_url
end
else
# Set environment name here so we can access it when evaluating the job's rules
variables.append(key: 'CI_ENVIRONMENT_NAME', value: job.environment) if job.environment # rubocop:disable Style/IfInsideElse
if environment.present?
variables.append(key: 'CI_ENVIRONMENT_NAME', value: environment)
variables.append(key: 'CI_ENVIRONMENT_ACTION', value: job.environment_action)
variables.append(key: 'CI_ENVIRONMENT_TIER', value: job.environment_tier)
variables.append(key: 'CI_ENVIRONMENT_URL', value: job.environment_url) if job.environment_url
end
end
end

View File

@ -30916,6 +30916,9 @@ msgstr ""
msgid "Navigation|Build"
msgstr ""
msgid "Navigation|CI/CD settings"
msgstr ""
msgid "Navigation|Code"
msgstr ""
@ -30952,9 +30955,15 @@ msgstr ""
msgid "Navigation|Manage"
msgstr ""
msgid "Navigation|Merge requests settings"
msgstr ""
msgid "Navigation|Monitor"
msgstr ""
msgid "Navigation|Monitor settings"
msgstr ""
msgid "Navigation|No group matches found"
msgstr ""
@ -30979,6 +30988,9 @@ msgstr ""
msgid "Navigation|Projects you visit often will appear here."
msgstr ""
msgid "Navigation|Repository settings"
msgstr ""
msgid "Navigation|Retrieving search results"
msgstr ""

View File

@ -2,6 +2,7 @@ import { shallowMount } from '@vue/test-utils';
import Vue from 'vue';
// eslint-disable-next-line no-restricted-imports
import Vuex from 'vuex';
import { SEARCH_TYPE_ZOEKT, SEARCH_TYPE_ADVANCED } from '~/search/sidebar/constants';
import { MOCK_QUERY } from 'jest/search/mock_data';
import GlobalSearchSidebar from '~/search/sidebar/components/app.vue';
import IssuesFilters from '~/search/sidebar/components/issues_filters.vue';
@ -60,7 +61,7 @@ describe('GlobalSearchSidebar', () => {
`('with sidebar $scope scope:', ({ scope, filter }) => {
beforeEach(() => {
getterSpies.currentScope = jest.fn(() => scope);
createComponent({ urlQuery: { scope } });
createComponent({ urlQuery: { scope }, searchType: SEARCH_TYPE_ADVANCED });
});
it(`shows filter ${filter.name.replace('find', '')}`, () => {
@ -68,13 +69,23 @@ describe('GlobalSearchSidebar', () => {
});
});
describe('with sidebar $scope scope:', () => {
describe('filters for blobs will not load if zoekt is enabled', () => {
beforeEach(() => {
createComponent({ urlQuery: { scope: 'blobs' }, searchType: SEARCH_TYPE_ZOEKT });
});
it("doesn't render blobs filters", () => {
expect(findBlobsFilters().exists()).toBe(false);
});
});
describe('with sidebar scope: projects', () => {
beforeEach(() => {
getterSpies.currentScope = jest.fn(() => 'projects');
createComponent({ urlQuery: { scope: 'projects' } });
});
it(`shows filter ProjectsFilters}`, () => {
it(`shows filter ProjectsFilters`, () => {
expect(findProjectsFilters().exists()).toBe(true);
});
});

View File

@ -87,4 +87,33 @@ describe('PinnedSection component', () => {
});
});
});
describe('ambiguous settings names', () => {
it('get renamed to be unambiguous', () => {
createWrapper({
items: [
{ title: 'CI/CD', id: 'ci_cd' },
{ title: 'Merge requests', id: 'merge_request_settings' },
{ title: 'Monitor', id: 'monitor' },
{ title: 'Repository', id: 'repository' },
{ title: 'Repository', id: 'code' },
{ title: 'Something else', id: 'not_a_setting' },
],
});
expect(
wrapper
.findComponent(MenuSection)
.props('item')
.items.map((i) => i.title),
).toEqual([
'CI/CD settings',
'Merge requests settings',
'Monitor settings',
'Repository settings',
'Repository',
'Something else',
]);
});
});
});

View File

@ -0,0 +1,31 @@
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Constraints::ActivityPubConstrainer, feature_category: :groups_and_projects do
subject(:constraint) { described_class.new }
describe '#matches?' do
subject { constraint.matches?(request) }
let(:request) { ActionDispatch::Request.new(headers) }
['application/ld+json; profile="https://www.w3.org/ns/activitystreams"', 'application/activity+json'].each do |mime|
context "when mime is #{mime}" do
let(:headers) { { 'HTTP_ACCEPT' => mime } }
it 'matches the header' do
is_expected.to be_truthy
end
end
end
context 'when Accept header is missing' do
let(:headers) { {} }
it 'does not match' do
is_expected.to be_falsey
end
end
end
end

View File

@ -171,20 +171,6 @@ RSpec.describe Gitlab::Ci::Variables::Builder, :clean_gitlab_redis_cache, featur
it { expect(subject.to_runner_variables).to eq(predefined_variables) }
context 'when support_ci_environment_variables_in_job_rules feature flag is disabled' do
before do
stub_feature_flags(support_ci_environment_variables_in_job_rules: false)
# This is a bug. `CI_ENVIRONMENT_NAME` should be expanded.
predefined_variables.find { |var| var[:key] == 'CI_ENVIRONMENT_NAME' }[:value] = 'review/$CI_COMMIT_REF_NAME'
predefined_variables.delete_if do |var|
%w[CI_ENVIRONMENT_ACTION CI_ENVIRONMENT_TIER CI_ENVIRONMENT_URL].include?(var[:key])
end
end
it { expect(subject.to_runner_variables).to eq(predefined_variables) }
end
context 'variables ordering' do
def var(name, value)
{ key: name, value: value.to_s, public: true, masked: false }

Some files were not shown because too many files have changed in this diff Show More