diff options
76 files changed, 533 insertions, 199 deletions
diff --git a/.markdownlint.json b/.markdownlint.json index caba86d4e67..79bd06991e7 100644 --- a/.markdownlint.json +++ b/.markdownlint.json @@ -102,6 +102,7 @@ "PostgreSQL", "Prometheus", "Puma", + "puma-worker-killer", "Python", "Rake", "Redis", diff --git a/app/assets/javascripts/boards/components/board_form.vue b/app/assets/javascripts/boards/components/board_form.vue index ec715759406..fbe221041c1 100644 --- a/app/assets/javascripts/boards/components/board_form.vue +++ b/app/assets/javascripts/boards/components/board_form.vue @@ -177,7 +177,7 @@ export default { @cancel="cancel" @submit="submit" > - <template slot="body"> + <template #body> <p v-if="isDeleteForm">{{ __('Are you sure you want to delete this board?') }}</p> <form v-else class="js-board-config-modal" @submit.prevent> <div v-if="!readonly" class="append-bottom-20"> diff --git a/app/assets/javascripts/ide/components/panes/collapsible_sidebar.vue b/app/assets/javascripts/ide/components/panes/collapsible_sidebar.vue index ea744eab2cf..91e80be7d18 100644 --- a/app/assets/javascripts/ide/components/panes/collapsible_sidebar.vue +++ b/app/assets/javascripts/ide/components/panes/collapsible_sidebar.vue @@ -115,7 +115,7 @@ export default { v-for="tabView in aliveTabViews" v-show="isActiveView(tabView.name)" :key="tabView.name" - class="flex-fill js-tab-view" + class="flex-fill gl-overflow-hidden js-tab-view" > <component :is="tabView.component" /> </div> diff --git a/app/assets/javascripts/lib/utils/text_markdown.js b/app/assets/javascripts/lib/utils/text_markdown.js index a2a806ff90b..0dfc144c363 100644 --- a/app/assets/javascripts/lib/utils/text_markdown.js +++ b/app/assets/javascripts/lib/utils/text_markdown.js @@ -225,7 +225,7 @@ export function insertMarkdownText({ } else if (tag.indexOf(textPlaceholder) > -1) { textToInsert = tag.replace(textPlaceholder, selected); } else { - textToInsert = String(startChar) + tag + selected + (wrap ? tag : ' '); + textToInsert = String(startChar) + tag + selected + (wrap ? tag : ''); } if (removedFirstNewLine) { diff --git a/app/assets/javascripts/notes/components/noteable_note.vue b/app/assets/javascripts/notes/components/noteable_note.vue index dea782683f2..a74207403e1 100644 --- a/app/assets/javascripts/notes/components/noteable_note.vue +++ b/app/assets/javascripts/notes/components/noteable_note.vue @@ -258,7 +258,7 @@ export default { <note-header v-once :author="author" :created-at="note.created_at" :note-id="note.id"> <slot slot="note-header-info" name="note-header-info"></slot> <span v-if="commit" v-html="actionText"></span> - <span v-else class="d-none d-sm-inline">·</span> + <span v-else-if="note.created_at" class="d-none d-sm-inline">·</span> </note-header> <note-actions :author-id="author.id" diff --git a/app/assets/javascripts/pages/milestones/shared/components/delete_milestone_modal.vue b/app/assets/javascripts/pages/milestones/shared/components/delete_milestone_modal.vue index 061044eba84..58dba41277d 100644 --- a/app/assets/javascripts/pages/milestones/shared/components/delete_milestone_modal.vue +++ b/app/assets/javascripts/pages/milestones/shared/components/delete_milestone_modal.vue @@ -123,7 +123,7 @@ Once deleted, it cannot be undone or recovered.`), kind="danger" @submit="onSubmit" > - <template slot="body" slot-scope="props"> + <template #body="props"> <p v-html="props.text"></p> </template> </deprecated-modal> diff --git a/app/assets/javascripts/projects/commits/components/author_select.vue b/app/assets/javascripts/projects/commits/components/author_select.vue index 78f9389b80c..eb514b5c070 100644 --- a/app/assets/javascripts/projects/commits/components/author_select.vue +++ b/app/assets/javascripts/projects/commits/components/author_select.vue @@ -110,6 +110,7 @@ export default { <gl-new-dropdown :text="dropdownText" :disabled="hasSearchParam" + toggle-class="gl-py-3" class="gl-dropdown w-100 mt-2 mt-sm-0" > <gl-new-dropdown-header> diff --git a/app/assets/stylesheets/framework/tables.scss b/app/assets/stylesheets/framework/tables.scss index ae5d452e57e..5739f048e86 100644 --- a/app/assets/stylesheets/framework/tables.scss +++ b/app/assets/stylesheets/framework/tables.scss @@ -9,6 +9,10 @@ table { * This is a temporary workaround until we fix the neutral * color palette in https://gitlab.com/gitlab-org/gitlab/-/issues/213570 * + * The overwrites here affected the security dashboard tables, when removing + * this code, table-th-transparent and original-text-color classes should + * be removed there. + * * Remove this code as soon as this happens */ &.gl-table { @@ -54,6 +58,11 @@ table { background: none; color: $gl-text-color-secondary; } + + &.original-gl-th { + @include gl-text-gray-700; + border-bottom: 1px solid $cycle-analytics-light-gray; + } } td { diff --git a/app/controllers/projects/branches_controller.rb b/app/controllers/projects/branches_controller.rb index 09754409104..cc595740696 100644 --- a/app/controllers/projects/branches_controller.rb +++ b/app/controllers/projects/branches_controller.rb @@ -186,7 +186,6 @@ class Projects::BranchesController < Projects::ApplicationController end def confidential_issue_project - return unless helpers.create_confidential_merge_request_enabled? return if params[:confidential_issue_project_id].blank? confidential_issue_project = Project.find(params[:confidential_issue_project_id]) diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb index 47dbb800047..3e9d956f7b1 100644 --- a/app/controllers/projects/issues_controller.rb +++ b/app/controllers/projects/issues_controller.rb @@ -187,7 +187,7 @@ class Projects::IssuesController < Projects::ApplicationController def create_merge_request create_params = params.slice(:branch_name, :ref).merge(issue_iid: issue.iid) - create_params[:target_project_id] = params[:target_project_id] if helpers.create_confidential_merge_request_enabled? + create_params[:target_project_id] = params[:target_project_id] result = ::MergeRequests::CreateFromIssueService.new(project, current_user, create_params).execute if result[:status] == :success diff --git a/app/graphql/resolvers/milestone_resolver.rb b/app/graphql/resolvers/milestone_resolver.rb index 2e7b6fdfd5f..6c6513e0ee4 100644 --- a/app/graphql/resolvers/milestone_resolver.rb +++ b/app/graphql/resolvers/milestone_resolver.rb @@ -9,6 +9,10 @@ module Resolvers required: false, description: 'Filter milestones by state' + argument :include_descendants, GraphQL::BOOLEAN_TYPE, + required: false, + description: 'Return also milestones in all subgroups and subprojects' + type Types::MilestoneType, null: true def resolve(**args) @@ -26,16 +30,16 @@ module Resolvers state: args[:state] || 'all', start_date: args[:start_date], end_date: args[:end_date] - }.merge(parent_id_parameter) + }.merge(parent_id_parameter(args)) end def parent @parent ||= object.respond_to?(:sync) ? object.sync : object end - def parent_id_parameter + def parent_id_parameter(args) if parent.is_a?(Group) - { group_ids: parent.id } + group_parameters(args) elsif parent.is_a?(Project) { project_ids: parent.id } end @@ -46,5 +50,26 @@ module Resolvers def authorize! Ability.allowed?(context[:current_user], :read_milestone, parent) || raise_resource_not_available_error! end + + def group_parameters(args) + return { group_ids: parent.id } unless include_descendants?(args) + + { + group_ids: parent.self_and_descendants.public_or_visible_to_user(current_user).select(:id), + project_ids: group_projects.with_issues_or_mrs_available_for_user(current_user) + } + end + + def include_descendants?(args) + args[:include_descendants].present? && Feature.enabled?(:group_milestone_descendants, parent) + end + + def group_projects + GroupProjectsFinder.new( + group: parent, + current_user: current_user, + options: { include_subgroups: true } + ).execute + end end end diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 8747430a909..39edfeea81e 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -138,17 +138,12 @@ module IssuesHelper can?(current_user, :create_issue, project) end - def create_confidential_merge_request_enabled? - Feature.enabled?(:create_confidential_merge_request, @project, default_enabled: true) - end - def show_new_branch_button? can_create_confidential_merge_request? || !@issue.confidential? end def can_create_confidential_merge_request? @issue.confidential? && !@project.private? && - create_confidential_merge_request_enabled? && can?(current_user, :create_merge_request_in, @project) end diff --git a/app/models/application_setting_implementation.rb b/app/models/application_setting_implementation.rb index 1276ef4ed8c..221e4d5e0c6 100644 --- a/app/models/application_setting_implementation.rb +++ b/app/models/application_setting_implementation.rb @@ -96,7 +96,7 @@ module ApplicationSettingImplementation plantuml_url: nil, polling_interval_multiplier: 1, project_export_enabled: true, - protected_ci_variables: false, + protected_ci_variables: true, push_event_hooks_limit: 3, push_event_activities_limit: 3, raw_blob_request_limit: 300, diff --git a/app/views/shared/notes/_note.html.haml b/app/views/shared/notes/_note.html.haml index 50bc4fb35df..df09c4338a1 100644 --- a/app/views/shared/notes/_note.html.haml +++ b/app/views/shared/notes/_note.html.haml @@ -40,9 +40,10 @@ - if note.system %span.system-note-message = markdown_field(note, :note) - %span.system-note-separator - · - %a.system-note-separator{ href: "##{dom_id(note)}" }= time_ago_with_tooltip(note.created_at, placement: 'bottom', html_class: 'note-created-ago') + - if note.created_at + %span.system-note-separator + · + %a.system-note-separator{ href: "##{dom_id(note)}" }= time_ago_with_tooltip(note.created_at, placement: 'bottom', html_class: 'note-created-ago') - unless note.system? .note-actions - if note.for_personal_snippet? diff --git a/changelogs/unreleased/10343-remove-a-lonely-dot-in-batch-comments.yml b/changelogs/unreleased/10343-remove-a-lonely-dot-in-batch-comments.yml new file mode 100644 index 00000000000..f741179ab92 --- /dev/null +++ b/changelogs/unreleased/10343-remove-a-lonely-dot-in-batch-comments.yml @@ -0,0 +1,5 @@ +--- +title: Remove a lonely dot in Batch Comments. +merge_request: 31783 +author: Gilang Gumilar +type: changed diff --git a/changelogs/unreleased/210045-make-ci-ci-variables-protected-by-default.yml b/changelogs/unreleased/210045-make-ci-ci-variables-protected-by-default.yml new file mode 100644 index 00000000000..f1ed15d1268 --- /dev/null +++ b/changelogs/unreleased/210045-make-ci-ci-variables-protected-by-default.yml @@ -0,0 +1,5 @@ +--- +title: Make protected_ci_variables setting enabled by default +merge_request: 31715 +author: +type: changed diff --git a/changelogs/unreleased/216091-align-author-dropdown-height.yml b/changelogs/unreleased/216091-align-author-dropdown-height.yml new file mode 100644 index 00000000000..bc1f2f058f3 --- /dev/null +++ b/changelogs/unreleased/216091-align-author-dropdown-height.yml @@ -0,0 +1,5 @@ +--- +title: Fix misalignment of author dropdown on the commits search page +merge_request: 31686 +author: +type: other diff --git a/changelogs/unreleased/fe-ide-fix-scroll-in-right-pane.yml b/changelogs/unreleased/fe-ide-fix-scroll-in-right-pane.yml new file mode 100644 index 00000000000..0a0dc3ead62 --- /dev/null +++ b/changelogs/unreleased/fe-ide-fix-scroll-in-right-pane.yml @@ -0,0 +1,5 @@ +--- +title: Fix no scroll when overflow in IDE right pane +merge_request: 31961 +author: +type: fixed diff --git a/changelogs/unreleased/markdown-toolbar-spaces.yml b/changelogs/unreleased/markdown-toolbar-spaces.yml new file mode 100644 index 00000000000..07200f021a3 --- /dev/null +++ b/changelogs/unreleased/markdown-toolbar-spaces.yml @@ -0,0 +1,5 @@ +--- +title: Remove extra spaces from markdown toolbar items +merge_request: 31288 +author: +type: other diff --git a/changelogs/unreleased/remove-create_confidential_merge_request.yml b/changelogs/unreleased/remove-create_confidential_merge_request.yml new file mode 100644 index 00000000000..49d6b201362 --- /dev/null +++ b/changelogs/unreleased/remove-create_confidential_merge_request.yml @@ -0,0 +1,5 @@ +--- +title: Removes create_confidential_merge_request feature flag leandrogs +merge_request: 31968 +author: Leandro Silva +type: other diff --git a/changelogs/unreleased/update-deprecated-slot-syntax-in---app-assets-javascripts-boards-componen.yml b/changelogs/unreleased/update-deprecated-slot-syntax-in---app-assets-javascripts-boards-componen.yml new file mode 100644 index 00000000000..1088f6aafab --- /dev/null +++ b/changelogs/unreleased/update-deprecated-slot-syntax-in---app-assets-javascripts-boards-componen.yml @@ -0,0 +1,5 @@ +--- +title: Update deprecated slot syntax in ./app/assets/javascripts/boards/components/board_form.vue +merge_request: 32005 +author: Gilang Gumilar +type: changed diff --git a/changelogs/unreleased/update-deprecated-slot-syntax-in---app-assets-javascripts-pages-milestone.yml b/changelogs/unreleased/update-deprecated-slot-syntax-in---app-assets-javascripts-pages-milestone.yml new file mode 100644 index 00000000000..15ea555a8fe --- /dev/null +++ b/changelogs/unreleased/update-deprecated-slot-syntax-in---app-assets-javascripts-pages-milestone.yml @@ -0,0 +1,5 @@ +--- +title: Update deprecated slot syntax in ./app/assets/javascripts/pages/milestones/shared/components/delete_milestone_modal.vue +merge_request: 31990 +author: Gilang Gumilar +type: changed diff --git a/db/migrate/20200512085150_change_default_value_of_protected_ci_variables_of_application_settings_to_true.rb b/db/migrate/20200512085150_change_default_value_of_protected_ci_variables_of_application_settings_to_true.rb new file mode 100644 index 00000000000..ca623ccf8b4 --- /dev/null +++ b/db/migrate/20200512085150_change_default_value_of_protected_ci_variables_of_application_settings_to_true.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class ChangeDefaultValueOfProtectedCiVariablesOfApplicationSettingsToTrue < ActiveRecord::Migration[6.0] + DOWNTIME = false + + def change + change_column_default :application_settings, :protected_ci_variables, from: false, to: true + end +end diff --git a/db/structure.sql b/db/structure.sql index ad50cae5ca2..164f1e4c6db 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -349,7 +349,7 @@ CREATE TABLE public.application_settings ( diff_max_patch_bytes integer DEFAULT 102400 NOT NULL, archive_builds_in_seconds integer, commit_email_hostname character varying, - protected_ci_variables boolean DEFAULT false NOT NULL, + protected_ci_variables boolean DEFAULT true NOT NULL, runners_registration_token_encrypted character varying, local_markdown_version integer DEFAULT 0 NOT NULL, first_day_of_week integer DEFAULT 0 NOT NULL, @@ -13768,5 +13768,6 @@ COPY "schema_migrations" (version) FROM STDIN; 20200508091106 20200511092714 20200511145545 +20200512085150 \. diff --git a/doc/administration/database_load_balancing.md b/doc/administration/database_load_balancing.md index b208a5052cb..1bc848e537a 100644 --- a/doc/administration/database_load_balancing.md +++ b/doc/administration/database_load_balancing.md @@ -167,6 +167,10 @@ queried over UDP. To overcome this issue, you can use TCP for querying by settin ### Forking +NOTE: **Note:** +Starting with GitLab 13.0, Puma is the default web server used in GitLab +all-in-one package based installations as well as GitLab Helm chart deployments. + If you use an application server that forks, such as Unicorn, you _have to_ update your Unicorn configuration to start service discovery _after_ a fork. Failure to do so will lead to service discovery only running in the parent diff --git a/doc/administration/geo/replication/database.md b/doc/administration/geo/replication/database.md index 870e486d6a1..4eac22e194d 100644 --- a/doc/administration/geo/replication/database.md +++ b/doc/administration/geo/replication/database.md @@ -91,7 +91,7 @@ There is an [issue where support is being discussed](https://gitlab.com/gitlab-o # Fill with the hash generated by `gitlab-ctl pg-password-md5 gitlab` postgresql['sql_user_password'] = '<md5_hash_of_your_password>' - # Every node that runs Unicorn or Sidekiq needs to have the database + # Every node that runs Puma or Sidekiq needs to have the database # password specified as below. If you have a high-availability setup, this # must be present in all application nodes. gitlab_rails['db_password'] = '<your_password_here>' @@ -273,7 +273,7 @@ There is an [issue where support is being discussed](https://gitlab.com/gitlab-o 1. Stop application server and Sidekiq ```shell - gitlab-ctl stop unicorn + gitlab-ctl stop puma gitlab-ctl stop sidekiq ``` diff --git a/doc/administration/geo/replication/high_availability.md b/doc/administration/geo/replication/high_availability.md index 6f5ab9fdfb2..3cc6502e720 100644 --- a/doc/administration/geo/replication/high_availability.md +++ b/doc/administration/geo/replication/high_availability.md @@ -261,7 +261,7 @@ Configure the tracking database. redis_exporter['enable'] = false repmgr['enable'] = false sidekiq['enable'] = false - unicorn['enable'] = false + puma['enable'] = false ``` After making these changes, [reconfigure GitLab](../../restart_gitlab.md#omnibus-gitlab-reconfigure) so the changes take effect. @@ -354,7 +354,7 @@ On the secondary the following GitLab frontend services will be enabled: - `registry` - `remote-syslog` - `sidekiq` -- `unicorn` +- `puma` Verify these services by running `sudo gitlab-ctl status` on the frontend application servers. @@ -407,7 +407,7 @@ application servers above, with some changes to run only the `sidekiq` service: redis['enable'] = false redis_exporter['enable'] = false repmgr['enable'] = false - unicorn['enable'] = false + puma['enable'] = false ## ## The unique identifier for the Geo node. diff --git a/doc/administration/geo/replication/security_review.md b/doc/administration/geo/replication/security_review.md index 18fe1ad22cd..c6b0b1e713f 100644 --- a/doc/administration/geo/replication/security_review.md +++ b/doc/administration/geo/replication/security_review.md @@ -177,7 +177,7 @@ from [owasp.org](https://owasp.org/). ### What databases and application servers support the application? -- PostgreSQL >= 9.6, Redis, Sidekiq, Unicorn. +- PostgreSQL >= 9.6, Redis, Sidekiq, Puma. ### How will database connection strings, encryption keys, and other sensitive components be stored, accessed, and protected from unauthorized detection? diff --git a/doc/administration/gitaly/index.md b/doc/administration/gitaly/index.md index 29dd48356d4..14b0a6bd450 100644 --- a/doc/administration/gitaly/index.md +++ b/doc/administration/gitaly/index.md @@ -74,7 +74,7 @@ The following list depicts what the network architecture of Gitaly is: - A GitLab server can use one or more Gitaly servers. - Gitaly addresses must be specified in such a way that they resolve correctly for ALL Gitaly clients. -- Gitaly clients are: Unicorn, Sidekiq, GitLab Workhorse, +- Gitaly clients are: Puma/Unicorn, Sidekiq, GitLab Workhorse, GitLab Shell, Elasticsearch Indexer, and Gitaly itself. - A Gitaly server must be able to make RPC calls **to itself** via its own `(Gitaly address, Gitaly token)` pair as specified in `/config/gitlab.yml`. @@ -195,7 +195,7 @@ authentication](https://gitlab.com/gitlab-org/gitaly/blob/master/doc/configurati postgresql['enable'] = false redis['enable'] = false nginx['enable'] = false - unicorn['enable'] = false + puma['enable'] = false sidekiq['enable'] = false gitlab_workhorse['enable'] = false grafana['enable'] = false diff --git a/doc/administration/gitaly/praefect.md b/doc/administration/gitaly/praefect.md index b552f7d88af..77655b723e9 100644 --- a/doc/administration/gitaly/praefect.md +++ b/doc/administration/gitaly/praefect.md @@ -207,7 +207,7 @@ application server, or a Gitaly node. nginx['enable'] = false prometheus['enable'] = false grafana['enable'] = false - unicorn['enable'] = false + puma['enable'] = false sidekiq['enable'] = false gitlab_workhorse['enable'] = false gitaly['enable'] = false @@ -421,7 +421,7 @@ documentation](index.md#3-gitaly-server-configuration). nginx['enable'] = false prometheus['enable'] = false grafana['enable'] = false - unicorn['enable'] = false + puma['enable'] = false sidekiq['enable'] = false gitlab_workhorse['enable'] = false prometheus_monitoring['enable'] = false diff --git a/doc/administration/high_availability/gitlab.md b/doc/administration/high_availability/gitlab.md index 6c90c66973d..cdafdbc4954 100644 --- a/doc/administration/high_availability/gitlab.md +++ b/doc/administration/high_availability/gitlab.md @@ -162,7 +162,7 @@ If you enable Monitoring, it must be enabled on **all** GitLab servers. node_exporter['listen_address'] = '0.0.0.0:9100' gitlab_workhorse['prometheus_listen_addr'] = '0.0.0.0:9229' sidekiq['listen_address'] = "0.0.0.0" - unicorn['listen'] = '0.0.0.0' + puma['listen'] = '0.0.0.0' # Add the monitoring node's IP address to the monitoring whitelist and allow it to # scrape the NGINX metrics. Replace placeholder `monitoring.gitlab.example.com` with @@ -174,9 +174,11 @@ If you enable Monitoring, it must be enabled on **all** GitLab servers. 1. Run `sudo gitlab-ctl reconfigure` to compile the configuration. CAUTION: **Warning:** - After changing `unicorn['listen']` in `gitlab.rb`, and running `sudo gitlab-ctl reconfigure`, - it can take an extended period of time for Unicorn to complete reloading after receiving a `HUP`. - For more information, see the [issue](https://gitlab.com/gitlab-org/omnibus-gitlab/issues/4401). + If running Unicorn, after changing `unicorn['listen']` in `gitlab.rb`, and + running `sudo gitlab-ctl reconfigure`, it can take an extended period of time + for Unicorn to complete reloading after receiving a `HUP`. For more + information, see the + [issue](https://gitlab.com/gitlab-org/omnibus-gitlab/issues/4401). ## Troubleshooting diff --git a/doc/administration/high_availability/monitoring_node.md b/doc/administration/high_availability/monitoring_node.md index 3e6fdbf9b1c..409a4dfecb9 100644 --- a/doc/administration/high_availability/monitoring_node.md +++ b/doc/administration/high_availability/monitoring_node.md @@ -64,7 +64,7 @@ Omnibus: redis['enable'] = false redis_exporter['enable'] = false sidekiq['enable'] = false - unicorn['enable'] = false + puma['enable'] = false node_exporter['enable'] = false gitlab_exporter['enable'] = false ``` diff --git a/doc/administration/high_availability/pgbouncer.md b/doc/administration/high_availability/pgbouncer.md index f0e76172a00..3b56008feb7 100644 --- a/doc/administration/high_availability/pgbouncer.md +++ b/doc/administration/high_availability/pgbouncer.md @@ -165,7 +165,7 @@ Refer to your preferred Load Balancer's documentation for further guidance. 1. Run `gitlab-ctl reconfigure` -1. On the node running Unicorn, make sure the following is set in `/etc/gitlab/gitlab.rb` +1. On the node running Puma, make sure the following is set in `/etc/gitlab/gitlab.rb` ```ruby gitlab_rails['db_host'] = 'PGBOUNCER_HOST' diff --git a/doc/administration/high_availability/redis.md b/doc/administration/high_availability/redis.md index 3af175b8539..945f456c904 100644 --- a/doc/administration/high_availability/redis.md +++ b/doc/administration/high_availability/redis.md @@ -63,7 +63,7 @@ Omnibus: ## Disable all other services sidekiq['enable'] = false gitlab_workhorse['enable'] = false - unicorn['enable'] = false + puma['enable'] = false postgresql['enable'] = false nginx['enable'] = false prometheus['enable'] = false diff --git a/doc/administration/high_availability/sidekiq.md b/doc/administration/high_availability/sidekiq.md index 2c1dea890af..493929dcf3b 100644 --- a/doc/administration/high_availability/sidekiq.md +++ b/doc/administration/high_availability/sidekiq.md @@ -88,7 +88,7 @@ you want using steps 1 and 2 from the GitLab downloads page. postgresql['enable'] = false redis['enable'] = false redis_exporter['enable'] = false - unicorn['enable'] = false + puma['enable'] = false gitlab_exporter['enable'] = false ``` @@ -119,7 +119,7 @@ postgres_exporter['enable'] = false postgresql['enable'] = false redis['enable'] = false redis_exporter['enable'] = false -unicorn['enable'] = false +puma['enable'] = false gitlab_exporter['enable'] = false ######################################## diff --git a/doc/administration/index.md b/doc/administration/index.md index cda2852b43b..682a5b94e20 100644 --- a/doc/administration/index.md +++ b/doc/administration/index.md @@ -79,7 +79,7 @@ Learn how to install, configure, update, and maintain your GitLab instance. - [Rake tasks](../raketasks/README.md): Perform various tasks for maintenance, backups, automatic webhooks setup, and more. - [Backup and restore](../raketasks/backup_restore.md): Backup and restore your GitLab instance. -- [Operations](operations/index.md): Keeping GitLab up and running (clean up Redis sessions, moving repositories, Sidekiq MemoryKiller, Unicorn). +- [Operations](operations/index.md): Keeping GitLab up and running (clean up Redis sessions, moving repositories, Sidekiq MemoryKiller, Puma). - [Restart GitLab](restart_gitlab.md): Learn how to restart GitLab and its components. - [Invalidate Markdown cache](invalidate_markdown_cache.md): Invalidate any cached Markdown. diff --git a/doc/administration/job_logs.md b/doc/administration/job_logs.md index 6020d1d2850..5c03ff1f4b2 100644 --- a/doc/administration/job_logs.md +++ b/doc/administration/job_logs.md @@ -12,8 +12,8 @@ In the following table you can see the phases a log goes through: | Phase | State | Condition | Data flow | Stored path | | -------------- | ------------ | ----------------------- | -----------------------------------------| ----------- | -| 1: patching | log | When a job is running | GitLab Runner => Unicorn => file storage | `#{ROOT_PATH}/gitlab-ci/builds/#{YYYY_mm}/#{project_id}/#{job_id}.log` | -| 2: overwriting | log | When a job is finished | GitLab Runner => Unicorn => file storage | `#{ROOT_PATH}/gitlab-ci/builds/#{YYYY_mm}/#{project_id}/#{job_id}.log` | +| 1: patching | log | When a job is running | GitLab Runner => Puma => file storage | `#{ROOT_PATH}/gitlab-ci/builds/#{YYYY_mm}/#{project_id}/#{job_id}.log` | +| 2: overwriting | log | When a job is finished | GitLab Runner => Puma => file storage | `#{ROOT_PATH}/gitlab-ci/builds/#{YYYY_mm}/#{project_id}/#{job_id}.log` | | 3: archiving | archived log | After a job is finished | Sidekiq moves log to artifacts folder | `#{ROOT_PATH}/gitlab-rails/shared/artifacts/#{disk_hash}/#{YYYY_mm_dd}/#{job_id}/#{job_artifact_id}/job.log` | | 4: uploading | archived log | After a log is archived | Sidekiq moves archived log to [object storage](#uploading-logs-to-object-storage) (if configured) | `#{bucket_name}/#{disk_hash}/#{YYYY_mm_dd}/#{job_id}/#{job_artifact_id}/job.log` | diff --git a/doc/administration/logs.md b/doc/administration/logs.md index d8ec588a37d..57b12897979 100644 --- a/doc/administration/logs.md +++ b/doc/administration/logs.md @@ -538,8 +538,18 @@ This file lives in `/var/log/gitlab/gitaly/current` and is produced by [runit](h This file lives in `/var/log/gitlab/gitlab-rails/grpc.log` for Omnibus GitLab packages. Native [gRPC](https://grpc.io/) logging used by Gitaly. +## `puma_stderr.log` & `puma_stdout.log` + +This file lives in `/var/log/gitlab/puma/puma_stderr.log` and `/var/log/gitlab/puma/puma_stdout.log` for +Omnibus GitLab packages or in `/home/git/gitlab/log/puma_stderr.log` and `/home/git/gitlab/log/puma_stdout.log` +for installations from source. + ## `unicorn_stderr.log` & `unicorn_stdout.log` +NOTE: **Note:** +Starting with GitLab 13.0, Puma is the default web server used in GitLab +all-in-one package based installations as well as GitLab Helm chart deployments. + This file lives in `/var/log/gitlab/unicorn/unicorn_stderr.log` and `/var/log/gitlab/unicorn/unicorn_stdout.log` for Omnibus GitLab packages or in `/home/git/gitlab/log/unicorn_stderr.log` and `/home/git/gitlab/log/unicorn_stdout.log` for installations from source. @@ -565,12 +575,6 @@ I, [2015-02-13T07:16:01.534501 #13379] INFO -- : worker=1 spawned pid=13379 I, [2015-02-13T07:16:01.534848 #13379] INFO -- : worker=1 ready ``` -## `puma_stderr.log` & `puma_stdout.log` - -This file lives in `/var/log/gitlab/puma/puma_stderr.log` and `/var/log/gitlab/puma/puma_stdout.log` for -Omnibus GitLab packages or in `/home/git/gitlab/log/puma_stderr.log` and `/home/git/gitlab/log/puma_stdout.log` -for installations from source. - ## `repocheck.log` This file lives in `/var/log/gitlab/gitlab-rails/repocheck.log` for @@ -657,7 +661,7 @@ will be generated in `/var/log/gitlab/gitlab-rails/sidekiq_exporter.log` for Omnibus GitLab packages or in `/home/git/gitlab/log/sidekiq_exporter.log` for installations from source. -If Prometheus metrics and the Web Exporter are both enabled, Unicorn/Puma will +If Prometheus metrics and the Web Exporter are both enabled, Puma/Unicorn will start a Web server and listen to the defined port (default: `8083`). Access logs will be generated in `/var/log/gitlab/gitlab-rails/web_exporter.log` for Omnibus GitLab packages or in `/home/git/gitlab/log/web_exporter.log` for diff --git a/doc/administration/operations/index.md b/doc/administration/operations/index.md index c27832e67ef..45b8e5ad448 100644 --- a/doc/administration/operations/index.md +++ b/doc/administration/operations/index.md @@ -12,6 +12,7 @@ Keep your GitLab instance up and running smoothly. - [Sidekiq MemoryKiller](sidekiq_memory_killer.md): Configure Sidekiq MemoryKiller to restart Sidekiq. - [Multiple Sidekiq processes](extra_sidekiq_processes.md): Configure multiple Sidekiq processes to ensure certain queues always have dedicated workers, no matter the number of jobs that need to be processed. **(CORE ONLY)** +- [Puma](puma.md): Understand Puma and puma-worker-killer. - [Unicorn](unicorn.md): Understand Unicorn and unicorn-worker-killer. - Speed up SSH operations by [Authorizing SSH users via a fast, indexed lookup to the GitLab database](fast_ssh_key_lookup.md), and/or diff --git a/doc/administration/operations/puma.md b/doc/administration/operations/puma.md index 9bc53ce1f49..af559cf00e9 100644 --- a/doc/administration/operations/puma.md +++ b/doc/administration/operations/puma.md @@ -3,7 +3,9 @@ ## Puma As of GitLab 12.9, [Puma](https://github.com/puma/puma) has replaced [Unicorn](https://yhbt.net/unicorn/). -as the default web server. +as the default web server. Starting with 13.0, both all-in-one package based +installations as well as Helm chart based installations will run Puma instead of +Unicorn unless explicitly specified not to. ## Why switch to Puma? diff --git a/doc/administration/operations/sidekiq_memory_killer.md b/doc/administration/operations/sidekiq_memory_killer.md index 6438dbb9dab..fdccfacc8a9 100644 --- a/doc/administration/operations/sidekiq_memory_killer.md +++ b/doc/administration/operations/sidekiq_memory_killer.md @@ -2,13 +2,13 @@ The GitLab Rails application code suffers from memory leaks. For web requests this problem is made manageable using -[`unicorn-worker-killer`](https://github.com/kzk/unicorn-worker-killer) which -restarts Unicorn worker processes in between requests when needed. The Sidekiq +[`puma-worker-killer`](https://github.com/schneems/puma_worker_killer) which +restarts Puma worker processes if it exceeds a memory limit. The Sidekiq MemoryKiller applies the same approach to the Sidekiq processes used by GitLab to process background jobs. -Unlike unicorn-worker-killer, which is enabled by default for all GitLab -installations since GitLab 6.4, the Sidekiq MemoryKiller is enabled by default +Unlike puma-worker-killer, which is enabled by default for all GitLab +installations since GitLab 13.0, the Sidekiq MemoryKiller is enabled by default _only_ for Omnibus packages. The reason for this is that the MemoryKiller relies on runit to restart Sidekiq after a memory-induced shutdown and GitLab installations from source do not all use runit or an equivalent. diff --git a/doc/administration/operations/unicorn.md b/doc/administration/operations/unicorn.md index bb817e71f5a..50481482f4c 100644 --- a/doc/administration/operations/unicorn.md +++ b/doc/administration/operations/unicorn.md @@ -1,5 +1,9 @@ # Understanding Unicorn and unicorn-worker-killer +NOTE: **Note:** +Starting with GitLab 13.0, Puma is the default web server used in GitLab +all-in-one package based installations as well as GitLab Helm chart deployments. + ## Unicorn GitLab uses [Unicorn](https://yhbt.net/unicorn/), a pre-forking Ruby web diff --git a/doc/administration/pages/index.md b/doc/administration/pages/index.md index e2863eb7e40..15d7567ad5c 100644 --- a/doc/administration/pages/index.md +++ b/doc/administration/pages/index.md @@ -472,7 +472,7 @@ To configure GitLab Pages on a separate server: postgresql['enable'] = false redis['enable'] = false prometheus['enable'] = false - unicorn['enable'] = false + puma['enable'] = false sidekiq['enable'] = false gitlab_workhorse['enable'] = false gitaly['enable'] = false diff --git a/doc/administration/reference_architectures/index.md b/doc/administration/reference_architectures/index.md index 5e9e2e1b489..d39a7bdecfa 100644 --- a/doc/administration/reference_architectures/index.md +++ b/doc/administration/reference_architectures/index.md @@ -165,7 +165,7 @@ column. | Redis Sentinel | High availability for Redis | [Redis Sentinel configuration](../high_availability/redis.md) | Yes | | [Gitaly](../../development/architecture.md#gitaly) ([2](#footnotes)) ([7](#footnotes)) ([10](#footnotes)) | Provides access to Git repositories | [Gitaly configuration](../gitaly/index.md#running-gitaly-on-its-own-server) | Yes | | [Sidekiq](../../development/architecture.md#sidekiq) | Asynchronous/background jobs | [Sidekiq configuration](../high_availability/sidekiq.md) | Yes | -| [GitLab application services](../../development/architecture.md#unicorn)([1](#footnotes)) | Unicorn/Puma, Workhorse, GitLab Shell - serves front-end requests (UI, API, Git over HTTP/SSH) | [GitLab app scaling configuration](../high_availability/gitlab.md) | Yes | +| [GitLab application services](../../development/architecture.md#unicorn)([1](#footnotes)) | Puma/Unicorn, Workhorse, GitLab Shell - serves front-end requests (UI, API, Git over HTTP/SSH) | [GitLab app scaling configuration](../high_availability/gitlab.md) | Yes | | [Prometheus](../../development/architecture.md#prometheus) and [Grafana](../../development/architecture.md#grafana) | GitLab environment monitoring | [Monitoring node for scaling](../high_availability/monitoring_node.md) | Yes | ## Footnotes diff --git a/doc/administration/restart_gitlab.md b/doc/administration/restart_gitlab.md index c2e750ed34e..57f53fd6cc4 100644 --- a/doc/administration/restart_gitlab.md +++ b/doc/administration/restart_gitlab.md @@ -16,7 +16,7 @@ If you have used the [Omnibus packages](https://about.gitlab.com/install/) to in you should already have `gitlab-ctl` in your `PATH`. `gitlab-ctl` interacts with the Omnibus packages and can be used to restart the -GitLab Rails application (Unicorn) as well as the other components, like: +GitLab Rails application (Puma) as well as the other components, like: - GitLab Workhorse - Sidekiq @@ -45,7 +45,7 @@ ok: run: nginx: (pid 11309) 0s ok: run: postgresql: (pid 11316) 1s ok: run: redis: (pid 11325) 0s ok: run: sidekiq: (pid 11331) 1s -ok: run: unicorn: (pid 11338) 0s +ok: run: puma: (pid 11338) 0s ``` To restart a component separately, you can append its service name to the @@ -110,25 +110,25 @@ sudo service gitlab restart The output should be similar to this: ```plaintext -Shutting down GitLab Unicorn +Shutting down GitLab Puma Shutting down GitLab Sidekiq Shutting down GitLab Workhorse Shutting down GitLab MailRoom ... GitLab is not running. -Starting GitLab Unicorn +Starting GitLab Puma Starting GitLab Sidekiq Starting GitLab Workhorse Starting GitLab MailRoom ... -The GitLab Unicorn web server with pid 28059 is running. +The GitLab Puma web server with pid 28059 is running. The GitLab Sidekiq job dispatcher with pid 28176 is running. The GitLab Workhorse with pid 28122 is running. The GitLab MailRoom email processor with pid 28114 is running. GitLab and all its components are up and running. ``` -This should restart Unicorn, Sidekiq, GitLab Workhorse, and [Mailroom](reply_by_email.md) +This should restart Puma, Sidekiq, GitLab Workhorse, and [Mailroom](reply_by_email.md) (if enabled). The init service file that does all the magic can be found on your server in `/etc/init.d/gitlab`. @@ -142,7 +142,7 @@ If you are using other init systems, like systemd, you can check the There is no single command to restart the entire GitLab application installed via the [cloud native Helm Chart](https://docs.gitlab.com/charts/). Usually, it should be -enough to restart a specific component separately (for example, `gitaly`, `unicorn`, +enough to restart a specific component separately (for example, `gitaly`, `puma`, `workhorse`, or `gitlab-shell`) by deleting all the pods related to it: ```shell diff --git a/doc/administration/troubleshooting/kubernetes_cheat_sheet.md b/doc/administration/troubleshooting/kubernetes_cheat_sheet.md index adc4b020331..cab073b9924 100644 --- a/doc/administration/troubleshooting/kubernetes_cheat_sheet.md +++ b/doc/administration/troubleshooting/kubernetes_cheat_sheet.md @@ -52,7 +52,7 @@ and they will assist you with any issues you are having. - Check logs via Kubectl: ```shell - kubectl logs <unicorn pod> -c dependencies + kubectl logs <webservice pod> -c dependencies ``` - How to tail all Kubernetes cluster events in real time: @@ -87,20 +87,20 @@ and they will assist you with any issues you are having. - Minimal config that can be used to test a Kubernetes Helm chart can be found [here](https://gitlab.com/gitlab-org/charts/gitlab/issues/620). -- Tailing logs of a separate pod. An example for a Unicorn pod: +- Tailing logs of a separate pod. An example for a Webservice pod: ```shell - kubectl logs gitlab-unicorn-7656fdd6bf-jqzfs -c unicorn + kubectl logs gitlab-webservice-54fbf6698b-hpckq -c webservice ``` -- Tail and follow all pods that share a label (in this case, `unicorn`): +- Tail and follow all pods that share a label (in this case, `webservice`): ```shell - # all containers in the unicorn pods - kubectl logs -f -l app=unicorn --all-containers=true --max-log-requests=50 + # all containers in the webservice pods + kubectl logs -f -l app=webservice --all-containers=true --max-log-requests=50 - # only the unicorn containers in all unicorn pods - kubectl logs -f -l app=unicorn -c unicorn --max-log-requests=50 + # only the webservice containers in all webservice pods + kubectl logs -f -l app=webservice -c webservice --max-log-requests=50 ``` - One can stream logs from all containers at once, similar to the Omnibus diff --git a/doc/administration/uploads.md b/doc/administration/uploads.md index 5aff9f9c358..0a300084342 100644 --- a/doc/administration/uploads.md +++ b/doc/administration/uploads.md @@ -65,7 +65,7 @@ For source installations the following settings are nested under `uploads:` and |---------|-------------|---------| | `enabled` | Enable/disable object storage | `false` | | `remote_directory` | The bucket name where Uploads will be stored| | -| `direct_upload` | Set to true to remove Unicorn from the Upload path. Workhorse handles the actual Artifact Upload to Object Storage while Unicorn does minimal processing to keep track of the upload. There is no need for local shared storage. The option may be removed if support for a single storage type for all files is introduced. Read more on [direct upload](../development/uploads.md#direct-upload). | `false` | +| `direct_upload` | Set to true to remove Puma from the Upload path. Workhorse handles the actual Artifact Upload to Object Storage while Puma does minimal processing to keep track of the upload. There is no need for local shared storage. The option may be removed if support for a single storage type for all files is introduced. Read more on [direct upload](../development/uploads.md#direct-upload). | `false` | | `background_upload` | Set to false to disable automatic upload. Option may be removed once upload is direct to S3 (if `direct_upload` is set to `true` it will override `background_upload`) | `true` | | `proxy_download` | Set to true to enable proxying all files served. Option allows to reduce egress traffic as this allows clients to download directly from remote storage instead of proxying all data | `false` | | `connection` | Various connection options described below | | diff --git a/doc/api/graphql/reference/gitlab_schema.graphql b/doc/api/graphql/reference/gitlab_schema.graphql index 860a32349f1..912400cd7f8 100644 --- a/doc/api/graphql/reference/gitlab_schema.graphql +++ b/doc/api/graphql/reference/gitlab_schema.graphql @@ -4111,6 +4111,11 @@ type Group { first: Int """ + Return also milestones in all subgroups and subprojects + """ + includeDescendants: Boolean + + """ Returns the last _n_ elements from the list. """ last: Int diff --git a/doc/api/graphql/reference/gitlab_schema.json b/doc/api/graphql/reference/gitlab_schema.json index 17b5730e899..70ff4c852ad 100644 --- a/doc/api/graphql/reference/gitlab_schema.json +++ b/doc/api/graphql/reference/gitlab_schema.json @@ -11440,6 +11440,16 @@ "defaultValue": null }, { + "name": "includeDescendants", + "description": "Return also milestones in all subgroups and subprojects", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { "name": "after", "description": "Returns the elements in the list that come after the specified cursor.", "type": { diff --git a/doc/development/cicd/img/ci_architecture.png b/doc/development/cicd/img/ci_architecture.png Binary files differnew file mode 100644 index 00000000000..b888f2f07aa --- /dev/null +++ b/doc/development/cicd/img/ci_architecture.png diff --git a/doc/development/cicd/index.md b/doc/development/cicd/index.md index ed33eb01308..db3f58d1d22 100644 --- a/doc/development/cicd/index.md +++ b/doc/development/cicd/index.md @@ -2,6 +2,81 @@ Development guides that are specific to CI/CD are listed here. +## CI Architecture overview + +The following is a simplified diagram of the CI architecture. Some details are left out in order to focus on +the main components. + + +<!-- Editable diagram available at https://app.diagrams.net/#G1LFl-KW4fgpBPzz8VIH9rsOlAH4t0xwKj --> + +On the left side we have the events that can trigger a pipeline based on various events (trigged by a user or automation): + +- A `git push` is the most common event that triggers a pipeline. +- The [Web API](../../api/pipelines.md#create-a-new-pipeline). +- A user clicking the "Run Pipeline" button in the UI. +- When a [merge request is created or updated](../../ci/merge_request_pipelines/index.md#pipelines-for-merge-requests). +- When an MR is added to a [Merge Train](../../ci/merge_request_pipelines/pipelines_for_merged_results/merge_trains/index.md#merge-trains-premium). +- A [scheduled pipeline](../../ci/pipelines/schedules.md#pipeline-schedules). +- When project is [subscribed to an upstream project](../../ci/multi_project_pipelines.md#trigger-a-pipeline-when-an-upstream-project-is-rebuilt). +- When [Auto DevOps](../../topics/autodevops/index.md) is enabled. +- When GitHub integration is used with [external pull requests](../../ci/ci_cd_for_external_repos/index.md#pipelines-for-external-pull-requests). +- When an upstream pipeline contains a [bridge job](../../ci/yaml/README.md#trigger) which triggers a downstream pipeline. + +Triggering any of these events will invoke the [`CreatePipelineService`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/services/ci/create_pipeline_service.rb) +which takes as input event data and the user triggering it, then will attempt to create a pipeline. + +The `CreatePipelineService` relies heavily on the [`YAML Processor`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/yaml_processor.rb) +component, which is responsible for taking in a YAML blob as input and returns the abstract data structure of a +pipeline (including stages and all jobs). This component also validates the structure of the YAML while +processing it, and returns any syntax or semantic errors. The `YAML Processor` component is where we define +[all the keywords](../../ci/yaml/README.md) available to structure a pipeline. + +The `CreatePipelineService` receives the abstract data structure returned by the `YAML Processor`, +which then converts it to persisted models (pipeline, stages, jobs, etc.). After that, the pipeline is ready +to be processed. Processing a pipeline means running the jobs in order of execution (stage or DAG) +until either one of the following: + +- All expected jobs have been executed. +- Failures interrupt the pipeline execution. + +The component that processes a pipeline is [`ProcessPipelineService`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/services/ci/process_pipeline_service.rb), +which is responsible for moving all the pipeline's jobs to a completed state. When a pipeline is created, all its +jobs are initially in `created` state. This services looks at what jobs in `created` stage are eligible +to be processed based on the pipeline structure. Then it moves them into the `pending` state, which means +they can now [be picked up by a Runner](#job-scheduling). After a job has been executed it can complete +successfully or fail. Each status transition for job within a pipeline triggers this service again, which +looks for the next jobs to be transitioned towards completion. While doing that, `ProcessPipelineService` +updates the status of jobs, stages and the overall pipeline. + +On the right side of the diagram we have a list of [Runners](../../ci/runners/README.md#configuring-gitlab-runners) +connected to the GitLab instance. These can be Shared Runners, Group Runners or Project-specific Runners. +The communication between Runners and the Rails server occurs through a set of API endpoints, grouped as +the `Runner API Gateway`. + +We can register, delete and verify Runners, which also causes read/write queries to the database. After a Runner is connected, +it keeps asking for the next job to execute. This invokes the [`RegisterJobService`](https://gitlab.com/gitlab-org/gitlab/blob/master/app/services/ci/register_job_service.rb) +which will pick the next job and assign it to the Runner. At this point the job will transition to a +`running` state, which again triggers `ProcessPipelineService` due to the status change. +For more details read [Job scheduling](#job-scheduling)). + +While a job is being executed, the Runner sends logs back to the server as well any possible artifacts +that need to be stored. Also, a job may depend on artifacts from previous jobs in order to run. In this +case the Runner will download them using a dedicated API endpoint. + +Artifacts are stored in object storage, while metadata is kept in the database. An important example of artifacts +is reports (JUnit, SAST, DAST, etc.) which are parsed and rendered in the merge request. + +Job status transitions are not all automated. A user may run [manual jobs](../../ci/yaml/README.md#whenmanual), cancel a pipeline, retry +specific failed jobs or the entire pipeline. Anything that +causes a job to change status will trigger `ProcessPipelineService`, as it's responsible for +tracking the status of the entire pipeline. + +A special type of job is the [bridge job](../../ci/yaml/README.md#trigger) which is executed server-side +when transitioning to the `pending` state. This job is responsible for creating a downstream pipeline, such as +a multi-project or child pipeline. The workflow loop starts again +from the `CreatePipelineService` every time a downstream pipeline is triggered. + ## Job scheduling When a Pipeline is created all its jobs are created at once for all stages, with an initial state of `created`. This makes it possible to visualize the full content of a pipeline. diff --git a/doc/development/testing_guide/end_to_end/rspec_metadata_tests.md b/doc/development/testing_guide/end_to_end/rspec_metadata_tests.md index 48d21ccfb1b..c3376bf6ab2 100644 --- a/doc/development/testing_guide/end_to_end/rspec_metadata_tests.md +++ b/doc/development/testing_guide/end_to_end/rspec_metadata_tests.md @@ -14,4 +14,5 @@ This is a partial list of the [RSpec metadata](https://relishapp.com/rspec/rspec | `:reliable` | The test has been [promoted to a reliable test](https://about.gitlab.com/handbook/engineering/quality/guidelines/reliable-tests/#promoting-an-existing-test-to-reliable) meaning it passes consistently in all pipelines, including merge requests. | | `:requires_admin` | The test requires an admin account. Tests with the tag are excluded when run against Canary and Production environments. | | `:runner` | The test depends on and will set up a GitLab Runner instance, typically to run a pipeline. | +| `:gitaly_ha` | The test will run against a GitLab instance where repositories are stored on redundant Gitaly nodes behind a Praefect node. All nodes are separate containers in a minimal version of [our recommended highly available configuration](../../../administration/gitaly/praefect.md#requirements-for-configuring-a-gitaly-cluster). Tests that use this tag have a longer setup time since there are three additional containers that need to be started. | | `:skip_live_env` | The test will be excluded when run against live deployed environments such as Staging, Canary, and Production. | @@ -143,6 +143,7 @@ module QA autoload :Mattermost, 'qa/scenario/test/integration/mattermost' autoload :ObjectStorage, 'qa/scenario/test/integration/object_storage' autoload :SMTP, 'qa/scenario/test/integration/smtp' + autoload :GitalyHA, 'qa/scenario/test/integration/gitaly_ha' end module Sanity @@ -449,6 +450,7 @@ module QA autoload :Shellout, 'qa/service/shellout' autoload :KubernetesCluster, 'qa/service/kubernetes_cluster' autoload :Omnibus, 'qa/service/omnibus' + autoload :PraefectManager, 'qa/service/praefect_manager' module ClusterProvider autoload :Base, 'qa/service/cluster_provider/base' diff --git a/qa/qa/scenario/test/integration/gitaly_ha.rb b/qa/qa/scenario/test/integration/gitaly_ha.rb new file mode 100644 index 00000000000..dbca1a1dd6d --- /dev/null +++ b/qa/qa/scenario/test/integration/gitaly_ha.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module QA + module Scenario + module Test + module Integration + class GitalyHA < Test::Instance::All + tags :gitaly_ha + end + end + end + end +end diff --git a/qa/qa/service/praefect_manager.rb b/qa/qa/service/praefect_manager.rb new file mode 100644 index 00000000000..d8fa72456ad --- /dev/null +++ b/qa/qa/service/praefect_manager.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module QA + module Service + class PraefectManager + include Service::Shellout + + def initialize + @praefect = 'praefect' + @first_node = 'gitaly1' + @second_node = 'gitaly2' + @primary_node = @first_node + @secondary_node = @second_node + end + + def stop_primary_node + shell "docker stop #{@primary_node}" + @secondary_node, @primary_node = @primary_node, @secondary_node + end + + def reset + shell "docker start #{@primary_node}" + shell "docker start #{@secondary_node}" + end + end + end +end diff --git a/qa/qa/specs/features/browser_ui/3_create/gitaly/high_availability_spec.rb b/qa/qa/specs/features/browser_ui/3_create/gitaly/high_availability_spec.rb new file mode 100644 index 00000000000..3bb03f68d51 --- /dev/null +++ b/qa/qa/specs/features/browser_ui/3_create/gitaly/high_availability_spec.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +module QA + context 'Create' do + context 'Gitaly' do + describe 'High Availability', :orchestrated, :gitaly_ha do + let(:project) do + Resource::Project.fabricate! do |project| + project.name = 'gitaly_high_availability' + end + end + let(:initial_file) { 'pushed_to_primary.txt' } + let(:final_file) { 'pushed_to_secondary.txt' } + + before do + @praefect_manager = Service::PraefectManager.new + Flow::Login.sign_in + end + + after do + @praefect_manager.reset + end + + it 'makes sure that automatic failover is happening' do + Resource::Repository::ProjectPush.fabricate! do |push| + push.project = project + push.commit_message = 'pushed to primary gitaly node' + push.new_branch = true + push.file_name = initial_file + push.file_content = "This should exist on both nodes" + end + + @praefect_manager.stop_primary_node + + project.visit! + + Page::Project::Show.perform do |show| + show.wait_until do + show.has_name?(project.name) + end + expect(show).to have_file(initial_file) + end + + Resource::Repository::Commit.fabricate_via_api! do |commit| + commit.project = project + commit.add_files([ + { + file_path: 'committed_to_primary.txt', + content: 'This should exist on both nodes too' + } + ]) + end + + project.visit! + + Page::Project::Show.perform do |show| + expect(show).to have_file(final_file) + end + end + end + end + end +end diff --git a/qa/qa/specs/features/browser_ui/8_monitor/all_monitor_core_features_spec.rb b/qa/qa/specs/features/browser_ui/8_monitor/all_monitor_core_features_spec.rb index eda509641e3..45273655bb6 100644 --- a/qa/qa/specs/features/browser_ui/8_monitor/all_monitor_core_features_spec.rb +++ b/qa/qa/specs/features/browser_ui/8_monitor/all_monitor_core_features_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module QA - context 'Monitor' do + context 'Monitor', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/217705', type: :flaky } do describe 'with Prometheus Gitlab-managed cluster', :orchestrated, :kubernetes, :docker, :runner do before :all do Flow::Login.sign_in diff --git a/spec/controllers/projects/branches_controller_spec.rb b/spec/controllers/projects/branches_controller_spec.rb index 85d3044993e..174d8904481 100644 --- a/spec/controllers/projects/branches_controller_spec.rb +++ b/spec/controllers/projects/branches_controller_spec.rb @@ -124,57 +124,39 @@ describe Projects::BranchesController do ) end - context 'create_confidential_merge_request feature is enabled' do + context 'user cannot update issue' do + let(:issue) { create(:issue, project: confidential_issue_project) } + + it 'does not post a system note' do + expect(SystemNoteService).not_to receive(:new_issue_branch) + + create_branch_with_confidential_issue_project + end + end + + context 'user can update issue' do before do - stub_feature_flags(create_confidential_merge_request: true) + confidential_issue_project.add_reporter(user) end - context 'user cannot update issue' do + context 'issue is under the specified project' do let(:issue) { create(:issue, project: confidential_issue_project) } - it 'does not post a system note' do - expect(SystemNoteService).not_to receive(:new_issue_branch) + it 'posts a system note' do + expect(SystemNoteService).to receive(:new_issue_branch).with(issue, confidential_issue_project, user, "1-feature-branch", branch_project: project) create_branch_with_confidential_issue_project end end - context 'user can update issue' do - before do - confidential_issue_project.add_reporter(user) - end - - context 'issue is under the specified project' do - let(:issue) { create(:issue, project: confidential_issue_project) } - - it 'posts a system note' do - expect(SystemNoteService).to receive(:new_issue_branch).with(issue, confidential_issue_project, user, "1-feature-branch", branch_project: project) - - create_branch_with_confidential_issue_project - end - end - - context 'issue is not under the specified project' do - it 'does not post a system note' do - expect(SystemNoteService).not_to receive(:new_issue_branch) + context 'issue is not under the specified project' do + it 'does not post a system note' do + expect(SystemNoteService).not_to receive(:new_issue_branch) - create_branch_with_confidential_issue_project - end + create_branch_with_confidential_issue_project end end end - - context 'create_confidential_merge_request feature is disabled' do - before do - stub_feature_flags(create_confidential_merge_request: false) - end - - it 'posts a system note on project' do - expect(SystemNoteService).to receive(:new_issue_branch).with(issue, project, user, "1-feature-branch", branch_project: project) - - create_branch_with_confidential_issue_project - end - end end context 'repository-less project' do diff --git a/spec/controllers/projects/issues_controller_spec.rb b/spec/controllers/projects/issues_controller_spec.rb index f3357124501..96f11f11dc4 100644 --- a/spec/controllers/projects/issues_controller_spec.rb +++ b/spec/controllers/projects/issues_controller_spec.rb @@ -1452,24 +1452,8 @@ describe Projects::IssuesController do let(:target_project) { fork_project(project, user, repository: true) } let(:target_project_id) { target_project.id } - context 'create_confidential_merge_request feature is enabled' do - before do - stub_feature_flags(create_confidential_merge_request: true) - end - - it 'creates a new merge request', :sidekiq_might_not_need_inline do - expect { create_merge_request }.to change(target_project.merge_requests, :count).by(1) - end - end - - context 'create_confidential_merge_request feature is disabled' do - before do - stub_feature_flags(create_confidential_merge_request: false) - end - - it 'creates a new merge request' do - expect { create_merge_request }.to change(project.merge_requests, :count).by(1) - end + it 'creates a new merge request', :sidekiq_might_not_need_inline do + expect { create_merge_request }.to change(target_project.merge_requests, :count).by(1) end end diff --git a/spec/features/issues/user_creates_branch_and_merge_request_spec.rb b/spec/features/issues/user_creates_branch_and_merge_request_spec.rb index 7eecfd1ccf4..848dbbb85a6 100644 --- a/spec/features/issues/user_creates_branch_and_merge_request_spec.rb +++ b/spec/features/issues/user_creates_branch_and_merge_request_spec.rb @@ -164,17 +164,7 @@ describe 'User creates branch and merge request on issue page', :js do context 'when issue is confidential' do let(:issue) { create(:issue, :confidential, project: project) } - it 'disables the create branch button' do - stub_feature_flags(create_confidential_merge_request: false) - - visit project_issue_path(project, issue) - - expect(page).not_to have_css('.create-mr-dropdown-wrap') - end - - it 'enables the create branch button when feature flag is enabled' do - stub_feature_flags(create_confidential_merge_request: true) - + it 'enables the create branch button' do visit project_issue_path(project, issue) expect(page).to have_css('.create-mr-dropdown-wrap') diff --git a/spec/frontend/lib/utils/text_markdown_spec.js b/spec/frontend/lib/utils/text_markdown_spec.js index ba3e4020e66..1d616a7da0b 100644 --- a/spec/frontend/lib/utils/text_markdown_spec.js +++ b/spec/frontend/lib/utils/text_markdown_spec.js @@ -25,7 +25,7 @@ describe('init markdown', () => { insertMarkdownText({ textArea, text: textArea.value, - tag: '*', + tag: '* ', blockTag: null, selected: '', wrap: false, @@ -43,7 +43,7 @@ describe('init markdown', () => { insertMarkdownText({ textArea, text: textArea.value, - tag: '*', + tag: '* ', blockTag: null, selected: '', wrap: false, @@ -61,7 +61,7 @@ describe('init markdown', () => { insertMarkdownText({ textArea, text: textArea.value, - tag: '*', + tag: '* ', blockTag: null, selected: '', wrap: false, @@ -79,7 +79,7 @@ describe('init markdown', () => { insertMarkdownText({ textArea, text: textArea.value, - tag: '*', + tag: '* ', blockTag: null, selected: '', wrap: false, diff --git a/spec/frontend/vue_shared/components/markdown/field_spec.js b/spec/frontend/vue_shared/components/markdown/field_spec.js index 4ef82b2dd4e..54ce1f47e28 100644 --- a/spec/frontend/vue_shared/components/markdown/field_spec.js +++ b/spec/frontend/vue_shared/components/markdown/field_spec.js @@ -185,7 +185,7 @@ describe('Markdown field component', () => { markdownButton.trigger('click'); return wrapper.vm.$nextTick(() => { - expect(textarea.value).toContain('* testing'); + expect(textarea.value).toContain('* testing'); }); }); diff --git a/spec/graphql/mutations/design_management/delete_spec.rb b/spec/graphql/mutations/design_management/delete_spec.rb index df587be5089..60be6dad62a 100644 --- a/spec/graphql/mutations/design_management/delete_spec.rb +++ b/spec/graphql/mutations/design_management/delete_spec.rb @@ -17,14 +17,6 @@ describe Mutations::DesignManagement::Delete do let(:mutation) { described_class.new(object: nil, context: { current_user: user }, field: nil) } before do - # TODO these tests are being temporarily skipped unless run in EE, - # as we are in the process of moving Design Management to FOSS in 13.0 - # in steps. In the current step the services have not yet been moved, - # which are used by this mutation. - # - # See https://gitlab.com/gitlab-org/gitlab/-/issues/212566#note_327724283. - skip 'See https://gitlab.com/gitlab-org/gitlab/-/issues/212566#note_327724283' unless Gitlab.ee? - stub_const('Errors', Gitlab::Graphql::Errors, transfer_nested_constants: true) end diff --git a/spec/graphql/mutations/design_management/upload_spec.rb b/spec/graphql/mutations/design_management/upload_spec.rb index 10c2164caec..783af70448c 100644 --- a/spec/graphql/mutations/design_management/upload_spec.rb +++ b/spec/graphql/mutations/design_management/upload_spec.rb @@ -37,14 +37,6 @@ describe Mutations::DesignManagement::Upload do context "when the feature is available" do before do - # TODO these tests are being temporarily skipped unless run in EE, - # as we are in the process of moving Design Management to FOSS in 13.0 - # in steps. In the current step the services have not yet been moved, - # which are used by this mutation. - # - # See https://gitlab.com/gitlab-org/gitlab/-/issues/212566#note_327724283. - skip 'See https://gitlab.com/gitlab-org/gitlab/-/issues/212566#note_327724283' unless Gitlab.ee? - enable_design_management end diff --git a/spec/graphql/resolvers/milestone_resolver_spec.rb b/spec/graphql/resolvers/milestone_resolver_spec.rb index 297130c2027..8e2c67fdc03 100644 --- a/spec/graphql/resolvers/milestone_resolver_spec.rb +++ b/spec/graphql/resolvers/milestone_resolver_spec.rb @@ -8,14 +8,14 @@ describe Resolvers::MilestoneResolver do describe '#resolve' do let_it_be(:current_user) { create(:user) } + def resolve_group_milestones(args = {}, context = { current_user: current_user }) + resolve(described_class, obj: group, args: args, ctx: context) + end + context 'for group milestones' do let_it_be(:now) { Time.now } let_it_be(:group) { create(:group, :private) } - def resolve_group_milestones(args = {}, context = { current_user: current_user }) - resolve(described_class, obj: group, args: args, ctx: context) - end - before do group.add_developer(current_user) end @@ -89,5 +89,25 @@ describe Resolvers::MilestoneResolver do end end end + + context 'when including descendant milestones in a public group' do + let_it_be(:group) { create(:group, :public) } + let(:args) { { include_descendants: true } } + + it 'finds milestones only in accessible projects and groups' do + accessible_group = create(:group, :private, parent: group) + accessible_project = create(:project, group: accessible_group) + accessible_group.add_developer(current_user) + inaccessible_group = create(:group, :private, parent: group) + inaccessible_project = create(:project, :private, group: group) + milestone1 = create(:milestone, group: group) + milestone2 = create(:milestone, group: accessible_group) + milestone3 = create(:milestone, project: accessible_project) + create(:milestone, group: inaccessible_group) + create(:milestone, project: inaccessible_project) + + expect(resolve_group_milestones(args)).to match_array([milestone1, milestone2, milestone3]) + end + end end end diff --git a/spec/lib/gitlab/kubernetes/helm/parsers/list_v2_spec.rb b/spec/lib/gitlab/kubernetes/helm/parsers/list_v2_spec.rb index b4b1d8bec51..ea1fbc98c9f 100644 --- a/spec/lib/gitlab/kubernetes/helm/parsers/list_v2_spec.rb +++ b/spec/lib/gitlab/kubernetes/helm/parsers/list_v2_spec.rb @@ -59,7 +59,7 @@ describe Gitlab::Kubernetes::Helm::Parsers::ListV2 do it 'raises an error on invalid JSON' do expect do described_class.new('') - end.to raise_error(described_class::ParserError, 'A JSON text must at least contain two octets!') + end.to raise_error(described_class::ParserError) end end diff --git a/spec/models/concerns/mentionable_spec.rb b/spec/models/concerns/mentionable_spec.rb index f721beefe94..ecb7802aab3 100644 --- a/spec/models/concerns/mentionable_spec.rb +++ b/spec/models/concerns/mentionable_spec.rb @@ -342,3 +342,19 @@ describe PersonalSnippet, 'Mentionable' do end end end + +describe DesignManagement::Design do + describe '#store_mentions!' do + it_behaves_like 'mentions in notes', :design do + let(:note) { create(:diff_note_on_design) } + let(:mentionable) { note.noteable } + end + end + + describe 'load mentions' do + it_behaves_like 'load mentions from DB', :design do + let(:note) { create(:diff_note_on_design) } + let(:mentionable) { note.noteable } + end + end +end diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb index ac69c1a667d..be626dd6e32 100644 --- a/spec/models/repository_spec.rb +++ b/spec/models/repository_spec.rb @@ -2876,7 +2876,7 @@ describe Repository do end describe '#lfs_enabled?' do - let_it_be(:project) { create(:project, :repository, lfs_enabled: true) } + let_it_be(:project) { create(:project, :repository, :design_repo, lfs_enabled: true) } subject { repository.lfs_enabled? } @@ -2933,5 +2933,21 @@ describe Repository do is_expected.to be_falsy end end + + context 'for a design repository' do + let(:repository) { project.design_repository } + + it 'returns true when LFS is enabled' do + stub_lfs_setting(enabled: true) + + is_expected.to be_truthy + end + + it 'returns false when LFS is disabled' do + stub_lfs_setting(enabled: false) + + is_expected.to be_falsy + end + end end end diff --git a/spec/requests/api/graphql/group/milestones_spec.rb b/spec/requests/api/graphql/group/milestones_spec.rb index f8e3c0026f5..bad0024e7a3 100644 --- a/spec/requests/api/graphql/group/milestones_spec.rb +++ b/spec/requests/api/graphql/group/milestones_spec.rb @@ -7,7 +7,7 @@ describe 'Milestones through GroupQuery' do let_it_be(:user) { create(:user) } let_it_be(:now) { Time.now } - let_it_be(:group) { create(:group, :private) } + let_it_be(:group) { create(:group) } let_it_be(:milestone_1) { create(:milestone, group: group) } let_it_be(:milestone_2) { create(:milestone, group: group, state: :closed, start_date: now, due_date: now + 1.day) } let_it_be(:milestone_3) { create(:milestone, group: group, start_date: now, due_date: now + 2.days) } @@ -17,10 +17,6 @@ describe 'Milestones through GroupQuery' do let(:milestone_data) { graphql_data['group']['milestones']['edges'] } describe 'Get list of milestones from a group' do - before do - group.add_developer(user) - end - context 'when the request is correct' do before do fetch_milestones(user) @@ -51,6 +47,48 @@ describe 'Milestones through GroupQuery' do end end + context 'when including milestones from decendants' do + let_it_be(:accessible_group) { create(:group, :private, parent: group) } + let_it_be(:accessible_project) { create(:project, group: accessible_group) } + let_it_be(:inaccessible_group) { create(:group, :private, parent: group) } + let_it_be(:inaccessible_project) { create(:project, :private, group: group) } + let_it_be(:submilestone_1) { create(:milestone, group: accessible_group) } + let_it_be(:submilestone_2) { create(:milestone, project: accessible_project) } + let_it_be(:submilestone_3) { create(:milestone, group: inaccessible_group) } + let_it_be(:submilestone_4) { create(:milestone, project: inaccessible_project) } + + let(:args) { { include_descendants: true } } + + before do + accessible_group.add_developer(user) + end + + it 'returns milestones also from subgroups and subprojects visible to user' do + fetch_milestones(user, args) + + expect_array_response( + milestone_1.to_global_id.to_s, milestone_2.to_global_id.to_s, + milestone_3.to_global_id.to_s, milestone_4.to_global_id.to_s, + submilestone_1.to_global_id.to_s, submilestone_2.to_global_id.to_s + ) + end + + context 'when group_milestone_descendants is disabled' do + before do + stub_feature_flags(group_milestone_descendants: false) + end + + it 'ignores descendant milestones' do + fetch_milestones(user, args) + + expect_array_response( + milestone_1.to_global_id.to_s, milestone_2.to_global_id.to_s, + milestone_3.to_global_id.to_s, milestone_4.to_global_id.to_s + ) + end + end + end + def fetch_milestones(user = nil, args = {}) post_graphql(milestones_query(args), current_user: user) end diff --git a/spec/requests/api/graphql/mutations/design_management/delete_spec.rb b/spec/requests/api/graphql/mutations/design_management/delete_spec.rb index 9ce2313f1e0..10376305b3e 100644 --- a/spec/requests/api/graphql/mutations/design_management/delete_spec.rb +++ b/spec/requests/api/graphql/mutations/design_management/delete_spec.rb @@ -29,14 +29,6 @@ describe "deleting designs" do end before do - # TODO these tests are being temporarily skipped unless run in EE, - # as we are in the process of moving Design Management to FOSS in 13.0 - # in steps. In the current step the services have not yet been moved, - # which are used by this mutation. - # - # See https://gitlab.com/gitlab-org/gitlab/-/issues/212566#note_327724283. - skip 'See https://gitlab.com/gitlab-org/gitlab/-/issues/212566#note_327724283' unless Gitlab.ee? - enable_design_management project.add_developer(developer) diff --git a/spec/requests/api/graphql/mutations/design_management/upload_spec.rb b/spec/requests/api/graphql/mutations/design_management/upload_spec.rb index 060e37f559d..22adc064406 100644 --- a/spec/requests/api/graphql/mutations/design_management/upload_spec.rb +++ b/spec/requests/api/graphql/mutations/design_management/upload_spec.rb @@ -24,14 +24,6 @@ describe "uploading designs" do let(:mutation_response) { graphql_mutation_response(:design_management_upload) } before do - # TODO these tests are being temporarily skipped unless run in EE, - # as we are in the process of moving Design Management to FOSS in 13.0 - # in steps. In the current step the services have not yet been moved, - # which are used by this mutation. - # - # See https://gitlab.com/gitlab-org/gitlab/-/issues/212566#note_327724283. - skip 'See https://gitlab.com/gitlab-org/gitlab/-/issues/212566#note_327724283' unless Gitlab.ee? - enable_design_management project.add_developer(current_user) diff --git a/spec/requests/api/graphql/project/issue/designs/designs_spec.rb b/spec/requests/api/graphql/project/issue/designs/designs_spec.rb index 105ee9daf0c..b6fd0d91bda 100644 --- a/spec/requests/api/graphql/project/issue/designs/designs_spec.rb +++ b/spec/requests/api/graphql/project/issue/designs/designs_spec.rb @@ -6,16 +6,6 @@ describe 'Getting designs related to an issue' do include GraphqlHelpers include DesignManagementTestHelpers - before_all do - # TODO these tests are being temporarily skipped unless run in EE, - # as we are in the process of moving Design Management to FOSS in 13.0 - # in steps. In the current step the services have not yet been moved, - # which are used by the `:with_smaller_image_versions` factory trait. - # - # See https://gitlab.com/gitlab-org/gitlab/-/issues/212566#note_327724283. - skip 'See https://gitlab.com/gitlab-org/gitlab/-/issues/212566#note_327724283' unless Gitlab.ee? - end - let_it_be(:design) { create(:design, :with_smaller_image_versions, versions_count: 1) } let_it_be(:current_user) { design.project.owner } let(:design_query) do diff --git a/spec/support/shared_examples/features/variable_list_shared_examples.rb b/spec/support/shared_examples/features/variable_list_shared_examples.rb index 4fd4d42003f..218ef070221 100644 --- a/spec/support/shared_examples/features/variable_list_shared_examples.rb +++ b/spec/support/shared_examples/features/variable_list_shared_examples.rb @@ -29,7 +29,6 @@ RSpec.shared_examples 'variable list' do page.within('.js-ci-variable-list-section .js-row:last-child') do find('.js-ci-variable-input-key').set('key') find('.js-ci-variable-input-value').set('key_value') - find('.ci-variable-protected-item .js-project-feature-toggle').click expect(find('.js-ci-variable-input-protected', visible: false).value).to eq('true') end @@ -173,6 +172,7 @@ RSpec.shared_examples 'variable list' do page.within('.js-ci-variable-list-section .js-row:last-child') do find('.js-ci-variable-input-key').set('unprotected_key') find('.js-ci-variable-input-value').set('unprotected_value') + find('.ci-variable-protected-item .js-project-feature-toggle').click expect(find('.js-ci-variable-input-protected', visible: false).value).to eq('false') end @@ -207,7 +207,6 @@ RSpec.shared_examples 'variable list' do page.within('.js-ci-variable-list-section .js-row:last-child') do find('.js-ci-variable-input-key').set('protected_key') find('.js-ci-variable-input-value').set('protected_value') - find('.ci-variable-protected-item .js-project-feature-toggle').click expect(find('.js-ci-variable-input-protected', visible: false).value).to eq('true') end diff --git a/spec/tasks/gitlab/uploads/migrate_rake_spec.rb b/spec/tasks/gitlab/uploads/migrate_rake_spec.rb index 8ea0a98a1dc..49026cd74f9 100644 --- a/spec/tasks/gitlab/uploads/migrate_rake_spec.rb +++ b/spec/tasks/gitlab/uploads/migrate_rake_spec.rb @@ -119,4 +119,16 @@ describe 'gitlab:uploads:migrate and migrate_to_local rake tasks' do it_behaves_like 'enqueue upload migration jobs in batch', batch: 4 end + + context 'for DesignManagement::DesignV432x230Uploader' do + let(:uploader_class) { DesignManagement::DesignV432x230Uploader } + let(:model_class) { DesignManagement::Action } + let(:mounted_as) { :image_v432x230 } + + before do + create_list(:design_action, 10, :with_image_v432x230) + end + + it_behaves_like 'enqueue upload migration jobs in batch', batch: 4 + end end diff --git a/spec/uploaders/workers/object_storage/migrate_uploads_worker_spec.rb b/spec/uploaders/workers/object_storage/migrate_uploads_worker_spec.rb index fcb8f4e51b5..7bf8512a6fd 100644 --- a/spec/uploaders/workers/object_storage/migrate_uploads_worker_spec.rb +++ b/spec/uploaders/workers/object_storage/migrate_uploads_worker_spec.rb @@ -65,4 +65,16 @@ describe ObjectStorage::MigrateUploadsWorker do end end end + + context 'for DesignManagement::DesignV432x230Uploader' do + let(:model_class) { DesignManagement::Action } + let!(:design_actions) { create_list(:design_action, 10, :with_image_v432x230) } + let(:mounted_as) { :image_v432x230 } + + before do + stub_uploads_object_storage(DesignManagement::DesignV432x230Uploader) + end + + it_behaves_like 'uploads migration worker' + end end diff --git a/spec/workers/post_receive_spec.rb b/spec/workers/post_receive_spec.rb index 3ad8eced2b3..aab7a36189a 100644 --- a/spec/workers/post_receive_spec.rb +++ b/spec/workers/post_receive_spec.rb @@ -471,4 +471,17 @@ describe PostReceive do it_behaves_like 'snippet changes actions' end end + + describe 'processing design changes' do + let(:gl_repository) { "design-#{project.id}" } + + it 'does not do anything' do + worker = described_class.new + + expect(worker).not_to receive(:process_wiki_changes) + expect(worker).not_to receive(:process_project_changes) + + described_class.new.perform(gl_repository, key_id, base64_changes) + end + end end |