From b3bdfebdb71285691db53fb8e27e6ce65ba71fbb Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 10 Dec 2024 18:31:27 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .gitlab/ci/release-environments.gitlab-ci.yml | 2 +- .gitlab/ci/test-on-gdk/main.gitlab-ci.yml | 66 ++---- ...e_end_string_concatenation_indentation.yml | 2 - .rubocop_todo/layout/line_length.yml | 1 - .rubocop_todo/lint/empty_block.yml | 1 - .../lint/redundant_cop_disable_directive.yml | 4 - .rubocop_todo/rails/output_safety.yml | 2 - .../rspec/before_all_role_assignment.yml | 2 - .../rspec/factory_bot/avoid_create.yml | 8 +- .../work_items/components/work_item_notes.vue | 4 +- .../stylesheets/framework/animations.scss | 22 -- .../page_bundles/oncall_schedules.scss | 4 - .../settings/applications_controller.rb | 4 +- app/controllers/groups_controller.rb | 13 +- app/helpers/users_helper.rb | 15 -- app/models/ci/bridge.rb | 18 +- .../ci/pipeline_bridge_status_service.rb | 11 +- .../ci/runners/create_runner_service.rb | 4 +- app/services/import/github_service.rb | 3 +- app/views/groups/_personalize.html.haml | 5 - .../doorkeeper/applications/_index.html.haml | 5 +- .../github_importer_lower_per_page_limit.yml | 8 - config/initializers/1_settings.rb | 1 - .../17-6-cancel-rest-api-change.yml | 41 ++++ .../supported_llm_serving_platforms.md | 15 ++ doc/administration/settings/email.md | 7 +- doc/api/import.md | 1 + doc/api/pipelines.md | 4 + doc/api/user_email_addresses.md | 57 ++--- doc/development/migration_style_guide.md | 2 +- .../jetbrains_troubleshooting.md | 40 ++-- .../neovim/neovim_troubleshooting.md | 30 +-- .../visual_studio_troubleshooting.md | 11 +- .../visual_studio_code/troubleshooting.md | 61 +---- doc/update/breaking_windows.md | 1 + doc/update/deprecations.md | 19 ++ doc/user/compliance/audit_event_types.md | 4 + doc/user/gitlab_duo_chat/troubleshooting.md | 8 + .../import/direct_transfer_migrations.md | 2 + doc/user/group/index.md | 1 - doc/user/profile/index.md | 2 +- doc/user/project/deploy_keys/index.md | 16 +- .../import/troubleshooting_github_import.md | 26 --- .../merge_requests/duo_in_merge_requests.md | 6 +- .../project/merge_requests/reviews/index.md | 3 +- .../repository/code_suggestions/index.md | 127 +--------- .../repository/code_suggestions/set_up.md | 141 ++++++++++++ .../code_suggestions/troubleshooting.md | 217 ++++++++++++++---- lib/api/helpers/import_github_helpers.rb | 3 +- lib/api/import_github.rb | 1 + lib/banzai/reference_redactor.rb | 5 +- lib/gitlab/audit/ci_runner_token_author.rb | 33 +-- lib/gitlab/audit/null_author.rb | 5 +- lib/gitlab/fogbugz_import/xml_adapter.rb | 15 +- lib/gitlab/github_import.rb | 12 +- lib/gitlab/github_import/client.rb | 1 - lib/gitlab/github_import/settings.rb | 3 +- locale/gitlab.pot | 33 --- qa/qa/scenario/test/instance/blocking.rb | 13 -- ...trigger_child_pipeline_with_manual_spec.rb | 8 +- .../nuget/nuget_group_level_spec.rb | 2 +- .../nuget/nuget_project_level_spec.rb | 2 +- scripts/frontend/quarantined_vue3_specs.txt | 1 - scripts/verify-tff-mapping | 1 + .../settings/applications_controller_spec.rb | 32 ++- spec/controllers/groups_controller_spec.rb | 10 - spec/lib/banzai/reference_redactor_spec.rb | 4 +- .../audit/ci_runner_token_author_spec.rb | 42 ++-- .../gitlab/fogbugz_import/xml_adapter_spec.rb | 32 ++- .../lib/gitlab/github_import/settings_spec.rb | 5 +- spec/lib/gitlab/github_import_spec.rb | 61 ++--- spec/models/audit_event_spec.rb | 22 +- spec/models/ci/bridge_spec.rb | 31 +++ .../mutations/ci/runner/create_spec.rb | 6 +- .../ci/pipeline_bridge_status_service_spec.rb | 20 -- spec/services/import/github_service_spec.rb | 7 +- .../helpers/user_with_namespace_shim.yml | 1 - spec/support/rspec_order_todo.yml | 2 - spec/views/groups/new.html.haml_spec.rb | 7 - tests.yml | 1 + 80 files changed, 741 insertions(+), 727 deletions(-) delete mode 100644 .rubocop_todo/lint/redundant_cop_disable_directive.yml delete mode 100644 config/feature_flags/ops/github_importer_lower_per_page_limit.yml create mode 100644 data/deprecations/17-6-cancel-rest-api-change.yml create mode 100644 doc/user/project/repository/code_suggestions/set_up.md delete mode 100644 qa/qa/scenario/test/instance/blocking.rb diff --git a/.gitlab/ci/release-environments.gitlab-ci.yml b/.gitlab/ci/release-environments.gitlab-ci.yml index 6702da3e66c..3a0af47886f 100644 --- a/.gitlab/ci/release-environments.gitlab-ci.yml +++ b/.gitlab/ci/release-environments.gitlab-ci.yml @@ -24,6 +24,6 @@ start-release-environments-security-pipeline: strategy: depend include: - project: 'gitlab-org/security/gitlab' - ref: 'master' + ref: '$CI_COMMIT_REF_NAME' file: '.gitlab/ci/release-environments/security.gitlab-ci.yml' resource_group: release-environment-${CI_COMMIT_REF_SLUG} diff --git a/.gitlab/ci/test-on-gdk/main.gitlab-ci.yml b/.gitlab/ci/test-on-gdk/main.gitlab-ci.yml index 8d91bec7e75..35a27763c95 100644 --- a/.gitlab/ci/test-on-gdk/main.gitlab-ci.yml +++ b/.gitlab/ci/test-on-gdk/main.gitlab-ci.yml @@ -23,12 +23,12 @@ include: when: never - <<: *code-pattern-with-selective-enabled-knapsack-unset - !reference [.rules:test:qa-selective, rules] - - if: $QA_SUITES =~ /Test::Instance::Blocking/ + - if: $QA_SUITES =~ /Test::Instance::All/ .rules:gdk:qa-parallel: rules: # To account for cases where a group label is set which may trigger selective execution - # But we want to execute full blocking suite on gdk in case of code-pattern-changes + # But we want to execute full suite on gdk in case of code-pattern-changes - <<: *code-pattern-changes-with-selective-disabled variables: QA_TESTS: "" @@ -37,7 +37,7 @@ include: when: never - <<: *code-pattern-with-selective-enabled-knapsack-set - !reference [.rules:test:qa-parallel, rules] - - if: $QA_SUITES =~ /Test::Instance::Blocking/ + - if: $QA_SUITES =~ /Test::Instance::All/ - !reference [.rules:test:manual, rules] .rules:test:gdk-load-balancer-changes: @@ -135,84 +135,50 @@ download-knapsack-report: # Test stage # ========================================== -# ------------------------------------------ -# Blocking tests -# ------------------------------------------ -gdk-qa-blocking: +gdk-instance: extends: - .gdk-qa-base - .with-parallel - .rules:gdk:qa-parallel variables: - QA_SCENARIO: Test::Instance::Blocking - QA_RUN_TYPE: gdk-qa-blocking + QA_SCENARIO: Test::Instance::All + QA_RUN_TYPE: gdk-instance -gdk-qa-blocking-ff-inverse: - extends: gdk-qa-blocking +gdk-instance-ff-inverse: + extends: gdk-instance variables: QA_FEATURE_FLAGS: $FEATURE_FLAGS rules: - !reference [.rules:test:feature-flags-set, rules] -gdk-qa-blocking-selective: +gdk-instance-selective: extends: - .gdk-qa-base - .rules:gdk:qa-selective variables: - QA_SCENARIO: Test::Instance::Blocking - QA_RUN_TYPE: gdk-qa-blocking + QA_SCENARIO: Test::Instance::All + QA_RUN_TYPE: gdk-instance -gdk-qa-blocking-gitaly-transactions: - extends: gdk-qa-blocking +gdk-instance-gitaly-transactions: + extends: gdk-instance variables: QA_GITALY_TRANSACTIONS_ENABLED: "true" rules: - !reference [.rules:test:never-schedule-pipeline, rules] - !reference [.rules:test:gdk-gitaly-version-change, rules] -# ------------------------------------------ -# Non Blocking tests -# ------------------------------------------ -gdk-qa-blocking-with-load-balancer: +gdk-instance-with-load-balancer: extends: - .gdk-qa-base - .gdk-with-load-balancer-setup - - .with-gdk-log - .with-parallel variables: - QA_SCENARIO: Test::Instance::Blocking - QA_RUN_TYPE: gdk-qa-blocking - artifacts: - paths: - - log - reports: - dotenv: "" + QA_SCENARIO: Test::Instance::All + QA_RUN_TYPE: gdk-instance rules: - !reference [".rules:test:never-schedule-pipeline", rules] - !reference [".rules:test:gdk-load-balancer-changes", rules] -gdk-qa-non-blocking: - extends: - - .gdk-qa-base - - .with-gdk-log - variables: - QA_SCENARIO: Test::Instance::NonBlocking - QA_RUN_TYPE: gdk-qa-non-blocking - allow_failure: true - artifacts: - paths: - - '*.log' - - qa/tmp/test-metrics-*.json - - qa/tmp/*.txt - - qa/tmp/*.log - - qa/tmp/qa-test-*/* - reports: - dotenv: "" - rules: - # run tests on master pipelines to collect metrics and move tests to `blocking` job until `non-blocking` job - # is removed entirely - - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' - - when: manual # ========================================== # Post test stage diff --git a/.rubocop_todo/layout/line_end_string_concatenation_indentation.yml b/.rubocop_todo/layout/line_end_string_concatenation_indentation.yml index c0b12be3495..8f8134d1736 100644 --- a/.rubocop_todo/layout/line_end_string_concatenation_indentation.yml +++ b/.rubocop_todo/layout/line_end_string_concatenation_indentation.yml @@ -58,9 +58,7 @@ Layout/LineEndStringConcatenationIndentation: - 'ee/app/components/namespaces/free_user_cap/usage_quota_alert_component.rb' - 'ee/app/components/namespaces/free_user_cap/usage_quota_trial_alert_component.rb' - 'ee/app/components/namespaces/storage/limit_alert_component.rb' - - 'ee/app/components/namespaces/storage/pre_enforcement_alert_component.rb' - 'ee/app/components/namespaces/storage/repository_limit_alert_component.rb' - - 'ee/app/components/namespaces/storage/user_pre_enforcement_alert_component.rb' - 'ee/app/controllers/concerns/insights_actions.rb' - 'ee/app/controllers/ee/ldap/omniauth_callbacks_controller.rb' - 'ee/app/finders/geo/framework_registry_finder.rb' diff --git a/.rubocop_todo/layout/line_length.yml b/.rubocop_todo/layout/line_length.yml index 6983205d3eb..7088afe74b1 100644 --- a/.rubocop_todo/layout/line_length.yml +++ b/.rubocop_todo/layout/line_length.yml @@ -698,7 +698,6 @@ Layout/LineLength: - 'ee/app/services/app_sec/dast/site_profiles/destroy_service.rb' - 'ee/app/services/app_sec/dast/site_profiles/update_service.rb' - 'ee/app/services/app_sec/dast/site_validations/runner_service.rb' - - 'ee/app/services/audit_events/runner_audit_event_service.rb' - 'ee/app/services/auto_merge/add_to_merge_train_when_pipeline_succeeds_service.rb' - 'ee/app/services/boards/epics/create_service.rb' - 'ee/app/services/boards/epics/move_service.rb' diff --git a/.rubocop_todo/lint/empty_block.yml b/.rubocop_todo/lint/empty_block.yml index ae8582f8550..8f5cd33b57d 100644 --- a/.rubocop_todo/lint/empty_block.yml +++ b/.rubocop_todo/lint/empty_block.yml @@ -23,7 +23,6 @@ Lint/EmptyBlock: - 'ee/spec/requests/api/vulnerability_exports_spec.rb' - 'ee/spec/requests/groups/security/credentials_controller_spec.rb' - 'ee/spec/requests/lfs_http_spec.rb' - - 'ee/spec/services/audit_events/register_runner_audit_event_service_spec.rb' - 'ee/spec/services/auto_merge/add_to_merge_train_when_pipeline_succeeds_service_spec.rb' - 'ee/spec/services/auto_merge/merge_train_service_spec.rb' - 'ee/spec/services/ci/runners/register_runner_service_spec.rb' diff --git a/.rubocop_todo/lint/redundant_cop_disable_directive.yml b/.rubocop_todo/lint/redundant_cop_disable_directive.yml deleted file mode 100644 index 3e6d09a35b3..00000000000 --- a/.rubocop_todo/lint/redundant_cop_disable_directive.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -# Cop supports --autocorrect. -Lint/RedundantCopDisableDirective: - Details: grace period diff --git a/.rubocop_todo/rails/output_safety.yml b/.rubocop_todo/rails/output_safety.yml index 40801e97034..ec025514e53 100644 --- a/.rubocop_todo/rails/output_safety.yml +++ b/.rubocop_todo/rails/output_safety.yml @@ -58,9 +58,7 @@ Rails/OutputSafety: - 'ee/app/components/namespaces/free_user_cap/usage_quota_alert_component.rb' - 'ee/app/components/namespaces/free_user_cap/usage_quota_trial_alert_component.rb' - 'ee/app/components/namespaces/storage/limit_alert_component.rb' - - 'ee/app/components/namespaces/storage/pre_enforcement_alert_component.rb' - 'ee/app/components/namespaces/storage/repository_limit_alert_component.rb' - - 'ee/app/components/namespaces/storage/user_pre_enforcement_alert_component.rb' - 'ee/app/controllers/ee/projects/issues_controller.rb' - 'ee/app/controllers/ee/repositories/lfs_api_controller.rb' - 'ee/app/helpers/billing_plans_helper.rb' diff --git a/.rubocop_todo/rspec/before_all_role_assignment.yml b/.rubocop_todo/rspec/before_all_role_assignment.yml index 3d59277b829..9e23982cbbf 100644 --- a/.rubocop_todo/rspec/before_all_role_assignment.yml +++ b/.rubocop_todo/rspec/before_all_role_assignment.yml @@ -1,8 +1,6 @@ --- RSpec/BeforeAllRoleAssignment: Exclude: - - 'ee/spec/components/namespaces/storage/pre_enforcement_alert_component_spec.rb' - - 'ee/spec/components/namespaces/storage/subgroup_pre_enforcement_alert_component_spec.rb' - 'ee/spec/controllers/autocomplete_controller_spec.rb' - 'ee/spec/controllers/dashboard_controller_spec.rb' - 'ee/spec/controllers/ee/dashboard/projects_controller_spec.rb' diff --git a/.rubocop_todo/rspec/factory_bot/avoid_create.yml b/.rubocop_todo/rspec/factory_bot/avoid_create.yml index 4d2cdda8309..4c643efa3df 100644 --- a/.rubocop_todo/rspec/factory_bot/avoid_create.yml +++ b/.rubocop_todo/rspec/factory_bot/avoid_create.yml @@ -5,10 +5,10 @@ RSpec/FactoryBot/AvoidCreate: - 'ee/spec/components/namespaces/free_user_cap/non_owner_enforcement_alert_component_spec.rb' - 'ee/spec/components/namespaces/free_user_cap/usage_quota_alert_component_spec.rb' - 'ee/spec/components/namespaces/free_user_cap/usage_quota_trial_alert_component_spec.rb' - - 'ee/spec/components/namespaces/storage/pre_enforcement_alert_component_spec.rb' - - 'ee/spec/components/namespaces/storage/project_pre_enforcement_alert_component_spec.rb' - - 'ee/spec/components/namespaces/storage/subgroup_pre_enforcement_alert_component_spec.rb' - - 'ee/spec/components/namespaces/storage/user_pre_enforcement_alert_component_spec.rb' + - 'ee/spec/components/namespaces/storage/namespace_limit/pre_enforcement_alert_component_spec.rb' + - 'ee/spec/components/namespaces/storage/namespace_limit/project_pre_enforcement_alert_component_spec.rb' + - 'ee/spec/components/namespaces/storage/namespace_limit/subgroup_pre_enforcement_alert_component_spec.rb' + - 'ee/spec/components/namespaces/storage/namespace_limit/user_pre_enforcement_alert_component_spec.rb' - 'ee/spec/helpers/application_helper_spec.rb' - 'ee/spec/helpers/billing_plans_helper_spec.rb' - 'ee/spec/helpers/boards_helper_spec.rb' diff --git a/app/assets/javascripts/work_items/components/work_item_notes.vue b/app/assets/javascripts/work_items/components/work_item_notes.vue index 8a8f5f903ca..81bc8a4b989 100644 --- a/app/assets/javascripts/work_items/components/work_item_notes.vue +++ b/app/assets/javascripts/work_items/components/work_item_notes.vue @@ -135,8 +135,8 @@ export default { return this.sortOrder === DESC; }, markdownPreviewPath() { - const { fullPath, isGroup, workItemIid: iid } = this; - return markdownPreviewPath({ fullPath, iid, isGroup }); + const { fullPath, workItemIid: iid } = this; + return markdownPreviewPath({ fullPath, iid, isGroup: this.isGroupWorkItem }); }, isGroupWorkItem() { return this.workItemNamespace?.id?.includes?.('Group'); diff --git a/app/assets/stylesheets/framework/animations.scss b/app/assets/stylesheets/framework/animations.scss index 042ed6bb9ac..fee1f69170f 100644 --- a/app/assets/stylesheets/framework/animations.scss +++ b/app/assets/stylesheets/framework/animations.scss @@ -234,28 +234,6 @@ $skeleton-line-widths: ( animation: slide-in-fwd-bottom 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both reverse; } -@keyframes spin { - 0% { transform: rotate(0deg);} - 100% { transform: rotate(360deg);} -} - -/** COMMON ANIMATION CLASSES **/ -.transform-origin-center { @include webkit-prefix(transform-origin, 50% 50%); } -.animate-n-spin { @include webkit-prefix(animation-name, spin); } -.animate-c-infinite { @include webkit-prefix(animation-iteration-count, infinite); } -.animate-t-linear { @include webkit-prefix(animation-timing-function, linear); } -.animate-d-1 { @include webkit-prefix(animation-duration, 1s); } -.animate-d-2 { @include webkit-prefix(animation-duration, 2s); } - -/** COMPOSITE ANIMATION CLASSES **/ -.gl-spinner { - @include webkit-prefix(animation-name, spin); - @include webkit-prefix(animation-iteration-count, infinite); - @include webkit-prefix(animation-timing-function, linear); - @include webkit-prefix(animation-duration, 1s); - transform-origin: 50% 50%; -} - /* ---------------------------------------------- * Generated by Animista on 2019-4-26 17:40:41 * w: http://animista.net, t: @cssanimista diff --git a/app/assets/stylesheets/page_bundles/oncall_schedules.scss b/app/assets/stylesheets/page_bundles/oncall_schedules.scss index ca69e11fc9f..07845af9940 100644 --- a/app/assets/stylesheets/page_bundles/oncall_schedules.scss +++ b/app/assets/stylesheets/page_bundles/oncall_schedules.scss @@ -1,9 +1,5 @@ @import 'mixins_and_variables_and_functions'; -.modal-footer { - background-color: $gray-10; -} - .invalid-dropdown { // stylelint-disable-next-line gitlab/no-gl-class .gl-button.gl-dropdown-toggle { diff --git a/app/controllers/groups/settings/applications_controller.rb b/app/controllers/groups/settings/applications_controller.rb index 11d90ab4415..f357de4dd42 100644 --- a/app/controllers/groups/settings/applications_controller.rb +++ b/app/controllers/groups/settings/applications_controller.rb @@ -61,9 +61,7 @@ module Groups private def set_index_vars - # TODO: Remove limit(100) and implement pagination - # https://gitlab.com/gitlab-org/gitlab/-/issues/324187 - @applications = @group.oauth_applications.limit(100) + @applications = @group.oauth_applications.keyset_paginate(cursor: params[:cursor]) # Don't overwrite a value possibly set by `create` @application ||= Doorkeeper::Application.new diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index 1d3ead25fee..237b661099a 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -358,17 +358,14 @@ class GroupsController < Groups::ApplicationController end def successful_creation_hooks - update_user_role_and_setup_for_company + update_user_setup_for_company end - def update_user_role_and_setup_for_company - user_params = params.fetch(:user, {}).permit(:role) + def update_user_setup_for_company + return if @group.setup_for_company.nil? || current_user.setup_for_company.present? - if !@group.setup_for_company.nil? && current_user.setup_for_company.nil? - user_params[:setup_for_company] = @group.setup_for_company - end - - Users::UpdateService.new(current_user, user_params.merge(user: current_user)).execute if user_params.present? + Users::UpdateService.new(current_user, + { setup_for_company: @group.setup_for_company }.merge(user: current_user)).execute end def groups diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb index 5b47d719280..d8450373ed7 100644 --- a/app/helpers/users_helper.rb +++ b/app/helpers/users_helper.rb @@ -352,21 +352,6 @@ module UsersHelper end end - # the keys should match the user model defined roles in app/models/user.rb - def localized_user_roles - { - software_developer: s_('User|Software Developer'), - development_team_lead: s_('User|Development Team Lead'), - devops_engineer: s_('User|Devops Engineer'), - systems_administrator: s_('User|Systems Administrator'), - security_analyst: s_('User|Security Analyst'), - data_analyst: s_('User|Data Analyst'), - product_manager: s_('User|Product Manager'), - product_designer: s_('User|Product Designer'), - other: s_('User|Other') - }.with_indifferent_access.freeze - end - def preload_project_associations(_) # Overridden in EE end diff --git a/app/models/ci/bridge.rb b/app/models/ci/bridge.rb index 9a45b5d6b51..2f0f6e758e9 100644 --- a/app/models/ci/bridge.rb +++ b/app/models/ci/bridge.rb @@ -59,6 +59,18 @@ module Ci event :finish_cancel do transition CANCELABLE_STATUSES.map(&:to_sym) + [:manual, :canceling] => :canceled end + + event :inherit_success do + transition all => :success + end + + event :inherit_finish_cancel do + transition all => :canceled + end + + event :inherit_failed do + transition all => :failed + end end def retryable? @@ -86,11 +98,11 @@ module Ci def inherit_status_from_downstream!(pipeline) case pipeline.status when 'success' - success! + inherit_success! when 'canceled' - finish_cancel! + inherit_finish_cancel! when 'failed', 'skipped' - drop! + inherit_failed! else false end diff --git a/app/services/ci/pipeline_bridge_status_service.rb b/app/services/ci/pipeline_bridge_status_service.rb index 11fade6cc52..2b12650b1c6 100644 --- a/app/services/ci/pipeline_bridge_status_service.rb +++ b/app/services/ci/pipeline_bridge_status_service.rb @@ -5,16 +5,7 @@ module Ci def execute(pipeline) return unless pipeline.bridge_triggered? - begin - pipeline.source_bridge.inherit_status_from_downstream!(pipeline) - rescue StateMachines::InvalidTransition => e - error = Ci::Bridge::InvalidTransitionError.new(e.message) - error.set_backtrace(caller) - Gitlab::ErrorTracking.track_exception( - error, - bridge_id: pipeline.source_bridge.id, - downstream_pipeline_id: pipeline.id) - end + pipeline.source_bridge.inherit_status_from_downstream!(pipeline) end end end diff --git a/app/services/ci/runners/create_runner_service.rb b/app/services/ci/runners/create_runner_service.rb index fbf49d1f3f7..013cbec7f6a 100644 --- a/app/services/ci/runners/create_runner_service.rb +++ b/app/services/ci/runners/create_runner_service.rb @@ -49,7 +49,7 @@ module Ci private - attr_reader :user, :params, :strategy + attr_reader :user, :scope, :params, :strategy def track_runner_event(runner) return if params[:maintenance_note].blank? @@ -73,3 +73,5 @@ module Ci end end end + +Ci::Runners::CreateRunnerService.prepend_mod diff --git a/app/services/import/github_service.rb b/app/services/import/github_service.rb index f14c778e08d..3c2e4b9dc1c 100644 --- a/app/services/import/github_service.rb +++ b/app/services/import/github_service.rb @@ -166,7 +166,8 @@ module Import .new(project) .write( timeout_strategy: params[:timeout_strategy] || ProjectImportData::PESSIMISTIC_TIMEOUT, - optional_stages: params[:optional_stages] + optional_stages: params[:optional_stages], + pagination_limit: params[:pagination_limit] ) end end diff --git a/app/views/groups/_personalize.html.haml b/app/views/groups/_personalize.html.haml index a644c67b12c..013e854eb32 100644 --- a/app/views/groups/_personalize.html.haml +++ b/app/views/groups/_personalize.html.haml @@ -5,11 +5,6 @@ %p = _("We'll use this to help surface the right features and information to you.") -.row - .form-group.col-sm-4 - = label :user, :role, _('Role') - = select :user, :role, ::User.roles.keys.map { |role| [localized_user_roles[role] || role.titleize, role] }, { selected: @current_user.role }, class: 'form-control' - .row .form-group.col-sm-4 = f.label :setup_for_company, _('Who will be using this group?') diff --git a/app/views/shared/doorkeeper/applications/_index.html.haml b/app/views/shared/doorkeeper/applications/_index.html.haml index 8de8ad031e0..1f0d241f014 100644 --- a/app/views/shared/doorkeeper/applications/_index.html.haml +++ b/app/views/shared/doorkeeper/applications/_index.html.haml @@ -16,7 +16,7 @@ - if oauth_applications_enabled = render ::Layouts::CrudComponent.new(_('Your applications'), icon: 'applications', - count: @applications.size, + count: @applications.count, toggle_text: _('Add new application'), toggle_options: { class: hide_class }, form_options: { form_errors: form_errors(@application) }, @@ -49,6 +49,9 @@ %div{ class: '!gl-flex !gl-pl-0' } = render Pajamas::ButtonComponent.new(category: :tertiary, href: edit_application_url.call(application), icon: 'pencil', button_options: { class: 'has-tooltip gl-mr-3', 'title': _('Edit'), 'aria-label': _('Edit') }) = render 'shared/doorkeeper/applications/delete_form', path: application_url.call(application), small: true + + - if @group.present? + = keyset_paginate @applications - else .gl-text-subtle= _("You don't have any applications.") diff --git a/config/feature_flags/ops/github_importer_lower_per_page_limit.yml b/config/feature_flags/ops/github_importer_lower_per_page_limit.yml deleted file mode 100644 index fa0e5d30b7d..00000000000 --- a/config/feature_flags/ops/github_importer_lower_per_page_limit.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: github_importer_lower_per_page_limit -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/67150 -rollout_issue_url: -milestone: '14.2' -type: ops -group: group::import and integrate -default_enabled: false diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index f82da981b01..f1218ff2a76 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -257,7 +257,6 @@ end # Gitlab.ee do Settings['elasticsearch'] ||= {} - Settings.elasticsearch['enabled'] = false if Settings.elasticsearch['enabled'].nil? Settings.elasticsearch['indexer_path'] ||= Gitlab::Utils.which('gitlab-elasticsearch-indexer') end diff --git a/data/deprecations/17-6-cancel-rest-api-change.yml b/data/deprecations/17-6-cancel-rest-api-change.yml new file mode 100644 index 00000000000..f1a29c0d534 --- /dev/null +++ b/data/deprecations/17-6-cancel-rest-api-change.yml @@ -0,0 +1,41 @@ +- title: "Pipelines API cancel endpoint returns error for non-cancelable pipelines" + # The milestones for the deprecation announcement, and the removal. + removal_milestone: "18.0" + announcement_milestone: "17.6" + # Change breaking_change to false if needed. + breaking_change: true + window: 1 # Can be [1, 2, or 3] - The window when the breaking change will be deployed on GitLab.com + # The stage and GitLab username of the person reporting the change, + # and a link to the deprecation issue + reporter: rutshah + stage: verify + issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/414963 + # Use the impact calculator https://gitlab-com.gitlab.io/gl-infra/breaking-change-impact-calculator/? + impact: high # Can be one of: [critical, high, medium, low] + scope: instance, group, project # Can be one or a combination of: [instance, group, project] + resolution_role: Owner # Can be one of: [Admin, Owner, Maintainer, Developer] + manual_task: true # Can be true or false. Use this to denote whether a resolution action must be performed manually (true), or if it can be automated by using the API or other automation (false). + body: | # (required) Don't change this line. + The Pipelines API cancel endpoint [`POST /projects/:id/pipelines/:pipeline_id/cancel`](https://docs.gitlab.com/ee/api/pipelines.html#cancel-a-pipelines-jobs) + returns a `200` success response regardless of whether a pipeline can be canceled. + Starting in GitLab 18.0, the endpoint will return a `422 Unprocessable Entity` error when a pipeline cannot be canceled. + Update your API integration to handle the `422` status code when making pipeline cancellation requests. + +# ============================== +# OPTIONAL END-OF-SUPPORT FIELDS +# ============================== +# +# If an End of Support period applies: +# 1) Share this announcement in the `#spt_managers` Support channel in Slack +# 2) Mention `@gitlab-com/support` in this merge request. +# + # When support for this feature ends, in XX.YY milestone format. + end_of_support_milestone: + # Array of tiers the feature is currently available to, + # like [Free, Silver, Gold, Core, Premium, Ultimate] + tiers: + # Links to documentation and thumbnail image + documentation_url: + image_url: + # Use the youtube thumbnail URL with the structure of https://img.youtube.com/vi/UNIQUEID/hqdefault.jpg + video_url: diff --git a/doc/administration/self_hosted_models/supported_llm_serving_platforms.md b/doc/administration/self_hosted_models/supported_llm_serving_platforms.md index 05e0cb36162..b765ed49b6f 100644 --- a/doc/administration/self_hosted_models/supported_llm_serving_platforms.md +++ b/doc/administration/self_hosted_models/supported_llm_serving_platforms.md @@ -25,6 +25,21 @@ There are multiple platforms available to host your self-hosted Large Language M - [vLLM Installation Guide](https://docs.vllm.ai/en/latest/getting_started/installation.html) - [vLLM Supported Models](https://docs.vllm.ai/en/latest/models/supported_models.html) + For information on available options when using vLLM to run a model, see the [vLLM documentation on engine arguments](https://docs.vllm.ai/en/stable/models/engine_args.html). + + For example, to set up and run the Mistral model, run the following command: + + ```shell + HF_TOKEN=HUGGING_FACE_TOKEN python -m vllm.entrypoints.openai.api_server \ + --model mistralai/Mistral-7B-Instruct-v0.3 \ + --served-model-name Mistral-7B-Instruct-v0.3 \ + --tensor-parallel-size 8 \ + --tokenizer_mode mistral \ + --load_format mistral \ + --config_format mistral \ + --tokenizer mistralai/Mistral-7B-Instruct-v0.3 + ``` + ## For cloud-hosted model deployments 1. [AWS Bedrock](https://aws.amazon.com/bedrock/). diff --git a/doc/administration/settings/email.md b/doc/administration/settings/email.md index d4a551a1ac6..2e0cce54ece 100644 --- a/doc/administration/settings/email.md +++ b/doc/administration/settings/email.md @@ -108,14 +108,9 @@ DETAILS: **Offering:** Self-managed > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/355964) in GitLab 15.9 [with a flag](../../administration/feature_flags.md) named `deactivation_email_additional_text`. Disabled by default. -> - [Enabled on self-managed and GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/111882) in GitLab 15.9. +> - [Enabled on self-managed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/111882) in GitLab 15.9. > - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/392761) in GitLab 16.5. Feature flag `deactivation_email_additional_text` removed. -FLAG: -On self-managed GitLab, by default this feature is available. To hide the feature, ask an -administrator to [disable the feature flag](../../administration/feature_flags.md) named -`deactivation_email_additional_text`. - You can add additional text at the bottom of the email that GitLab sends to users when their account is deactivated. This email text is separate from the [custom additional text](#custom-additional-text) setting. diff --git a/doc/api/import.md b/doc/api/import.md index 1b16471d5a0..85223408019 100644 --- a/doc/api/import.md +++ b/doc/api/import.md @@ -42,6 +42,7 @@ POST /import/github | `github_hostname` | string | no | Custom GitHub Enterprise hostname. Do not set for GitHub.com. From GitLab 16.5 to GitLab 17.1, you must include the path `/api/v3`. | | `optional_stages` | object | no | [Additional items to import](../user/project/import/github.md#select-additional-items-to-import). [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/373705) in GitLab 15.5 | | `timeout_strategy` | string | no | Strategy for handling import timeouts. Valid values are `optimistic` (continue to next stage of import) or `pessimistic` (fail immediately). Defaults to `pessimistic`. [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/422979) in GitLab 16.5. | +| `pagination_limit` | integer | no | Number of items retrieved per API request to GitHub. The default value is 100 items per page. For project imports from large repositories, reducing this to a lower number can reduce the risk of GitHub API endpoints returning `500` or `502` errors. However, decreasing the page size will result in longer migration times. | ```shell curl --request POST \ diff --git a/doc/api/pipelines.md b/doc/api/pipelines.md index cda35b8abb1..a1b553b2735 100644 --- a/doc/api/pipelines.md +++ b/doc/api/pipelines.md @@ -470,6 +470,10 @@ Response: POST /projects/:id/pipelines/:pipeline_id/cancel ``` +NOTE: +This endpoint returns a success response `200` regardless of the pipeline's state. +For more information, see [issue 414963](https://gitlab.com/gitlab-org/gitlab/-/issues/414963). + | Attribute | Type | Required | Description | |---------------|----------------|----------|-------------| | `id` | integer/string | Yes | The ID or [URL-encoded path of the project](rest/index.md#namespaced-paths) | diff --git a/doc/api/user_email_addresses.md b/doc/api/user_email_addresses.md index f9a0e94aae9..4236976a93e 100644 --- a/doc/api/user_email_addresses.md +++ b/doc/api/user_email_addresses.md @@ -12,17 +12,14 @@ DETAILS: Use this API to interact with email addresses for user accounts. For more information, see [User account](../user/profile/index.md). -## List your email addresses +## List all email addresses -Get a list of your email addresses. +Lists all email addresses for your user account. Prerequisites: - You must be authenticated. -This endpoint does not return the primary email address, but [issue 25077](https://gitlab.com/gitlab-org/gitlab/-/issues/25077) -proposes to change this behavior. - ```plaintext GET /user/emails ``` @@ -44,20 +41,17 @@ Example response: ] ``` -## List email addresses for a user +## List all email addresses for a user DETAILS: **Tier:** Free, Premium, Ultimate **Offering:** Self-managed, GitLab Dedicated -Get a list of a specified user's emails. +Lists all email addresses for a given user account. Prerequisites: -- You must be an administrator. - -This endpoint does not return the primary email address, but [issue 25077](https://gitlab.com/gitlab-org/gitlab/-/issues/25077) -proposes to change this behavior. +- You must have administrator access to the instance. ```plaintext GET /users/:id/emails @@ -67,11 +61,11 @@ Supported attributes: | Attribute | Type | Required | Description | |:----------|:--------|:---------|:------------| -| `id` | integer | yes | ID of specified user | +| `id` | integer | yes | ID of user account | -## Get a single email address +## Get details on an email address -Get a single email address. +Gets details on a given email address for your user account. ```plaintext GET /user/emails/:email_id @@ -81,7 +75,7 @@ Supported attributes: | Attribute | Type | Required | Description | |:-----------|:--------|:---------|:------------| -| `email_id` | integer | yes | Email ID | +| `email_id` | integer | yes | ID of email address | Example response: @@ -95,7 +89,7 @@ Example response: ## Add an email address -Creates a new email owned by the authenticated user. +Adds an email address for your user account. ```plaintext POST /user/emails @@ -134,11 +128,11 @@ DETAILS: **Tier:** Free, Premium, Ultimate **Offering:** Self-managed, GitLab Dedicated -Create a new email address owned by the specified user. +Adds an email address for a given user account. Prerequisites: -- You must be an administrator. +- You must have administrator access to the instance. ```plaintext POST /users/:id/emails @@ -148,23 +142,20 @@ Supported attributes: | Attribute | Type | Required | Description | |:--------------------|:--------|:---------|:------------| -| `id` | string | yes | ID of specified user | +| `id` | string | yes | ID of user account| | `email` | string | yes | Email address | -| `skip_confirmation` | boolean | no | Skip confirmation and assume email is verified - true or false (default) | +| `skip_confirmation` | boolean | no | Skip confirmation and assume email is verified. Possible values: `true`, `false`. Default value: `false`. | -## Delete one of your email addresses +## Delete an email address -Delete one of your email addresses, other than your primary email address. +Deletes an email address for your user account. You cannot delete a primary email address. + +Any future emails sent to the deleted email address are sent to the primary email address instead. Prerequisites: - You must be authenticated. -If the deleted email address is used for any user emails, those user emails are sent to the primary email address instead. - -Because of [known issue](https://gitlab.com/gitlab-org/gitlab/-/issues/438600), group notifications are still sent to -the deleted email address. - ```plaintext DELETE /user/emails/:email_id ``` @@ -173,7 +164,7 @@ Supported attributes: | Attribute | Type | Required | Description | |:-----------|:--------|:---------|:------------| -| `email_id` | integer | yes | Email ID | +| `email_id` | integer | yes | ID of email address | Returns: @@ -186,13 +177,11 @@ DETAILS: **Tier:** Free, Premium, Ultimate **Offering:** Self-managed, GitLab Dedicated -Delete an email address for a user. +Deletes an email address for a given user account. You cannot delete a primary email address. Prerequisites: -- You must be an administrator. - -Deletes an email address of a specified user. You cannot delete a primary email address. +- You must have administrator access to the instance. ```plaintext DELETE /users/:id/emails/:email_id @@ -202,5 +191,5 @@ Supported attributes: | Attribute | Type | Required | Description | |:-----------|:--------|:---------|:------------| -| `id` | integer | yes | ID of specified user | -| `email_id` | integer | yes | Email ID | +| `id` | integer | yes | ID of user account | +| `email_id` | integer | yes | ID of email address | diff --git a/doc/development/migration_style_guide.md b/doc/development/migration_style_guide.md index 723b60dbe73..b9e143a6bb5 100644 --- a/doc/development/migration_style_guide.md +++ b/doc/development/migration_style_guide.md @@ -189,7 +189,7 @@ part of the migration file. git rebase master # Rollback changes -VERSION= bundle exec rails db:rollback:main +VERSION= bundle exec rails db:migrate:down:main # Checkout db/structure.sql from master git checkout origin/master db/structure.sql diff --git a/doc/editor_extensions/jetbrains_ide/jetbrains_troubleshooting.md b/doc/editor_extensions/jetbrains_ide/jetbrains_troubleshooting.md index 5103ea90c7e..551ca917fa9 100644 --- a/doc/editor_extensions/jetbrains_ide/jetbrains_troubleshooting.md +++ b/doc/editor_extensions/jetbrains_ide/jetbrains_troubleshooting.md @@ -12,6 +12,9 @@ If the steps on this page don't solve your problem, check the in the JetBrains plugin's project. If an issue matches your problem, update the issue. If no issues match your problem, [create a new issue](https://gitlab.com/gitlab-org/editor-extensions/gitlab-jetbrains-plugin/-/issues/new). +For troubleshooting JetBrains IDEs for GitLab Duo Code Suggestions, +see [Troubleshooting Code Suggestions](../../user/project/repository/code_suggestions/troubleshooting.md#jetbrains-ides-troubleshooting). + ## Enable debug mode To enable debug logs in JetBrains: @@ -21,6 +24,17 @@ To enable debug logs in JetBrains: 1. Add this line: `com.gitlab.plugin` 1. Select **OK** or **Save**. +## Use an HTTP proxy + +If you experience [certificate errors](#certificate-errors) or other connection errors, and +use a HTTP proxy to connect to your GitLab instance, you must +[configure the Language Server to use a proxy](../language_server/index.md#configure-the-language-server-to-use-a-proxy) +for the GitLab Language Server. + +You can also [enable proxy authentication](../language_server/index.md#enable-proxy-authentication). + +## Enable GitLab Language Server debug logs + To enable GitLab Language Server debug logs: 1. In your IDE, on the top bar, select your IDE name, then select **Settings**. @@ -36,20 +50,6 @@ The debug logs are available in the `idea.log` log file. To view this file, eith - Go to the directory `/Users//Library/Logs/JetBrains/IntelliJIdea`, replacing `` and `` with the appropriate values. -## Use an HTTP proxy - -If you experience [certificate errors](#certificate-errors) or other connection errors, and -use a HTTP proxy to connect to your GitLab instance, you must -[configure the Language Server to use a proxy](../language_server/index.md#configure-the-language-server-to-use-a-proxy) -for the GitLab Language Server. - -You can also [enable proxy authentication](../language_server/index.md#enable-proxy-authentication). - -## Error: `unable to find valid certification path to requested target` - -The GitLab Duo plugin verifies TLS certificate information before connecting to your GitLab instance. -You can [add a custom SSL certificate](index.md#add-a-custom-certificate-for-code-suggestions). - ## Certificate errors If your machine connects to your GitLab instance through a proxy, you might encounter @@ -97,15 +97,3 @@ To do this: 1. Enable the **Ignore certificate errors** option. 1. Select **Verify setup**. 1. Select **OK** or **Save**. - -## Error: `Failed to check token` - -This error occurs when the provided connection instance URL and authentication token passed through to the -GitLab Language Server process are invalid. To re-enable Code Suggestions: - -1. In your IDE, on the top bar, select your IDE name, then select **Settings**. -1. On the left sidebar, select **Tools > GitLab Duo**. -1. Under **Connection**, select **Verify setup**. -1. Update your **Connection** details as needed. -1. Select **Verify setup**, and confirm that authentication succeeds. -1. Select **OK** or **Save**. diff --git a/doc/editor_extensions/neovim/neovim_troubleshooting.md b/doc/editor_extensions/neovim/neovim_troubleshooting.md index a1ac3d3f4c6..8e262a5d565 100644 --- a/doc/editor_extensions/neovim/neovim_troubleshooting.md +++ b/doc/editor_extensions/neovim/neovim_troubleshooting.md @@ -8,14 +8,17 @@ description: "Connect and use GitLab Duo in Neovim." # Neovim troubleshooting When troubleshooting the GitLab plugin for Neovim, you should confirm if an issue still occurs -in isolation from other Neovim plugins and settings. Run the Neovim [testing steps](#test-your-neovim-configuration), -then the [troubleshooting steps](#troubleshooting-code-suggestions) for GitLab Duo Code Suggestions. +in isolation from other Neovim plugins and settings. First, run the Neovim [testing steps](#test-your-neovim-configuration), +then the [GitLab Duo Code Suggestions troubleshooting steps](../../user/project/repository/code_suggestions/troubleshooting.md). If the steps on this page don't solve your problem, check the [list of open issues](https://gitlab.com/gitlab-org/editor-extensions/gitlab.vim/-/issues/?sort=created_date&state=opened&first_page_size=100) in the Neovim plugin's project. If an issue matches your problem, update the issue. If no issues match your problem, [create a new issue](https://gitlab.com/gitlab-org/editor-extensions/gitlab.vim/-/issues/new). +For troubleshooting the extension for GitLab Duo Code Suggestions, +see [Troubleshooting Code Suggestions](../../user/project/repository/code_suggestions/troubleshooting.md#neovim-troubleshooting). + ## Test your Neovim configuration The maintainers of the Neovim plugin often ask for the results of these checks as part of troubleshooting: @@ -90,29 +93,6 @@ a problem with Code Suggestions: echo ~/.local/state/nvim/lsp.log ``` -## Troubleshooting Code Suggestions - -If code completions fail: - -1. Confirm `omnifunc` is set in Neovim: - - ```lua - :verbose set omnifunc? - ``` - -1. Confirm the Language Server is active by running this command in Neovim: - - ```lua - :lua =vim.lsp.get_active_clients() - ``` - -1. Check the logs for the Language Server in `~/.local/state/nvim/lsp.log`. -1. Inspect the `vim.lsp` log path for errors by running this command in Neovim: - - ```lua - :lua =vim.cmd('view ' .. vim.lsp.get_log_path()) - ``` - ### Error: `GCS:unavailable` This error happens when your local project has not set a remote in `.git/config`. diff --git a/doc/editor_extensions/visual_studio/visual_studio_troubleshooting.md b/doc/editor_extensions/visual_studio/visual_studio_troubleshooting.md index 628e17e203f..03996789b2c 100644 --- a/doc/editor_extensions/visual_studio/visual_studio_troubleshooting.md +++ b/doc/editor_extensions/visual_studio/visual_studio_troubleshooting.md @@ -12,15 +12,8 @@ If the steps on this page don't solve your problem, check the in the Visual Studio plugin's project. If an issue matches your problem, update the issue. If no issues match your problem, [create a new issue](https://gitlab.com/gitlab-org/editor-extensions/gitlab-visual-studio-extension/-/issues/new). -## Code Suggestions not displayed - -1. Check all the steps in [Code Suggestions aren't displayed](../../user/project/repository/code_suggestions/troubleshooting.md#suggestions-not-displayed-in-microsoft-visual-studio) first. -1. Ensure you have properly [configured the extension](index.md#configure-the-extension). -1. Ensure you are working on a [supported language](../../user/project/repository/code_suggestions/supported_extensions.md#supported-languages). -1. If another extension provides similar suggestion or completion features, the extension might not return suggestions. To resolve this: - 1. Disable all other Visual Studio extensions. - 1. Confirm that you now receive Code Suggestions. - 1. Re-enable extensions one at a time, testing for Code Suggestions each time, to find the extension that conflicts. +For troubleshooting the extension for GitLab Duo Code Suggestions, +see [Troubleshooting Code Suggestions](../../user/project/repository/code_suggestions/troubleshooting.md#microsoft-visual-studio-troubleshooting).. ## View more logs diff --git a/doc/editor_extensions/visual_studio_code/troubleshooting.md b/doc/editor_extensions/visual_studio_code/troubleshooting.md index 31764f4d1ec..4c8c5ab0d35 100644 --- a/doc/editor_extensions/visual_studio_code/troubleshooting.md +++ b/doc/editor_extensions/visual_studio_code/troubleshooting.md @@ -13,6 +13,9 @@ If you encounter any issues with the GitLab Workflow extension for VS Code, or h 1. Report bugs or request features in the [`gitlab-vscode-extension` issue queue](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues). +For troubleshooting VS Code for GitLab Duo Code Suggestions, +see [Troubleshooting Code Suggestions for VS Code](../../user/project/repository/code_suggestions/troubleshooting.md#vs-code-troubleshooting). + ## Enable debug logs Both the VS Code Extension and the GitLab Language Server provide logs that can help you troubleshoot. To enable debug logging: @@ -64,64 +67,6 @@ Prerequisites: | `gitlab.certKey`| null | Unsupported. See [epic 6244](https://gitlab.com/groups/gitlab-org/-/epics/6244). If your self-managed GitLab instance requires a custom certificate or key pair, set this option to point to your certificate key file. See `gitlab.cert`. | | `gitlab.ignoreCertificateErrors` | false | Unsupported. See [epic 6244](https://gitlab.com/groups/gitlab-org/-/epics/6244). If you use a self-managed GitLab instance with no SSL certificate, or have certificate issues that prevent you from using the extension, set this option to `true` to ignore certificate errors. | -## Disable Code Suggestions - -Code completion is enabled by default. To disable it: - -1. In VS Code, on the left sidebar, select **Extensions > GitLab Workflow**. -1. Select **Manage** (**{settings}**) **> Extension Settings**. -1. In **GitLab > Duo Code Suggestions**, clear **Enable GitLab Duo Code Suggestions**. - -## Disable streaming of code generation results - -By default, code generation streams AI-generated code. Streaming sends generated code -to your editor incrementally, rather than waiting for the full code snippet to generate. -This allows for a more interactive and responsive experience. - -If you prefer to see code generation results only when they are complete, you can turn off streaming. -Disabling streaming means that code generation requests might be perceived -as taking longer to resolve. To disable streaming: - -1. In VS Code, on the top bar, go to **Code > Settings > Settings**. -1. On the top right corner, select **Open Settings (JSON)** to edit your `settings.json` file: - - ![The icons on the top right corner of VS Code, including 'Open Settings.'](img/open_settings_v17_5.png) -1. In your `settings.json` file, add this line, or set it to `false` it already exists: - - ```json - "gitlab.featureFlags.streamCodeGenerations": false, - ``` - -1. Save your changes. - -## Error: Direct connection fails - -> - Direct connection [introduced](https://gitlab.com/groups/gitlab-org/-/epics/13252) in GitLab 17.2. - -To reduce latency, the Workflow extension tries to send suggestion completion requests directly to GitLab Cloud Connector, -bypassing the GitLab instance. This network connection does not use the proxy and certificate settings of the VS Code extension. - -If your GitLab instance doesn't support direct connections, or your network prevents the extension from connecting to -GitLab Cloud Connector, you might see these warnings in your logs: - -```plaintext -Failed to fetch direct connection details from GitLab instance. -Code suggestion requests will be sent to GitLab instance. -``` - -This error means your instance either doesn't support direct connections, or is misconfigured. -To fix the problem, see the [troubleshooting guide for Code Suggestions](../../user/project/repository/code_suggestions/troubleshooting.md). - -If you see this error, the extension can't connect to GitLab Cloud Connector, and is reverting to use your GitLab instance: - -```plaintext -Direct connection for code suggestions failed. -Code suggestion requests will be sent to your GitLab instance. -``` - -The indirect connection through your GitLab instance is about 100 ms slower, but otherwise works the same. -This issue is often caused by network connection problems, like with your LAN firewall or proxy settings. - ## HTTPS project cloning works but SSH cloning fails This problem happens in VS Code when your SSH URL host or path is different from your HTTPS path. The GitLab Workflow extension uses: diff --git a/doc/update/breaking_windows.md b/doc/update/breaking_windows.md index f0dc54d8cee..f7b3e09cbe1 100644 --- a/doc/update/breaking_windows.md +++ b/doc/update/breaking_windows.md @@ -36,6 +36,7 @@ This window takes place on April 21 - 23, 2025 from 09:00 UTC to 22:00 UTC. | [Replace `add_on_purchase` GraphQL field with `add_on_purchases`](https://gitlab.com/gitlab-org/gitlab/-/issues/476858) | Low | | | | [Replace namespace `add_on_purchase` GraphQL field with `add_on_purchases`](https://gitlab.com/gitlab-org/gitlab/-/issues/489850) | Low | | | | [Public use of Secure container registries is deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/470641) | Low | Secure | Instance | +| [Pipelines API cancel endpoint returns error for non-cancelable pipelines](https://gitlab.com/gitlab-org/gitlab/-/issues/414963) | High | Verify | Instance, group, project | | [Deprecate CI job implementation of Repository X-Ray](https://gitlab.com/gitlab-org/gitlab/-/issues/500146) | Low | Create | Project | | [Pipeline job limits extended to the Commits API](https://gitlab.com/gitlab-org/gitlab/-/issues/436361) | Low | Verify | Project | | [Deprecation of `name` field in `ProjectMonthlyUsageType` GraphQL API](https://gitlab.com/gitlab-org/gitlab/-/issues/381894) | Low | Fulfillment | Project | diff --git a/doc/update/deprecations.md b/doc/update/deprecations.md index e7299103043..a61e08a30cf 100644 --- a/doc/update/deprecations.md +++ b/doc/update/deprecations.md @@ -745,6 +745,25 @@ Instead, use [CI/CD jobs with pipeline trigger tokens](https://docs.gitlab.com/e +
+ +### Pipelines API cancel endpoint returns error for non-cancelable pipelines + +
+ +- Announced in GitLab 17.6 +- Removal in GitLab 18.0 ([breaking change](https://docs.gitlab.com/ee/update/terminology.html#breaking-change)) +- To discuss this change or learn more, see the [deprecation issue](https://gitlab.com/gitlab-org/gitlab/-/issues/414963). + +
+ +The Pipelines API cancel endpoint [`POST /projects/:id/pipelines/:pipeline_id/cancel`](https://docs.gitlab.com/ee/api/pipelines.html#cancel-a-pipelines-jobs) +returns a `200` success response regardless of whether a pipeline can be canceled. +Starting in GitLab 18.0, the endpoint will return a `422 Unprocessable Entity` error when a pipeline cannot be canceled. +Update your API integration to handle the `422` status code when making pipeline cancellation requests. + +
+
### Project page in group settings is deprecated diff --git a/doc/user/compliance/audit_event_types.md b/doc/user/compliance/audit_event_types.md index cc98e3fe3f8..1c77fecc98a 100644 --- a/doc/user/compliance/audit_event_types.md +++ b/doc/user/compliance/audit_event_types.md @@ -307,6 +307,7 @@ Audit event types belong to the following product categories. | Name | Description | Saved to database | Introduced in | Scope | |:------------|:------------|:------------------|:---------|:--------------|:--------------| +| [`ci_runner_created`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/173885) | Triggered when a runner is created | **{check-circle}** Yes | GitLab [17.7](https://gitlab.com/gitlab-org/gitlab/-/issues/503315) | Instance, Group, Project | | [`ci_runner_usage_export`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/139578) | A runner usage report is generated | **{check-circle}** Yes | GitLab [16.8](https://gitlab.com/gitlab-org/gitlab/-/issues/426560) | Instance | | [`ci_runners_bulk_deleted`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/173886) | Triggered when runners are deleted in bulk | **{check-circle}** Yes | GitLab [17.7](https://gitlab.com/gitlab-org/gitlab/-/issues/503315) | User | @@ -481,7 +482,9 @@ Audit event types belong to the following product categories. | Name | Description | Saved to database | Introduced in | Scope | |:------------|:------------|:------------------|:---------|:--------------|:--------------| | [`ci_runner_assigned_to_project`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/81508) | Triggered when a runner is assigned to a project | **{check-circle}** Yes | GitLab [14.9](https://gitlab.com/gitlab-org/gitlab/-/issues/349542) | Project | +| [`ci_runner_registered`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/77109) | Triggered when an instance, group or project runner is registered | **{check-circle}** Yes | GitLab [14.8](https://gitlab.com/gitlab-org/gitlab/-/issues/359958) | Instance, Group, Project | | [`ci_runner_unassigned_from_project`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/81540) | Triggered when a runner is unassigned from a project | **{check-circle}** Yes | GitLab [14.9](https://gitlab.com/gitlab-org/gitlab/-/issues/349542) | Project | +| [`ci_runner_unregistered`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/79754) | Triggered when an instance, group or project runner is unregistered | **{check-circle}** Yes | GitLab [14.9](https://gitlab.com/gitlab-org/gitlab/-/issues/349540) | Instance, Group, Project | | [`set_runner_associated_projects`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/97666) | Associated projects are successfully assigned to a CI/CD runner | **{check-circle}** Yes | GitLab [15.4](https://gitlab.com/gitlab-org/gitlab/-/issues/359958) | Project | ### Secret detection @@ -589,6 +592,7 @@ Audit event types belong to the following product categories. | [`authenticated_with_group_saml`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/28575) | Successfully signing in with SAML authentication | **{check-circle}** Yes | GitLab [12.10](https://gitlab.com/gitlab-org/gitlab/-/issues/35710) | Group | | [`ban_user`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/116103) | A user is banned, unbanned, blocked, or unblocked | **{check-circle}** Yes | GitLab [15.11](https://gitlab.com/gitlab-org/gitlab/-/issues/377620) | User | | [`change_membership_state`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/87924) | A user's membership is updated | **{check-circle}** Yes | GitLab [15.1](https://gitlab.com/gitlab-org/gitlab/-/issues/362200) | Group | +| [`inactive_scim_user_cannot_be_added`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/173879) | A user cannot be added to a group during SAML authentication when their SCIM identity is inactive | **{check-circle}** Yes | GitLab [17.7](https://gitlab.com/gitlab-org/gitlab/-/issues/422582) | Group | | [`password_reset_failed`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/129079) | A password reset fails for a user | **{dotted-circle}** No | GitLab [16.4](https://gitlab.com/gitlab-org/gitlab/-/issues/377762) | User | | [`unban_user`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/116221) | A user is unbanned | **{check-circle}** Yes | GitLab [15.11](https://gitlab.com/gitlab-org/gitlab/-/issues/377620) | User | | [`unblock_user`](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/115727) | A user is banned | **{check-circle}** Yes | GitLab [15.11](https://gitlab.com/gitlab-org/gitlab/-/issues/377620) | User | diff --git a/doc/user/gitlab_duo_chat/troubleshooting.md b/doc/user/gitlab_duo_chat/troubleshooting.md index f1aa393d47b..49a60343a21 100644 --- a/doc/user/gitlab_duo_chat/troubleshooting.md +++ b/doc/user/gitlab_duo_chat/troubleshooting.md @@ -20,6 +20,14 @@ as well as After you enable GitLab Duo Chat, it might take a few minutes for the button to appear. +If this does not work, you can also check the following troubleshooting documentation: + +- [GitLab Duo Code Suggestions](../project/repository/code_suggestions/troubleshooting.md) +- [VS Code](../../editor_extensions/visual_studio_code/troubleshooting.md) +- [Microsoft Visual Studio](../../editor_extensions/visual_studio/visual_studio_troubleshooting.md) +- [JetBrains IDEs](../../editor_extensions/jetbrains_ide/jetbrains_troubleshooting.md) +- [Neovim](../../editor_extensions/neovim/neovim_troubleshooting.md) + ## `Error M2000` You might get an error that states diff --git a/doc/user/group/import/direct_transfer_migrations.md b/doc/user/group/import/direct_transfer_migrations.md index a95070bcffc..b676bb61d61 100644 --- a/doc/user/group/import/direct_transfer_migrations.md +++ b/doc/user/group/import/direct_transfer_migrations.md @@ -62,6 +62,8 @@ GitLab 16.8. - You must have a role in the destination namespace that enables you to [create a subgroup](../../group/subgroups/index.md#create-a-subgroup) in that namespace. +- To import project snippets, ensure snippets are + [enabled in the source project](../../snippets.md#change-default-visibility-of-snippets). - To import items stored in object storage, you must either: - [Configure `proxy_download`](../../../administration/object_storage.md#configure-the-common-parameters). - Ensure that the destination GitLab instance has access to the object storage of the source GitLab instance. diff --git a/doc/user/group/index.md b/doc/user/group/index.md index d4036c8d466..9b757ca9cd0 100644 --- a/doc/user/group/index.md +++ b/doc/user/group/index.md @@ -174,7 +174,6 @@ To create a group: 1. In the **Group URL** text box, enter the path for the group used for the [namespace](../namespace/index.md). 1. Select the [**Visibility level**](../public_access.md) of the group. 1. Optional. To personalize your GitLab experience: - - From the **Role** dropdown list, select your role. - For **Who will be using this group?**, select an option. - From the **What will you use this group for?** dropdown list, select an option. 1. Optional. To invite members to the group, in the **Email 1** text box, enter the email address of the user you want to invite. To invite more users, select **Invite another member** and enter the user's email address. diff --git a/doc/user/profile/index.md b/doc/user/profile/index.md index 9de64ec8599..59569f72139 100644 --- a/doc/user/profile/index.md +++ b/doc/user/profile/index.md @@ -101,7 +101,7 @@ To delete an email address from your account: 1. On the left sidebar, select **Emails**. 1. Select **Delete** (**{remove}**) and confirm you want to **Remove**. -You can also [use the API to delete a secondary email address](../../api/user_email_addresses.md#delete-one-of-your-email-addresses). +You can also [use the API to delete a secondary email address](../../api/user_email_addresses.md#delete-an-email-address). ## Make your user profile page private diff --git a/doc/user/project/deploy_keys/index.md b/doc/user/project/deploy_keys/index.md index 7151e04a184..5ea6fb54e4d 100644 --- a/doc/user/project/deploy_keys/index.md +++ b/doc/user/project/deploy_keys/index.md @@ -57,7 +57,7 @@ If a push that uses a deploy key triggers additional processes, the creator of t Deploy keys are meant to facilitate non-human interaction with GitLab. For example, you can use a deploy key to grant permissions to a script that automatically runs on a server in your organization. -You should create a dedicated account to act as a service account, and create the deploy key with the service account. +You should use [a service account](../../profile/service_accounts.md), and create the deploy key with the service account. If you use another user account to create deploy keys, that user is granted privileges that persist until the deploy key is revoked. In addition: @@ -68,6 +68,7 @@ In addition: - Gains access to the protected branch, as well as to the deploy key itself. - Can push to the protected branch, if the deploy key has read-write permission. This is true even if the branch is protected against changes from all users. +- Deploy keys are invalidated when the user is blocked or removed from the instance. As with all sensitive information, you should ensure only those who need access to the secret can read it. For human interactions, use credentials tied to users such as personal access tokens. @@ -249,3 +250,16 @@ DeployKeysProject.with_write_access.find_each do |deploy_key_mapping| ", User: #{username}, User state: #{user_state}" end ``` + +#### Set the owner of a deploy key + +Deploy keys belong to a specific user and are deactivated when the user is blocked or removed from the instance. +To keep a deploy key working when a user is removed, change its owner to an active user. + +If you have the fingerprint of the deploy key, you can change the user associated with a deploy key with the following commands: + +```shell +k = Key.find_by(fingerprint: '5e:51:92:11:27:90:01:b5:83:c3:87:e3:38:82:47:2e') +k.user_id = User.find_by(username: 'anactiveuser').id +k.save() +``` diff --git a/doc/user/project/import/troubleshooting_github_import.md b/doc/user/project/import/troubleshooting_github_import.md index 0d4af8d2b44..5c1827cdc91 100644 --- a/doc/user/project/import/troubleshooting_github_import.md +++ b/doc/user/project/import/troubleshooting_github_import.md @@ -84,32 +84,6 @@ When importing GitHub projects with a large number of comments, select the **Use [additional item to import](github.md#select-additional-items-to-import) checkbox. This setting makes the import process take longer because it increases the number of network requests required to perform the import. -### Reduce GitHub API request objects per page - -Some GitHub API endpoints might return a `500` or `502` error for project imports from large repositories. -To reduce the chance of these errors, in the group project importing the data, enable the -`github_importer_lower_per_page_limit` feature flag. When enabled, the flag reduces the -page size from `100` to `50`. - -To enable this feature flag: - -1. Start a [Rails console](../../../administration/operations/rails_console.md#starting-a-rails-console-session). -1. Run the following `enable` command: - - ```ruby - group = Group.find_by_full_path('my/group/fullpath') - - # Enable - Feature.enable(:github_importer_lower_per_page_limit, group) - ``` - -To disable the feature flag, run this command: - -```ruby -# Disable -Feature.disable(:github_importer_lower_per_page_limit, group) -``` - ## GitLab instance cannot connect to GitHub Self-managed instances that run GitLab 15.10 or earlier, and are behind proxies, cannot resolve DNS for `github.com` or `api.github.com`. diff --git a/doc/user/project/merge_requests/duo_in_merge_requests.md b/doc/user/project/merge_requests/duo_in_merge_requests.md index a2cbb6fec97..6f22a5e6cb3 100644 --- a/doc/user/project/merge_requests/duo_in_merge_requests.md +++ b/doc/user/project/merge_requests/duo_in_merge_requests.md @@ -105,10 +105,6 @@ DETAILS: > - Feature flag `generate_commit_message_flag` [enabled by default](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/158339) in GitLab 17.2. > - Feature flag `generate_commit_message_flag` [removed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/173262) in GitLab 17.7. -FLAG: -The availability of this feature is controlled by a feature flag. -For more information, see the history. - When preparing to merge your merge request, edit the proposed merge commit message by using GitLab Duo Merge Commit Message Generation. @@ -116,7 +112,7 @@ by using GitLab Duo Merge Commit Message Generation. 1. Select **Code > Merge requests** and find your merge request. 1. Select the **Edit commit message** checkbox on the merge widget. 1. Select **Generate commit message**. -1. Review the commit message provide and choose **Insert** to add it to the commit. +1. Review the commit message provided and choose **Insert** to add it to the commit. **Data usage**: When you use this feature, the following data is sent to the large language model: diff --git a/doc/user/project/merge_requests/reviews/index.md b/doc/user/project/merge_requests/reviews/index.md index 632fa24d4e6..bb01d124fcd 100644 --- a/doc/user/project/merge_requests/reviews/index.md +++ b/doc/user/project/merge_requests/reviews/index.md @@ -95,7 +95,8 @@ In this example, the merge request requires 3 Code Owner approvals, but has none ### Re-request a review After a reviewer completes their [merge request reviews](../../../discussions/index.md), -the author of the merge request can request a new review from the reviewer: +the author of the merge request can request a new review from the reviewer. +To do this, either use the `/request_review @user` quick action in any text field on the merge request, or: 1. On the left sidebar, select **Search or go to** and find your project. 1. Select **Code > Merge requests** and find your merge request. diff --git a/doc/user/project/repository/code_suggestions/index.md b/doc/user/project/repository/code_suggestions/index.md index 281171a4c1d..833f2352a05 100644 --- a/doc/user/project/repository/code_suggestions/index.md +++ b/doc/user/project/repository/code_suggestions/index.md @@ -49,88 +49,11 @@ Before you start using Code Suggestions, decide if you want to use the default G [View a code completion vs. code generation comparison demo](https://www.youtube.com/watch?v=9dsyqMt9yg4). -## Set up Code Suggestions +## Use Code Suggestions Prerequisites: -- You should have the latest version of GitLab. - -To set up Code Suggestions: - -1. Configure GitLab Duo. -1. Check that your preferred language is supported. -1. Configure your editor extension. - -### Configure GitLab Duo - -1. [Create a personal access token](../../../profile/personal_access_tokens.md#create-a-personal-access-token) - with at least the [`ai_features` scope](../../../profile/personal_access_tokens.md#personal-access-token-scopes). -1. [Turn on GitLab Duo](../../../gitlab_duo/turn_on_off.md). -1. Purchase the [GitLab Duo Pro add-on subscription](../../../../subscriptions/subscription-add-ons.md). -1. [Get a Duo Pro seat assigned to you](../../../../subscriptions/subscription-add-ons.md#assign-gitlab-duo-seats), - either individually or [in bulk](../../../../subscriptions/subscription-add-ons.md#assign-and-remove-gitlab-duo-seats-in-bulk). -1. For GitLab self-managed, you must: - - - Fulfill the [prerequisites](../../../gitlab_duo/turn_on_off.md#prerequisites). - - Have GitLab 16.8 or later. - - [Configure proxy settings](../../../../subscriptions/subscription-add-ons.md#configure-network-and-proxy-settings). - -For more information, see how to [Get started with GitLab Duo](../../../get_started/getting_started_gitlab_duo.md). - -### Check language support - -Code Suggestions supports a range of programming languages and development concepts. - -Check that Code Suggestions [supports your preferred language](supported_extensions.md#supported-languages). - -Different IDEs support different languages. - -### Configure editor extension - -NOTE: -You might have already completed this as part of [getting started with GitLab Duo](../../../get_started/getting_started_gitlab_duo.md). - -To use Code Suggestions, if you are not using the [GitLab Web IDE](../../web_ide/index.md), you must -configure one of the following [editor extensions](supported_extensions.md#supported-editor-extensions) -to then use an equivalent IDE: - -- GitLab Workflow for VS Code. -- Visual Studio GitLab Extension. -- GitLab Duo Plugin for JetBrains. -- `gitlab.vim` plugin for Neovim. - -Regardless of the extension you use, you must: - -1. Install the extension in your IDE. -1. Authenticate with GitLab from the IDE. You can use either OAuth or the [personal access token](../../../profile/personal_access_tokens.md#create-a-personal-access-token) you created when configuring GitLab Duo. -1. Configure the extension. - -#### GitLab Workflow for VS Code - -1. [Install the extension](../../../../editor_extensions/visual_studio_code/index.md#install-the-extension). -1. [Authenticate with GitLab](../../../../editor_extensions/visual_studio_code/index.md#authenticate-with-gitlab). -1. [Configure the extension](../../../../editor_extensions/visual_studio_code/index.md#configure-the-extension). - -#### Visual Studio GitLab extension - -1. [Install the extension](../../../../editor_extensions/visual_studio/index.md#install-the-extension). -1. [Authenticate with GitLab](../../../../editor_extensions/visual_studio/index.md#authenticate-with-gitlab). -1. [Configure the extension](../../../../editor_extensions/visual_studio/index.md#configure-the-extension). - -#### GitLab Duo plugin for JetBrains IDEs - -1. [Install the extension](../../../../editor_extensions/jetbrains_ide/index.md#install-the-extension). -1. [Configure the extension](../../../../editor_extensions/jetbrains_ide/index.md#configure-the-extension). -1. [Authenticate with GitLab](../../../../editor_extensions/jetbrains_ide/index.md#authenticate-with-gitlab). - -#### `gitlab.vim` plugin for Neovim - -1. [Install the extension](../../../../editor_extensions/neovim/index.md#install-the-extension). -1. [Authenticate with GitLab](../../../../editor_extensions/neovim/index.md#authenticate-with-gitlab). -1. [Configure the extension](../../../../editor_extensions/neovim/index.md#configure-the-extension). -1. [Enable Omni Completion](../../../../editor_extensions/neovim/index.md#configure-omni-completion). - -## Use Code Suggestions +- You must have [set up Code Suggestions](set_up.md#set-up-code-suggestions). To use Code Suggestions: @@ -195,51 +118,7 @@ For use cases and best practices, follow the [GitLab Duo examples documentation] How you turn off Code Suggestions differs depending on which editor extension and IDE you use. -NOTE: -When turning off Code Suggestions, you cannot turn off code generation and code completion separately. - -### VS Code - -To turn off Code Suggestions in the UI: - -1. In VS Code, go to **Code > Settings > Extensions**. -1. Select **Manage** (**{settings}**) **> Settings**. -1. Clear the **GitLab Duo Code Suggestions** checkbox. - -You can also [set `gitlab.duoCodeSuggestions.enabled` to `false` in the VS Code `settings.json` file](../../../../editor_extensions/visual_studio_code/settings.md#extension-settings). - -### Visual Studio - -To turn Code Suggestions on or off without uninstalling the extension, -[assign a keyboard shortcut to the `GitLab.ToggleCodeSuggestions` custom command](../../../../editor_extensions/visual_studio/index.md#configure-the-extension). - -To disable or uninstall the extension, see the [Microsoft Visual Studio documentation on uninstalling or disabling the extension](https://learn.microsoft.com/en-us/visualstudio/ide/finding-and-using-visual-studio-extensions?view=vs-2022#uninstall-or-disable-an-extension). - -### JetBrains IDEs - -The process to disable GitLab Duo, including Code Suggestions, is the same -regardless of which JetBrains IDE you use. - -1. In your JetBrains IDE, go to settings and select the plugins menu. -1. Under the installed plugins, find the GitLab Duo plugin. -1. Disable the plugin. - -For more information, see the [JetBrains product documentation](https://www.jetbrains.com/help/). - -### Neovim - -1. Go to the [Neovim `defaults.lua` settings file](https://gitlab.com/gitlab-org/editor-extensions/gitlab.vim/-/blob/main/lua/gitlab/config/defaults.lua). -1. Under `code_suggestions`, change the `enabled =` flag to `false`: - - ```lua - code_suggestions = { - ... - enabled = false, - ``` - -### Turn off GitLab Duo - -Alternatively, you can [turn off GitLab Duo](../../../../user/gitlab_duo/turn_on_off.md#turn-off-gitlab-duo-features) (which includes Code Suggestions) completely for a group, project, or instance. +For more information, see [turn off Code Suggestions](set_up.md#turn-off-code-suggestions). ## Open tabs as context diff --git a/doc/user/project/repository/code_suggestions/set_up.md b/doc/user/project/repository/code_suggestions/set_up.md new file mode 100644 index 00000000000..408c8f41fad --- /dev/null +++ b/doc/user/project/repository/code_suggestions/set_up.md @@ -0,0 +1,141 @@ +--- +stage: Create +group: Code Creation +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments +description: "Set up Code Suggestions." +--- + +# Configure Code Suggestions + +Before you can use Code Suggestions, you must set it up. + +## Set up Code Suggestions + +Prerequisites: + +- You should have the latest version of GitLab. + +To set up Code Suggestions: + +1. Configure GitLab Duo. +1. Check that your preferred language is supported. +1. Configure your editor extension. + +### Configure GitLab Duo + +1. [Create a personal access token](../../../profile/personal_access_tokens.md#create-a-personal-access-token) + with at least the [`ai_features` scope](../../../profile/personal_access_tokens.md#personal-access-token-scopes). +1. [Turn on GitLab Duo](../../../gitlab_duo/turn_on_off.md). +1. Purchase the [GitLab Duo Pro add-on subscription](../../../../subscriptions/subscription-add-ons.md). +1. [Get a Duo Pro seat assigned to you](../../../../subscriptions/subscription-add-ons.md#assign-gitlab-duo-seats), + either individually or [in bulk](../../../../subscriptions/subscription-add-ons.md#assign-and-remove-gitlab-duo-seats-in-bulk). +1. For GitLab self-managed, you must: + + - Fulfill the [prerequisites](../../../gitlab_duo/turn_on_off.md#prerequisites). + - Have GitLab 16.8 or later. + - [Configure proxy settings](../../../../subscriptions/subscription-add-ons.md#configure-network-and-proxy-settings). + +For more information, see how to [Get started with GitLab Duo](../../../get_started/getting_started_gitlab_duo.md). + +### Check language support + +Code Suggestions supports a range of programming languages and development concepts. + +Check that Code Suggestions [supports your preferred language](supported_extensions.md#supported-languages). + +Different IDEs support different languages. + +### Configure editor extension + +NOTE: +You might have already completed this as part of [getting started with GitLab Duo](../../../get_started/getting_started_gitlab_duo.md). + +To use Code Suggestions, if you are not using the [GitLab Web IDE](../../web_ide/index.md), you must +configure one of the following [editor extensions](supported_extensions.md#supported-editor-extensions) +to then use an equivalent IDE: + +- GitLab Workflow for VS Code. +- Visual Studio GitLab Extension. +- GitLab Duo Plugin for JetBrains. +- `gitlab.vim` plugin for Neovim. + +Regardless of the extension you use, you must: + +1. Install the extension in your IDE. +1. Authenticate with GitLab from the IDE. You can use either OAuth or the [personal access token](../../../profile/personal_access_tokens.md#create-a-personal-access-token) you created when configuring GitLab Duo. +1. Configure the extension. + +#### GitLab Workflow for VS Code + +1. [Install the extension](../../../../editor_extensions/visual_studio_code/index.md#install-the-extension). +1. [Authenticate with GitLab](../../../../editor_extensions/visual_studio_code/index.md#authenticate-with-gitlab). +1. [Configure the extension](../../../../editor_extensions/visual_studio_code/index.md#configure-the-extension). + +#### Visual Studio GitLab extension + +1. [Install the extension](../../../../editor_extensions/visual_studio/index.md#install-the-extension). +1. [Authenticate with GitLab](../../../../editor_extensions/visual_studio/index.md#authenticate-with-gitlab). +1. [Configure the extension](../../../../editor_extensions/visual_studio/index.md#configure-the-extension). + +#### GitLab Duo plugin for JetBrains IDEs + +1. [Install the extension](../../../../editor_extensions/jetbrains_ide/index.md#install-the-extension). +1. [Configure the extension](../../../../editor_extensions/jetbrains_ide/index.md#configure-the-extension). +1. [Authenticate with GitLab](../../../../editor_extensions/jetbrains_ide/index.md#authenticate-with-gitlab). + +#### `gitlab.vim` plugin for Neovim + +1. [Install the extension](../../../../editor_extensions/neovim/index.md#install-the-extension). +1. [Authenticate with GitLab](../../../../editor_extensions/neovim/index.md#authenticate-with-gitlab). +1. [Configure the extension](../../../../editor_extensions/neovim/index.md#configure-the-extension). +1. [Enable Omni Completion](../../../../editor_extensions/neovim/index.md#configure-omni-completion). + +## Turn off Code Suggestions + +How you turn off Code Suggestions differs depending on which editor extension and IDE you use. + +NOTE: +When turning off Code Suggestions, you cannot turn off code generation and code completion separately. + +### VS Code + +To turn off Code Suggestions in the UI: + +1. In VS Code, go to **Code > Settings > Extensions**. +1. Select **Manage** (**{settings}**) **> Settings**. +1. Clear the **GitLab Duo Code Suggestions** checkbox. + +You can also [set `gitlab.duoCodeSuggestions.enabled` to `false` in the VS Code `settings.json` file](../../../../editor_extensions/visual_studio_code/settings.md#extension-settings). + +### Visual Studio + +To turn Code Suggestions on or off without uninstalling the extension, +[assign a keyboard shortcut to the `GitLab.ToggleCodeSuggestions` custom command](../../../../editor_extensions/visual_studio/index.md#configure-the-extension). + +To disable or uninstall the extension, see the [Microsoft Visual Studio documentation on uninstalling or disabling the extension](https://learn.microsoft.com/en-us/visualstudio/ide/finding-and-using-visual-studio-extensions?view=vs-2022#uninstall-or-disable-an-extension). + +### JetBrains IDEs + +The process to disable GitLab Duo, including Code Suggestions, is the same +regardless of which JetBrains IDE you use. + +1. In your JetBrains IDE, go to settings and select the plugins menu. +1. Under the installed plugins, find the GitLab Duo plugin. +1. Disable the plugin. + +For more information, see the [JetBrains product documentation](https://www.jetbrains.com/help/). + +### Neovim + +1. Go to the [Neovim `defaults.lua` settings file](https://gitlab.com/gitlab-org/editor-extensions/gitlab.vim/-/blob/main/lua/gitlab/config/defaults.lua). +1. Under `code_suggestions`, change the `enabled =` flag to `false`: + + ```lua + code_suggestions = { + ... + enabled = false, + ``` + +### Turn off GitLab Duo + +Alternatively, you can [turn off GitLab Duo](../../../../user/gitlab_duo/turn_on_off.md#turn-off-gitlab-duo-features) (which includes Code Suggestions) completely for a group, project, or instance. diff --git a/doc/user/project/repository/code_suggestions/troubleshooting.md b/doc/user/project/repository/code_suggestions/troubleshooting.md index c174c4f480a..0829858bea6 100644 --- a/doc/user/project/repository/code_suggestions/troubleshooting.md +++ b/doc/user/project/repository/code_suggestions/troubleshooting.md @@ -19,52 +19,19 @@ You can run a [health check](../../../gitlab_duo/turn_on_off.md) to test if your ## Suggestions are not displayed -If suggestions are not displayed, follow these steps: +If suggestions are not displayed, ensure that you: -1. Ensure you have [installed a supported IDE extension](supported_extensions.md#supported-editor-extensions) -1. Ensure your administrator has [assigned you a seat](../../../../subscriptions/subscription-add-ons.md#assign-gitlab-duo-seats). +- Have [configured GitLab Duo correctly](set_up.md#configure-gitlab-duo). +- Are using a [supported language](supported_extensions.md#supported-languages) + and [editor extension](supported_extensions.md#supported-editor-extensions). +- Have [configured your editor extension correctly](set_up.md#configure-editor-extension). -If suggestions are still not displayed, try the following troubleshooting steps. +If suggestions are still not displayed, try the following troubleshooting steps +for the different IDEs: -### Suggestions not displayed in VS Code or GitLab Web IDE - -If you are a self-managed user, ensure that Code Suggestions for the [GitLab Web IDE](../../../project/web_ide/index.md) is enabled. The same settings apply to VS Code as local IDE. - -1. On the left sidebar, select **Extensions > GitLab Workflow**. -1. Select **Settings** (**{settings}**), and then select **Extension Settings**. -1. In **GitLab > Duo Code Suggestions**, select the **GitLab Duo Code Suggestions** - checkbox. - -### View Code Suggestions logs - -If the settings are enabled, but suggestions are still not displayed, try the following steps: - -1. In the GitLab Workflow **Extension Settings**, enable **GitLab: Debug**. -1. On the top menu, select **View > Output** to open the bottom panel, then either: - - In the command palette, select `GitLab: Show Extension Logs`. - - In the bottom panel, on the right, select the dropdown list to filter the logs. Select **GitLab Workflow**. -1. In the GitLab Workflow **Extension Settings**, clear and re-select the **GitLab Duo Code Suggestions** checkbox. - -### Suggestions not displayed in JetBrains IDEs - -1. Ensure you have properly [set up the extension](https://gitlab.com/gitlab-org/editor-extensions/gitlab-intellij-plugin#setup). -1. From the **Tools > GitLab Duo** menu, select **Verify setup**. Make sure the health check passes. -1. Verify that your JetBrains IDE natively supports the language of the file you are - working on. Go to **Settings** > **Languages & Frameworks** to see the full list of - languages and frameworks supported by your JetBrains IDE. - -### Suggestions not displayed in Microsoft Visual Studio - -1. Ensure you have properly [set up the extension](https://gitlab.com/gitlab-org/editor-extensions/gitlab-visual-studio-extension#setup). -1. From the **Tools > Options** menu, find the **GitLab** option. Ensure **Log Level** is set to **Debug**. -1. Open the extension log in **View > Output** and change the dropdown list to **GitLab Extension** as the log filter. -1. Verify that the debug log contains similar output: - -```shell -14:48:21:344 GitlabProposalSource.GetCodeSuggestionAsync -14:48:21:344 LsClient.SendTextDocumentCompletionAsync("GitLab.Extension.Test\TestData.cs", 34, 0) -14:48:21:346 LS(55096): time="2023-07-17T14:48:21-05:00" level=info msg="update context" -``` +- [VS Code or GitLab Web IDE](#suggestions-not-displayed-in-vs-code-or-gitlab-web-ide) +- [JetBrains IDEs](#suggestions-not-displayed-in-jetbrains-ides) +- [Microsoft Visual Studio](#suggestions-not-displayed-in-microsoft-visual-studio) ## Code Suggestions returns a 401 error @@ -84,9 +51,169 @@ If GitLab has access to the [cloud server](../../../ai_features.md), try ## Authentication troubleshooting -If the above steps do not solve your issue, the problem may be related to the recent changes in authentication, +The problem might be driven to the recent changes in authentication, specifically the token system. To resolve the issue: 1. Remove the existing personal access token from your GitLab account settings. -1. Reauthorize your GitLab account in VS Code using OAuth. +1. Reauthorize your GitLab account using OAuth. 1. Test the Code Suggestions feature with different file extensions to verify if the issue is resolved. + +## VS Code troubleshooting + +The following documentation is for Code Suggestions-specific troubleshooting for +VS Code. + +For non-Code Suggestions troubleshooting for VS Code, see [Troubleshooting the GitLab Workflow extension for VS Code](../../../../editor_extensions/visual_studio_code/troubleshooting.md). + +### Suggestions not displayed in VS Code or GitLab Web IDE + +If you are a self-managed user, ensure that Code Suggestions for the [GitLab Web IDE](../../../project/web_ide/index.md) is enabled. The same settings apply to VS Code as local IDE. + +1. On the left sidebar, select **Extensions > GitLab Workflow**. +1. Select **Settings** (**{settings}**), and then select **Extension Settings**. +1. In **GitLab > Duo Code Suggestions**, select the **GitLab Duo Code Suggestions** + checkbox. + +#### View Code Suggestions logs + +If Code Suggestions are enabled for the IDE, but suggestions are still not displayed: + +1. In your IDE, in the GitLab Workflow **Extension Settings**, enable **GitLab: Debug**. +1. On the top menu, select **View > Output** to open the bottom panel, then either: + - In the command palette, select `GitLab: Show Extension Logs`. + - In the bottom panel, on the right, select the dropdown list to filter the logs. Select **GitLab Workflow**. +1. In the GitLab Workflow **Extension Settings**, clear and re-select the **GitLab Duo Code Suggestions** checkbox. + +### Disable streaming of code generation results + +By default, code generation streams AI-generated code. Streaming sends generated code +to your editor incrementally, rather than waiting for the full code snippet to generate. +This allows for a more interactive and responsive experience. + +If you prefer to see code generation results only when they are complete, you can turn off streaming. +Disabling streaming means that code generation requests might be perceived +as taking longer to resolve. To disable streaming: + +1. In VS Code, on the top bar, go to **Code > Settings > Settings**. +1. On the top right corner, select **Open Settings (JSON)** to edit your `settings.json` file: + + ![The icons on the top right corner of VS Code, including 'Open Settings.'](../../../../editor_extensions/visual_studio_code/img/open_settings_v17_5.png) +1. In your `settings.json` file, add this line, or set it to `false` it already exists: + + ```json + "gitlab.featureFlags.streamCodeGenerations": false, + ``` + +1. Save your changes. + +### Error: Direct connection fails + +> - Direct connection [introduced](https://gitlab.com/groups/gitlab-org/-/epics/13252) in GitLab 17.2. + +To reduce latency, the Workflow extension tries to send suggestion completion requests directly to GitLab Cloud Connector, +bypassing the GitLab instance. This network connection does not use the proxy and certificate settings of the VS Code extension. + +If your GitLab instance doesn't support direct connections, or your network prevents the extension from connecting to +GitLab Cloud Connector, you might see these warnings in your logs: + +```plaintext +Failed to fetch direct connection details from GitLab instance. +Code suggestion requests will be sent to GitLab instance. +``` + +This error means your instance either doesn't support direct connections, or is misconfigured. + +If you see this error, the extension can't connect to GitLab Cloud Connector, and is reverting to use your GitLab instance: + +```plaintext +Direct connection for code suggestions failed. +Code suggestion requests will be sent to your GitLab instance. +``` + +The indirect connection through your GitLab instance is about 100 ms slower, but otherwise works the same. +This issue is often caused by network connection problems, like with your LAN firewall or proxy settings. + +## JetBrains IDEs troubleshooting + +The following documentation is for Code Suggestions-specific troubleshooting for +JetBrains IDEs. + +For non-Code Suggestions troubleshooting for JetBrains IDEs, see [JetBrains troubleshooting](../../../../editor_extensions/jetbrains_ide/jetbrains_troubleshooting.md). + +### Suggestions not displayed in JetBrains IDEs + +1. From the **Tools > GitLab Duo** menu, select **Verify setup**. Make sure the health check passes. +1. Verify that your JetBrains IDE natively supports the language of the file you are + working on. Go to **Settings** > **Languages & Frameworks** to see the full list of + languages and frameworks supported by your JetBrains IDE. + +### Error: `unable to find valid certification path to requested target` + +The GitLab Duo plugin verifies TLS certificate information before connecting to your GitLab instance. +You can [add a custom SSL certificate](../../../../editor_extensions/jetbrains_ide/index.md#add-a-custom-certificate-for-code-suggestions). + +### Error: `Failed to check token` + +This error occurs when the provided connection instance URL and authentication token passed through to the +GitLab Language Server process are invalid. To re-enable Code Suggestions: + +1. In your IDE, on the top bar, select your IDE name, then select **Settings**. +1. On the left sidebar, select **Tools > GitLab Duo**. +1. Under **Connection**, select **Verify setup**. +1. Update your **Connection** details as needed. +1. Select **Verify setup**, and confirm that authentication succeeds. +1. Select **OK** or **Save**. + +## Microsoft Visual Studio troubleshooting + +The following documentation is for Code Suggestions-specific troubleshooting for +Microsoft Visual Studio. + +For non-Code Suggestions troubleshooting for Microsoft Visual Studio, see [Visual Studio troubleshooting](../../../../editor_extensions/visual_studio/visual_studio_troubleshooting.md). + +### Suggestions not displayed in Microsoft Visual Studio + +1. Ensure you have properly [set up the extension](https://gitlab.com/gitlab-org/editor-extensions/gitlab-visual-studio-extension#setup). +1. From the **Tools > Options** menu, find the **GitLab** option. Ensure **Log Level** is set to **Debug**. +1. Open the extension log in **View > Output** and change the dropdown list to **GitLab Extension** as the log filter. +1. Verify that the debug log contains similar output: + +```shell +14:48:21:344 GitlabProposalSource.GetCodeSuggestionAsync +14:48:21:344 LsClient.SendTextDocumentCompletionAsync("GitLab.Extension.Test\TestData.cs", 34, 0) +14:48:21:346 LS(55096): time="2023-07-17T14:48:21-05:00" level=info msg="update context" +``` + +If another extension provides similar suggestion or completion features, the extension might not return suggestions. To resolve this: + +1. Disable all other Visual Studio extensions. +1. Confirm that you now receive Code Suggestions. +1. Re-enable extensions one at a time, testing for Code Suggestions each time, to find the extension that conflicts. + +## Neovim troubleshooting + +The following documentation is for Code Suggestions-specific troubleshooting for +Neovim. + +For non-Code Suggestions troubleshooting for Neovim, see [Neovim troubleshooting](../../../../editor_extensions/neovim/neovim_troubleshooting.md). + +### Code completions fails + +1. Confirm `omnifunc` is set in Neovim: + + ```lua + :verbose set omnifunc? + ``` + +1. Confirm the Language Server is active by running this command in Neovim: + + ```lua + :lua =vim.lsp.get_active_clients() + ``` + +1. Check the logs for the Language Server in `~/.local/state/nvim/lsp.log`. +1. Inspect the `vim.lsp` log path for errors by running this command in Neovim: + + ```lua + :lua =vim.cmd('view ' .. vim.lsp.get_log_path()) + ``` diff --git a/lib/api/helpers/import_github_helpers.rb b/lib/api/helpers/import_github_helpers.rb index 19567e04d87..ae303bd4da0 100644 --- a/lib/api/helpers/import_github_helpers.rb +++ b/lib/api/helpers/import_github_helpers.rb @@ -4,7 +4,8 @@ module API module Helpers module ImportGithubHelpers def client - @client ||= Gitlab::GithubImport::Client.new(params[:personal_access_token], host: params[:github_hostname]) + @client ||= Gitlab::GithubImport::Client.new(params[:personal_access_token], host: params[:github_hostname], + per_page: params[:pagination_limit]) end def access_params diff --git a/lib/api/import_github.rb b/lib/api/import_github.rb index 15a67ee1a8d..be96d8191b4 100644 --- a/lib/api/import_github.rb +++ b/lib/api/import_github.rb @@ -35,6 +35,7 @@ module API optional :optional_stages, type: Hash, desc: 'Optional stages of import to be performed' optional :timeout_strategy, type: String, values: ::ProjectImportData::TIMEOUT_STRATEGIES, desc: 'Strategy for behavior on timeouts' + optional :pagination_limit, type: Integer, desc: 'Pagination limit', values: ->(v) { v > 0 && v <= 100 } end post 'import/github' do result = Import::GithubService.new(client, current_user, params).execute(access_params, provider) diff --git a/lib/banzai/reference_redactor.rb b/lib/banzai/reference_redactor.rb index b08a0da6893..0c031ace977 100644 --- a/lib/banzai/reference_redactor.rb +++ b/lib/banzai/reference_redactor.rb @@ -67,9 +67,6 @@ module Banzai original_content = node.attr('data-original') original_content = CGI.escape_html(original_content) if original_content - # Redact gollum wiki links completely - redacted_content = _('[redacted]') if node.attr('data-reference-type') == 'wiki_page' - # Build the raw tag just with a link as href and content if # it's originally a link pattern. We shouldn't return a plain text href. original_link = @@ -81,7 +78,7 @@ module Banzai # The reference should be replaced by the original link's content, # which is not always the same as the rendered one. - redacted_content || original_link || original_content || node.inner_html + original_link || original_content || node.inner_html end def redact_cross_project_references(documents) diff --git a/lib/gitlab/audit/ci_runner_token_author.rb b/lib/gitlab/audit/ci_runner_token_author.rb index 2ace983688e..5fc3fce38c3 100644 --- a/lib/gitlab/audit/ci_runner_token_author.rb +++ b/lib/gitlab/audit/ci_runner_token_author.rb @@ -3,24 +3,29 @@ module Gitlab module Audit class CiRunnerTokenAuthor < Gitlab::Audit::NullAuthor + attr_reader :entity_type, :entity_path + # Represents a CI Runner token (registration or authentication) # - # @param [AuditEvent] audit_event event representing a runner registration/un-registration operation - def initialize(audit_event) - if audit_event.details.include?(:runner_authentication_token) - token = audit_event.details[:runner_authentication_token] - name = "Authentication token: #{token}" - elsif audit_event.details.include?(:runner_registration_token) - token = audit_event.details[:runner_registration_token] - name = "Registration token: #{token}" - else - name = "Token not available" - end + # @param ["gitlab_instance", "Group", "Project"] entity_type type of the scope that the token applies to + # @param [String] entity_path full path to the scope that the token applies to + # @param [String] runner_authentication_token authentication token used in a runner registration/un-registration + # operation + # @param [String] runner_registration_token authentication token used in a runner registration operation + def initialize(entity_type:, entity_path:, runner_authentication_token: nil, runner_registration_token: nil) + name = + if runner_authentication_token.present? + "Authentication token: #{runner_authentication_token}" + elsif runner_registration_token.present? + "Registration token: #{runner_registration_token}" + else + "Token not available" + end super(id: -1, name: name) - @entity_type = audit_event.entity_type - @entity_path = audit_event.entity_path + @entity_type = entity_type + @entity_path = entity_path end def full_path @@ -28,7 +33,7 @@ module Gitlab case @entity_type when 'Group' - url_helpers.group_settings_ci_cd_path(@entity_path, anchor: 'js-runners-settings') + url_helpers.group_runners(@entity_path) when 'Project' project = Project.find_by_full_path(@entity_path) url_helpers.project_settings_ci_cd_path(project, anchor: 'js-runners-settings') if project diff --git a/lib/gitlab/audit/null_author.rb b/lib/gitlab/audit/null_author.rb index cb0dfe45aef..c70c91bc103 100644 --- a/lib/gitlab/audit/null_author.rb +++ b/lib/gitlab/audit/null_author.rb @@ -19,7 +19,10 @@ module Gitlab name = audit_event[:author_name] || audit_event.details[:author_name] if audit_event.target_type == ::Ci::Runner.name - Gitlab::Audit::CiRunnerTokenAuthor.new(audit_event) + Gitlab::Audit::CiRunnerTokenAuthor.new( + entity_type: audit_event.entity_type, entity_path: audit_event.entity_path, + **audit_event.details.slice(:runner_authentication_token, :runner_registration_token) + ) elsif id == -1 Gitlab::Audit::UnauthenticatedAuthor.new(name: name) elsif id == -2 diff --git a/lib/gitlab/fogbugz_import/xml_adapter.rb b/lib/gitlab/fogbugz_import/xml_adapter.rb index 4bcc4aa175b..4a0f2c2bc5b 100644 --- a/lib/gitlab/fogbugz_import/xml_adapter.rb +++ b/lib/gitlab/fogbugz_import/xml_adapter.rb @@ -8,11 +8,8 @@ module Gitlab module Conversions module Document def to_hash - objects = object_count(root) - - if objects > XmlAdapter::MAX_ALLOWED_OBJECTS - raise XmlAdapter::ResponseTooLargeError, - "XML exceeds permitted complexity: #{objects}/#{XmlAdapter::MAX_ALLOWED_OBJECTS} objects" + if ActiveSupport::XmlMini.backend == Gitlab::FogbugzImport::NokogiriBackendWithLimits + check_object_count!(root) end super @@ -20,6 +17,14 @@ module Gitlab private + def check_object_count!(document) + objects = object_count(document) + return if objects <= XmlAdapter::MAX_ALLOWED_OBJECTS + + raise XmlAdapter::ResponseTooLargeError, + "XML exceeds permitted complexity: #{objects}/#{XmlAdapter::MAX_ALLOWED_OBJECTS} objects" + end + def object_count(object) return 0 if object.text? || object.cdata? return 1 unless object.children.any? diff --git a/lib/gitlab/github_import.rb b/lib/gitlab/github_import.rb index 31fe2461e86..82674af12c9 100644 --- a/lib/gitlab/github_import.rb +++ b/lib/gitlab/github_import.rb @@ -8,10 +8,12 @@ module Gitlab def self.new_client_for(project, token: nil, host: nil, parallel: true) token_to_use = token || project.import_data&.credentials&.fetch(:user) + pagination_limit = project.import_data&.data&.dig('pagination_limit') || Gitlab::GithubImport::Client::DEFAULT_PER_PAGE + Client.new( token_to_use, host: host.presence || self.formatted_import_url(project), - per_page: self.per_page(project), + per_page: pagination_limit, parallel: parallel ) end @@ -34,13 +36,5 @@ module Gitlab url.to_s end end - - def self.per_page(project) - if project.group.present? && Feature.enabled?(:github_importer_lower_per_page_limit, project.group, type: :ops) - Gitlab::GithubImport::Client::LOWER_PER_PAGE - else - Gitlab::GithubImport::Client::DEFAULT_PER_PAGE - end - end end end diff --git a/lib/gitlab/github_import/client.rb b/lib/gitlab/github_import/client.rb index 431f67d0314..fee5094c095 100644 --- a/lib/gitlab/github_import/client.rb +++ b/lib/gitlab/github_import/client.rb @@ -21,7 +21,6 @@ module Gitlab SEARCH_MAX_REQUESTS_PER_MINUTE = 30 DEFAULT_PER_PAGE = 100 - LOWER_PER_PAGE = 50 CLIENT_CONNECTION_ERROR = ::Faraday::ConnectionFailed # used/set in sawyer agent which octokit uses # A single page of data and the corresponding page number. diff --git a/lib/gitlab/github_import/settings.rb b/lib/gitlab/github_import/settings.rb index 96433176d5f..77a264fed27 100644 --- a/lib/gitlab/github_import/settings.rb +++ b/lib/gitlab/github_import/settings.rb @@ -54,7 +54,8 @@ module Gitlab data: { optional_stages: optional_stages, timeout_strategy: user_settings[:timeout_strategy], - user_contribution_mapping_enabled: user_contribution_mapping_enabled? + user_contribution_mapping_enabled: user_contribution_mapping_enabled?, + pagination_limit: user_settings[:pagination_limit] }, credentials: project.import_data&.credentials ) diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 905f402a3a0..a1db8dad256 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -57088,9 +57088,6 @@ msgstr "" msgid "This stage has one or more manual jobs that require confirmation before retrying. Do you want to proceed?" msgstr "" -msgid "This subscription is for" -msgstr "" - msgid "This suggestion already matches its content." msgstr "" @@ -60847,33 +60844,6 @@ msgstr "" msgid "UsersSelect|Unassigned" msgstr "" -msgid "User|Data Analyst" -msgstr "" - -msgid "User|Development Team Lead" -msgstr "" - -msgid "User|Devops Engineer" -msgstr "" - -msgid "User|Other" -msgstr "" - -msgid "User|Product Designer" -msgstr "" - -msgid "User|Product Manager" -msgstr "" - -msgid "User|Security Analyst" -msgstr "" - -msgid "User|Software Developer" -msgstr "" - -msgid "User|Systems Administrator" -msgstr "" - msgid "Uses GitLab as an alternative to Sentry." msgstr "" @@ -65072,9 +65042,6 @@ msgstr "" msgid "[Supports GitLab-flavored markdown, including quick actions]" msgstr "" -msgid "[redacted]" -msgstr "" - msgid "`.campfirenow.com` subdomain when you're signed in." msgstr "" diff --git a/qa/qa/scenario/test/instance/blocking.rb b/qa/qa/scenario/test/instance/blocking.rb deleted file mode 100644 index 7f73f4cdfa3..00000000000 --- a/qa/qa/scenario/test/instance/blocking.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -module QA - module Scenario - module Test - module Instance - class Blocking < All - tags :smoke, :blocking, *Specs::Runner::DEFAULT_SKIPPED_TAGS.map { |tag| :"~#{tag}" } - end - end - end - end -end diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/trigger_child_pipeline_with_manual_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/trigger_child_pipeline_with_manual_spec.rb index 17c63fb8de4..26d7ef55ded 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/pipeline/trigger_child_pipeline_with_manual_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/trigger_child_pipeline_with_manual_spec.rb @@ -18,7 +18,13 @@ module QA runner.remove_via_api! end - it 'can trigger bridge job', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/348086' do + it 'can trigger bridge job', + quarantine: { + only: { job: 'gdk-instance' }, + issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/461957', + type: :test_environment + }, + testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/348086' do Page::Project::Pipeline::Show.perform do |parent_pipeline| expect(parent_pipeline).not_to have_child_pipeline diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/nuget/nuget_group_level_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/nuget/nuget_group_level_spec.rb index 95440afe149..698edc1b108 100644 --- a/qa/qa/specs/features/browser_ui/5_package/package_registry/nuget/nuget_group_level_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/nuget/nuget_group_level_spec.rb @@ -3,7 +3,7 @@ module QA RSpec.describe 'Package', :object_storage, product_group: :package_registry, quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/455304', - only: { condition: -> { ENV['QA_RUN_TYPE']&.match?('gdk-qa-blocking') } }, + only: { condition: -> { ENV['QA_RUN_TYPE']&.match?('gdk-instance') } }, type: :investigating } do describe 'NuGet group level endpoint', :external_api_calls do diff --git a/qa/qa/specs/features/browser_ui/5_package/package_registry/nuget/nuget_project_level_spec.rb b/qa/qa/specs/features/browser_ui/5_package/package_registry/nuget/nuget_project_level_spec.rb index 509fed231e1..02879be497a 100644 --- a/qa/qa/specs/features/browser_ui/5_package/package_registry/nuget/nuget_project_level_spec.rb +++ b/qa/qa/specs/features/browser_ui/5_package/package_registry/nuget/nuget_project_level_spec.rb @@ -3,7 +3,7 @@ module QA RSpec.describe 'Package', :object_storage, product_group: :package_registry, quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/455027', - only: { condition: -> { ENV['QA_RUN_TYPE']&.match?('gdk-qa-blocking') } }, + only: { condition: -> { ENV['QA_RUN_TYPE']&.match?('gdk-instance') } }, type: :investigating } do describe 'NuGet project level endpoint', :external_api_calls do diff --git a/scripts/frontend/quarantined_vue3_specs.txt b/scripts/frontend/quarantined_vue3_specs.txt index 23d8f6a0c7d..0b8268acd69 100644 --- a/scripts/frontend/quarantined_vue3_specs.txt +++ b/scripts/frontend/quarantined_vue3_specs.txt @@ -102,7 +102,6 @@ ee/spec/frontend/status_checks/mount_spec.js ee/spec/frontend/tracing/details/tracing_details_spec.js ee/spec/frontend/tracing/details/tracing_span_chart_spec.js ee/spec/frontend/usage_quotas/code_suggestions/components/add_on_eligible_user_list_spec.js -ee/spec/frontend/usage_quotas/code_suggestions/components/health_check_list_spec.js ee/spec/frontend/users/identity_verification/components/international_phone_input_spec.js ee/spec/frontend/users/identity_verification/components/verify_phone_verification_code_spec.js ee/spec/frontend/vue_merge_request_widget/components/mr_widget_pipeline_container_spec.js diff --git a/scripts/verify-tff-mapping b/scripts/verify-tff-mapping index 561cea8f7f8..ad80f476e03 100755 --- a/scripts/verify-tff-mapping +++ b/scripts/verify-tff-mapping @@ -588,6 +588,7 @@ tests = [ ee/spec/features/gitlab_subscriptions/trials/creation_with_one_existing_namespace_flow_spec.rb ee/spec/requests/gitlab_subscriptions/trials_controller_spec.rb ee/spec/features/gitlab_subscriptions/trials/access_denied_spec.rb + ee/spec/features/trials/lead_creation_form_validation_spec.rb ] }, diff --git a/spec/controllers/groups/settings/applications_controller_spec.rb b/spec/controllers/groups/settings/applications_controller_spec.rb index 99acc26a0c8..b9da077cdd8 100644 --- a/spec/controllers/groups/settings/applications_controller_spec.rb +++ b/spec/controllers/groups/settings/applications_controller_spec.rb @@ -2,11 +2,12 @@ require 'spec_helper' -RSpec.describe Groups::Settings::ApplicationsController do +RSpec.describe Groups::Settings::ApplicationsController, feature_category: :system_access do let_it_be(:user) { create(:user) } let_it_be(:admin) { create(:user, :admin) } let_it_be(:group) { create(:group) } let_it_be(:application) { create(:oauth_application, owner_id: group.id, owner_type: 'Namespace') } + let(:pagination_limit) { 20 } before do sign_in(user) @@ -25,6 +26,35 @@ RSpec.describe Groups::Settings::ApplicationsController do expect(assigns[:scopes]).to be_kind_of(Doorkeeper::OAuth::Scopes) end + context 'when it renders all group applications' do + before do + 21.times do + create(:oauth_application, owner_id: group.id, owner_type: 'Namespace') + end + end + + render_views + + it 'returns the maximum paginated limit per page', :aggregate_failures do + get :index, params: { group_id: group } + + expect(assigns(:applications).count).to eq(pagination_limit) + expect(assigns(:applications).has_next_page?).to be_truthy + expect(response.body).to have_css('.gl-pagination-item[rel=next]') + expect(response).to have_gitlab_http_status(:ok) + end + + it 'returns the second page with the remaining applications', :aggregate_failures do + get :index, params: { group_id: group } + get :index, params: { group_id: group, cursor: assigns(:applications).cursor_for_next_page } + + expect(assigns(:applications).count).to eq(2) # extra 1 from let_it_be(:application) + expect(assigns(:applications).has_next_page?).to be_falsey + expect(response.body).to have_css('.gl-pagination-item[rel=prev]') + expect(response).to have_gitlab_http_status(:ok) + end + end + context 'when admin mode is enabled' do let(:user) { admin } diff --git a/spec/controllers/groups_controller_spec.rb b/spec/controllers/groups_controller_spec.rb index f29887d2f0d..5fa418a5282 100644 --- a/spec/controllers/groups_controller_spec.rb +++ b/spec/controllers/groups_controller_spec.rb @@ -505,16 +505,6 @@ RSpec.describe GroupsController, :with_current_organization, factory_default: :k end end - context 'when creating a group with the `role` attribute present' do - it 'changes the users role' do - sign_in(user) - - expect do - post :create, params: { group: { name: 'new_group', path: 'new_group' }, user: { role: 'devops_engineer' } } - end.to change { user.reload.role }.to('devops_engineer') - end - end - context 'when creating a group with the `setup_for_company` attribute present' do before do sign_in(user) diff --git a/spec/lib/banzai/reference_redactor_spec.rb b/spec/lib/banzai/reference_redactor_spec.rb index b9e44efe41f..2b09745a75a 100644 --- a/spec/lib/banzai/reference_redactor_spec.rb +++ b/spec/lib/banzai/reference_redactor_spec.rb @@ -105,14 +105,14 @@ RSpec.describe Banzai::ReferenceRedactor, feature_category: :markdown do end context 'when reference is a gollum wiki page link that is not visible to user' do - it 'redacts the wiki page title and href' do + it 'replaces redacted reference with original content' do doc = Nokogiri::HTML.fragment('foo') expect(redactor).to receive(:nodes_visible_to_user).and_return([]) redactor.redact([doc]) - expect(doc.to_html).to eq('[redacted]') + expect(doc.to_html).to eq('foo') end end end diff --git a/spec/lib/gitlab/audit/ci_runner_token_author_spec.rb b/spec/lib/gitlab/audit/ci_runner_token_author_spec.rb index 6718760e920..c347e529acc 100644 --- a/spec/lib/gitlab/audit/ci_runner_token_author_spec.rb +++ b/spec/lib/gitlab/audit/ci_runner_token_author_spec.rb @@ -2,12 +2,13 @@ require 'spec_helper' -RSpec.describe Gitlab::Audit::CiRunnerTokenAuthor do - describe '.initialize' do - subject { described_class.new(audit_event) } +RSpec.describe Gitlab::Audit::CiRunnerTokenAuthor, feature_category: :runner do + let(:token_args) { details.slice(:runner_authentication_token, :runner_registration_token) } - let(:details) {} - let(:audit_event) { instance_double(AuditEvent, details: details, entity_type: 'Project', entity_path: 'd/e') } + describe '.initialize' do + subject do + described_class.new(entity_type: 'Project', entity_path: 'd/e', **token_args) + end context 'with runner_authentication_token' do let(:details) do @@ -41,12 +42,18 @@ RSpec.describe Gitlab::Audit::CiRunnerTokenAuthor do end describe '#full_path' do - subject { author.full_path } + let_it_be(:group) { create(:group) } + let_it_be(:project) { create(:project, group: group) } - let(:author) { described_class.new(audit_event) } + let(:details) { { runner_authentication_token: 'grlt-abc1234567' } } # gitleaks:allow + let(:author) { described_class.new(entity_type: entity_type, entity_path: entity_path, **token_args) } + + subject(:full_path) { author.full_path } context 'with instance registration token' do - let(:audit_event) { instance_double(AuditEvent, details: { runner_registration_token: 'abc1234567' }, entity_type: 'User', entity_path: nil) } + let(:details) { { runner_registration_token: 'abc1234567' } } + let(:entity_type) { 'Gitlab::Audit::InstanceScope' } + let(:entity_path) { 'gitlab_instance' } it 'returns correct url' do is_expected.to eq('/admin/runners') @@ -54,29 +61,26 @@ RSpec.describe Gitlab::Audit::CiRunnerTokenAuthor do end context 'with group registration token' do - let(:audit_event) { instance_double(AuditEvent, details: { runner_registration_token: 'abc1234567' }, entity_type: 'Group', entity_path: 'a/b') } + let(:entity_type) { 'Group' } + let(:entity_path) { group.full_path } it 'returns correct url' do - expect(::Gitlab::Routing.url_helpers).to receive(:group_settings_ci_cd_path) - .once - .with('a/b', { anchor: 'js-runners-settings' }) - .and_return('/path/to/group/runners') + expect(::Gitlab::Routing.url_helpers).to receive(:group_runners).with(entity_path).and_return('runners path') - is_expected.to eq('/path/to/group/runners') + is_expected.to eq('runners path') end end context 'with project registration token' do - let(:audit_event) { instance_double(AuditEvent, details: { runner_registration_token: 'abc1234567' }, entity_type: 'Project', entity_path: project.full_path) } - let(:project) { create(:project) } + let(:entity_type) { 'Project' } + let(:entity_path) { project.full_path } it 'returns correct url' do expect(::Gitlab::Routing.url_helpers).to receive(:project_settings_ci_cd_path) - .once .with(project, { anchor: 'js-runners-settings' }) - .and_return('/path/to/project/runners') + .and_return('runners path') - is_expected.to eq('/path/to/project/runners') + is_expected.to eq('runners path') end end end diff --git a/spec/lib/gitlab/fogbugz_import/xml_adapter_spec.rb b/spec/lib/gitlab/fogbugz_import/xml_adapter_spec.rb index 6838ddf33ab..5e0ff0df92e 100644 --- a/spec/lib/gitlab/fogbugz_import/xml_adapter_spec.rb +++ b/spec/lib/gitlab/fogbugz_import/xml_adapter_spec.rb @@ -12,13 +12,13 @@ RSpec.describe Gitlab::FogbugzImport::XmlAdapter, feature_category: :importers d context 'when parsing an XML response' do let(:xml) do <<~XML - - - - 1234 - Sample Bug - - + + + + 1234 + Sample Bug + + XML end @@ -28,10 +28,10 @@ RSpec.describe Gitlab::FogbugzImport::XmlAdapter, feature_category: :importers d context 'when given an HTML response' do let(:xml) do <<~HTML - - Object moved -

Object moved to here.

- + + Object moved +

Object moved to here.

+ HTML end @@ -62,5 +62,15 @@ RSpec.describe Gitlab::FogbugzImport::XmlAdapter, feature_category: :importers d it 'raises a ResponseTooLargeError' do expect { parsed_xml }.to raise_error(described_class::ResponseTooLargeError, /XML exceeds permitted complexity/) end + + context 'when using the standard Nokogiri adapter' do + it 'does not raise' do + expect do + ActiveSupport::XmlMini.with_backend('Nokogiri') do + Hash.from_xml(xml)['response'] + end + end.not_to raise_error + end + end end end diff --git a/spec/lib/gitlab/github_import/settings_spec.rb b/spec/lib/gitlab/github_import/settings_spec.rb index 70c0a192811..ac3ce5d15f6 100644 --- a/spec/lib/gitlab/github_import/settings_spec.rb +++ b/spec/lib/gitlab/github_import/settings_spec.rb @@ -23,6 +23,7 @@ RSpec.describe Gitlab::GithubImport::Settings, feature_category: :importers do collaborators_import: false, foo: :bar }, + pagination_limit: 50, timeout_strategy: "optimistic" }.stringify_keys end @@ -58,7 +59,7 @@ RSpec.describe Gitlab::GithubImport::Settings, feature_category: :importers do end describe '#write' do - it 'puts optional steps, timeout strategy, and user mapping setting into projects import_data' do + it 'puts optional steps, timeout strategy, user mapping setting and pagination_limit into projects import_data' do project.build_or_assign_import_data(credentials: { user: 'token' }) settings.write(data_input) @@ -69,6 +70,8 @@ RSpec.describe Gitlab::GithubImport::Settings, feature_category: :importers do .to eq("optimistic") expect(project.import_data.data['user_contribution_mapping_enabled']) .to be true + expect(project.import_data.data['pagination_limit']) + .to eq(50) end end diff --git a/spec/lib/gitlab/github_import_spec.rb b/spec/lib/gitlab/github_import_spec.rb index 6bbf0637744..b6e0860a97a 100644 --- a/spec/lib/gitlab/github_import_spec.rb +++ b/spec/lib/gitlab/github_import_spec.rb @@ -3,14 +3,14 @@ require 'spec_helper' RSpec.describe Gitlab::GithubImport, feature_category: :importers do - before do - stub_feature_flags(github_importer_lower_per_page_limit: false) - end - context 'github.com' do let(:project) { double(:project, import_url: 'http://t0ken@github.com/user/repo.git', id: 1, group: nil) } it 'returns a new Client with a custom token' do + import_data = double(:import_data) + allow(project).to receive(:import_data).and_return(import_data) + allow(import_data).to receive(:data).and_return({}) + expect(described_class::Client) .to receive(:new) .with('ghp_123', host: nil, parallel: true, per_page: 100) @@ -20,6 +20,8 @@ RSpec.describe Gitlab::GithubImport, feature_category: :importers do it 'returns a new Client with a token stored in the import data' do import_data = double(:import_data, credentials: { user: '123' }) + allow(project).to receive(:import_data).and_return(import_data) + allow(import_data).to receive(:data).and_return({}) expect(project) .to receive(:import_data) @@ -46,12 +48,28 @@ RSpec.describe Gitlab::GithubImport, feature_category: :importers do described_class.ghost_user_id end end + + it 'returns a new client with the pagination_limit stored in the import data' do + import_data = double(:import_data, credentials: { user: '123' }) + allow(project).to receive(:import_data).and_return(import_data) + allow(import_data).to receive(:data).and_return({ 'pagination_limit' => 50 }) + + expect(described_class::Client) + .to receive(:new) + .with('123', host: nil, parallel: true, per_page: 50) + + described_class.new_client_for(project) + end end context 'GitHub Enterprise' do let(:project) { double(:project, import_url: 'http://t0ken@github.another-domain.com/repo-org/repo.git', group: nil) } it 'returns a new Client with a custom token' do + import_data = double(:import_data) + allow(project).to receive(:import_data).and_return(import_data) + allow(import_data).to receive(:data).and_return({}) + expect(described_class::Client) .to receive(:new) .with('ghp_123', host: 'http://github.another-domain.com/api/v3', parallel: true, per_page: 100) @@ -61,6 +79,8 @@ RSpec.describe Gitlab::GithubImport, feature_category: :importers do it 'returns a new Client with a token stored in the import data' do import_data = double(:import_data, credentials: { user: '123' }) + allow(project).to receive(:import_data).and_return(import_data) + allow(import_data).to receive(:data).and_return({}) expect(project) .to receive(:import_data) @@ -92,37 +112,4 @@ RSpec.describe Gitlab::GithubImport, feature_category: :importers do expect(described_class.formatted_import_url(project)).to eq('http://github.another-domain.com/api/v3') end end - - describe '.per_page' do - context 'when project group is present' do - context 'when github_importer_lower_per_page_limit is enabled' do - it 'returns lower per page value' do - project = create(:project, import_url: 'http://t0ken@github.com/user/repo.git') - group = create(:group, projects: [project]) - - stub_feature_flags(github_importer_lower_per_page_limit: group) - - expect(described_class.per_page(project)).to eq(Gitlab::GithubImport::Client::LOWER_PER_PAGE) - end - end - - context 'when github_importer_lower_per_page_limit is disabled' do - it 'returns default per page value' do - project = double(:project, import_url: 'http://t0ken@github.com/user/repo.git', id: 1, group: create(:group)) - - stub_feature_flags(github_importer_lower_per_page_limit: false) - - expect(described_class.per_page(project)).to eq(Gitlab::GithubImport::Client::DEFAULT_PER_PAGE) - end - end - end - - context 'when project group is missing' do - it 'returns default per page value' do - project = double(:project, import_url: 'http://t0ken@github.com/user/repo.git', id: 1, group: nil) - - expect(described_class.per_page(project)).to eq(Gitlab::GithubImport::Client::DEFAULT_PER_PAGE) - end - end - end end diff --git a/spec/models/audit_event_spec.rb b/spec/models/audit_event_spec.rb index 7167e21165c..9e0d2507c26 100644 --- a/spec/models/audit_event_spec.rb +++ b/spec/models/audit_event_spec.rb @@ -110,34 +110,38 @@ RSpec.describe AuditEvent do end describe '#author' do - subject { audit_event.author } + subject(:author) { audit_event.author } context "when the target type is not Ci::Runner" do let(:audit_event) { build(:project_audit_event, target_id: 678) } it 'returns a NullAuthor' do - expect(::Gitlab::Audit::NullAuthor).to receive(:for) - .and_call_original - .once + expect(::Gitlab::Audit::NullAuthor).to receive(:for).and_call_original is_expected.to be_a_kind_of(::Gitlab::Audit::NullAuthor) end end context 'when the target type is Ci::Runner and details contain runner_registration_token' do - let(:audit_event) { build(:project_audit_event, target_type: ::Ci::Runner.name, target_id: 678, details: { runner_registration_token: 'abc123' }) } + let_it_be(:project) { create(:project) } + let(:audit_event) do + build(:project_audit_event, target_project: project, target_type: ::Ci::Runner.name, target_id: 678, + details: { runner_registration_token: 'abc123' }) + end it 'returns a CiRunnerTokenAuthor' do expect(::Gitlab::Audit::CiRunnerTokenAuthor).to receive(:new) - .with(audit_event) - .and_call_original - .once + .with( + entity_type: project.class.name, + entity_path: project.full_path, + runner_registration_token: 'abc123') + .and_call_original is_expected.to be_an_instance_of(::Gitlab::Audit::CiRunnerTokenAuthor) end it 'name consists of prefix and token' do - expect(subject.name).to eq('Registration token: abc123') + expect(author.name).to eq('Registration token: abc123') end end end diff --git a/spec/models/ci/bridge_spec.rb b/spec/models/ci/bridge_spec.rb index 1c7fe633214..cff97ac9318 100644 --- a/spec/models/ci/bridge_spec.rb +++ b/spec/models/ci/bridge_spec.rb @@ -275,6 +275,37 @@ RSpec.describe Ci::Bridge, feature_category: :continuous_integration do end end end + + Ci::HasStatus::COMPLETED_STATUSES.each do |bridge_starting_status| + context "when initial bridge status is a completed status #{bridge_starting_status}" do + before do + bridge.status = bridge_starting_status + create(:ci_sources_pipeline, pipeline: downstream_pipeline, source_job: bridge) + end + + using RSpec::Parameterized::TableSyntax + where(:downstream_status, :expected_bridge_status) do + [ + %w[success success], + %w[failed failed], + %w[skipped failed] + ] + end + + with_them do + it 'inherits the downstream status' do + perform_transition = -> { subject } + if bridge.status == expected_bridge_status + expect { perform_transition.call }.not_to change { bridge.status } + else + expect { perform_transition.call }.to change { bridge.status } + .from(bridge_starting_status) + .to(expected_bridge_status) + end + end + end + end + end end describe '#dependent?' do diff --git a/spec/requests/api/graphql/mutations/ci/runner/create_spec.rb b/spec/requests/api/graphql/mutations/ci/runner/create_spec.rb index 844be90851d..5a7a719eb9b 100644 --- a/spec/requests/api/graphql/mutations/ci/runner/create_spec.rb +++ b/spec/requests/api/graphql/mutations/ci/runner/create_spec.rb @@ -25,13 +25,9 @@ RSpec.describe 'RunnerCreate', feature_category: :runner do end let(:mutation) do - variables = { - **mutation_params - } - graphql_mutation( :runner_create, - variables, + mutation_params, <<-QL runner { ephemeralAuthenticationToken diff --git a/spec/services/ci/pipeline_bridge_status_service_spec.rb b/spec/services/ci/pipeline_bridge_status_service_spec.rb index f6163b9e0ee..f2c25f41458 100644 --- a/spec/services/ci/pipeline_bridge_status_service_spec.rb +++ b/spec/services/ci/pipeline_bridge_status_service_spec.rb @@ -23,26 +23,6 @@ RSpec.describe Ci::PipelineBridgeStatusService, feature_category: :continuous_in subject end - - context 'when bridge job status raises state machine errors' do - before do - pipeline.drop! - bridge.drop! - end - - it 'tracks the exception' do - expect(Gitlab::ErrorTracking) - .to receive(:track_exception) - .with( - instance_of(Ci::Bridge::InvalidTransitionError), - bridge_id: bridge.id, - downstream_pipeline_id: pipeline.id) do |error| - expect(error.backtrace).to be_present - end - - subject - end - end end end end diff --git a/spec/services/import/github_service_spec.rb b/spec/services/import/github_service_spec.rb index 0260b48d092..a5c15bbaee6 100644 --- a/spec/services/import/github_service_spec.rb +++ b/spec/services/import/github_service_spec.rb @@ -11,13 +11,15 @@ RSpec.describe Import::GithubService, feature_category: :importers do let(:user_namespace_path) { user.namespace_path } let(:optional_stages) { nil } let(:timeout_strategy) { "optimistic" } + let(:pagination_limit) { nil } let(:params) do { repo_id: 123, new_name: 'new_repo', target_namespace: user_namespace_path, optional_stages: optional_stages, - timeout_strategy: timeout_strategy + timeout_strategy: timeout_strategy, + pagination_limit: pagination_limit } end @@ -34,7 +36,8 @@ RSpec.describe Import::GithubService, feature_category: :importers do .to receive(:write) .with( optional_stages: optional_stages, - timeout_strategy: timeout_strategy + timeout_strategy: timeout_strategy, + pagination_limit: pagination_limit ) end diff --git a/spec/support/helpers/user_with_namespace_shim.yml b/spec/support/helpers/user_with_namespace_shim.yml index 8d50dc78996..64133ec1a99 100644 --- a/spec/support/helpers/user_with_namespace_shim.yml +++ b/spec/support/helpers/user_with_namespace_shim.yml @@ -1,5 +1,4 @@ --- -- ee/spec/components/namespaces/storage/user_pre_enforcement_alert_component_spec.rb - ee/spec/controllers/admin/users_controller_spec.rb - ee/spec/controllers/autocomplete_controller_spec.rb - ee/spec/controllers/ee/profiles/preferences_controller_spec.rb diff --git a/spec/support/rspec_order_todo.yml b/spec/support/rspec_order_todo.yml index ee848362f0e..efb6719ce6a 100644 --- a/spec/support/rspec_order_todo.yml +++ b/spec/support/rspec_order_todo.yml @@ -1864,7 +1864,6 @@ - './ee/spec/services/audit_event_service_spec.rb' - './ee/spec/services/audit_events/export_csv_service_spec.rb' - './ee/spec/services/audit_events/protected_branch_audit_event_service_spec.rb' -- './ee/spec/services/audit_events/register_runner_audit_event_service_spec.rb' - './ee/spec/services/audit_events/release_artifacts_downloaded_audit_event_service_spec.rb' - './ee/spec/services/audit_events/release_associate_milestone_audit_event_service_spec.rb' - './ee/spec/services/audit_events/release_created_audit_event_service_spec.rb' @@ -1874,7 +1873,6 @@ - './ee/spec/services/audit_events/streaming/headers/create_service_spec.rb' - './ee/spec/services/audit_events/streaming/headers/destroy_service_spec.rb' - './ee/spec/services/audit_events/streaming/headers/update_service_spec.rb' -- './ee/spec/services/audit_events/unregister_runner_audit_event_service_spec.rb' - './ee/spec/services/audit_events/user_impersonation_group_audit_event_service_spec.rb' - './ee/spec/services/auto_merge/add_to_merge_train_when_pipeline_succeeds_service_spec.rb' - './ee/spec/services/auto_merge/merge_train_service_spec.rb' diff --git a/spec/views/groups/new.html.haml_spec.rb b/spec/views/groups/new.html.haml_spec.rb index 0bbc4c1d717..5c7378e8dc7 100644 --- a/spec/views/groups/new.html.haml_spec.rb +++ b/spec/views/groups/new.html.haml_spec.rb @@ -36,11 +36,4 @@ RSpec.describe 'groups/new.html.haml' do expect(rendered).to have_field('Public') end end - - describe 'role field' do - it 'does have a default selection' do - expect(rendered).to have_content('Role') - expect(rendered).to have_select('Role', selected: 'Software Developer') - end - end end diff --git a/tests.yml b/tests.yml index 57dbd2b02f9..960d5e31768 100644 --- a/tests.yml +++ b/tests.yml @@ -316,6 +316,7 @@ mapping: test: - 'ee/spec/features/gitlab_subscriptions/trials/creation_*_spec.rb' - ee/spec/features/gitlab_subscriptions/trials/access_denied_spec.rb + - ee/spec/features/trials/lead_creation_form_validation_spec.rb # duo pro trials - source: 'ee/app/controllers/gitlab_subscriptions/trials/duo_pro_controller\.rb'