From 66a3180a3b9417cb5259ecca83934f22b136394b Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 8 Jul 2021 15:10:06 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- .gitlab/ci/review.gitlab-ci.yml | 1 - .gitlab/ci/rules.gitlab-ci.yml | 27 +- .../Geo Replicate a new Git repository type.md | 76 ++++-- .../Geo Replicate a new blob type.md | 76 ++++-- CHANGELOG.md | 13 + app/assets/javascripts/fly_out_nav.js | 4 +- app/assets/javascripts/packages/list/constants.js | 4 + .../javascripts/packages/shared/constants.js | 1 + app/assets/javascripts/packages/shared/utils.js | 2 + .../settings/project/components/settings_form.vue | 2 - .../settings/project/utils.js | 7 +- .../new_namespace/components/welcome.vue | 2 +- .../stylesheets/framework/contextual_sidebar.scss | 4 + app/graphql/resolvers/issues_resolver.rb | 1 + app/graphql/types/issue_sort_enum.rb | 2 + app/models/integrations/buildkite.rb | 12 +- app/services/ci/pipelines/add_job_service.rb | 37 +++ app/services/ci/retry_build_service.rb | 35 +-- app/services/projects/update_pages_service.rb | 14 +- .../admin/application_settings/_ci_cd.html.haml | 2 +- app/views/projects/settings/ci_cd/_form.html.haml | 8 +- ...ad_balancing_improved_caught_up_hosts_check.yml | 8 - doc/administration/compliance.md | 2 +- doc/administration/geo/setup/index.md | 18 +- doc/api/graphql/reference/index.md | 16 ++ doc/api/projects.md | 2 +- doc/ci/environments/deployment_safety.md | 2 +- doc/ci/index.md | 10 +- doc/ci/large_repositories/index.md | 2 +- doc/ci/pipelines/settings.md | 152 +++++------ doc/ci/runners/configure_runners.md | 4 +- doc/ci/ssh_keys/index.md | 2 +- doc/ci/variables/index.md | 2 +- doc/development/index.md | 113 +++++---- doc/development/integrations/secure.md | 78 +++++- .../integrations/secure_partner_integration.md | 1 + doc/push_rules/push_rules.md | 6 - .../admin_area/settings/continuous_integration.md | 2 +- .../cluster_image_scanning/index.md | 281 +++++++++++++++++++++ .../container_scanning/index.md | 5 - doc/user/application_security/index.md | 21 +- .../application_security/secret_detection/index.md | 2 +- .../security_dashboard/index.md | 1 + doc/user/application_security/terminology/index.md | 1 + .../img/discussion_lock_system_notes.png | Bin 14288 -> 0 bytes .../discussions/img/image_resolved_discussion.png | Bin 55713 -> 0 bytes doc/user/discussions/img/lock_form_member.png | Bin 23780 -> 0 bytes doc/user/discussions/img/lock_form_non_member.png | Bin 8362 -> 0 bytes doc/user/discussions/img/onion_skin_view.png | Bin 29955 -> 0 bytes .../img/quickly_assign_commenter_v13_1.png | Bin 69299 -> 43849 bytes .../discussions/img/start_image_discussion.gif | Bin 146627 -> 208151 bytes doc/user/discussions/img/swipe_view.png | Bin 20840 -> 0 bytes doc/user/discussions/img/turn_off_lock.png | Bin 9626 -> 0 bytes doc/user/discussions/img/turn_on_lock.png | Bin 10409 -> 0 bytes doc/user/discussions/img/two_up_view.png | Bin 34612 -> 0 bytes doc/user/discussions/index.md | 112 +++----- doc/user/project/issue_board.md | 2 +- doc/user/project/issues/issue_data_and_actions.md | 2 +- doc/user/project/issues/sorting_issue_lists.md | 4 +- lib/api/commit_statuses.rb | 60 +++-- .../Security/Cluster-Image-Scanning.gitlab-ci.yml | 34 +++ .../database/load_balancing/load_balancer.rb | 10 - lib/gitlab/database/load_balancing/sticking.rb | 6 +- .../pagination/keyset/column_order_definition.rb | 4 +- lib/gitlab/pagination/keyset/order.rb | 24 ++ locale/gitlab.pot | 15 ++ spec/frontend/packages/shared/utils_spec.js | 1 + .../settings/__snapshots__/utils_spec.js.snap | 8 + .../__snapshots__/settings_form_spec.js.snap | 4 +- .../settings/components/settings_form_spec.js | 8 +- .../settings/project/settings/utils_spec.js | 1 + spec/graphql/resolvers/issues_resolver_spec.rb | 36 +++ .../database/load_balancing/load_balancer_spec.rb | 32 --- .../database/load_balancing/sticking_spec.rb | 12 +- spec/lib/gitlab/pagination/keyset/order_spec.rb | 6 + spec/services/ci/pipelines/add_job_service_spec.rb | 72 ++++++ 76 files changed, 1077 insertions(+), 437 deletions(-) create mode 100644 app/services/ci/pipelines/add_job_service.rb delete mode 100644 config/feature_flags/development/load_balancing_improved_caught_up_hosts_check.yml create mode 100644 doc/user/application_security/cluster_image_scanning/index.md delete mode 100644 doc/user/discussions/img/discussion_lock_system_notes.png delete mode 100644 doc/user/discussions/img/image_resolved_discussion.png delete mode 100644 doc/user/discussions/img/lock_form_member.png delete mode 100644 doc/user/discussions/img/lock_form_non_member.png delete mode 100644 doc/user/discussions/img/onion_skin_view.png delete mode 100644 doc/user/discussions/img/swipe_view.png delete mode 100644 doc/user/discussions/img/turn_off_lock.png delete mode 100644 doc/user/discussions/img/turn_on_lock.png delete mode 100644 doc/user/discussions/img/two_up_view.png create mode 100644 lib/gitlab/ci/templates/Security/Cluster-Image-Scanning.gitlab-ci.yml create mode 100644 spec/services/ci/pipelines/add_job_service_spec.rb diff --git a/.gitlab/ci/review.gitlab-ci.yml b/.gitlab/ci/review.gitlab-ci.yml index 5ef248c27e8..faafc8ef0e1 100644 --- a/.gitlab/ci/review.gitlab-ci.yml +++ b/.gitlab/ci/review.gitlab-ci.yml @@ -54,7 +54,6 @@ review-deploy: extends: - .review-workflow-base - .review:rules:review-deploy - retry: 2 stage: review needs: ["review-build-cng"] resource_group: "review/${CI_COMMIT_REF_NAME}" diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml index da9a32389fa..55ebd3ba038 100644 --- a/.gitlab/ci/rules.gitlab-ci.yml +++ b/.gitlab/ci/rules.gitlab-ci.yml @@ -1200,19 +1200,31 @@ changes: *code-qa-patterns allow_failure: true +# The rule needs to be duplicated between `on_success` and `on_failure` +# because the jobs `needs` the previous job to complete. +# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/63844#note_599012559 .review:rules:review-qa-smoke-report: rules: - <<: *if-not-ee when: never - <<: *if-dot-com-gitlab-org-merge-request changes: *ci-review-patterns - when: always + when: on_success + - <<: *if-dot-com-gitlab-org-merge-request + changes: *ci-review-patterns + when: on_failure - <<: *if-dot-com-gitlab-org-merge-request changes: *frontend-patterns - when: always + when: on_success + - <<: *if-dot-com-gitlab-org-merge-request + changes: *frontend-patterns + when: on_failure - <<: *if-dot-com-gitlab-org-merge-request changes: *code-qa-patterns - when: always + when: on_success + - <<: *if-dot-com-gitlab-org-merge-request + changes: *code-qa-patterns + when: on_failure .review:rules:review-qa-all: rules: @@ -1226,6 +1238,9 @@ changes: *qa-patterns allow_failure: true +# The rule needs to be duplicated between `on_success` and `on_failure` +# because the jobs `needs` the previous job to complete. +# See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/63844#note_599012559 .review:rules:review-qa-all-report: rules: - <<: *if-not-ee @@ -1237,7 +1252,11 @@ - <<: *if-dot-com-gitlab-org-merge-request changes: *qa-patterns allow_failure: true - when: always + when: on_success + - <<: *if-dot-com-gitlab-org-merge-request + changes: *qa-patterns + allow_failure: true + when: on_failure .review:rules:review-cleanup: rules: diff --git a/.gitlab/issue_templates/Geo Replicate a new Git repository type.md b/.gitlab/issue_templates/Geo Replicate a new Git repository type.md index dd37cd703b1..560b1722348 100644 --- a/.gitlab/issue_templates/Geo Replicate a new Git repository type.md +++ b/.gitlab/issue_templates/Geo Replicate a new Git repository type.md @@ -513,19 +513,59 @@ That's all of the required database changes. end ``` -##### If you added verification state fields to a separate table (option 2 above), then you need to make additional model changes +- [ ] Add the following to `spec/factories/cool_widgets.rb`: + + ```ruby + trait(:verification_succeeded) do + with_file + verification_checksum { 'abc' } + verification_state { CoolWidget.verification_state_value(:verification_succeeded) } + end + + trait(:verification_failed) do + with_file + verification_failure { 'Could not calculate the checksum' } + verification_state { CoolWidget.verification_state_value(:verification_failed) } + end + ``` + +- [ ] Make sure the factory also allows setting a `project` attribute. If the model does not have a direct relation to a project, you can use a `transient` attribute. Check out `spec/factories/merge_request_diffs.rb` for an example. + +##### If you added verification state fields to a separate table (option 2 above), then you need to make additional model and factory changes If you did not add verification state fields to a separate table, `cool_widget_states`, then skip to [Step 2. Implement metrics gathering](#step-2-implement-metrics-gathering). Otherwise, you can follow [the example of Merge Request Diffs](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/63309). -- [ ] Add the following lines to the `cool_widget_state.rb` model: +- [ ] Add a `Geo::CoolWidgetState` model in `ee/app/models/ee/geo/cool_widget_state.rb`: ``` ruby - class CoolWidgetState < ApplicationRecord - self.primary_key = :cool_widget_id + module Geo + class CoolWidgetState < ApplicationRecord + self.primary_key = :cool_widget_id - belongs_to :cool_widget, inverse_of: :cool_widget_state + belongs_to :cool_widget, inverse_of: :cool_widget_state + end + end + ``` + +- [ ] Add a `factory` for `cool_widget_state`, in `ee/spec/factories/geo/cool_widget_states.rb`: + + ``` ruby + # frozen_string_literal: true + + FactoryBot.define do + factory :geo_cool_widget_state, class: 'Geo::CoolWidgetState' do + cool_widget + + trait(:checksummed) do + verification_checksum { 'abc' } + end + + trait(:checksum_failure) do + verification_failure { 'Could not calculate the checksum' } + end + end end ``` @@ -540,7 +580,7 @@ Otherwise, you can follow [the example of Merge Request Diffs](https://gitlab.co ... include ::Gitlab::Geo::VerificationState - has_one :cool_widget_state, autosave: true, inverse_of: :cool_widget + has_one :cool_widget_state, autosave: true, inverse_of: :cool_widget, class_name: 'Geo::CoolWidgetState' delegate :verification_retry_at, :verification_retry_at=, :verified_at, :verified_at=, @@ -577,6 +617,12 @@ Otherwise, you can follow [the example of Merge Request Diffs](https://gitlab.co end end ... + + def cool_widget_state + super || build_cool_widget_state + end + + ... end ``` @@ -616,24 +662,6 @@ Metrics are gathered by `Geo::MetricsUpdateWorker`, persisted in `GeoNodeStatus` Geo::CoolWidgetReplicator | :cool_widget | :geo_cool_widget_registry ``` -- [ ] Add the following to `spec/factories/cool_widgets.rb`: - - ```ruby - trait(:verification_succeeded) do - with_file - verification_checksum { 'abc' } - verification_state { CoolWidget.verification_state_value(:verification_succeeded) } - end - - trait(:verification_failed) do - with_file - verification_failure { 'Could not calculate the checksum' } - verification_state { CoolWidget.verification_state_value(:verification_failed) } - end - ``` - -- [ ] Make sure the factory also allows setting a `project` attribute. If the model does not have a direct relation to a project, you can use a `transient` attribute. Check out `spec/factories/merge_request_diffs.rb` for an example. - Cool Widget replication and verification metrics should now be available in the API, the `Admin > Geo > Nodes` view, and Prometheus. #### Step 3. Implement the GraphQL API diff --git a/.gitlab/issue_templates/Geo Replicate a new blob type.md b/.gitlab/issue_templates/Geo Replicate a new blob type.md index fcb5c281fc1..58b08f490f7 100644 --- a/.gitlab/issue_templates/Geo Replicate a new blob type.md +++ b/.gitlab/issue_templates/Geo Replicate a new blob type.md @@ -480,19 +480,59 @@ That's all of the required database changes. end ``` -##### If you added verification state fields to a separate table (option 2 above), then you need to make additional model changes +- [ ] Add the following to `spec/factories/cool_widgets.rb`: + + ```ruby + trait(:verification_succeeded) do + with_file + verification_checksum { 'abc' } + verification_state { CoolWidget.verification_state_value(:verification_succeeded) } + end + + trait(:verification_failed) do + with_file + verification_failure { 'Could not calculate the checksum' } + verification_state { CoolWidget.verification_state_value(:verification_failed) } + end + ``` + +- [ ] Make sure the factory also allows setting a `project` attribute. If the model does not have a direct relation to a project, you can use a `transient` attribute. Check out `spec/factories/merge_request_diffs.rb` for an example. + +##### If you added verification state fields to a separate table (option 2 above), then you need to make additional model and factory changes If you did not add verification state fields to a separate table, `cool_widget_states`, then skip to [Step 2. Implement metrics gathering](#step-2-implement-metrics-gathering). Otherwise, you can follow [the example of Merge Request Diffs](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/63309). -- [ ] Add the following lines to the `cool_widget_state.rb` model: +- [ ] Add a `Geo::CoolWidgetState` model in `ee/app/models/ee/geo/cool_widget_state.rb`: ``` ruby - class CoolWidgetState < ApplicationRecord - self.primary_key = :cool_widget_id + module Geo + class CoolWidgetState < ApplicationRecord + self.primary_key = :cool_widget_id - belongs_to :cool_widget, inverse_of: :cool_widget_state + belongs_to :cool_widget, inverse_of: :cool_widget_state + end + end + ``` + +- [ ] Add a `factory` for `cool_widget_state`, in `ee/spec/factories/geo/cool_widget_states.rb`: + + ``` ruby + # frozen_string_literal: true + + FactoryBot.define do + factory :geo_cool_widget_state, class: 'Geo::CoolWidgetState' do + cool_widget + + trait(:checksummed) do + verification_checksum { 'abc' } + end + + trait(:checksum_failure) do + verification_failure { 'Could not calculate the checksum' } + end + end end ``` @@ -507,7 +547,7 @@ Otherwise, you can follow [the example of Merge Request Diffs](https://gitlab.co ... include ::Gitlab::Geo::VerificationState - has_one :cool_widget_state, autosave: true, inverse_of: :cool_widget + has_one :cool_widget_state, autosave: true, inverse_of: :cool_widget, class_name: 'Geo::CoolWidgetState' delegate :verification_retry_at, :verification_retry_at=, :verified_at, :verified_at=, @@ -544,6 +584,12 @@ Otherwise, you can follow [the example of Merge Request Diffs](https://gitlab.co end end ... + + def cool_widget_state + super || build_cool_widget_state + end + + ... end ``` @@ -583,24 +629,6 @@ Metrics are gathered by `Geo::MetricsUpdateWorker`, persisted in `GeoNodeStatus` Geo::CoolWidgetReplicator | :cool_widget | :geo_cool_widget_registry ``` -- [ ] Add the following to `spec/factories/cool_widgets.rb`: - - ```ruby - trait(:verification_succeeded) do - with_file - verification_checksum { 'abc' } - verification_state { CoolWidget.verification_state_value(:verification_succeeded) } - end - - trait(:verification_failed) do - with_file - verification_failure { 'Could not calculate the checksum' } - verification_state { CoolWidget.verification_state_value(:verification_failed) } - end - ``` - -- [ ] Make sure the factory also allows setting a `project` attribute. If the model does not have a direct relation to a project, you can use a `transient` attribute. Check out `spec/factories/merge_request_diffs.rb` for an example. - Cool Widget replication and verification metrics should now be available in the API, the `Admin > Geo > Nodes` view, and Prometheus. #### Step 3. Implement the GraphQL API diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c0ac790402..a658a6f32c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,19 @@ documentation](doc/development/changelog.md) for instructions on adding your own entry. +## 14.0.5 (2021-07-08) + +### Fixed (4 changes) + +- [Return empty strings for Jira links when URL is not set](gitlab-org/gitlab@6da7890d8137b1879297ad81c6737312d6f672b3) ([merge request](gitlab-org/gitlab!65728)) +- [Add prefix to autocomplete path](gitlab-org/gitlab@5256ab7db346610a816ebb975ae9a6ce0d853435) ([merge request](gitlab-org/gitlab!65728)) +- [Do not create audit event for failed logins on read-only DB](gitlab-org/gitlab@30c7944ddddfe92566b3f66a7f549bef3ffd8d82) ([merge request](gitlab-org/gitlab!65728)) **GitLab Enterprise Edition** +- [Fix git clone for projects with a trailing dot over HTTP](gitlab-org/gitlab@a91be9412a09b069390cc33c14d1bc72216cdbf0) ([merge request](gitlab-org/gitlab!65728)) + +### Other (1 change) + +- [Initialize conversion of ci_builds_metadata.id for bigint migration](gitlab-org/gitlab@34522b102be43118063aa3245d23af313173700d) ([merge request](gitlab-org/gitlab!65728)) + ## 14.0.4 (2021-07-07) ### Security (1 change) diff --git a/app/assets/javascripts/fly_out_nav.js b/app/assets/javascripts/fly_out_nav.js index be7418ba802..0fb70fb831e 100644 --- a/app/assets/javascripts/fly_out_nav.js +++ b/app/assets/javascripts/fly_out_nav.js @@ -88,12 +88,12 @@ export const moveSubItemsToPosition = (el, subItems) => { const boundingRect = el.getBoundingClientRect(); const left = sidebar ? sidebar.offsetWidth : COLLAPSED_PANEL_WIDTH; let top = calculateTop(boundingRect, subItems.offsetHeight); + const isAbove = top < boundingRect.top; if (hasSubItems) { - top -= header.offsetHeight; + top = isAbove ? top : top - header.offsetHeight; } else { top = boundingRect.top; } - const isAbove = top <= boundingRect.top; subItems.classList.add('fly-out-list'); subItems.style.transform = `translate3d(${left}px, ${Math.floor(top) - getHeaderHeight()}px, 0)`; // eslint-disable-line no-param-reassign diff --git a/app/assets/javascripts/packages/list/constants.js b/app/assets/javascripts/packages/list/constants.js index f2125034b5f..2c6fd94024e 100644 --- a/app/assets/javascripts/packages/list/constants.js +++ b/app/assets/javascripts/packages/list/constants.js @@ -90,6 +90,10 @@ export const PACKAGE_TYPES = [ title: s__('PackageRegistry|Debian'), type: PackageType.DEBIAN, }, + { + title: s__('PackageRegistry|Helm'), + type: PackageType.HELM, + }, ]; export const LIST_TITLE_TEXT = s__('PackageRegistry|Package Registry'); diff --git a/app/assets/javascripts/packages/shared/constants.js b/app/assets/javascripts/packages/shared/constants.js index c6b9c8b29de..b4cdca34d92 100644 --- a/app/assets/javascripts/packages/shared/constants.js +++ b/app/assets/javascripts/packages/shared/constants.js @@ -10,6 +10,7 @@ export const PackageType = { RUBYGEMS: 'rubygems', GENERIC: 'generic', DEBIAN: 'debian', + HELM: 'helm', }; // we want this separated from the main dictionary to avoid it being pulled in the search of package diff --git a/app/assets/javascripts/packages/shared/utils.js b/app/assets/javascripts/packages/shared/utils.js index 89b9bd34b08..7e86e5b2991 100644 --- a/app/assets/javascripts/packages/shared/utils.js +++ b/app/assets/javascripts/packages/shared/utils.js @@ -27,6 +27,8 @@ export const getPackageTypeLabel = (packageType) => { return s__('PackageRegistry|Generic'); case PackageType.DEBIAN: return s__('PackageRegistry|Debian'); + case PackageType.HELM: + return s__('PackageRegistry|Helm'); default: return null; } diff --git a/app/assets/javascripts/packages_and_registries/settings/project/components/settings_form.vue b/app/assets/javascripts/packages_and_registries/settings/project/components/settings_form.vue index efdb65265d0..6030af9d2c3 100644 --- a/app/assets/javascripts/packages_and_registries/settings/project/components/settings_form.vue +++ b/app/assets/javascripts/packages_and_registries/settings/project/components/settings_form.vue @@ -88,8 +88,6 @@ export default { return { ...this.value, cadence: this.findDefaultOption('cadence'), - keepN: this.findDefaultOption('keepN'), - olderThan: this.findDefaultOption('olderThan'), }; }, showLoadingIcon() { diff --git a/app/assets/javascripts/packages_and_registries/settings/project/utils.js b/app/assets/javascripts/packages_and_registries/settings/project/utils.js index 4a2d7c7d466..b577a051862 100644 --- a/app/assets/javascripts/packages_and_registries/settings/project/utils.js +++ b/app/assets/javascripts/packages_and_registries/settings/project/utils.js @@ -11,11 +11,14 @@ export const olderThanTranslationGenerator = (variable) => n__('%d day', '%d day export const keepNTranslationGenerator = (variable) => n__('%d tag per image name', '%d tags per image name', variable); -export const optionLabelGenerator = (collection, translationFn) => - collection.map((option) => ({ +export const optionLabelGenerator = (collection, translationFn) => { + const result = collection.map((option) => ({ ...option, label: translationFn(option.variable), })); + result.unshift({ key: null, label: '' }); + return result; +}; export const formOptionsGenerator = () => { return { diff --git a/app/assets/javascripts/vue_shared/new_namespace/components/welcome.vue b/app/assets/javascripts/vue_shared/new_namespace/components/welcome.vue index 2e6aa3486cf..1b20ae57563 100644 --- a/app/assets/javascripts/vue_shared/new_namespace/components/welcome.vue +++ b/app/assets/javascripts/vue_shared/new_namespace/components/welcome.vue @@ -30,7 +30,7 @@ export default { };