diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-19 15:10:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-19 15:10:14 +0300 |
commit | 9320083e480a8a1f2584af4e3d9a4538ab14cf1e (patch) | |
tree | 2a0017492eee05a58beb990a979a9eecca9b09dc | |
parent | dec42ba662f39f8acc2fba6a48a1d10cf3832bd1 (diff) |
Add latest changes from gitlab-org/gitlab@master
41 files changed, 445 insertions, 296 deletions
diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index 436d5acf1ef..5d63e07ea39 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -d47724f6e9e18fd7c7c73ec68d89ed874c841502 +e46faa9b41cefbad8dddc2d716ff75a691018ce6 @@ -62,7 +62,7 @@ gem 'omniauth-azure-activedirectory-v2', '~> 2.0' gem 'omniauth-azure-oauth2', '~> 0.0.9', path: 'vendor/gems/omniauth-azure-oauth2' # See gem README.md gem 'omniauth-cas3', '~> 1.1.4', path: 'vendor/gems/omniauth-cas3' # See vendor/gems/omniauth-cas3/README.md gem 'omniauth-dingtalk-oauth2', '~> 1.0' -gem 'omniauth-alicloud', '~> 2.0.0' +gem 'omniauth-alicloud', '~> 2.0.1' gem 'omniauth-facebook', '~> 4.0.0' gem 'omniauth-github', '2.0.1' gem 'omniauth-gitlab', '~> 4.0.0', path: 'vendor/gems/omniauth-gitlab' # See vendor/gems/omniauth-gitlab/README.md diff --git a/Gemfile.checksum b/Gemfile.checksum index e79f87cdad1..c75e1530c47 100644 --- a/Gemfile.checksum +++ b/Gemfile.checksum @@ -385,7 +385,7 @@ {"name":"oj","version":"3.13.23","platform":"ruby","checksum":"206dfdc4020ad9974705037f269cfba211d61b7662a58c717cce771829ccef51"}, {"name":"oj-introspect","version":"0.7.1","platform":"ruby","checksum":"ea584e78495a62d5356aece7242bb55455d623ad3deb3cd778e623dd19e050c0"}, {"name":"omniauth","version":"2.1.0","platform":"ruby","checksum":"bff7234f5ec9323622b217c7f26d52f850de0b0e2b8c807c3358fc79fe572300"}, -{"name":"omniauth-alicloud","version":"2.0.0","platform":"ruby","checksum":"8ecf369d51cd5317c1e7c6b80276891f76cff210a534ec654326af5c62265de3"}, +{"name":"omniauth-alicloud","version":"2.0.1","platform":"ruby","checksum":"b14c425bca02b4d0f73e710ceb62c0f1f8533e0c427c1c495d2b40f87b3f48d3"}, {"name":"omniauth-atlassian-oauth2","version":"0.2.0","platform":"ruby","checksum":"eb07574a188ab8a03376ce288bce86bc2dd4a1382ffa5781cb5e2b7bc15d76c9"}, {"name":"omniauth-auth0","version":"2.0.0","platform":"ruby","checksum":"823769be7883b45b2fa94367c2f6a17f7b3b1333986016089c016d45827da545"}, {"name":"omniauth-authentiq","version":"0.3.3","platform":"ruby","checksum":"11b3791085a130782bf14b0088653beeb085638a9548d7110a57d3cbbb54fb4c"}, diff --git a/Gemfile.lock b/Gemfile.lock index bccbd860e5e..3b65e2b4061 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -979,7 +979,7 @@ GEM hashie (>= 3.4.6) rack (>= 2.2.3) rack-protection - omniauth-alicloud (2.0.0) + omniauth-alicloud (2.0.1) omniauth-oauth2 (~> 1.8) omniauth-atlassian-oauth2 (0.2.0) omniauth (>= 1.1.1) @@ -1747,7 +1747,7 @@ DEPENDENCIES oj (~> 3.13.21) oj-introspect (~> 0.7) omniauth (~> 2.1.0) - omniauth-alicloud (~> 2.0.0) + omniauth-alicloud (~> 2.0.1) omniauth-atlassian-oauth2 (~> 0.2.0) omniauth-auth0 (~> 2.0.0) omniauth-authentiq (~> 0.3.3) diff --git a/app/assets/javascripts/issuable/issuable_form.js b/app/assets/javascripts/issuable/issuable_form.js index 99a3f76ca76..8a094d5d688 100644 --- a/app/assets/javascripts/issuable/issuable_form.js +++ b/app/assets/javascripts/issuable/issuable_form.js @@ -60,8 +60,6 @@ export default class IssuableForm { return; } this.form = form; - this.toggleWip = this.toggleWip.bind(this); - this.renderWipExplanation = this.renderWipExplanation.bind(this); this.resetAutosave = this.resetAutosave.bind(this); this.handleSubmit = this.handleSubmit.bind(this); // prettier-ignore @@ -86,6 +84,7 @@ export default class IssuableForm { this.fallbackKey = getFallbackKey(); this.titleField = this.form.find('input[name*="[title]"]'); this.descriptionField = this.form.find('textarea[name*="[description]"]'); + this.draftCheck = document.querySelector('input.js-toggle-draft'); if (!(this.titleField.length && this.descriptionField.length)) { return; } @@ -93,8 +92,7 @@ export default class IssuableForm { this.autosaves = this.initAutosave(); this.form.on('submit', this.handleSubmit); this.form.on('click', '.btn-cancel, .js-reset-autosave', this.resetAutosave); - this.form.find('.js-unwrap-on-load').unwrap(); - this.initWip(); + this.initDraft(); const $issuableDueDate = $('#issuable-due-date'); @@ -160,48 +158,34 @@ export default class IssuableForm { }); } - initWip() { - this.$wipExplanation = this.form.find('.js-wip-explanation'); - this.$noWipExplanation = this.form.find('.js-no-wip-explanation'); - if (!(this.$wipExplanation.length && this.$noWipExplanation.length)) { - return undefined; + initDraft() { + if (this.draftCheck) { + this.draftCheck.addEventListener('click', () => this.writeDraftStatus()); + this.titleField.on('keyup blur', () => this.readDraftStatus()); + + this.readDraftStatus(); } - this.form.on('click', '.js-toggle-wip', this.toggleWip); - this.titleField.on('keyup blur', this.renderWipExplanation); - return this.renderWipExplanation(); } - workInProgress() { + isMarkedDraft() { return this.draftRegex.test(this.titleField.val()); } - - renderWipExplanation() { - if (this.workInProgress()) { - // These strings are not "translatable" (the code is hard-coded to look for them) - this.$wipExplanation.find('code')[0].textContent = - 'Draft'; /* eslint-disable-line @gitlab/require-i18n-strings */ - this.$wipExplanation.show(); - return this.$noWipExplanation.hide(); - } - this.$wipExplanation.hide(); - return this.$noWipExplanation.show(); + readDraftStatus() { + this.draftCheck.checked = this.isMarkedDraft(); } - - toggleWip(event) { - event.preventDefault(); - if (this.workInProgress()) { - this.removeWip(); + writeDraftStatus() { + if (this.draftCheck.checked) { + this.addDraft(); } else { - this.addWip(); + this.removeDraft(); } - return this.renderWipExplanation(); } - removeWip() { + removeDraft() { return this.titleField.val(this.titleField.val().replace(this.draftRegex, '')); } - addWip() { + addDraft() { this.titleField.val(`Draft: ${this.titleField.val()}`); } } diff --git a/app/controllers/concerns/issuable_collections_action.rb b/app/controllers/concerns/issuable_collections_action.rb index b8249345a54..13298b9065d 100644 --- a/app/controllers/concerns/issuable_collections_action.rb +++ b/app/controllers/concerns/issuable_collections_action.rb @@ -2,6 +2,7 @@ module IssuableCollectionsAction extend ActiveSupport::Concern + include GracefulTimeoutHandling include IssuableCollections include IssuesCalendar @@ -33,6 +34,10 @@ module IssuableCollectionsAction @merge_requests = issuables_collection.page(params[:page]) @issuable_meta_data = Gitlab::IssuableMetadata.new(current_user, @merge_requests).data + rescue ActiveRecord::QueryCanceled => exception # rubocop:disable Database/RescueQueryCanceled + log_exception(exception) + + @search_timeout_occurred = true end # rubocop:enable Gitlab/ModuleWithInstanceVariables diff --git a/app/controllers/explore/groups_controller.rb b/app/controllers/explore/groups_controller.rb index ac355b861b3..545fac1433b 100644 --- a/app/controllers/explore/groups_controller.rb +++ b/app/controllers/explore/groups_controller.rb @@ -7,8 +7,6 @@ class Explore::GroupsController < Explore::ApplicationController urgency :low def index - user = Feature.enabled?(:generic_explore_groups, current_user, type: :experiment) ? nil : current_user - - render_group_tree GroupsFinder.new(user).execute + render_group_tree GroupsFinder.new(nil).execute end end diff --git a/app/views/dashboard/merge_requests.html.haml b/app/views/dashboard/merge_requests.html.haml index c921375edd1..97fb35b28ab 100644 --- a/app/views/dashboard/merge_requests.html.haml +++ b/app/views/dashboard/merge_requests.html.haml @@ -19,5 +19,7 @@ - if current_user && @no_filters_set = render 'shared/dashboard/no_filter_selected' +- elsif @search_timeout_occurred + = render 'shared/dashboard/search_timeout_occurred' - else = render 'shared/merge_requests' diff --git a/app/views/shared/dashboard/_search_timeout_occurred.html.haml b/app/views/shared/dashboard/_search_timeout_occurred.html.haml new file mode 100644 index 00000000000..4b6331ee986 --- /dev/null +++ b/app/views/shared/dashboard/_search_timeout_occurred.html.haml @@ -0,0 +1,8 @@ +.row.empty-state.text-center + .col-12 + .svg-130.gl-mt-3 + = image_tag 'illustrations/issue-dashboard_results-without-filter.svg' + .col-12 + .text-content + %h4 + = _("Too many results to display. Edit your search or add a filter.") diff --git a/app/views/shared/issuable/form/_title.html.haml b/app/views/shared/issuable/form/_title.html.haml index 0f6ef33d532..4d31baee25b 100644 --- a/app/views/shared/issuable/form/_title.html.haml +++ b/app/views/shared/issuable/form/_title.html.haml @@ -1,27 +1,18 @@ - issuable = local_assigns.fetch(:issuable) -- has_wip_commits = local_assigns.fetch(:has_wip_commits) - form = local_assigns.fetch(:form) - no_issuable_templates = issuable_templates(ref_project, issuable.to_ability_name).empty? -- toggle_wip_link_start = '<a href="" class="js-toggle-wip">' -- toggle_wip_link_end = '</a>' -- add_wip_text = (_('%{link_start}Start the title with %{draft_snippet}%{link_end} to prevent a merge request draft from merging before it\'s ready.') % { link_start: toggle_wip_link_start, link_end: toggle_wip_link_end, draft_snippet: '<code>Draft:</code>'.html_safe }).html_safe -- remove_wip_text = (_('%{link_start}Remove the %{draft_snippet} prefix%{link_end} from the title to allow this merge request to be merged when it\'s ready.') % { link_start: toggle_wip_link_start, link_end: toggle_wip_link_end, draft_snippet: '<code>Draft</code>'.html_safe }).html_safe %div{ data: { testid: 'issue-title-input-field' } } = form.text_field :title, required: true, aria: { required: true }, maxlength: 255, autofocus: true, autocomplete: 'off', class: 'form-control pad', dir: 'auto', data: { qa_selector: 'issuable_form_title_field' } - if issuable.respond_to?(:draft?) - .form-text.text-muted - .js-wip-explanation{ style: "display: none;" } - = remove_wip_text - .js-no-wip-explanation - - if has_wip_commits - = _('It looks like you have some draft commits in this branch.') - %br - .invisible - .js-unwrap-on-load - = add_wip_text + .gl-pt-3 + = render Pajamas::CheckboxTagComponent.new(name: 'mark_as_draft', checkbox_options: { class: 'js-toggle-draft' }) do |c| + = c.label do + = s_('MergeRequests|Mark as draft') + = c.help_text do + = s_('MergeRequests|Drafts cannot be merged until marked ready.') - if no_issuable_templates && can?(current_user, :push_code, issuable.project) = render 'shared/issuable/form/default_templates' diff --git a/config/feature_flags/experiment/generic_explore_groups.yml b/config/feature_flags/experiment/generic_explore_groups.yml deleted file mode 100644 index d928dcd4189..00000000000 --- a/config/feature_flags/experiment/generic_explore_groups.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: generic_explore_groups -introduced_by_url: "https://gitlab.com/gitlab-org/gitlab/-/merge_requests/103019" -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/381564 -milestone: '15.6' -type: experiment -group: group::source code -default_enabled: true diff --git a/data/deprecations/15-8-deprecate-slack-notifications-integration.yml b/data/deprecations/15-8-deprecate-slack-notifications-integration.yml new file mode 100644 index 00000000000..644b12b3405 --- /dev/null +++ b/data/deprecations/15-8-deprecate-slack-notifications-integration.yml @@ -0,0 +1,29 @@ +- title: "Slack Notifications integration" # (required) Clearly explain the change, or planned change. For example, "The `confidential` field for a `Note` is deprecated" or "CI/CD job names will be limited to 250 characters." + announcement_milestone: "15.8" # (required) The milestone when this feature was first announced as deprecated. + removal_milestone: "16.0" # (required) The milestone when this feature is planned to be removed + breaking_change: true # (required) Change to false if this is not a breaking change. + reporter: g.hickman # (required) GitLab username of the person reporting the change + stage: manage # (required) String value of the stage that the feature was created in. e.g., Growth + issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/372411 # (required) Link to the deprecation issue in GitLab + body: | # (required) Do not modify this line, instead modify the lines below. + As we're consolidating all Slack capabilities into the + GitLab for Slack app, we're [deprecating the Slack Notifications + integration](https://gitlab.com/gitlab-org/gitlab/-/issues/372411). + GitLab.com users can now use the GitLab for Slack app to manage notifications + to their Slack workspace. For self-managed users of the Slack Notifications integration, + we'll be introducing support in [this epic](https://gitlab.com/groups/gitlab-org/-/epics/1211). + +# +# OPTIONAL END OF SUPPORT FIELDS +# +# If an End of Support period applies, the announcement should be shared with GitLab Support +# in the `#spt_managers` channel in Slack, and mention `@gitlab-com/support` in this MR. +# + end_of_support_milestone: "16.0" # (optional) Use "XX.YY" format. The milestone when support for this feature will end. + # + # OTHER OPTIONAL FIELDS + # + tiers: [Free, Silver, Gold] # (optional - may be required in the future) An array of tiers that the feature is available in currently. e.g., [Free, Silver, Gold, Core, Premium, Ultimate] + documentation_url: https://docs.gitlab.com/ee/user/project/integrations/slack.html # (optional) This is a link to the current documentation page + image_url: # (optional) This is a link to a thumbnail image depicting the feature + video_url: # (optional) Use the youtube thumbnail URL with the structure of https://img.youtube.com/vi/UNIQUEID/hqdefault.jpg diff --git a/data/deprecations/15-8-deprecate-system-hook-test-endpoint.yml b/data/deprecations/15-8-deprecate-system-hook-test-endpoint.yml new file mode 100644 index 00000000000..afde85f03d9 --- /dev/null +++ b/data/deprecations/15-8-deprecate-system-hook-test-endpoint.yml @@ -0,0 +1,24 @@ +- title: "Test system hook endpoint" # (required) Clearly explain the change, or planned change. For example, "The `confidential` field for a `Note` is deprecated" or "The maximum number of characters in a job name will be limited to 250." + announcement_milestone: "15.8" # (required) The milestone when this feature was first announced as deprecated. + removal_milestone: "16.0" # (required) The milestone when this feature is planned to be removed + breaking_change: true # (required) If this deprecation is a breaking change, set this value to true + reporter: arturoherrero # (required) GitLab username of the person reporting the deprecation + stage: Manage # (required) String value of the stage that the feature was created in. e.g., Growth + issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/381572 # (required) Link to the deprecation issue in GitLab + body: | # (required) Do not modify this line, instead modify the lines below. + The [test system hook](https://docs.gitlab.com/ee/api/system_hooks.html#test-system-hook) endpoint returns dummy data. + This endpoint is now deprecated and will be removed from the GitLab codebase. +# +# OPTIONAL END OF SUPPORT FIELDS +# +# If an End of Support period applies, the announcement should be shared with GitLab Support +# in the `#spt_managers` channel in Slack, and mention `@gitlab-com/support` in this MR. +# + end_of_support_milestone: "16.0" # (optional) Use "XX.YY" format. The milestone when support for this feature will end. + # + # OTHER OPTIONAL FIELDS + # + tiers: [Core, Premium, Ultimate] # (optional - may be required in the future) An array of tiers that the feature is available in currently. e.g., [Free, Silver, Gold, Core, Premium, Ultimate] + documentation_url: https://docs.gitlab.com/ee/api/system_hooks.html#test-system-hook # (optional) This is a link to the current documentation page + image_url: # (optional) This is a link to a thumbnail image depicting the feature + video_url: # (optional) Use the youtube thumbnail URL with the structure of https://img.youtube.com/vi/UNIQUEID/hqdefault.jpg diff --git a/doc/api/scim.md b/doc/api/scim.md index be31ddda22d..528eca3b828 100644 --- a/doc/api/scim.md +++ b/doc/api/scim.md @@ -33,10 +33,11 @@ Supported attributes: If successful, returns [`200`](rest/index.md#status-codes) and the following response attributes: -| Attribute | Type | Description | -| ------------ | ------ | ------------------------- | -| `extern_uid` | string | External UID for the user | -| `user_id` | string | ID for the user | +| Attribute | Type | Description | +| ------------ | ------- | ------------------------- | +| `extern_uid` | string | External UID for the user | +| `user_id` | integer | ID for the user | +| `active` | boolean | Status of the identity | Example response: @@ -44,7 +45,8 @@ Example response: [ { "extern_uid": "4", - "user_id": 48 + "user_id": 48, + "active": true } ] ``` @@ -67,7 +69,7 @@ Fields that can be updated are: | `id/externalId` | `extern_uid` | ```plaintext -PATCH groups/:groups_id/scim/:uid +PATCH /groups/:groups_id/scim/:uid ``` Parameters: diff --git a/doc/development/database/table_partitioning.md b/doc/development/database/table_partitioning.md index 30131fc0347..7489154d64a 100644 --- a/doc/development/database/table_partitioning.md +++ b/doc/development/database/table_partitioning.md @@ -307,44 +307,12 @@ class PrepareIndexesForPartitioning < Gitlab::Database::Migration[2.1] end ``` -### Step 3 - Swap primary key +### Step 3 - Enforce unique constraint -Swap the primary key including the partitioning key column. For example, in a rails migration: - -```ruby -class PreparePrimaryKeyForPartitioning < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - TABLE_NAME = :table_name - PRIMARY_KEY = :primary_key - OLD_INDEX_NAME = :old_index_name - NEW_INDEX_NAME = :new_index_name - - def up - swap_primary_key(TABLE_NAME, PRIMARY_KEY, NEW_INDEX_NAME) - end - - def down - add_concurrent_index(TABLE_NAME, :id, unique: true, name: OLD_INDEX_NAME) - add_concurrent_index(TABLE_NAME, [:id, :partition_id], unique: true, name: NEW_INDEX_NAME) - - unswap_primary_key(TABLE_NAME, PRIMARY_KEY, OLD_INDEX_NAME) - end -end -``` - -NOTE: -Do not forget to set the primary key explicitly in your model as `ActiveRecord` does not support composite primary keys. - -```ruby -class Model < ApplicationRecord - self.primary_key = :id -end -``` - -### Step 4 - Enforce unique constraint - -Enforce unique indexes including the partitioning key column. For example, in a rails migration: +Change all unique indexes to include the partitioning key column, +including the primary key index. You can start by adding an unique +index on `[primary_key_column, :partition_id]`, which will be +required for the next two steps. For example, in a rails migration: ```ruby class PrepareUniqueContraintForPartitioning < Gitlab::Database::Migration[2.1] @@ -355,20 +323,20 @@ class PrepareUniqueContraintForPartitioning < Gitlab::Database::Migration[2.1] NEW_UNIQUE_INDEX_NAME = :new_index_name def up - add_concurrent_index(TABLE_NAME, [:some_column, :partition_id], unique: true, name: NEW_UNIQUE_INDEX_NAME) + add_concurrent_index(TABLE_NAME, [:id, :partition_id], unique: true, name: NEW_UNIQUE_INDEX_NAME) remove_concurrent_index_by_name(TABLE_NAME, OLD_UNIQUE_INDEX_NAME) end def down - add_concurrent_index(TABLE_NAME, :some_column, unique: true, name: OLD_UNIQUE_INDEX_NAME) + add_concurrent_index(TABLE_NAME, :id, unique: true, name: OLD_UNIQUE_INDEX_NAME) remove_concurrent_index_by_name(TABLE_NAME, NEW_UNIQUE_INDEX_NAME) end end ``` -### Step 5 - Enforce foreign key constraint +### Step 4 - Enforce foreign key constraint Enforce foreign keys including the partitioning key column. For example, in a rails migration: @@ -380,7 +348,7 @@ class PrepareForeignKeyForPartitioning < Gitlab::Database::Migration[2.1] TARGET_TABLE_NAME = :target_table_name COLUMN = :foreign_key_id TARGET_COLUMN = :id - CONSTRAINT_NAME = :fk_365d1db505_p + FK_NAME = :fk_365d1db505_p PARTITION_COLUMN = :partition_id def up @@ -394,11 +362,14 @@ class PrepareForeignKeyForPartitioning < Gitlab::Database::Migration[2.1] name: CONSTRAINT_NAME ) - validate_foreign_key(TARGET_TABLE_NAME, CONSTRAINT_NAME) + # This should be done in a separate post migration when dealing with a high traffic table + validate_foreign_key(TABLE_NAME, [PARTITION_COLUMN, COLUMN], name: FK_NAME) end def down - drop_constraint(TARGET_TABLE_NAME, CONSTRAINT_NAME) + with_lock_retries do + remove_foreign_key_if_exists(SOURCE_TABLE_NAME, name: FK_NAME) + end end end ``` @@ -410,6 +381,42 @@ result in a `Key is still referenced from table ...` error and updating the partition column on the source table would raise a `Key is not present in table ...` error. +### Step 5 - Swap primary key + +Swap the primary key including the partitioning key column. This can be done only after +including the partition key for all references foreign keys. For example, in a rails migration: + +```ruby +class PreparePrimaryKeyForPartitioning < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TABLE_NAME = :table_name + PRIMARY_KEY = :primary_key + OLD_INDEX_NAME = :old_index_name + NEW_INDEX_NAME = :new_index_name + + def up + swap_primary_key(TABLE_NAME, PRIMARY_KEY, NEW_INDEX_NAME) + end + + def down + add_concurrent_index(TABLE_NAME, :id, unique: true, name: OLD_INDEX_NAME) + add_concurrent_index(TABLE_NAME, [:id, :partition_id], unique: true, name: NEW_INDEX_NAME) + + unswap_primary_key(TABLE_NAME, PRIMARY_KEY, OLD_INDEX_NAME) + end +end +``` + +NOTE: +Do not forget to set the primary key explicitly in your model as `ActiveRecord` does not support composite primary keys. + +```ruby +class Model < ApplicationRecord + self.primary_key = :id +end +``` + ### Step 6 - Create parent table and attach existing table as the initial partition You can now create the parent table attaching the existing table as the initial @@ -465,7 +472,7 @@ class ConvertTableToListPartitioning < Gitlab::Database::Migration[2.1] table_name: TABLE_NAME, partitioning_column: PARTITION_COLUMN, parent_table_name: PARENT_TABLE_NAME, - initial_partitioning_value: FIRST_PARTITION + initial_partitioning_value: FIRST_PARTITION, lock_tables: [TABLE_FK, TABLE_NAME] ) end diff --git a/doc/install/aws/gitlab_hybrid_on_aws.md b/doc/install/aws/gitlab_hybrid_on_aws.md index ef7d4ac0f69..7f45eb96e86 100644 --- a/doc/install/aws/gitlab_hybrid_on_aws.md +++ b/doc/install/aws/gitlab_hybrid_on_aws.md @@ -19,7 +19,7 @@ Amazon provides a managed Kubernetes service offering known as [Amazon Elastic K | [2K Omnibus](../../administration/reference_architectures/2k_users.md) | [2K Baseline](https://gitlab.com/gitlab-org/quality/performance/-/wikis/Benchmarks/Latest/2k) | [2K Cloud Native Hybrid on EKS](#2k-cloud-native-hybrid-on-eks) | GPT Test Results | [1 YR Ec2 Compute Savings + 1 YR RDS & ElastiCache RIs](https://calculator.aws/#/estimate?id=544bcf1162beae6b8130ad257d081cdf9d4504e3)<br />(2 AZ Cost Estimate is in BOM Below) | | [3K](../../administration/reference_architectures/3k_users.md#cloud-native-hybrid-reference-architecture-with-helm-charts-alternative) | [3k Baseline](https://gitlab.com/gitlab-org/quality/performance/-/wikis/Benchmarks/Latest/3k) | [3K Cloud Native Hybrid on EKS](#3k-cloud-native-hybrid-on-eks) | [3K Full Fixed Scale GPT Test Results](https://gitlab.com/guided-explorations/aws/implementation-patterns/gitlab-cloud-native-hybrid-on-eks/-/blob/master/gitlab-alliances-testing/3K/3k-QuickStart-ARM-RDS-Cache_v13-12-3-ee_2021-07-23_124216/3k-QuickStart-ARM-RDS-Cache_v13-12-3-ee_2021-07-23_124216_results.txt)<br /><br />[3K Elastic Auto Scale GPT Test Results](https://gitlab.com/guided-explorations/aws/implementation-patterns/gitlab-cloud-native-hybrid-on-eks/-/blob/master/gitlab-alliances-testing/3K/3k-QuickStart-AutoScale-ARM-RDS-Cache_v13-12-3-ee_2021-07-23_194200/3k-QuickStart-AutoScale-ARM-RDS-Cache_v13-12-3-ee_2021-07-23_194200_results.txt) | [1 YR Ec2 Compute Savings + 1 YR RDS & ElastiCache RIs](https://calculator.aws/#/estimate?id=f1294fec554e21be999711cddcdab9c5e7f83f14)<br />(2 AZ Cost Estimate is in BOM Below) | | [5K](../../administration/reference_architectures/5k_users.md#cloud-native-hybrid-reference-architecture-with-helm-charts-alternative) | [5k Baseline](https://gitlab.com/gitlab-org/quality/performance/-/wikis/Benchmarks/Latest/5k) | [5K Cloud Native Hybrid on EKS](#5k-cloud-native-hybrid-on-eks) | [5K Full Fixed Scale GPT Test Results](https://gitlab.com/guided-explorations/aws/implementation-patterns/gitlab-cloud-native-hybrid-on-eks/-/blob/master/gitlab-alliances-testing/5K/5k-QuickStart-ARM-RDS-Redis_v13-12-3-ee_2021-07-23_140128/5k-QuickStart-ARM-RDS-Redis_v13-12-3-ee_2021-07-23_140128_results.txt)<br /><br />[5K AutoScale from 25% GPT Test Results](https://gitlab.com/guided-explorations/aws/implementation-patterns/gitlab-cloud-native-hybrid-on-eks/-/blob/master/gitlab-alliances-testing/5K/5k-QuickStart-AutoScale-From-25Percent-ARM-RDS-Redis_v13-12-3-ee_2021-07-24_102717/5k-QuickStart-AutoScale-From-25Percent-ARM-RDS-Redis_v13-12-3-ee_2021-07-24_102717_results.txt) | [1 YR Ec2 Compute Savings + 1 YR RDS & ElastiCache RIs](https://calculator.aws/#/estimate?id=330ee43c5b14662db5df6e52b34898d181a09e16) | -| [10K](../../administration/reference_architectures/10k_users.md#cloud-native-hybrid-reference-architecture-with-helm-charts-alternative) | [10k Baseline](https://gitlab.com/gitlab-org/quality/performance/-/wikis/Benchmarks/Latest/10k) | [10K Cloud Native Hybrid on EKS](#10k-cloud-native-hybrid-on-eks) | [10K Full Fixed Scale GPT Test Results](https://gitlab.com/guided-explorations/aws/implementation-patterns/gitlab-cloud-native-hybrid-on-eks/-/blob/master/gitlab-alliances-testing/10K/GL-CloudNative-10k-RDS-Graviton_v13-12-3-ee_2021-07-08_194647/GL-CloudNative-10k-RDS-Graviton_v13-12-3-ee_2021-07-08_194647_results.txt)<br /><br />[10K Elastic Auto Scale GPT Test Results](hhttps://gitlab.com/guided-explorations/aws/implementation-patterns/gitlab-cloud-native-hybrid-on-eks/-/blob/master/gitlab-alliances-testing/10K/GL-CloudNative-10k-AutoScaling-Test_v13-12-3-ee_2021-07-09_115139/GL-CloudNative-10k-AutoScaling-Test_v13-12-3-ee_2021-07-09_115139_results.txt) | [10K 1 YR Ec2 Compute Savings + 1 YR RDS & ElastiCache RIs](https://calculator.aws/#/estimate?id=5ac2e07a22e01c36ee76b5477c5a046cd1bea792) | +| [10K](../../administration/reference_architectures/10k_users.md#cloud-native-hybrid-reference-architecture-with-helm-charts-alternative) | [10k Baseline](https://gitlab.com/gitlab-org/quality/performance/-/wikis/Benchmarks/Latest/10k) | [10K Cloud Native Hybrid on EKS](#10k-cloud-native-hybrid-on-eks) | [10K Full Fixed Scale GPT Test Results](https://gitlab.com/guided-explorations/aws/implementation-patterns/gitlab-cloud-native-hybrid-on-eks/-/blob/master/gitlab-alliances-testing/10K/GL-CloudNative-10k-RDS-Graviton_v13-12-3-ee_2021-07-08_194647/GL-CloudNative-10k-RDS-Graviton_v13-12-3-ee_2021-07-08_194647_results.txt)<br /><br />[10K Elastic Auto Scale GPT Test Results](https://gitlab.com/guided-explorations/aws/implementation-patterns/gitlab-cloud-native-hybrid-on-eks/-/blob/master/gitlab-alliances-testing/10K/GL-CloudNative-10k-AutoScaling-Test_v13-12-3-ee_2021-07-09_115139/GL-CloudNative-10k-AutoScaling-Test_v13-12-3-ee_2021-07-09_115139_results.txt) | [10K 1 YR Ec2 Compute Savings + 1 YR RDS & ElastiCache RIs](https://calculator.aws/#/estimate?id=5ac2e07a22e01c36ee76b5477c5a046cd1bea792) | | [50K](../../administration/reference_architectures/50k_users.md#cloud-native-hybrid-reference-architecture-with-helm-charts-alternative) | [50k Baseline](https://gitlab.com/gitlab-org/quality/performance/-/wikis/Benchmarks/Latest/50k) | [50K Cloud Native Hybrid on EKS](#50k-cloud-native-hybrid-on-eks) | [50K Full Fixed Scale GPT Test Results](https://gitlab.com/guided-explorations/aws/implementation-patterns/gitlab-cloud-native-hybrid-on-eks/-/blob/master/gitlab-alliances-testing/50K/50k-Fixed-Scale-Test_v13-12-3-ee_2021-08-13_172819/50k-Fixed-Scale-Test_v13-12-3-ee_2021-08-13_172819_results.txt)<br /><br />[10K Elastic Auto Scale GPT Test Results](https://gitlab.com/guided-explorations/aws/implementation-patterns/gitlab-cloud-native-hybrid-on-eks/-/blob/master/gitlab-alliances-testing/50K/50k-AutoScale-Test_v13-12-3-ee_2021-08-13_192633/50k-AutoScale-Test_v13-12-3-ee_2021-08-13_192633.txt) | [50K 1 YR Ec2 Compute Savings + 1 YR RDS & ElastiCache RIs](https://calculator.aws/#/estimate?id=b9c9d6ac1d4a7848011d2050cef3120931fb7c22) | \*Cost calculations for actual implementations are a rough guideline with the following considerations: diff --git a/doc/integration/saml.md b/doc/integration/saml.md index c42807f33cd..5c3bbdf2201 100644 --- a/doc/integration/saml.md +++ b/doc/integration/saml.md @@ -262,13 +262,6 @@ gitlab_rails['omniauth_providers'] = [ ] ``` -To allow your users to use SAML to sign up without having to manually create an -account from either of the providers, add the following values to your configuration. - -```ruby -gitlab_rails['omniauth_allow_single_sign_on'] = ['saml', 'saml1'] -``` - ## Set up identity providers GitLab support of SAML means you can sign in to GitLab through a wide range diff --git a/doc/operations/incident_management/linked_resources.md b/doc/operations/incident_management/linked_resources.md index 96edd41c12f..642a6972bcf 100644 --- a/doc/operations/incident_management/linked_resources.md +++ b/doc/operations/incident_management/linked_resources.md @@ -8,7 +8,7 @@ info: To determine the technical writer assigned to the Stage/Group associated w > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/230852) in GitLab 15.3 [with a flag](../../administration/feature_flags.md) named `incident_resource_links_widget`. Disabled by default. > - [Enabled on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues/364755) in GitLab 15.3. -> - [Generally available](ihttps://gitlab.com/gitlab-org/gitlab/-/issues/364755) in GitLab 15.5. Feature flag `incident_resource_links_widget` removed. +> - [Generally available](https://gitlab.com/gitlab-org/gitlab/-/issues/364755) in GitLab 15.5. Feature flag `incident_resource_links_widget` removed. To help your team members find the important links without having to search through many comments, you can add linked resources to an incident issue. diff --git a/doc/raketasks/index.md b/doc/raketasks/index.md index 0d5a826b0a1..1b8eccc7ae4 100644 --- a/doc/raketasks/index.md +++ b/doc/raketasks/index.md @@ -28,7 +28,6 @@ The following Rake tasks are available for use with GitLab: | [General maintenance](../administration/raketasks/maintenance.md) | General maintenance and self-check tasks. | | [Geo maintenance](../administration/raketasks/geo.md) | [Geo](../administration/geo/index.md)-related maintenance. | | [GitHub import](../administration/raketasks/github_import.md) | Retrieve and import repositories from GitHub. | -| [Import repositories](import.md) | Import bare repositories into your GitLab instance. | | [Import large project exports](../development/import_project.md#importing-via-a-rake-task) | Import large GitLab [project exports](../user/project/settings/import_export.md). | | [Integrity checks](../administration/raketasks/check.md) | Check the integrity of repositories, files, LDAP, and more. | | [LDAP maintenance](../administration/raketasks/ldap.md) | [LDAP](../administration/auth/ldap/index.md)-related tasks. | diff --git a/doc/subscriptions/gitlab_com/index.md b/doc/subscriptions/gitlab_com/index.md index 8fce04ec109..ad320632628 100644 --- a/doc/subscriptions/gitlab_com/index.md +++ b/doc/subscriptions/gitlab_com/index.md @@ -37,7 +37,7 @@ To subscribe to GitLab SaaS: 1. Create additional users and [add them to the group](../../user/group/manage.md#add-users-to-a-group). The users in this group, its subgroups, and projects can use the features of your subscription tier, and they consume a seat in your subscription. -1. On the left sidebar, select **Billing** and choose a tier. +1. On the left sidebar, select **Settings > Billing** and choose a tier. 1. Fill out the form to complete your purchase. ## View your GitLab SaaS subscription diff --git a/doc/update/deprecations.md b/doc/update/deprecations.md index e4c2f149653..ee6d241ae93 100644 --- a/doc/update/deprecations.md +++ b/doc/update/deprecations.md @@ -387,6 +387,26 @@ Alternatives to using the `gitlab:import:repos` Rake task include: <div class="deprecation removal-160 breaking-change"> +### Slack Notifications integration + +End of Support: GitLab <span class="removal-milestone">16.0</span> <span class="support-end-date"></span><br /> +Planned removal: GitLab <span class="removal-milestone">16.0</span> <span class="removal-date"></span> + +WARNING: +This is a [breaking change](https://docs.gitlab.com/ee/development/deprecation_guidelines/). +Review the details carefully before upgrading. + +As we're consolidating all Slack capabilities into the +GitLab for Slack app, we're [deprecating the Slack Notifications +integration](https://gitlab.com/gitlab-org/gitlab/-/issues/372411). +GitLab.com users can now use the GitLab for Slack app to manage notifications +to their Slack workspace. For self-managed users of the Slack Notifications integration, +we'll be introducing support in [this epic](https://gitlab.com/groups/gitlab-org/-/epics/1211). + +</div> + +<div class="deprecation removal-160 breaking-change"> + ### Support for third party registries Planned removal: GitLab <span class="removal-milestone">16.0</span> <span class="removal-date"></span> @@ -405,6 +425,22 @@ Moving forward, we'll continue to invest in developing and releasing new feature <div class="deprecation removal-160 breaking-change"> +### Test system hook endpoint + +End of Support: GitLab <span class="removal-milestone">16.0</span> <span class="support-end-date"></span><br /> +Planned removal: GitLab <span class="removal-milestone">16.0</span> <span class="removal-date"></span> + +WARNING: +This is a [breaking change](https://docs.gitlab.com/ee/development/deprecation_guidelines/). +Review the details carefully before upgrading. + +The [test system hook](https://docs.gitlab.com/ee/api/system_hooks.html#test-system-hook) endpoint returns dummy data. +This endpoint is now deprecated and will be removed from the GitLab codebase. + +</div> + +<div class="deprecation removal-160 breaking-change"> + ### The API no longer returns revoked tokens for the agent for Kubernetes Planned removal: GitLab <span class="removal-milestone">16.0</span> <span class="removal-date"></span> diff --git a/doc/user/application_security/policies/scan-execution-policies.md b/doc/user/application_security/policies/scan-execution-policies.md index c9c48c0c926..a14dbb1c00a 100644 --- a/doc/user/application_security/policies/scan-execution-policies.md +++ b/doc/user/application_security/policies/scan-execution-policies.md @@ -97,7 +97,7 @@ GitLab supports the following types of CRON syntax for the `cadence` field: - A weekly cadence of once per week on a specified day and at a specified hour, for example: `0 13 * * 0` NOTE: -Other elements of the [CRON syntax]((https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm)) may work in the cadence field if supported by the [cron](https://github.com/robfig/cron) we are using in our implementation, however, GitLab does not officially test or support them. +Other elements of the [CRON syntax](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm) may work in the cadence field if supported by the [cron](https://github.com/robfig/cron) we are using in our implementation, however, GitLab does not officially test or support them. NOTE: If using the `agents` field, required for `Operational Container Scanning`, the CRON expression is evaluated in [UTC](https://www.timeanddate.com/worldclock/timezone/utc) using the system-time of the Kubernetes-agent pod. If not using the `agents` field, the CRON expression is evaluated in standard [UTC](https://www.timeanddate.com/worldclock/timezone/utc) time from GitLab.com. If you have a self-managed GitLab instance and have [changed the server timezone](../../../administration/timezone.md), the CRON expression is evaluated with the new timezone. diff --git a/doc/user/packages/nuget_repository/index.md b/doc/user/packages/nuget_repository/index.md index 540db463f0a..bc19acde6f7 100644 --- a/doc/user/packages/nuget_repository/index.md +++ b/doc/user/packages/nuget_repository/index.md @@ -283,7 +283,7 @@ To use the [group-level](#use-the-gitlab-endpoint-for-nuget-packages) Package Re Prerequisite: -- Set up the [source](#https://docs.gitlab.com/ee/user/packages/nuget_repository/#add-the-package-registry-as-a-source-for-nuget-packages) with a [project-level endpoint](#use-the-gitlab-endpoint-for-nuget-packages). +- Set up the [source](#add-the-package-registry-as-a-source-for-nuget-packages) with a [project-level endpoint](#use-the-gitlab-endpoint-for-nuget-packages). When publishing packages: diff --git a/doc/user/project/import/index.md b/doc/user/project/import/index.md index 23397de0735..733e58dd031 100644 --- a/doc/user/project/import/index.md +++ b/doc/user/project/import/index.md @@ -47,13 +47,11 @@ You can import projects from: - [CVS](cvs.md) - [FogBugz](fogbugz.md) - [GitHub.com or GitHub Enterprise](github.md) -- [GitLab.com](gitlab_com.md) - [Gitea](gitea.md) - [Perforce](perforce.md) - [TFVC](tfvc.md) - [Repository by URL](repo_by_url.md) -- [Uloading a manifest file (AOSP)](manifest.md) -- [Phabricator](phabricator.md) +- [Uploading a manifest file (AOSP)](manifest.md) - [Jira (issues only)](jira.md) You can also import any Git repository through HTTP from the **New Project** page. Note that if the diff --git a/doc/user/project/merge_requests/drafts.md b/doc/user/project/merge_requests/drafts.md index 0bc9b337e3b..c216514fff4 100644 --- a/doc/user/project/merge_requests/drafts.md +++ b/doc/user/project/merge_requests/drafts.md @@ -21,12 +21,13 @@ the **Merge** button until you remove the **Draft** flag: > - [Removed](https://gitlab.com/gitlab-org/gitlab/-/issues/228685) all support for using **WIP** in GitLab 14.8. > - **Mark as draft** and **Mark as ready** buttons [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/227421) in GitLab 13.5. > `/draft` quick action as a toggle [deprecated](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/92654) in GitLab 15.4. +> - [Changed](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/108073) the draft status to use a checkbox in GitLab 15.8. There are several ways to flag a merge request as a draft: - **Viewing a merge request**: In the top right corner of the merge request, select **Mark as draft**. - **Creating or editing a merge request**: Add `[Draft]`, `Draft:` or `(Draft)` to - the beginning of the merge request's title, or select **Start the title with Draft:** + the beginning of the merge request's title, or select **Mark as draft** below the **Title** field. - **Commenting in an existing merge request**: Add the `/draft` [quick action](../quick_actions.md#issues-merge-requests-and-epics) @@ -47,7 +48,7 @@ When a merge request is ready to be merged, you can remove the `Draft` flag in s ![Mark as ready](img/draft_blocked_merge_button_v13_10.png) - **Editing an existing merge request**: Remove `[Draft]`, `Draft:` or `(Draft)` - from the beginning of the title, or select **Remove the Draft: prefix from the title** + from the beginning of the title, or clear **Mark as draft** below the **Title** field. - **Commenting in an existing merge request**: Add the `/ready` [quick action](../quick_actions.md#issues-merge-requests-and-epics) diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 5a60905422d..23f7c87a308 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -823,12 +823,6 @@ msgstr "" msgid "%{linkStart} Learn more%{linkEnd}." msgstr "" -msgid "%{link_start}Remove the %{draft_snippet} prefix%{link_end} from the title to allow this merge request to be merged when it's ready." -msgstr "" - -msgid "%{link_start}Start the title with %{draft_snippet}%{link_end} to prevent a merge request draft from merging before it's ready." -msgstr "" - msgid "%{listToShow}, and %{awardsListLength} more" msgstr "" @@ -12731,6 +12725,9 @@ msgstr "" msgid "DastProfiles|Request headers" msgstr "" +msgid "DastProfiles|Retry" +msgstr "" + msgid "DastProfiles|Run the AJAX spider, in addition to the traditional spider, to crawl the target site." msgstr "" @@ -12833,6 +12830,12 @@ msgstr "" msgid "DastProfiles|Username form field" msgstr "" +msgid "DastProfiles|Validate" +msgstr "" + +msgid "DastProfiles|Validate site profile" +msgstr "" + msgid "DastProfiles|Validated" msgstr "" @@ -23434,9 +23437,6 @@ msgstr "" msgid "Issue|Title" msgstr "" -msgid "It looks like you have some draft commits in this branch." -msgstr "" - msgid "It looks like you're attempting to activate your subscription. Use %{a_start}the Subscription page%{a_end} instead." msgstr "" @@ -26331,6 +26331,12 @@ msgstr "" msgid "MergeRequests|Create issue to resolve thread" msgstr "" +msgid "MergeRequests|Drafts cannot be merged until marked ready." +msgstr "" + +msgid "MergeRequests|Mark as draft" +msgstr "" + msgid "MergeRequests|Reference copied" msgstr "" @@ -44228,6 +44234,9 @@ msgstr "" msgid "Too many references. Quick actions are limited to at most %{max_count} user references" msgstr "" +msgid "Too many results to display. Edit your search or add a filter." +msgstr "" + msgid "Too many users found. Quick actions are limited to at most %{max_count} users" msgstr "" diff --git a/qa/qa/resource/project.rb b/qa/qa/resource/project.rb index 3f42c6b649e..5603e80e321 100644 --- a/qa/qa/resource/project.rb +++ b/qa/qa/resource/project.rb @@ -450,7 +450,7 @@ module QA parse_body(response) end - # Fetch project specific runners + # Fetch project runners # # @param [Hash] **kwargs optional query arguments, see: https://docs.gitlab.com/ee/api/runners.html#list-projects-runners # @return [Array] diff --git a/qa/qa/specs/features/browser_ui/4_verify/runner/register_runner_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/runner/register_runner_spec.rb index e141bac5e3f..4db935df43d 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/runner/register_runner_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/runner/register_runner_spec.rb @@ -15,7 +15,7 @@ module QA runner.remove_via_api! end - it 'user registers a new specific runner', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/348025' do + it 'user registers a new project runner', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/348025' do Flow::Login.sign_in runner.project.visit! diff --git a/spec/controllers/dashboard_controller_spec.rb b/spec/controllers/dashboard_controller_spec.rb index b0a080a768a..1b5a8c0807c 100644 --- a/spec/controllers/dashboard_controller_spec.rb +++ b/spec/controllers/dashboard_controller_spec.rb @@ -46,6 +46,37 @@ RSpec.describe DashboardController, feature_category: :code_review_workflow do describe 'GET merge requests' do it_behaves_like 'issuables list meta-data', :merge_request, :merge_requests it_behaves_like 'issuables requiring filter', :merge_requests + + context 'when an ActiveRecord::QueryCanceled is raised' do + before do + allow_next_instance_of(Gitlab::IssuableMetadata) do |instance| + allow(instance).to receive(:data).and_raise(ActiveRecord::QueryCanceled) + end + end + + it 'sets :search_timeout_occurred' do + get :merge_requests, params: { author_id: user.id } + + expect(response).to have_gitlab_http_status(:ok) + expect(assigns(:search_timeout_occurred)).to eq(true) + end + + context 'rendering views' do + render_views + + it 'shows error message' do + get :merge_requests, params: { author_id: user.id } + + expect(response.body).to have_content('Too many results to display. Edit your search or add a filter.') + end + end + + it 'logs the exception' do + expect(Gitlab::ErrorTracking).to receive(:track_exception).and_call_original + + get :merge_requests, params: { author_id: user.id } + end + end end end diff --git a/spec/controllers/explore/groups_controller_spec.rb b/spec/controllers/explore/groups_controller_spec.rb index a3bd8102462..d53cb233df9 100644 --- a/spec/controllers/explore/groups_controller_spec.rb +++ b/spec/controllers/explore/groups_controller_spec.rb @@ -40,12 +40,4 @@ RSpec.describe Explore::GroupsController do end it_behaves_like 'explore groups' - - context 'generic_explore_groups flag is disabled' do - before do - stub_feature_flags(generic_explore_groups: false) - end - - it_behaves_like 'explore groups' - end end diff --git a/spec/features/merge_request/user_can_see_draft_toggle_spec.rb b/spec/features/merge_request/user_can_see_draft_toggle_spec.rb new file mode 100644 index 00000000000..0282c954225 --- /dev/null +++ b/spec/features/merge_request/user_can_see_draft_toggle_spec.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'Merge request > User sees draft toggle', feature_category: :code_review do + let_it_be(:project) { create(:project, :public, :repository) } + let(:user) { project.creator } + + before do + project.add_maintainer(user) + sign_in(user) + end + + context 'with draft commits' do + it 'shows the draft toggle' do + visit project_new_merge_request_path( + project, + merge_request: { + source_project_id: project.id, + target_project_id: project.id, + source_branch: 'wip', + target_branch: 'master' + }) + + expect(page).to have_css('input[type="checkbox"].js-toggle-draft', count: 1) + expect(page).to have_text('Mark as draft') + expect(page).to have_text('Drafts cannot be merged until marked ready.') + end + end + + context 'without draft commits' do + it 'shows the draft toggle' do + visit project_new_merge_request_path( + project, + merge_request: { + source_project_id: project.id, + target_project_id: project.id, + source_branch: 'fix', + target_branch: 'master' + }) + + expect(page).to have_css('input[type="checkbox"].js-toggle-draft', count: 1) + expect(page).to have_text('Mark as draft') + expect(page).to have_text('Drafts cannot be merged until marked ready.') + end + end +end diff --git a/spec/features/merge_request/user_sees_wip_help_message_spec.rb b/spec/features/merge_request/user_sees_wip_help_message_spec.rb deleted file mode 100644 index fdefe5ffb06..00000000000 --- a/spec/features/merge_request/user_sees_wip_help_message_spec.rb +++ /dev/null @@ -1,61 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe 'Merge request > User sees draft help message', feature_category: :code_review_workflow do - let(:project) { create(:project, :public, :repository) } - let(:user) { project.creator } - - before do - project.add_maintainer(user) - sign_in(user) - end - - context 'with draft commits' do - it 'shows a specific draft hint' do - visit project_new_merge_request_path( - project, - merge_request: { - source_project_id: project.id, - target_project_id: project.id, - source_branch: 'wip', - target_branch: 'master' - }) - - within_wip_explanation do - expect(page).to have_text( - 'It looks like you have some draft commits in this branch' - ) - end - end - end - - context 'without draft commits' do - it 'shows the regular draft message' do - visit project_new_merge_request_path( - project, - merge_request: { - source_project_id: project.id, - target_project_id: project.id, - source_branch: 'fix', - target_branch: 'master' - }) - - within_wip_explanation do - expect(page).not_to have_text( - 'It looks like you have some draft commits in this branch' - ) - expect(page).to have_text( - "Start the title with Draft: to prevent a merge request draft \ -from merging before it's ready." - ) - end - end - end - - def within_wip_explanation(&block) - page.within '.js-no-wip-explanation' do - yield - end - end -end diff --git a/spec/frontend/issuable/helpers.js b/spec/frontend/issuable/helpers.js new file mode 100644 index 00000000000..632d69c2c88 --- /dev/null +++ b/spec/frontend/issuable/helpers.js @@ -0,0 +1,18 @@ +export function getSaveableFormChildren(form, exclude = ['input.js-toggle-draft']) { + const children = Array.from(form.children); + const saveable = children.filter((e) => { + const isFiltered = exclude.reduce( + ({ isFiltered: filtered, element }, selector) => { + return { + isFiltered: filtered || element.matches(selector), + element, + }; + }, + { isFiltered: false, element: e }, + ); + + return !isFiltered.isFiltered; + }); + + return saveable; +} diff --git a/spec/frontend/issuable/issuable_form_spec.js b/spec/frontend/issuable/issuable_form_spec.js index 28ec0e22d8b..3e778e50fb8 100644 --- a/spec/frontend/issuable/issuable_form_spec.js +++ b/spec/frontend/issuable/issuable_form_spec.js @@ -4,6 +4,8 @@ import { setHTMLFixture, resetHTMLFixture } from 'helpers/fixtures'; import IssuableForm from '~/issuable/issuable_form'; import setWindowLocation from 'helpers/set_window_location_helper'; +import { getSaveableFormChildren } from './helpers'; + jest.mock('~/autosave'); const createIssuable = (form) => { @@ -18,6 +20,7 @@ describe('IssuableForm', () => { setHTMLFixture(` <form> <input name="[title]" /> + <input type="checkbox" class="js-toggle-draft" /> <textarea name="[description]"></textarea> </form> `); @@ -99,10 +102,11 @@ describe('IssuableForm', () => { ])('creates $id autosave when $id input exist', ({ id, input, selector }) => { $form.append(input); const $input = $form.find(selector); - const totalAutosaveFormFields = $form.children().length; createIssuable($form); - expect(Autosave).toHaveBeenCalledTimes(totalAutosaveFormFields); + const children = getSaveableFormChildren($form[0]); + + expect(Autosave).toHaveBeenCalledTimes(children.length); expect(Autosave).toHaveBeenLastCalledWith( $input.get(0), ['/', '', id], @@ -153,12 +157,17 @@ describe('IssuableForm', () => { }); }); - describe('wip', () => { + describe('draft', () => { + let titleField; + let toggleDraft; + beforeEach(() => { instance = createIssuable($form); + titleField = document.querySelector('input[name="[title]"]'); + toggleDraft = document.querySelector('input.js-toggle-draft'); }); - describe('removeWip', () => { + describe('removeDraft', () => { it.each` prefix ${'draFT: '} @@ -169,25 +178,25 @@ describe('IssuableForm', () => { ${' (DrafT)'} ${'draft: [draft] (draft)'} `('removes "$prefix" from the beginning of the title', ({ prefix }) => { - instance.titleField.val(`${prefix}The Issuable's Title Value`); + titleField.value = `${prefix}The Issuable's Title Value`; - instance.removeWip(); + instance.removeDraft(); - expect(instance.titleField.val()).toBe("The Issuable's Title Value"); + expect(titleField.value).toBe("The Issuable's Title Value"); }); }); - describe('addWip', () => { + describe('addDraft', () => { it("properly adds the work in progress prefix to the Issuable's title", () => { - instance.titleField.val("The Issuable's Title Value"); + titleField.value = "The Issuable's Title Value"; - instance.addWip(); + instance.addDraft(); - expect(instance.titleField.val()).toBe("Draft: The Issuable's Title Value"); + expect(titleField.value).toBe("Draft: The Issuable's Title Value"); }); }); - describe('workInProgress', () => { + describe('isMarkedDraft', () => { it.each` title | expected ${'draFT: something is happening'} | ${true} @@ -195,10 +204,45 @@ describe('IssuableForm', () => { ${'something is happening to drafts'} | ${false} ${'something is happening'} | ${false} `('returns $expected with "$title"', ({ title, expected }) => { - instance.titleField.val(title); + titleField.value = title; - expect(instance.workInProgress()).toBe(expected); + expect(instance.isMarkedDraft()).toBe(expected); }); }); + + describe('readDraftStatus', () => { + it.each` + title | checked + ${'Draft: my title'} | ${true} + ${'my title'} | ${false} + `( + 'sets the draft checkbox checked status to $checked when the title is $title', + ({ title, checked }) => { + titleField.value = title; + + instance.readDraftStatus(); + + expect(toggleDraft.checked).toBe(checked); + }, + ); + }); + + describe('writeDraftStatus', () => { + it.each` + checked | title + ${true} | ${'Draft: my title'} + ${false} | ${'my title'} + `( + 'updates the title to $title when the draft checkbox checked status is $checked', + ({ checked, title }) => { + titleField.value = 'my title'; + toggleDraft.checked = checked; + + instance.writeDraftStatus(); + + expect(titleField.value).toBe(title); + }, + ); + }); }); }); diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb index 7d5e82d5210..6d9fbad7d10 100644 --- a/spec/models/ci/build_spec.rb +++ b/spec/models/ci/build_spec.rb @@ -2601,7 +2601,7 @@ RSpec.describe Ci::Build, feature_category: :continuous_integration do it { is_expected.to be_truthy } - context "and there are specific runner" do + context "and there is a project runner" do let!(:runner) { create(:ci_runner, :project, projects: [build.project], contacted_at: 1.second.ago) } it { is_expected.to be_falsey } diff --git a/spec/models/ci/runner_spec.rb b/spec/models/ci/runner_spec.rb index b7c7b67b98f..0fde9e5f187 100644 --- a/spec/models/ci/runner_spec.rb +++ b/spec/models/ci/runner_spec.rb @@ -259,7 +259,7 @@ RSpec.describe Ci::Runner, feature_category: :runner do end describe '.belonging_to_project' do - it 'returns the specific project runner' do + it 'returns the project runner' do # own specific_project = create(:project) specific_runner = create(:ci_runner, :project, projects: [specific_project]) @@ -285,7 +285,7 @@ RSpec.describe Ci::Runner, feature_category: :runner do subject(:result) { described_class.belonging_to_parent_group_of_project(project_id) } - it 'returns the specific group runner' do + it 'returns the group runner' do expect(result).to contain_exactly(runner1) end @@ -339,7 +339,7 @@ RSpec.describe Ci::Runner, feature_category: :runner do describe '.owned_or_instance_wide' do subject { described_class.owned_or_instance_wide(project.id) } - it 'returns a globally shared, a project specific and a group specific runner' do + it 'returns a shared, project and group runner' do is_expected.to contain_exactly(group_runner, project_runner, shared_runner) end end @@ -352,7 +352,7 @@ RSpec.describe Ci::Runner, feature_category: :runner do project_runner end - it 'returns a globally shared and a group specific runner' do + it 'returns a globally shared and a group runner' do is_expected.to contain_exactly(group_runner, shared_runner) end end @@ -382,7 +382,7 @@ RSpec.describe Ci::Runner, feature_category: :runner do context 'with group runners disabled' do let(:group_runners_enabled) { false } - it 'returns only the project specific runner' do + it 'returns only the project runner' do is_expected.to contain_exactly(project_runner) end end @@ -390,7 +390,7 @@ RSpec.describe Ci::Runner, feature_category: :runner do context 'with group runners enabled' do let(:group_runners_enabled) { true } - it 'returns a project specific and a group specific runner' do + it 'returns a project runner and a group runner' do is_expected.to contain_exactly(group_runner, project_runner) end end @@ -404,7 +404,7 @@ RSpec.describe Ci::Runner, feature_category: :runner do project_runner end - it 'returns a group specific runner' do + it 'returns a group runner' do is_expected.to contain_exactly(group_runner) end end diff --git a/spec/models/ci/running_build_spec.rb b/spec/models/ci/running_build_spec.rb index 1a5ea044ba3..7f254bd235c 100644 --- a/spec/models/ci/running_build_spec.rb +++ b/spec/models/ci/running_build_spec.rb @@ -31,7 +31,7 @@ RSpec.describe Ci::RunningBuild, feature_category: :continuous_integration do end end - context 'when build has been picked by a specific runner' do + context 'when build has been picked by a project runner' do let(:runner) { create(:ci_runner, :project) } it 'raises an error' do diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 4ed85844a53..340b859ee5c 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -2320,7 +2320,7 @@ RSpec.describe Project, factory_default: :keep, feature_category: :projects do context 'shared runners' do let(:project) { create(:project, shared_runners_enabled: shared_runners_enabled) } - let(:specific_runner) { create(:ci_runner, :project, :online, projects: [project]) } + let(:project_runner) { create(:ci_runner, :project, :online, projects: [project]) } let(:shared_runner) { create(:ci_runner, :instance, :online) } let(:offline_runner) { create(:ci_runner, :instance) } @@ -2331,8 +2331,8 @@ RSpec.describe Project, factory_default: :keep, feature_category: :projects do is_expected.to be_falsey end - it 'has a specific runner' do - specific_runner + it 'has a project runner' do + project_runner is_expected.to be_truthy end @@ -2343,14 +2343,14 @@ RSpec.describe Project, factory_default: :keep, feature_category: :projects do is_expected.to be_falsey end - it 'checks the presence of specific runner' do - specific_runner + it 'checks the presence of project runner' do + project_runner - expect(project.any_online_runners? { |runner| runner == specific_runner }).to be_truthy + expect(project.any_online_runners? { |runner| runner == project_runner }).to be_truthy end it 'returns false if match cannot be found' do - specific_runner + project_runner expect(project.any_online_runners? { false }).to be_falsey end diff --git a/spec/requests/api/ci/runners_spec.rb b/spec/requests/api/ci/runners_spec.rb index b07dd388390..ca051386265 100644 --- a/spec/requests/api/ci/runners_spec.rb +++ b/spec/requests/api/ci/runners_spec.rb @@ -794,7 +794,7 @@ RSpec.describe API::Ci::Runners, feature_category: :runner_fleet do end end - context 'when runner is specific' do + context 'when runner is a project runner' do it 'return jobs' do get api("/runners/#{project_runner.id}/jobs", admin) @@ -947,7 +947,7 @@ RSpec.describe API::Ci::Runners, feature_category: :runner_fleet do end end - context 'when runner is specific' do + context 'when runner is a project runner' do it 'return jobs' do get api("/runners/#{project_runner.id}/jobs", user) @@ -1203,7 +1203,7 @@ RSpec.describe API::Ci::Runners, feature_category: :runner_fleet do context 'authorized user' do let_it_be(:project_runner2) { create(:ci_runner, :project, projects: [project2]) } - it 'enables specific runner' do + it 'enables project runner' do expect do post api("/projects/#{project.id}/runners", user), params: { runner_id: project_runner2.id } end.to change { project.runners.count }.by(+1) @@ -1243,7 +1243,7 @@ RSpec.describe API::Ci::Runners, feature_category: :runner_fleet do context 'when project runner is used' do let!(:new_project_runner) { create(:ci_runner, :project) } - it 'enables any specific runner' do + it 'enables any project runner' do expect do post api("/projects/#{project.id}/runners", admin), params: { runner_id: new_project_runner.id } end.to change { project.runners.count }.by(+1) @@ -1255,7 +1255,7 @@ RSpec.describe API::Ci::Runners, feature_category: :runner_fleet do create(:plan_limits, :default_plan, ci_registered_project_runners: 1) end - it 'does not enable specific runner' do + it 'does not enable project runner' do expect do post api("/projects/#{project.id}/runners", admin), params: { runner_id: new_project_runner.id } end.not_to change { project.runners.count } diff --git a/spec/services/ci/register_job_service_spec.rb b/spec/services/ci/register_job_service_spec.rb index f40f5cc5a62..f834bc2674b 100644 --- a/spec/services/ci/register_job_service_spec.rb +++ b/spec/services/ci/register_job_service_spec.rb @@ -9,7 +9,7 @@ module Ci let_it_be_with_reload(:pipeline) { create(:ci_pipeline, project: project) } let!(:shared_runner) { create(:ci_runner, :instance) } - let!(:specific_runner) { create(:ci_runner, :project, projects: [project]) } + let!(:project_runner) { create(:ci_runner, :project, projects: [project]) } let!(:group_runner) { create(:ci_runner, :group, groups: [group]) } let!(:pending_job) { create(:ci_build, :pending, :queued, pipeline: pipeline) } @@ -46,32 +46,32 @@ module Ci pending_job.update!(tag_list: ["linux"]) pending_job.reload pending_job.create_queuing_entry! - specific_runner.update!(tag_list: ["linux"]) - expect(execute(specific_runner)).to eq(pending_job) + project_runner.update!(tag_list: ["linux"]) + expect(execute(project_runner)).to eq(pending_job) end it "does not pick build with different tag" do pending_job.update!(tag_list: ["linux"]) pending_job.reload pending_job.create_queuing_entry! - specific_runner.update!(tag_list: ["win32"]) - expect(execute(specific_runner)).to be_falsey + project_runner.update!(tag_list: ["win32"]) + expect(execute(project_runner)).to be_falsey end it "picks build without tag" do - expect(execute(specific_runner)).to eq(pending_job) + expect(execute(project_runner)).to eq(pending_job) end it "does not pick build with tag" do pending_job.update!(tag_list: ["linux"]) pending_job.reload pending_job.create_queuing_entry! - expect(execute(specific_runner)).to be_falsey + expect(execute(project_runner)).to be_falsey end it "pick build without tag" do - specific_runner.update!(tag_list: ["win32"]) - expect(execute(specific_runner)).to eq(pending_job) + project_runner.update!(tag_list: ["win32"]) + expect(execute(project_runner)).to eq(pending_job) end end @@ -90,9 +90,9 @@ module Ci end end - context 'for specific runner' do + context 'for project runner' do it 'does not pick a build' do - expect(execute(specific_runner)).to be_nil + expect(execute(project_runner)).to be_nil expect(pending_job.reload).to be_failed expect(pending_job.queuing_entry).to be_nil end @@ -216,13 +216,13 @@ module Ci it { expect(Gitlab::Json.parse(response.build_json)['id']).to eq(build.id) } end - context 'specific runner' do - let(:build) { execute(specific_runner) } + context 'project runner' do + let(:build) { execute(project_runner) } it { expect(build).to be_kind_of(Build) } it { expect(build).to be_valid } it { expect(build).to be_running } - it { expect(build.runner).to eq(specific_runner) } + it { expect(build.runner).to eq(project_runner) } end end @@ -237,13 +237,13 @@ module Ci it { expect(build).to be_nil } end - context 'specific runner' do - let(:build) { execute(specific_runner) } + context 'project runner' do + let(:build) { execute(project_runner) } it { expect(build).to be_kind_of(Build) } it { expect(build).to be_valid } it { expect(build).to be_running } - it { expect(build.runner).to eq(specific_runner) } + it { expect(build.runner).to eq(project_runner) } end end @@ -268,7 +268,7 @@ module Ci end context 'and uses project runner' do - let(:build) { execute(specific_runner) } + let(:build) { execute(project_runner) } it 'does not pick a build' do expect(build).to be_nil @@ -360,7 +360,7 @@ module Ci .with(pending_job, anything).and_raise(ActiveRecord::StaleObjectError) end - subject { described_class.new(specific_runner).execute } + subject { described_class.new(project_runner).execute } context 'with multiple builds are in queue' do let!(:other_build) { create(:ci_build, :pending, :queued, pipeline: pipeline) } @@ -404,13 +404,13 @@ module Ci end context 'when access_level of runner is not_protected' do - let!(:specific_runner) { create(:ci_runner, :project, projects: [project]) } + let!(:project_runner) { create(:ci_runner, :project, projects: [project]) } context 'when a job is protected' do let!(:pending_job) { create(:ci_build, :pending, :queued, :protected, pipeline: pipeline) } it 'picks the job' do - expect(execute(specific_runner)).to eq(pending_job) + expect(execute(project_runner)).to eq(pending_job) end end @@ -418,7 +418,7 @@ module Ci let!(:pending_job) { create(:ci_build, :pending, :queued, pipeline: pipeline) } it 'picks the job' do - expect(execute(specific_runner)).to eq(pending_job) + expect(execute(project_runner)).to eq(pending_job) end end @@ -430,19 +430,19 @@ module Ci end it 'picks the job' do - expect(execute(specific_runner)).to eq(pending_job) + expect(execute(project_runner)).to eq(pending_job) end end end context 'when access_level of runner is ref_protected' do - let!(:specific_runner) { create(:ci_runner, :project, :ref_protected, projects: [project]) } + let!(:project_runner) { create(:ci_runner, :project, :ref_protected, projects: [project]) } context 'when a job is protected' do let!(:pending_job) { create(:ci_build, :pending, :queued, :protected, pipeline: pipeline) } it 'picks the job' do - expect(execute(specific_runner)).to eq(pending_job) + expect(execute(project_runner)).to eq(pending_job) end end @@ -450,7 +450,7 @@ module Ci let!(:pending_job) { create(:ci_build, :pending, :queued, pipeline: pipeline) } it 'does not pick the job' do - expect(execute(specific_runner)).to be_nil + expect(execute(project_runner)).to be_nil end end @@ -462,7 +462,7 @@ module Ci end it 'does not pick the job' do - expect(execute(specific_runner)).to be_nil + expect(execute(project_runner)).to be_nil end end end @@ -471,7 +471,7 @@ module Ci let(:options) { { artifacts: { reports: { junit: "junit.xml" } } } } let!(:pending_job) { create(:ci_build, :pending, :queued, pipeline: pipeline, options: options) } - subject { execute(specific_runner, params) } + subject { execute(project_runner, params) } context 'when feature is missing by runner' do let(:params) { {} } @@ -507,10 +507,10 @@ module Ci let(:dependencies) { %w[test] } - subject { execute(specific_runner) } + subject { execute(project_runner) } it 'picks a build with a dependency' do - picked_build = execute(specific_runner) + picked_build = execute(project_runner) expect(picked_build).to be_present end @@ -523,7 +523,7 @@ module Ci let(:dependencies) { %w[test deploy] } it 'logs build artifacts size' do - execute(specific_runner) + execute(project_runner) artifacts_size = [pre_stage_job, pre_stage_job_second].sum do |job| job.job_artifacts_archive.size @@ -622,7 +622,7 @@ module Ci context 'when build is degenerated' do let!(:pending_job) { create(:ci_build, :pending, :queued, :degenerated, pipeline: pipeline) } - subject { execute(specific_runner, {}) } + subject { execute(project_runner, {}) } it 'does not pick the build and drops the build' do expect(subject).to be_nil @@ -642,7 +642,7 @@ module Ci pending_job.update_columns(options: "string") end - subject { execute(specific_runner, {}) } + subject { execute(project_runner, {}) } it 'does drop the build and logs both failures' do expect(Gitlab::ErrorTracking).to receive(:track_exception) @@ -668,7 +668,7 @@ module Ci .and_raise(RuntimeError, 'scheduler error') end - subject { execute(specific_runner, {}) } + subject { execute(project_runner, {}) } it 'does drop the build and logs failure' do expect(Gitlab::ErrorTracking).to receive(:track_exception) @@ -690,7 +690,7 @@ module Ci allow_any_instance_of(Ci::PersistentRef).to receive(:create_ref) { raise ArgumentError } end - subject { execute(specific_runner, {}) } + subject { execute(project_runner, {}) } it 'picks the build' do expect(subject).to eq(pending_job) @@ -701,7 +701,7 @@ module Ci end context 'when only some builds can be matched by runner' do - let!(:specific_runner) { create(:ci_runner, :project, projects: [project], tag_list: %w[matching]) } + let!(:project_runner) { create(:ci_runner, :project, projects: [project], tag_list: %w[matching]) } let!(:pending_job) { create(:ci_build, :pending, :queued, pipeline: pipeline, tag_list: %w[matching]) } before do @@ -713,21 +713,21 @@ module Ci it 'observes queue size of only matching jobs' do # pending_job + 2 x matching ones expect(Gitlab::Ci::Queue::Metrics.queue_size_total).to receive(:observe) - .with({ runner_type: specific_runner.runner_type }, 3) + .with({ runner_type: project_runner.runner_type }, 3) - expect(execute(specific_runner)).to eq(pending_job) + expect(execute(project_runner)).to eq(pending_job) end it 'observes queue processing time by the runner type' do expect(Gitlab::Ci::Queue::Metrics.queue_iteration_duration_seconds) .to receive(:observe) - .with({ runner_type: specific_runner.runner_type }, anything) + .with({ runner_type: project_runner.runner_type }, anything) expect(Gitlab::Ci::Queue::Metrics.queue_retrieval_duration_seconds) .to receive(:observe) - .with({ runner_type: specific_runner.runner_type }, anything) + .with({ runner_type: project_runner.runner_type }, anything) - expect(execute(specific_runner)).to eq(pending_job) + expect(execute(project_runner)).to eq(pending_job) end end @@ -739,7 +739,7 @@ module Ci end context 'when a build is temporarily locked' do - let(:service) { described_class.new(specific_runner) } + let(:service) { described_class.new(project_runner) } before do service.send(:acquire_temporary_lock, pending_job.id) @@ -777,7 +777,7 @@ module Ci include_examples 'handles runner assignment' context 'when a conflicting data is stored in denormalized table' do - let!(:specific_runner) { create(:ci_runner, :project, projects: [project], tag_list: %w[conflict]) } + let!(:project_runner) { create(:ci_runner, :project, projects: [project], tag_list: %w[conflict]) } let!(:pending_job) { create(:ci_build, :pending, :queued, pipeline: pipeline, tag_list: %w[conflict]) } before do @@ -788,7 +788,7 @@ module Ci expect(pending_job.reload).to be_running expect(pending_job.queuing_entry).to be_present - result = described_class.new(specific_runner).execute + result = described_class.new(project_runner).execute expect(result).not_to be_valid expect(pending_job.reload.queuing_entry).not_to be_present @@ -918,7 +918,7 @@ module Ci end end - context 'when specific runner is used' do + context 'when project runner is used' do let(:runner) { create(:ci_runner, :project, projects: [project], tag_list: %w(tag1 metrics_shard::shard_tag tag2)) } let(:expected_shared_runner) { false } let(:expected_shard) { ::Gitlab::Ci::Queue::Metrics::DEFAULT_METRICS_SHARD } @@ -933,12 +933,12 @@ module Ci it 'present sets runner session configuration in the build' do runner_session_params = { session: { 'url' => 'https://example.com' } } - expect(execute(specific_runner, runner_session_params).runner_session.attributes) + expect(execute(project_runner, runner_session_params).runner_session.attributes) .to include(runner_session_params[:session]) end it 'not present it does not configure the runner session' do - expect(execute(specific_runner).runner_session).to be_nil + expect(execute(project_runner).runner_session).to be_nil end end @@ -954,7 +954,7 @@ module Ci it 'returns 409 conflict' do expect(Ci::Build.pending.unstarted.count).to eq 3 - result = described_class.new(specific_runner).execute + result = described_class.new(project_runner).execute expect(result).not_to be_valid expect(result.build).to be_nil diff --git a/spec/services/ci/update_build_queue_service_spec.rb b/spec/services/ci/update_build_queue_service_spec.rb index d3f537a1aa0..dd26339831c 100644 --- a/spec/services/ci/update_build_queue_service_spec.rb +++ b/spec/services/ci/update_build_queue_service_spec.rb @@ -277,7 +277,7 @@ RSpec.describe Ci::UpdateBuildQueueService do end end - context 'when updating specific runners' do + context 'when updating project runners' do let(:runner) { create(:ci_runner, :project, projects: [project]) } it_behaves_like 'matching build' |