diff options
104 files changed, 588 insertions, 303 deletions
diff --git a/.rubocop_todo/layout/line_length.yml b/.rubocop_todo/layout/line_length.yml index 77648d3ff90..fb62bc15d7b 100644 --- a/.rubocop_todo/layout/line_length.yml +++ b/.rubocop_todo/layout/line_length.yml @@ -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' diff --git a/.rubocop_todo/rspec/context_wording.yml b/.rubocop_todo/rspec/context_wording.yml index f945c911d4a..b1b6c13c9f7 100644 --- a/.rubocop_todo/rspec/context_wording.yml +++ b/.rubocop_todo/rspec/context_wording.yml @@ -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' diff --git a/.rubocop_todo/style/class_and_module_children.yml b/.rubocop_todo/style/class_and_module_children.yml index 1f36e2fbd11..80e5b613fac 100644 --- a/.rubocop_todo/style/class_and_module_children.yml +++ b/.rubocop_todo/style/class_and_module_children.yml @@ -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' diff --git a/.rubocop_todo/style/format_string.yml b/.rubocop_todo/style/format_string.yml index c128f96eafe..c5cfe255b96 100644 --- a/.rubocop_todo/style/format_string.yml +++ b/.rubocop_todo/style/format_string.yml @@ -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' diff --git a/.rubocop_todo/style/if_unless_modifier.yml b/.rubocop_todo/style/if_unless_modifier.yml index 872282a6a93..ef4fca8270d 100644 --- a/.rubocop_todo/style/if_unless_modifier.yml +++ b/.rubocop_todo/style/if_unless_modifier.yml @@ -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' diff --git a/.rubocop_todo/style/percent_literal_delimiters.yml b/.rubocop_todo/style/percent_literal_delimiters.yml index 9218d445cd9..4d7023d8a94 100644 --- a/.rubocop_todo/style/percent_literal_delimiters.yml +++ b/.rubocop_todo/style/percent_literal_delimiters.yml @@ -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' diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index 5780c96e363..b3754d9b475 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -f6193a424bcc235e906bc1ae82737b4ed58ec8fd +638126d9b6839f340c151f55d66ec5742223c901 @@ -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' diff --git a/Gemfile.checksum b/Gemfile.checksum index dc1ec99036a..920b5cb24b6 100644 --- a/Gemfile.checksum +++ b/Gemfile.checksum @@ -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"}, diff --git a/Gemfile.lock b/Gemfile.lock index e25460969a1..c3115e0b0cc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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 diff --git a/app/assets/javascripts/issues/list/components/issues_list_app.vue b/app/assets/javascripts/issues/list/components/issues_list_app.vue index b6f7f4a41c6..8a8895e55a9 100644 --- a/app/assets/javascripts/issues/list/components/issues_list_app.vue +++ b/app/assets/javascripts/issues/list/components/issues_list_app.vue @@ -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" diff --git a/app/assets/javascripts/search/index.js b/app/assets/javascripts/search/index.js index f5684cebbf9..f83130213f2 100644 --- a/app/assets/javascripts/search/index.js +++ b/app/assets/javascripts/search/index.js @@ -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); diff --git a/app/assets/javascripts/search/sidebar/components/app.vue b/app/assets/javascripts/search/sidebar/components/app.vue index e556c813d8e..eb7971a9d5a 100644 --- a/app/assets/javascripts/search/sidebar/components/app.vue +++ b/app/assets/javascripts/search/sidebar/components/app.vue @@ -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 diff --git a/app/assets/javascripts/search/sidebar/constants/index.js b/app/assets/javascripts/search/sidebar/constants/index.js index 01d0aad206c..e5b803b92cb 100644 --- a/app/assets/javascripts/search/sidebar/constants/index.js +++ b/app/assets/javascripts/search/sidebar/constants/index.js @@ -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'; diff --git a/app/assets/javascripts/search/sidebar/index.js b/app/assets/javascripts/search/sidebar/index.js index 415f6f7454c..3a699355dc9 100644 --- a/app/assets/javascripts/search/sidebar/index.js +++ b/app/assets/javascripts/search/sidebar/index.js @@ -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) => { diff --git a/app/assets/javascripts/search/store/state.js b/app/assets/javascripts/search/store/state.js index 5407b08fa83..b4cd2af65ba 100644 --- a/app/assets/javascripts/search/store/state.js +++ b/app/assets/javascripts/search/store/state.js @@ -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; diff --git a/app/assets/javascripts/super_sidebar/components/pinned_section.vue b/app/assets/javascripts/super_sidebar/components/pinned_section.vue index 1085f11fbe8..32ace1c55f5 100644 --- a/app/assets/javascripts/super_sidebar/components/pinned_section.vue +++ b/app/assets/javascripts/super_sidebar/components/pinned_section.vue @@ -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> diff --git a/app/assets/javascripts/vue_shared/issuable/list/components/issuable_item.vue b/app/assets/javascripts/vue_shared/issuable/list/components/issuable_item.vue index 7fb80af4b4e..ec3078cd5a9 100644 --- a/app/assets/javascripts/vue_shared/issuable/list/components/issuable_item.vue +++ b/app/assets/javascripts/vue_shared/issuable/list/components/issuable_item.vue @@ -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}`; diff --git a/app/assets/javascripts/work_items/constants.js b/app/assets/javascripts/work_items/constants.js index c68f59abe00..2834799e4e8 100644 --- a/app/assets/javascripts/work_items/constants.js +++ b/app/assets/javascripts/work_items/constants.js @@ -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'; diff --git a/app/assets/javascripts/work_items/graphql/group_work_item_types.query.graphql b/app/assets/javascripts/work_items/graphql/group_work_item_types.query.graphql new file mode 100644 index 00000000000..30757f57234 --- /dev/null +++ b/app/assets/javascripts/work_items/graphql/group_work_item_types.query.graphql @@ -0,0 +1,11 @@ +query groupWorkItemTypes($fullPath: ID!) { + workspace: group(fullPath: $fullPath) { + id + workItemTypes { + nodes { + id + name + } + } + } +} diff --git a/app/assets/javascripts/work_items/list/components/work_items_list_app.vue b/app/assets/javascripts/work_items/list/components/work_items_list_app.vue index 0b8dbf86573..a853018a931 100644 --- a/app/assets/javascripts/work_items/list/components/work_items_list_app.vue +++ b/app/assets/javascripts/work_items/list/components/work_items_list_app.vue @@ -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> diff --git a/app/assets/javascripts/work_items/list/index.js b/app/assets/javascripts/work_items/list/index.js index 113a3918e51..885cea2c1d6 100644 --- a/app/assets/javascripts/work_items/list/index.js +++ b/app/assets/javascripts/work_items/list/index.js @@ -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), }, diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb index 4180e76e1a0..77d32a55941 100644 --- a/app/mailers/notify.rb +++ b/app/mailers/notify.rb @@ -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 diff --git a/app/models/bulk_imports/file_transfer/group_config.rb b/app/models/bulk_imports/file_transfer/group_config.rb index 6766c00246b..67d53056444 100644 --- a/app/models/bulk_imports/file_transfer/group_config.rb +++ b/app/models/bulk_imports/file_transfer/group_config.rb @@ -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 diff --git a/app/models/bulk_imports/file_transfer/project_config.rb b/app/models/bulk_imports/file_transfer/project_config.rb index 8d4c68f7b5a..890a0fb6ee4 100644 --- a/app/models/bulk_imports/file_transfer/project_config.rb +++ b/app/models/bulk_imports/file_transfer/project_config.rb @@ -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' diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb index 2b954e399ae..394ba3c51bf 100644 --- a/app/models/ci/build.rb +++ b/app/models/ci/build.rb @@ -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 diff --git a/app/models/ci/build_runner_session.rb b/app/models/ci/build_runner_session.rb index eaa2e1c428e..e197217bb70 100644 --- a/app/models/ci/build_runner_session.rb +++ b/app/models/ci/build_runner_session.rb @@ -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)) diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index 3a5db04a687..5bf4e846304 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -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? diff --git a/app/models/clusters/platforms/kubernetes.rb b/app/models/clusters/platforms/kubernetes.rb index 123ad0ebfaf..5efbec45561 100644 --- a/app/models/clusters/platforms/kubernetes.rb +++ b/app/models/clusters/platforms/kubernetes.rb @@ -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 = [ diff --git a/app/models/commit.rb b/app/models/commit.rb index 879745483c1..df4b9e0ff70 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -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) diff --git a/app/models/concerns/clusters/agents/authorizations/ci_access/config_scopes.rb b/app/models/concerns/clusters/agents/authorizations/ci_access/config_scopes.rb index eef68bfd349..9528a708ee1 100644 --- a/app/models/concerns/clusters/agents/authorizations/ci_access/config_scopes.rb +++ b/app/models/concerns/clusters/agents/authorizations/ci_access/config_scopes.rb @@ -17,7 +17,7 @@ module Clusters class_methods do def available_ci_access_fields(_project) - %w(agent) + %w[agent] end end end diff --git a/app/models/concerns/diff_positionable_note.rb b/app/models/concerns/diff_positionable_note.rb index b10b318fb7c..2f64129b65f 100644 --- a/app/models/concerns/diff_positionable_note.rb +++ b/app/models/concerns/diff_positionable_note.rb @@ -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 diff --git a/app/models/concerns/enums/prometheus_metric.rb b/app/models/concerns/enums/prometheus_metric.rb index e65a01990a3..2cc765b7a3c 100644 --- a/app/models/concerns/enums/prometheus_metric.rb +++ b/app/models/concerns/enums/prometheus_metric.rb @@ -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 diff --git a/app/models/concerns/issuable.rb b/app/models/concerns/issuable.rb index fbd1f1115ca..32e6b20f512 100644 --- a/app/models/concerns/issuable.rb +++ b/app/models/concerns/issuable.rb @@ -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 diff --git a/app/models/concerns/issue_available_features.rb b/app/models/concerns/issue_available_features.rb index 3f65e701da7..425754e0853 100644 --- a/app/models/concerns/issue_available_features.rb +++ b/app/models/concerns/issue_available_features.rb @@ -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 diff --git a/app/models/concerns/mentionable/reference_regexes.rb b/app/models/concerns/mentionable/reference_regexes.rb index 0b6075fbeb8..b5634ba3b6d 100644 --- a/app/models/concerns/mentionable/reference_regexes.rb +++ b/app/models/concerns/mentionable/reference_regexes.rb @@ -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 diff --git a/app/models/concerns/noteable.rb b/app/models/concerns/noteable.rb index d3f76585182..06cee46645b 100644 --- a/app/models/concerns/noteable.rb +++ b/app/models/concerns/noteable.rb @@ -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 diff --git a/app/models/concerns/resolvable_note.rb b/app/models/concerns/resolvable_note.rb index 7f9a7faa3f5..23abc5d5c22 100644 --- a/app/models/concerns/resolvable_note.rb +++ b/app/models/concerns/resolvable_note.rb @@ -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" diff --git a/app/models/concerns/with_uploads.rb b/app/models/concerns/with_uploads.rb index caaf2b33ef0..319509ea69a 100644 --- a/app/models/concerns/with_uploads.rb +++ b/app/models/concerns/with_uploads.rb @@ -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 diff --git a/app/models/container_registry/event.rb b/app/models/container_registry/event.rb index 8ca3c15cc89..9f7724c052c 100644 --- a/app/models/container_registry/event.rb +++ b/app/models/container_registry/event.rb @@ -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 diff --git a/app/models/deploy_token.rb b/app/models/deploy_token.rb index 498ca9c4f30..920321a1699 100644 --- a/app/models/deploy_token.rb +++ b/app/models/deploy_token.rb @@ -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 diff --git a/app/models/description_version.rb b/app/models/description_version.rb index fb61b7f5fde..05cca9f931f 100644 --- a/app/models/description_version.rb +++ b/app/models/description_version.rb @@ -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 diff --git a/app/models/design_management.rb b/app/models/design_management.rb index 81e170f7e59..20ada71755b 100644 --- a/app/models/design_management.rb +++ b/app/models/design_management.rb @@ -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' diff --git a/app/models/diff_note.rb b/app/models/diff_note.rb index 02979d5f804..d680d0e334f 100644 --- a/app/models/diff_note.rb +++ b/app/models/diff_note.rb @@ -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 diff --git a/app/models/discussion_note.rb b/app/models/discussion_note.rb index 6621b30b645..a1dfa0e72ec 100644 --- a/app/models/discussion_note.rb +++ b/app/models/discussion_note.rb @@ -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 } diff --git a/app/models/draft_note.rb b/app/models/draft_note.rb index ffc04f9bf90..f95eec742d8 100644 --- a/app/models/draft_note.rb +++ b/app/models/draft_note.rb @@ -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 diff --git a/app/models/environment.rb b/app/models/environment.rb index dcac75ee120..29394c37e2c 100644 --- a/app/models/environment.rb +++ b/app/models/environment.rb @@ -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 diff --git a/app/models/event.rb b/app/models/event.rb index 4547d7b9e60..9e26efe11de 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -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 diff --git a/app/models/instance_configuration.rb b/app/models/instance_configuration.rb index 57638356362..7b2036a9def 100644 --- a/app/models/instance_configuration.rb +++ b/app/models/instance_configuration.rb @@ -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 diff --git a/app/models/integrations/asana.rb b/app/models/integrations/asana.rb index 3c3c12463ec..859522670ef 100644 --- a/app/models/integrations/asana.rb +++ b/app/models/integrations/asana.rb @@ -37,7 +37,7 @@ module Integrations end def self.supported_events - %w(push) + %w[push] end def client diff --git a/app/models/integrations/assembla.rb b/app/models/integrations/assembla.rb index 6831fac32e6..1d3616b4c3b 100644 --- a/app/models/integrations/assembla.rb +++ b/app/models/integrations/assembla.rb @@ -28,7 +28,7 @@ module Integrations end def self.supported_events - %w(push) + %w[push] end def execute(data) diff --git a/app/models/integrations/base_issue_tracker.rb b/app/models/integrations/base_issue_tracker.rb index 7a54d354007..b59aee6743d 100644 --- a/app/models/integrations/base_issue_tracker.rb +++ b/app/models/integrations/base_issue_tracker.rb @@ -88,7 +88,7 @@ module Integrations end def self.supported_events - %w(push) + %w[push] end def execute(data) diff --git a/app/models/integrations/base_monitoring.rb b/app/models/integrations/base_monitoring.rb index b0bebb5a859..12ea57f59a3 100644 --- a/app/models/integrations/base_monitoring.rb +++ b/app/models/integrations/base_monitoring.rb @@ -9,7 +9,7 @@ module Integrations attribute :category, default: 'monitoring' def self.supported_events - %w() + %w[] end def can_query? diff --git a/app/models/integrations/base_slash_commands.rb b/app/models/integrations/base_slash_commands.rb index 7662da933ba..58821e5fb4e 100644 --- a/app/models/integrations/base_slash_commands.rb +++ b/app/models/integrations/base_slash_commands.rb @@ -13,7 +13,7 @@ module Integrations end def self.supported_events - %w() + %w[] end def testable? diff --git a/app/models/integrations/base_third_party_wiki.rb b/app/models/integrations/base_third_party_wiki.rb index 8df172e9a53..dee3706c518 100644 --- a/app/models/integrations/base_third_party_wiki.rb +++ b/app/models/integrations/base_third_party_wiki.rb @@ -9,7 +9,7 @@ module Integrations after_commit :cache_project_has_integration def self.supported_events - %w() + %w[] end private diff --git a/app/models/integrations/buildkite.rb b/app/models/integrations/buildkite.rb index 6cd36e545a5..82a5142e8c2 100644 --- a/app/models/integrations/buildkite.rb +++ b/app/models/integrations/buildkite.rb @@ -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 diff --git a/app/models/integrations/campfire.rb b/app/models/integrations/campfire.rb index 007578e5830..e21f7d94b5e 100644 --- a/app/models/integrations/campfire.rb +++ b/app/models/integrations/campfire.rb @@ -62,7 +62,7 @@ module Integrations end def self.supported_events - %w(push) + %w[push] end def execute(data) diff --git a/app/models/integrations/datadog.rb b/app/models/integrations/datadog.rb index 1a56763fe57..c4986f76df9 100644 --- a/app/models/integrations/datadog.rb +++ b/app/models/integrations/datadog.rb @@ -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, diff --git a/app/models/integrations/drone_ci.rb b/app/models/integrations/drone_ci.rb index ac464c020dd..f6a12c4bb1a 100644 --- a/app/models/integrations/drone_ci.rb +++ b/app/models/integrations/drone_ci.rb @@ -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) diff --git a/app/models/integrations/emails_on_push.rb b/app/models/integrations/emails_on_push.rb index eb893ae45d0..144d1a07b04 100644 --- a/app/models/integrations/emails_on_push.rb +++ b/app/models/integrations/emails_on_push.rb @@ -52,7 +52,7 @@ module Integrations end def self.supported_events - %w(push tag_push) + %w[push tag_push] end def initialize_properties diff --git a/app/models/integrations/external_wiki.rb b/app/models/integrations/external_wiki.rb index 75fe6b6f164..acacab2528e 100644 --- a/app/models/integrations/external_wiki.rb +++ b/app/models/integrations/external_wiki.rb @@ -47,7 +47,7 @@ module Integrations end def self.supported_events - %w() + %w[] end end end diff --git a/app/models/integrations/jenkins.rb b/app/models/integrations/jenkins.rb index 7769ea7d2dd..0683c8408bc 100644 --- a/app/models/integrations/jenkins.rb +++ b/app/models/integrations/jenkins.rb @@ -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 diff --git a/app/models/integrations/jira.rb b/app/models/integrations/jira.rb index faf0a378a17..d8d1f860e9a 100644 --- a/app/models/integrations/jira.rb +++ b/app/models/integrations/jira.rb @@ -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 diff --git a/app/models/integrations/packagist.rb b/app/models/integrations/packagist.rb index c9c08ec9771..c0acb6c87b4 100644 --- a/app/models/integrations/packagist.rb +++ b/app/models/integrations/packagist.rb @@ -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) diff --git a/app/models/integrations/pivotaltracker.rb b/app/models/integrations/pivotaltracker.rb index 0d9a3f05a86..f42a872c49e 100644 --- a/app/models/integrations/pivotaltracker.rb +++ b/app/models/integrations/pivotaltracker.rb @@ -38,7 +38,7 @@ module Integrations end def self.supported_events - %w(push) + %w[push] end def execute(data) diff --git a/app/models/integrations/pushover.rb b/app/models/integrations/pushover.rb index 006b731c6c2..e97c7e5e738 100644 --- a/app/models/integrations/pushover.rb +++ b/app/models/integrations/pushover.rb @@ -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) diff --git a/app/models/integrations/teamcity.rb b/app/models/integrations/teamcity.rb index c74e0aab030..e3f30e3ed1c 100644 --- a/app/models/integrations/teamcity.rb +++ b/app/models/integrations/teamcity.rb @@ -43,7 +43,7 @@ module Integrations end def supported_events - %w(push merge_request) + %w[push merge_request] end end diff --git a/app/models/integrations/zentao.rb b/app/models/integrations/zentao.rb index b922658af58..58ec4abf30c 100644 --- a/app/models/integrations/zentao.rb +++ b/app/models/integrations/zentao.rb @@ -86,7 +86,7 @@ module Integrations end def self.supported_events - %w() + %w[] end private diff --git a/app/models/issuable_severity.rb b/app/models/issuable_severity.rb index cd7e5fafb60..08984bbb723 100644 --- a/app/models/issuable_severity.rb +++ b/app/models/issuable_severity.rb @@ -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 diff --git a/app/models/issue.rb b/app/models/issue.rb index 4738207fe0a..41ccc15852d 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -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! diff --git a/app/views/search/show.html.haml b/app/views/search/show.html.haml index 16ca829a6d4..e1fa0760d53 100644 --- a/app/views/search/show.html.haml +++ b/app/views/search/show.html.haml @@ -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' diff --git a/config/application.rb b/config/application.rb index 6f7d2892d1d..e795e54567d 100644 --- a/config/application.rb +++ b/config/application.rb @@ -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 diff --git a/config/feature_flags/development/support_ci_environment_variables_in_job_rules.yml b/config/feature_flags/development/support_ci_environment_variables_in_job_rules.yml deleted file mode 100644 index cb858abeea0..00000000000 --- a/config/feature_flags/development/support_ci_environment_variables_in_job_rules.yml +++ /dev/null @@ -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 diff --git a/db/migrate/20230823160533_update_package_metadata_sync_setting.rb b/db/migrate/20230823160533_update_package_metadata_sync_setting.rb new file mode 100644 index 00000000000..23d0de6e38b --- /dev/null +++ b/db/migrate/20230823160533_update_package_metadata_sync_setting.rb @@ -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 diff --git a/db/migrate/20230828153646_extend_push_rules_regex_limits.rb b/db/migrate/20230828153646_extend_push_rules_regex_limits.rb new file mode 100644 index 00000000000..ba5e8e54f9f --- /dev/null +++ b/db/migrate/20230828153646_extend_push_rules_regex_limits.rb @@ -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 diff --git a/db/migrate/20230830084959_validate_push_rules_constraints.rb b/db/migrate/20230830084959_validate_push_rules_constraints.rb new file mode 100644 index 00000000000..99b5d680642 --- /dev/null +++ b/db/migrate/20230830084959_validate_push_rules_constraints.rb @@ -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 diff --git a/db/migrate/20230830085501_remove_push_rules_regex_limits.rb b/db/migrate/20230830085501_remove_push_rules_regex_limits.rb new file mode 100644 index 00000000000..31d85e3ec11 --- /dev/null +++ b/db/migrate/20230830085501_remove_push_rules_regex_limits.rb @@ -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 diff --git a/db/migrate/20230830101525_update_default_value_pm.rb b/db/migrate/20230830101525_update_default_value_pm.rb new file mode 100644 index 00000000000..71de72c7e97 --- /dev/null +++ b/db/migrate/20230830101525_update_default_value_pm.rb @@ -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 diff --git a/db/schema_migrations/20230823160533 b/db/schema_migrations/20230823160533 new file mode 100644 index 00000000000..de83556d427 --- /dev/null +++ b/db/schema_migrations/20230823160533 @@ -0,0 +1 @@ +1583a9581ec2905781f4a5bb7715c7da784d6772eb6b6d8ecb05cad53f13b8c9
\ No newline at end of file diff --git a/db/schema_migrations/20230828153646 b/db/schema_migrations/20230828153646 new file mode 100644 index 00000000000..737645fba5d --- /dev/null +++ b/db/schema_migrations/20230828153646 @@ -0,0 +1 @@ +913b2384ea76d9169020253dacf14a51ccb7ebbaee9c9bc62b0e0473734ed981
\ No newline at end of file diff --git a/db/schema_migrations/20230830084959 b/db/schema_migrations/20230830084959 new file mode 100644 index 00000000000..12a8dea429c --- /dev/null +++ b/db/schema_migrations/20230830084959 @@ -0,0 +1 @@ +3469c47c0cd4c86c7d1c9da450493a882d3a5f371fb7b78f49af64a837f989fb
\ No newline at end of file diff --git a/db/schema_migrations/20230830085501 b/db/schema_migrations/20230830085501 new file mode 100644 index 00000000000..92c45a647fc --- /dev/null +++ b/db/schema_migrations/20230830085501 @@ -0,0 +1 @@ +5756f155e295263ea8376b9161c523f9ee39628be289d1939c220852abd4d098
\ No newline at end of file diff --git a/db/schema_migrations/20230830101525 b/db/schema_migrations/20230830101525 new file mode 100644 index 00000000000..7dd7920d7b8 --- /dev/null +++ b/db/schema_migrations/20230830101525 @@ -0,0 +1 @@ +02b0d2f9133db9378d2511144c4cff91a5d2ea9dce30eed371122dec342d547b
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 0ab32dec106..f3340e05eb3 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -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 diff --git a/doc/api/settings.md b/doc/api/settings.md index 284539ab022..f6db12e45a7 100644 --- a/doc/api/settings.md +++ b/doc/api/settings.md @@ -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`. | diff --git a/doc/architecture/blueprints/cells/impacted_features/ci-cd-catalog.md b/doc/architecture/blueprints/cells/impacted_features/ci-cd-catalog.md new file mode 100644 index 00000000000..f39de0a4072 --- /dev/null +++ b/doc/architecture/blueprints/cells/impacted_features/ci-cd-catalog.md @@ -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. diff --git a/doc/architecture/blueprints/cells/index.md b/doc/architecture/blueprints/cells/index.md index c5931bcd67e..2571de191e4 100644 --- a/doc/architecture/blueprints/cells/index.md +++ b/doc/architecture/blueprints/cells/index.md @@ -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) diff --git a/doc/ci/environments/deployment_approvals.md b/doc/ci/environments/deployment_approvals.md index f9d486d7288..754dcafb9f7 100644 --- a/doc/ci/environments/deployment_approvals.md +++ b/doc/ci/environments/deployment_approvals.md @@ -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. - -## Prerequisites - -- Basic knowledge of [GitLab Environments and Deployments](index.md). -- Basic knowledge of [Protected Environments](protected_environments.md). +## Configure deployment approvals -## 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 diff --git a/doc/ci/runners/runners_scope.md b/doc/ci/runners/runners_scope.md index bc727e2222d..814b8a1c0d2 100644 --- a/doc/ci/runners/runners_scope.md +++ b/doc/ci/runners/runners_scope.md @@ -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. diff --git a/doc/development/permissions/predefined_roles.md b/doc/development/permissions/predefined_roles.md index 62d6c1d92e2..50e8fbfd5b3 100644 --- a/doc/development/permissions/predefined_roles.md +++ b/doc/development/permissions/predefined_roles.md @@ -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 diff --git a/doc/topics/git/lfs/index.md b/doc/topics/git/lfs/index.md index 1839cbe0450..23d972e9aa7 100644 --- a/doc/topics/git/lfs/index.md +++ b/doc/topics/git/lfs/index.md @@ -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 +``` diff --git a/doc/user/profile/notifications.md b/doc/user/profile/notifications.md index ba8c83e3106..706065d4693 100644 --- a/doc/user/profile/notifications.md +++ b/doc/user/profile/notifications.md @@ -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 diff --git a/doc/user/project/repository/code_suggestions/index.md b/doc/user/project/repository/code_suggestions/index.md index 6100a79d528..d0ef6df48b8 100644 --- a/doc/user/project/repository/code_suggestions/index.md +++ b/doc/user/project/repository/code_suggestions/index.md @@ -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). diff --git a/lib/constraints/activity_pub_constrainer.rb b/lib/constraints/activity_pub_constrainer.rb index 383de2a84ea..947584dc978 100644 --- a/lib/constraints/activity_pub_constrainer.rb +++ b/lib/constraints/activity_pub_constrainer.rb @@ -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 diff --git a/lib/gitlab/ci/variables/builder.rb b/lib/gitlab/ci/variables/builder.rb index 569288962ed..c279af6acfc 100644 --- a/lib/gitlab/ci/variables/builder.rb +++ b/lib/gitlab/ci/variables/builder.rb @@ -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 diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 317d93371bb..bf76f6cdbc4 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -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 "" diff --git a/spec/frontend/search/sidebar/components/app_spec.js b/spec/frontend/search/sidebar/components/app_spec.js index 31263a4365c..61a87af476e 100644 --- a/spec/frontend/search/sidebar/components/app_spec.js +++ b/spec/frontend/search/sidebar/components/app_spec.js @@ -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); }); }); diff --git a/spec/frontend/super_sidebar/components/pinned_section_spec.js b/spec/frontend/super_sidebar/components/pinned_section_spec.js index 00cc7cf29c9..fe1653f1177 100644 --- a/spec/frontend/super_sidebar/components/pinned_section_spec.js +++ b/spec/frontend/super_sidebar/components/pinned_section_spec.js @@ -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', + ]); + }); + }); }); diff --git a/spec/lib/constraints/activity_pub_constrainer_spec.rb b/spec/lib/constraints/activity_pub_constrainer_spec.rb new file mode 100644 index 00000000000..8a37beb4d0f --- /dev/null +++ b/spec/lib/constraints/activity_pub_constrainer_spec.rb @@ -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 diff --git a/spec/lib/gitlab/ci/variables/builder_spec.rb b/spec/lib/gitlab/ci/variables/builder_spec.rb index 041a186e133..af745c75f42 100644 --- a/spec/lib/gitlab/ci/variables/builder_spec.rb +++ b/spec/lib/gitlab/ci/variables/builder_spec.rb @@ -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 } diff --git a/spec/migrations/db/migrate/20230823160533_update_package_metadata_sync_setting_spec.rb b/spec/migrations/db/migrate/20230823160533_update_package_metadata_sync_setting_spec.rb new file mode 100644 index 00000000000..0e1f6cd9b69 --- /dev/null +++ b/spec/migrations/db/migrate/20230823160533_update_package_metadata_sync_setting_spec.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +require 'spec_helper' +require_migration! + +RSpec.describe UpdatePackageMetadataSyncSetting, feature_category: :software_composition_analysis do + let(:settings) { table(:application_settings) } + let(:fully_enabled_sync_setting) { [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] } + + describe "#up" do + context 'with default value' do + let(:fully_disabled_sync) { [] } + + it 'updates setting' do + settings.create!(package_metadata_purl_types: fully_disabled_sync) + + migrate! + + expect(ApplicationSetting.last.package_metadata_purl_types).to eq(fully_enabled_sync_setting) + end + end + + context 'with custom value' do + let(:partially_enabled_sync) { [1, 2, 3, 4, 5] } + + it 'does not change setting' do + settings.create!(package_metadata_purl_types: partially_enabled_sync) + + migrate! + + expect(ApplicationSetting.last.package_metadata_purl_types).to eq(partially_enabled_sync) + end + end + end +end diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index 15f31d98d98..8adbd27cd1c 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -2670,14 +2670,6 @@ RSpec.describe Ci::Build, feature_category: :continuous_integration, factory_def end it_behaves_like 'containing environment 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) - end - - it_behaves_like 'containing environment variables' - end end context 'when an URL was set' do diff --git a/spec/support/rspec_order_todo.yml b/spec/support/rspec_order_todo.yml index 6ac1a27745f..0d84b9829b1 100644 --- a/spec/support/rspec_order_todo.yml +++ b/spec/support/rspec_order_todo.yml @@ -19,7 +19,6 @@ - './ee/spec/controllers/admin/elasticsearch_controller_spec.rb' - './ee/spec/controllers/admin/emails_controller_spec.rb' - './ee/spec/controllers/admin/geo/nodes_controller_spec.rb' -- './ee/spec/controllers/admin/geo/projects_controller_spec.rb' - './ee/spec/controllers/admin/geo/settings_controller_spec.rb' - './ee/spec/controllers/admin/groups_controller_spec.rb' - './ee/spec/controllers/admin/impersonations_controller_spec.rb' diff --git a/spec/support/shared_examples/mailers/notify_shared_examples.rb b/spec/support/shared_examples/mailers/notify_shared_examples.rb index cf1ab7697ab..987060d73b9 100644 --- a/spec/support/shared_examples/mailers/notify_shared_examples.rb +++ b/spec/support/shared_examples/mailers/notify_shared_examples.rb @@ -54,6 +54,14 @@ RSpec.shared_examples 'an email with X-GitLab headers containing IDs' do expect(subject.header["X-GitLab-#{model.class.name}-IID"]).to eq nil end end + + it 'has X-GitLab-*-State header if model has state defined' do + if model.respond_to?(:state) + is_expected.to have_header "X-GitLab-#{model.class.name}-State", model.state.to_s + else + expect(subject.header["X-GitLab-#{model.class.name}-State"]).to eq nil + end + end end RSpec.shared_examples 'an email with X-GitLab headers containing project details' do |