diff --git a/.gitlab/ci/frontend.gitlab-ci.yml b/.gitlab/ci/frontend.gitlab-ci.yml index cc9150420c4..3e1ec6519ab 100644 --- a/.gitlab/ci/frontend.gitlab-ci.yml +++ b/.gitlab/ci/frontend.gitlab-ci.yml @@ -259,11 +259,42 @@ graphql-schema-dump: script: - run_timed_command "yarn jest:ci" +jest-build-cache: + extends: + - .frontend-test-base + - .frontend:rules:jest + needs: [] + artifacts: + name: jest-cache + expire_in: 12h + when: always + paths: + - tmp/cache/jest/ + script: + - run_timed_command "yarn jest:ci:build-cache" + variables: + # Propagate exit code correctly. See https://gitlab.com/groups/gitlab-org/-/epics/6074. + FF_USE_NEW_BASH_EVAL_STRATEGY: 'true' + FORCE_COLOR: '1' + allow_failure: + # In merge requests, failures exit with 2, so fail the pipeline. Otherwise, + # they exit with 1, so as not to break master and other pipelines. + exit_codes: 1 + +jest-build-cache-vue3: + extends: + - jest-build-cache + - .frontend:rules:jest-vue3 + - .vue3 + jest: extends: - .jest-base - .frontend:rules:jest - needs: ["rspec-all frontend_fixture"] + needs: + - "rspec-all frontend_fixture" + - job: jest-build-cache + optional: true artifacts: name: coverage-frontend expire_in: 31d @@ -281,6 +312,10 @@ jest vue3: - jest - .frontend:rules:jest-vue3 - .vue3 + needs: + - "rspec-all frontend_fixture" + - job: jest-build-cache-vue3 + optional: true jest predictive: extends: diff --git a/.gitlab/ci/reports.gitlab-ci.yml b/.gitlab/ci/reports.gitlab-ci.yml index ad5e0546109..6e1d749118c 100644 --- a/.gitlab/ci/reports.gitlab-ci.yml +++ b/.gitlab/ci/reports.gitlab-ci.yml @@ -52,9 +52,6 @@ code_quality cache: SAST_EXCLUDED_PATHS: "qa, spec, doc, ee/spec, config/gitlab.yml.example, tmp" # GitLab-specific SAST_EXCLUDED_ANALYZERS: bandit, flawfinder, phpcs-security-audit, pmd-apex, security-code-scan, spotbugs, eslint, nodejs-scan, sobelow -brakeman-sast: - rules: !reference [".reports:rules:brakeman-sast", rules] - semgrep-sast: rules: !reference [".reports:rules:semgrep-sast", rules] diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml index 2162b847c99..b86bae48373 100644 --- a/.gitlab/ci/rules.gitlab-ci.yml +++ b/.gitlab/ci/rules.gitlab-ci.yml @@ -2634,19 +2634,6 @@ - <<: *if-default-refs changes: *docs-patterns -.reports:rules:brakeman-sast: - rules: - - <<: *if-merge-request-labels-pipeline-expedite - when: never - - if: $SAST_DISABLED - when: never - - if: $SAST_EXCLUDED_ANALYZERS =~ /brakeman/ - when: never - - <<: *if-default-refs - changes: - - '**/*.rb' - - '**/Gemfile' - .reports:rules:semgrep-sast: rules: - <<: *if-merge-request-labels-pipeline-expedite diff --git a/.gitlab/merge_request_templates/Stable Branch.md b/.gitlab/merge_request_templates/Stable Branch.md index 7130067b1f2..2186ac4b791 100644 --- a/.gitlab/merge_request_templates/Stable Branch.md +++ b/.gitlab/merge_request_templates/Stable Branch.md @@ -29,7 +29,7 @@ If you have questions about the patch release process, please: * Refer to the [patch release runbook for engineers and maintainers] for guidance. * Ask questions on the [`#releases`] Slack channel (internal only). -[severity label]: https://about.gitlab.com/handbook/engineering/quality/issue-triage/#severity +[severity label]: https://handbook.gitlab.com/handbook/engineering/infrastructure/engineering-productivity/issue-triage/#severity [patch release runbook for engineers and maintainers]: https://gitlab.com/gitlab-org/release/docs/-/blob/master/general/patch/engineers.md [`#releases`]: https://gitlab.slack.com/archives/C0XM5UU6B diff --git a/.rubocop_todo/gettext/static_identifier.yml b/.rubocop_todo/gettext/static_identifier.yml index 2db2a2f130f..e78a3583e89 100644 --- a/.rubocop_todo/gettext/static_identifier.yml +++ b/.rubocop_todo/gettext/static_identifier.yml @@ -19,7 +19,6 @@ Gettext/StaticIdentifier: - 'ee/app/models/integrations/github.rb' - 'ee/app/services/ee/projects/create_from_template_service.rb' - 'ee/app/services/security/security_orchestration_policies/policy_configuration_validation_service.rb' - - 'ee/app/services/timebox/rollup_report_service.rb' - 'ee/app/services/timebox_report_service.rb' - 'ee/spec/controllers/groups/security/policies_controller_spec.rb' - 'ee/spec/features/registrations/identity_verification_spec.rb' diff --git a/.rubocop_todo/layout/multiline_operation_indentation.yml b/.rubocop_todo/layout/multiline_operation_indentation.yml index 4b0d1d80e26..9f5f12fcefe 100644 --- a/.rubocop_todo/layout/multiline_operation_indentation.yml +++ b/.rubocop_todo/layout/multiline_operation_indentation.yml @@ -23,16 +23,3 @@ Layout/MultilineOperationIndentation: - 'app/services/labels/transfer_service.rb' - 'app/services/members/approve_access_request_service.rb' - 'app/services/webauthn/authenticate_service.rb' - - 'app/validators/feature_flag_strategies_validator.rb' - - 'app/workers/container_expiration_policies/cleanup_container_repository_worker.rb' - - 'config/initializers/devise_dynamic_password_length_validation.rb' - - 'danger/utility_css/Dangerfile' - - 'ee/app/controllers/projects/integrations/jira/issues_controller.rb' - - 'ee/app/controllers/smartcard_controller.rb' - - 'ee/app/graphql/resolvers/boards/epic_lists_resolver.rb' - - 'ee/app/helpers/ee/application_settings_helper.rb' - - 'ee/app/helpers/ee/boards_helper.rb' - - 'ee/app/helpers/ee/groups/group_members_helper.rb' - - 'ee/app/helpers/ee/projects/project_members_helper.rb' - - 'ee/app/helpers/groups/security_features_helper.rb' - - 'ee/app/helpers/groups/sso_helper.rb' diff --git a/.rubocop_todo/lint/ambiguous_regexp_literal.yml b/.rubocop_todo/lint/ambiguous_regexp_literal.yml index 92231f0a60e..cb6735f617a 100644 --- a/.rubocop_todo/lint/ambiguous_regexp_literal.yml +++ b/.rubocop_todo/lint/ambiguous_regexp_literal.yml @@ -15,23 +15,5 @@ Lint/AmbiguousRegexpLiteral: - 'spec/initializers/validate_database_config_spec.rb' - 'spec/lib/banzai/filter/references/label_reference_filter_spec.rb' - 'spec/lib/feature_spec.rb' - - 'spec/lib/gitlab/composer/version_index_spec.rb' - - 'spec/lib/gitlab/config/entry/validator_spec.rb' - - 'spec/lib/gitlab/config/entry/validators_spec.rb' - - 'spec/lib/gitlab/database/migration_helpers/restrict_gitlab_schema_spec.rb' - - 'spec/lib/gitlab/database/migration_helpers/v2_spec.rb' - - 'spec/lib/gitlab/database/migration_helpers_spec.rb' - - 'spec/lib/gitlab/database/migrations/background_migration_helpers_spec.rb' - - 'spec/lib/gitlab/database/migrations/batched_background_migration_helpers_spec.rb' - - 'spec/lib/gitlab/database/partitioning_spec.rb' - - 'spec/lib/gitlab/database/query_analyzers/prevent_cross_database_modification_spec.rb' - - 'spec/lib/gitlab/gitaly_client/with_feature_flag_actors_spec.rb' - - 'spec/lib/gitlab/pagination/keyset/in_operator_optimization/array_scope_columns_spec.rb' - - 'spec/lib/gitlab/pagination/keyset/in_operator_optimization/query_builder_spec.rb' - - 'spec/lib/gitlab/pagination/keyset/iterator_spec.rb' - - 'spec/lib/gitlab/sidekiq_middleware/duplicate_jobs/duplicate_job_spec.rb' - - 'spec/lib/gitlab/usage/metrics/aggregates/sources/postgres_hll_spec.rb' - - 'spec/lib/gitlab/web_ide/config/entry/global_spec.rb' - - 'spec/lib/gitlab/web_ide/config/entry/terminal_spec.rb' - 'spec/serializers/commit_entity_spec.rb' diff --git a/.rubocop_todo/migration/ensure_factory_for_table.yml b/.rubocop_todo/migration/ensure_factory_for_table.yml index c1a565510a3..79f2f4f9f53 100644 --- a/.rubocop_todo/migration/ensure_factory_for_table.yml +++ b/.rubocop_todo/migration/ensure_factory_for_table.yml @@ -51,3 +51,4 @@ Migration/EnsureFactoryForTable: - 'db/migrate/20240306121653_create_relation_import_tracker.rb' - 'db/migrate/20240404192955_create_early_access_program_tracking_events.rb' - 'db/migrate/20240423064716_create_ci_build_execution_config.rb' + - 'db/migrate/20240419082037_create_ai_self_hosted_models.rb' diff --git a/.rubocop_todo/rspec/feature_category.yml b/.rubocop_todo/rspec/feature_category.yml index f6ecb3270d7..1117d2db245 100644 --- a/.rubocop_todo/rspec/feature_category.yml +++ b/.rubocop_todo/rspec/feature_category.yml @@ -3960,7 +3960,6 @@ RSpec/FeatureCategory: - 'spec/lib/gitlab/usage_data_counters/base_counter_spec.rb' - 'spec/lib/gitlab/usage_data_counters/ci_template_unique_counter_spec.rb' - 'spec/lib/gitlab/usage_data_counters/code_review_events_spec.rb' - - 'spec/lib/gitlab/usage_data_counters/designs_counter_spec.rb' - 'spec/lib/gitlab/usage_data_counters/gitlab_cli_activity_unique_counter_spec.rb' - 'spec/lib/gitlab/usage_data_counters/hll_redis_counter_spec.rb' - 'spec/lib/gitlab/usage_data_counters/ipynb_diff_activity_counter_spec.rb' diff --git a/.rubocop_todo/style/class_and_module_children.yml b/.rubocop_todo/style/class_and_module_children.yml index ac1fbd3fcc7..61b5456eff8 100644 --- a/.rubocop_todo/style/class_and_module_children.yml +++ b/.rubocop_todo/style/class_and_module_children.yml @@ -508,7 +508,6 @@ Style/ClassAndModuleChildren: - 'lib/gitlab/instrumentation/elasticsearch_transport.rb' - 'lib/gitlab/usage_data_counters/base_counter.rb' - 'lib/gitlab/usage_data_counters/ci_template_unique_counter.rb' - - 'lib/gitlab/usage_data_counters/designs_counter.rb' - 'lib/gitlab/usage_data_counters/note_counter.rb' - 'lib/release_highlights/validator/entry.rb' - 'qa/qa/page/component/project/templates.rb' diff --git a/.rubocop_todo/style/inline_disable_annotation.yml b/.rubocop_todo/style/inline_disable_annotation.yml index 65a9056eb12..523d93fd9bb 100644 --- a/.rubocop_todo/style/inline_disable_annotation.yml +++ b/.rubocop_todo/style/inline_disable_annotation.yml @@ -1530,7 +1530,6 @@ Style/InlineDisableAnnotation: - 'ee/app/services/security/update_training_service.rb' - 'ee/app/services/status_page/publish_base_service.rb' - 'ee/app/services/timebox/event_aggregation_service.rb' - - 'ee/app/services/timebox/rollup_report_service.rb' - 'ee/app/services/timebox_report_service.rb' - 'ee/app/services/vulnerabilities/bulk_dismiss_service.rb' - 'ee/app/services/vulnerabilities/create_service_base.rb' diff --git a/app/assets/javascripts/projects/settings/branch_rules/components/view/constants.js b/app/assets/javascripts/projects/settings/branch_rules/components/view/constants.js index c8882fee7a4..610977b9b11 100644 --- a/app/assets/javascripts/projects/settings/branch_rules/components/view/constants.js +++ b/app/assets/javascripts/projects/settings/branch_rules/components/view/constants.js @@ -50,6 +50,12 @@ export const I18N = { update: s__('BranchRules|Update'), edit: s__('BranchRules|Edit'), updateBranchRuleError: s__('BranchRules|Something went wrong while updating branch rule.'), + allowedToPushDescription: s__( + 'BranchRules|Changes require a merge request. The following users can push and merge directly.', + ), + allowedToPushEmptyState: s__('BranchRules|No one is allowed to push and merge changes.'), + allowedToMergeEmptyState: s__('BranchRules|No one is allowed to merge changes.'), + statusChecksEmptyState: s__('BranchRules|No status checks have been added.'), }; export const EDIT_RULE_MODAL_ID = 'editRuleModal'; diff --git a/app/assets/javascripts/projects/settings/branch_rules/components/view/index.vue b/app/assets/javascripts/projects/settings/branch_rules/components/view/index.vue index e5d91b00cc7..a315cf59a18 100644 --- a/app/assets/javascripts/projects/settings/branch_rules/components/view/index.vue +++ b/app/assets/javascripts/projects/settings/branch_rules/components/view/index.vue @@ -293,6 +293,8 @@ export default { :roles="pushAccessLevels.roles" :users="pushAccessLevels.users" :groups="pushAccessLevels.groups" + :empty-state-copy="$options.i18n.allowedToPushEmptyState" + :help-text="$options.i18n.allowedToPushDescription" data-testid="allowed-to-push-content" /> @@ -304,6 +306,7 @@ export default { :roles="mergeAccessLevels.roles" :users="mergeAccessLevels.users" :groups="mergeAccessLevels.groups" + :empty-state-copy="$options.i18n.allowedToMergeEmptyState" is-edit-available data-testid="allowed-to-merge-content" /> @@ -377,6 +380,7 @@ export default { :header-link-title="$options.i18n.statusChecksLinkTitle" :header-link-href="statusChecksPath" :status-checks="statusChecks" + :empty-state-copy="$options.i18n.statusChecksEmptyState" /> diff --git a/app/assets/javascripts/projects/settings/branch_rules/components/view/protection.vue b/app/assets/javascripts/projects/settings/branch_rules/components/view/protection.vue index dbe9ed0d6f9..11c23d8017a 100644 --- a/app/assets/javascripts/projects/settings/branch_rules/components/view/protection.vue +++ b/app/assets/javascripts/projects/settings/branch_rules/components/view/protection.vue @@ -58,13 +58,34 @@ export default { required: false, default: false, }, + emptyStateCopy: { + type: String, + required: true, + }, + helpText: { + type: String, + required: false, + default: () => '', + }, }, computed: { - showUsersDivider() { + hasRoles() { return Boolean(this.roles.length); }, + hasUsers() { + return Boolean(this.users.length); + }, + hasStatusChecks() { + return Boolean(this.statusChecks.length); + }, showGroupsDivider() { - return Boolean(this.roles.length || this.users.length); + return this.hasRoles || this.hasUsers; + }, + showEmptyState() { + return !this.hasRoles && !this.hasUsers && !this.hasStatusChecks; + }, + showHelpText() { + return Boolean(this.helpText.length); }, }, }; @@ -73,8 +94,8 @@ export default { + +

+ {{ emptyStateCopy }} +

@@ -94,7 +122,7 @@ export default { diff --git a/app/assets/javascripts/projects/settings/branch_rules/components/view/protection_row.vue b/app/assets/javascripts/projects/settings/branch_rules/components/view/protection_row.vue index b1ce9ed61e8..75df9cacfcf 100644 --- a/app/assets/javascripts/projects/settings/branch_rules/components/view/protection_row.vue +++ b/app/assets/javascripts/projects/settings/branch_rules/components/view/protection_row.vue @@ -66,7 +66,7 @@ export default {