From 830c9943a95cbd755700d6624c64a158b2602cd0 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 11 Jan 2022 21:14:42 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .../framework/contextual_sidebar.scss | 8 +++- app/assets/stylesheets/framework/wells.scss | 27 ------------- .../stylesheets/startup/startup-dark.scss | 26 +++++++++++- .../stylesheets/startup/startup-general.scss | 26 +++++++++++- app/helpers/commits_helper.rb | 8 +--- app/models/ci/runner.rb | 2 + app/models/customer_relations/contact.rb | 11 +++++ .../commit/_limit_exceeded_message.html.haml | 13 +++--- app/views/projects/commit/branches.html.haml | 5 ++- .../registrations/welcome/show.html.haml | 2 +- app/views/shared/nav/_sidebar_menu.html.haml | 2 +- .../development/use_traversal_ids.yml | 2 +- .../use_traversal_ids_for_ancestor_scopes.yml | 2 +- .../use_traversal_ids_for_ancestors.yml | 2 +- .../use_traversal_ids_for_ancestors_upto.yml | 2 +- .../use_traversal_ids_for_root_ancestor.yml | 2 +- .../use_traversal_ids_groups_finder.yml | 2 +- ...95006_add_maintainer_note_to_ci_runners.rb | 12 ++++++ ...ext_limit_to_ci_runners_maintainer_note.rb | 13 ++++++ db/schema_migrations/20220111095006 | 1 + db/schema_migrations/20220111095007 | 1 + db/structure.sql | 4 +- doc/operations/index.md | 28 ++++++++++--- .../database/gitlab_loose_foreign_keys.yml | 10 ++++- locale/gitlab.pot | 9 +++++ qa/lib/gitlab/page/main/welcome.rb | 13 ------ qa/lib/gitlab/page/main/welcome.stub.rb | 33 --------------- qa/qa/flow/sign_up.rb | 5 ++- qa/qa/flow/user_onboarding.rb | 19 +++++++++ qa/qa/page/dashboard/welcome.rb | 4 ++ qa/qa/page/registration/sign_up.rb | 4 -- qa/qa/page/registration/welcome.rb | 23 ++++++++--- qa/qa/runtime/env.rb | 14 +++++++ .../1_manage/login/register_spec.rb | 11 ++--- qa/spec/runtime/env_spec.rb | 40 +++++++++++++++++++ .../models/customer_relations/contact_spec.rb | 32 +++++++++++++++ 36 files changed, 292 insertions(+), 126 deletions(-) create mode 100644 db/migrate/20220111095006_add_maintainer_note_to_ci_runners.rb create mode 100644 db/migrate/20220111095007_add_text_limit_to_ci_runners_maintainer_note.rb create mode 100644 db/schema_migrations/20220111095006 create mode 100644 db/schema_migrations/20220111095007 delete mode 100644 qa/lib/gitlab/page/main/welcome.rb delete mode 100644 qa/lib/gitlab/page/main/welcome.stub.rb create mode 100644 qa/qa/flow/user_onboarding.rb diff --git a/app/assets/stylesheets/framework/contextual_sidebar.scss b/app/assets/stylesheets/framework/contextual_sidebar.scss index 345c180d164..2a3ed29258a 100644 --- a/app/assets/stylesheets/framework/contextual_sidebar.scss +++ b/app/assets/stylesheets/framework/contextual_sidebar.scss @@ -357,7 +357,9 @@ } > li { - .badge.badge-pill { + // TODO: Remove this block once all sidebar badges use gl_badge_tag + // https://gitlab.com/gitlab-org/gitlab/-/issues/350061 + .badge.badge-pill:not(.gl-badge) { @include gl-rounded-lg; @include gl-py-1; @include gl-px-3; @@ -370,7 +372,9 @@ display: block; } - .badge.badge-pill { + // TODO: Remove this block once all sidebar badges use gl_badge_tag + // https://gitlab.com/gitlab-org/gitlab/-/issues/350061 + .badge.badge-pill:not(.gl-badge) { @include gl-font-weight-normal; color: $blue-700; } diff --git a/app/assets/stylesheets/framework/wells.scss b/app/assets/stylesheets/framework/wells.scss index d550a1faa18..b796f04750b 100644 --- a/app/assets/stylesheets/framework/wells.scss +++ b/app/assets/stylesheets/framework/wells.scss @@ -65,33 +65,6 @@ display: inline; } - .branch-link { - margin-bottom: 2px; - } - - .limit-box { - cursor: pointer; - display: inline-flex; - align-items: center; - background-color: $red-100; - border-radius: $border-radius-default; - text-align: center; - - &:hover { - background-color: $red-200; - } - - .limit-icon { - margin: 0 4px; - } - - .limit-message { - line-height: 16px; - margin-right: 8px; - font-size: 12px; - } - } - svg { vertical-align: text-top; } diff --git a/app/assets/stylesheets/startup/startup-dark.scss b/app/assets/stylesheets/startup/startup-dark.scss index f792e80de3f..fb96c23517c 100644 --- a/app/assets/stylesheets/startup/startup-dark.scss +++ b/app/assets/stylesheets/startup/startup-dark.scss @@ -314,6 +314,10 @@ h1 { padding-left: 0.6em; border-radius: 10rem; } +.badge-info { + color: #fff; + background-color: #428fdc; +} .bg-transparent { background-color: transparent !important; } @@ -372,6 +376,24 @@ h1 { padding-left: 0.5rem; padding-right: 0.5rem; } +.gl-badge.sm { + padding-top: 0; + padding-bottom: 0; +} +.gl-badge.badge-info { + background-color: #064787; + color: #9dc7f1; +} +a.gl-badge.badge-info.active, +a.gl-badge.badge-info:active { + color: #e9f3fc; + background-color: #0b5cad; +} +a.gl-badge.badge-info:active { + box-shadow: inset 0 0 0 1px rgba(51, 51, 51, 0.8), + 0 0 0 1px rgba(51, 51, 51, 0.4), 0 0 0 4px rgba(66, 143, 220, 0.48); + outline: none; +} .gl-button .gl-badge { top: 0; } @@ -1367,7 +1389,7 @@ input { border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); } -.sidebar-top-level-items > li .badge.badge-pill { +.sidebar-top-level-items > li .badge.badge-pill:not(.gl-badge) { border-radius: 0.5rem; padding-top: 0.125rem; padding-bottom: 0.125rem; @@ -1381,7 +1403,7 @@ input { .sidebar-sub-level-items:not(.is-fly-out-only) { display: block; } -.sidebar-top-level-items > li.active .badge.badge-pill { +.sidebar-top-level-items > li.active .badge.badge-pill:not(.gl-badge) { font-weight: 400; color: #9dc7f1; } diff --git a/app/assets/stylesheets/startup/startup-general.scss b/app/assets/stylesheets/startup/startup-general.scss index b99570ee69c..8d3c0fbb485 100644 --- a/app/assets/stylesheets/startup/startup-general.scss +++ b/app/assets/stylesheets/startup/startup-general.scss @@ -295,6 +295,10 @@ h1 { padding-left: 0.6em; border-radius: 10rem; } +.badge-info { + color: #fff; + background-color: #1f75cb; +} .bg-transparent { background-color: transparent !important; } @@ -353,6 +357,24 @@ h1 { padding-left: 0.5rem; padding-right: 0.5rem; } +.gl-badge.sm { + padding-top: 0; + padding-bottom: 0; +} +.gl-badge.badge-info { + background-color: #cbe2f9; + color: #0b5cad; +} +a.gl-badge.badge-info.active, +a.gl-badge.badge-info:active { + color: #033464; + background-color: #9dc7f1; +} +a.gl-badge.badge-info:active { + box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8), + 0 0 0 1px rgba(255, 255, 255, 0.4), 0 0 0 4px rgba(31, 117, 203, 0.48); + outline: none; +} .gl-button .gl-badge { top: 0; } @@ -1348,7 +1370,7 @@ input { border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); } -.sidebar-top-level-items > li .badge.badge-pill { +.sidebar-top-level-items > li .badge.badge-pill:not(.gl-badge) { border-radius: 0.5rem; padding-top: 0.125rem; padding-bottom: 0.125rem; @@ -1362,7 +1384,7 @@ input { .sidebar-sub-level-items:not(.is-fly-out-only) { display: block; } -.sidebar-top-level-items > li.active .badge.badge-pill { +.sidebar-top-level-items > li.active .badge.badge-pill:not(.gl-badge) { font-weight: 400; color: #0b5cad; } diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index ee5f4bb364a..4256a24bc16 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -73,9 +73,7 @@ module CommitsHelper # Returns a link formatted as a commit branch link def commit_branch_link(url, text) - link_to(url, class: 'badge badge-gray ref-name branch-link') do - sprite_icon('branch', size: 12, css_class: 'fork-svg') + "#{text}" - end + gl_badge_tag(text, { variant: :info, icon: 'branch' }, { href: url, class: 'gl-font-monospace gl-mb-1' }) end # Returns the sorted alphabetically links to branches, separated by a comma @@ -87,9 +85,7 @@ module CommitsHelper # Returns a link formatted as a commit tag link def commit_tag_link(url, text) - link_to(url, class: 'badge badge-gray ref-name') do - sprite_icon('tag', size: 12, css_class: 'gl-mr-2 vertical-align-middle') + "#{text}" - end + gl_badge_tag(text, { variant: :info, icon: 'tag' }, { href: url, class: 'gl-font-monospace' }) end # Returns the sorted links to tags, separated by a comma diff --git a/app/models/ci/runner.rb b/app/models/ci/runner.rb index fa2c5b2f5fa..35616a542c1 100644 --- a/app/models/ci/runner.rb +++ b/app/models/ci/runner.rb @@ -210,6 +210,8 @@ module Ci validates :config, json_schema: { filename: 'ci_runner_config' } + validates :maintainer_note, length: { maximum: 255 } + # Searches for runners matching the given query. # # This method uses ILIKE on PostgreSQL for the description field and performs a full match on tokens. diff --git a/app/models/customer_relations/contact.rb b/app/models/customer_relations/contact.rb index d8669f1f4c2..01ed620baf9 100644 --- a/app/models/customer_relations/contact.rb +++ b/app/models/customer_relations/contact.rb @@ -24,6 +24,7 @@ class CustomerRelations::Contact < ApplicationRecord validates :email, length: { maximum: 255 } validates :description, length: { maximum: 1024 } validate :validate_email_format + validate :unique_email_for_group_hierarchy def self.find_ids_by_emails(group_id, emails) raise ArgumentError, "Cannot lookup more than #{MAX_PLUCK} emails" if emails.length > MAX_PLUCK @@ -39,4 +40,14 @@ class CustomerRelations::Contact < ApplicationRecord self.errors.add(:email, I18n.t(:invalid, scope: 'valid_email.validations.email')) unless ValidateEmail.valid?(self.email) end + + def unique_email_for_group_hierarchy + return unless group + return unless email + + duplicate_email_exists = CustomerRelations::Contact + .where(group_id: group.self_and_hierarchy.pluck(:id), email: email) + .where.not(id: id).exists? + self.errors.add(:email, _('contact with same email already exists in group hierarchy')) if duplicate_email_exists + end end diff --git a/app/views/projects/commit/_limit_exceeded_message.html.haml b/app/views/projects/commit/_limit_exceeded_message.html.haml index 236418ecd0e..444e7d209f1 100644 --- a/app/views/projects/commit/_limit_exceeded_message.html.haml +++ b/app/views/projects/commit/_limit_exceeded_message.html.haml @@ -1,8 +1,5 @@ -.has-tooltip{ class: "limit-box limit-box-#{objects} gl-ml-2", data: { title: _('Project has too many %{label_for_message} to search') % { label_for_message: label_for_message } } } - .limit-icon - - if objects == :branch - = sprite_icon('fork', size: 12) - - else - = sprite_icon('tag') - .limit-message - %span= _('%{label_for_message} unavailable') % { label_for_message: label_for_message.capitalize } +- icon = objects == :branch ? 'fork' : 'tag' +- text = _('%{label_for_message} unavailable') % { label_for_message: label_for_message.capitalize } +- tooltip_title = _('Project has too many %{label_for_message} to search') % { label_for_message: label_for_message } + += gl_badge_tag(text, { variant: :danger, icon: icon }, { class: 'has-tooltip gl-ml-2', data: { title: tooltip_title } }) diff --git a/app/views/projects/commit/branches.html.haml b/app/views/projects/commit/branches.html.haml index 0b8e5105bc0..d08ace98408 100644 --- a/app/views/projects/commit/branches.html.haml +++ b/app/views/projects/commit/branches.html.haml @@ -6,8 +6,9 @@ - if @branches.any? || @tags.any? || @tags_limit_exceeded %span - = link_to "#", class: "js-details-expand badge badge-gray ref-name" do - = sprite_icon('ellipsis_h', size: 12, css_class: 'vertical-align-middle') + = gl_badge_tag(_("Expand"), + { variant: :info, icon: 'ellipsis_h', icon_only: true }, + { href: '#', class: 'js-details-expand gl-font-monospace' }) %span.js-details-content.hide = commit_branches_links(@project, @branches) - if @tags_limit_exceeded diff --git a/app/views/registrations/welcome/show.html.haml b/app/views/registrations/welcome/show.html.haml index 7e9fb2db5dc..ca2f225a2d8 100644 --- a/app/views/registrations/welcome/show.html.haml +++ b/app/views/registrations/welcome/show.html.haml @@ -22,7 +22,7 @@ .row .form-group.col-sm-12 = f.label :role, _('Role'), class: 'label-bold' - = f.select :role, ::User.roles.keys.map { |role| [role.titleize, role] }, { include_blank: _('Select a role') }, class: 'form-control js-user-role-dropdown', autofocus: true, required: true + = f.select :role, ::User.roles.keys.map { |role| [role.titleize, role] }, { include_blank: _('Select a role') }, class: 'form-control js-user-role-dropdown', autofocus: true, required: true, data: { qa_selector: 'role_dropdown' } - if Feature.enabled?(:user_other_role_details) .row .form-group.col-sm-12.js-other-role-group.hidden diff --git a/app/views/shared/nav/_sidebar_menu.html.haml b/app/views/shared/nav/_sidebar_menu.html.haml index 4c4ceb9ea70..bc0648c14e0 100644 --- a/app/views/shared/nav/_sidebar_menu.html.haml +++ b/app/views/shared/nav/_sidebar_menu.html.haml @@ -13,7 +13,7 @@ %span.nav-item-name{ **sidebar_menu.title_html_options } = sidebar_menu.title - if sidebar_menu.has_pill? - %span.badge.badge-pill.count{ **sidebar_menu.pill_html_options } + = gl_badge_tag({ variant: :info, size: :sm }, { class: "count #{sidebar_menu.pill_html_options[:class]}" }) do = number_with_delimiter(sidebar_menu.pill_count) = render partial: 'shared/nav/sidebar_submenu', locals: { sidebar_menu: sidebar_menu } diff --git a/config/feature_flags/development/use_traversal_ids.yml b/config/feature_flags/development/use_traversal_ids.yml index e9fd2d03737..ab3a2eaf733 100644 --- a/config/feature_flags/development/use_traversal_ids.yml +++ b/config/feature_flags/development/use_traversal_ids.yml @@ -4,5 +4,5 @@ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56296 rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/321948 milestone: '13.11' type: development -group: group::access +group: group::workspace default_enabled: false diff --git a/config/feature_flags/development/use_traversal_ids_for_ancestor_scopes.yml b/config/feature_flags/development/use_traversal_ids_for_ancestor_scopes.yml index 7f398fc5f0b..e2619ef5231 100644 --- a/config/feature_flags/development/use_traversal_ids_for_ancestor_scopes.yml +++ b/config/feature_flags/development/use_traversal_ids_for_ancestor_scopes.yml @@ -4,5 +4,5 @@ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/67652 rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/340159 milestone: '14.3' type: development -group: group::access +group: group::workspace default_enabled: false diff --git a/config/feature_flags/development/use_traversal_ids_for_ancestors.yml b/config/feature_flags/development/use_traversal_ids_for_ancestors.yml index ae5f154a6bc..4a89aac140d 100644 --- a/config/feature_flags/development/use_traversal_ids_for_ancestors.yml +++ b/config/feature_flags/development/use_traversal_ids_for_ancestors.yml @@ -4,5 +4,5 @@ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57137 rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/334952 milestone: '13.12' type: development -group: group::access +group: group::workspace default_enabled: false diff --git a/config/feature_flags/development/use_traversal_ids_for_ancestors_upto.yml b/config/feature_flags/development/use_traversal_ids_for_ancestors_upto.yml index 4fe7ca695c3..9da967f87ea 100644 --- a/config/feature_flags/development/use_traversal_ids_for_ancestors_upto.yml +++ b/config/feature_flags/development/use_traversal_ids_for_ancestors_upto.yml @@ -4,5 +4,5 @@ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/72662 rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/343619 milestone: '14.6' type: development -group: group::access +group: group::workspace default_enabled: false diff --git a/config/feature_flags/development/use_traversal_ids_for_root_ancestor.yml b/config/feature_flags/development/use_traversal_ids_for_root_ancestor.yml index be02645720e..74ae139b68a 100644 --- a/config/feature_flags/development/use_traversal_ids_for_root_ancestor.yml +++ b/config/feature_flags/development/use_traversal_ids_for_root_ancestor.yml @@ -4,5 +4,5 @@ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/61163 rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/331907 milestone: '14.0' type: development -group: group::access +group: group::workspace default_enabled: false diff --git a/config/feature_flags/development/use_traversal_ids_groups_finder.yml b/config/feature_flags/development/use_traversal_ids_groups_finder.yml index b0550fe62d9..2f35ede7e87 100644 --- a/config/feature_flags/development/use_traversal_ids_groups_finder.yml +++ b/config/feature_flags/development/use_traversal_ids_groups_finder.yml @@ -4,5 +4,5 @@ introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/67650 rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/345666 milestone: '14.6' type: development -group: group::access +group: group::workspace default_enabled: false diff --git a/db/migrate/20220111095006_add_maintainer_note_to_ci_runners.rb b/db/migrate/20220111095006_add_maintainer_note_to_ci_runners.rb new file mode 100644 index 00000000000..969774983c4 --- /dev/null +++ b/db/migrate/20220111095006_add_maintainer_note_to_ci_runners.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class AddMaintainerNoteToCiRunners < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def change + # rubocop:disable Migration/AddLimitToTextColumns + # limit is added in 20220111095007_add_text_limit_to_ci_runners_maintainer_note.rb + add_column :ci_runners, :maintainer_note, :text + # rubocop:enable Migration/AddLimitToTextColumns + end +end diff --git a/db/migrate/20220111095007_add_text_limit_to_ci_runners_maintainer_note.rb b/db/migrate/20220111095007_add_text_limit_to_ci_runners_maintainer_note.rb new file mode 100644 index 00000000000..0a0a4171306 --- /dev/null +++ b/db/migrate/20220111095007_add_text_limit_to_ci_runners_maintainer_note.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddTextLimitToCiRunnersMaintainerNote < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + add_text_limit :ci_runners, :maintainer_note, 255 + end + + def down + remove_text_limit :ci_runners, :maintainer_note + end +end diff --git a/db/schema_migrations/20220111095006 b/db/schema_migrations/20220111095006 new file mode 100644 index 00000000000..b5fed6279f1 --- /dev/null +++ b/db/schema_migrations/20220111095006 @@ -0,0 +1 @@ +0bc00cc8a5fa7cafa665ec113a4d0d1384c5acde37dfdf53ab1f5a2e1d6acb02 \ No newline at end of file diff --git a/db/schema_migrations/20220111095007 b/db/schema_migrations/20220111095007 new file mode 100644 index 00000000000..77c70f8bccf --- /dev/null +++ b/db/schema_migrations/20220111095007 @@ -0,0 +1 @@ +65259b0e71c1883b81c61354325cfeeade0013b55af8901bf707f2a94ee3a46a \ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 77556f4de31..9188caad2c0 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -12177,7 +12177,9 @@ CREATE TABLE ci_runners ( public_projects_minutes_cost_factor double precision DEFAULT 0.0 NOT NULL, private_projects_minutes_cost_factor double precision DEFAULT 1.0 NOT NULL, config jsonb DEFAULT '{}'::jsonb NOT NULL, - executor_type smallint + executor_type smallint, + maintainer_note text, + CONSTRAINT check_56f5ea8804 CHECK ((char_length(maintainer_note) <= 255)) ); CREATE SEQUENCE ci_runners_id_seq diff --git a/doc/operations/index.md b/doc/operations/index.md index cc1effc289f..5a83e47b556 100644 --- a/doc/operations/index.md +++ b/doc/operations/index.md @@ -9,7 +9,13 @@ info: To determine the technical writer assigned to the Stage/Group associated w GitLab provides a variety of tools to help operate and maintain your applications. -## Measure reliability and stability with metrics +## Measure reliability and stability with metrics (DEPRECATED) + +> [Deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/346485) in GitLab 14.7. + +WARNING: +This feature is in its end-of-life process. It is [deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/346485) +for use in GitLab 14.7, and is planned for removal in GitLab 15.0. Metrics help you understand the health and performance of your infrastructure, applications, and systems by providing insights into your application's reliability, @@ -30,13 +36,13 @@ performance degrades, and manage those alerts - all within GitLab. GitLab helps reduce alert fatigue for IT responders by providing tools to identify issues across multiple systems and aggregate alerts in a centralized place. Your team needs a single, central interface where they can easily investigate alerts -using metrics and logs, and promote the critical alerts to incidents. +and promote the critical alerts to incidents. Are your alerts too noisy? Alerts configured on GitLab metrics can configured and fine-tuned in GitLab immediately following a fire-fight. - [Manage alerts and incidents](incident_management/index.md) in GitLab. -- [Configure alerts for metrics](metrics/alerts.md) in GitLab. +- [Configure alerts for metrics](metrics/alerts.md) in GitLab. (DEPRECATED) - Create a [status page](incident_management/status_page.md) to communicate efficiently to your users during an incident. @@ -51,7 +57,13 @@ and the work required to fix them - all without leaving GitLab. - Discover and view errors generated by your applications with [Error Tracking](error_tracking.md). -## Trace application health and performance +## Trace application health and performance (DEPRECATED) + +> [Deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/346485) in GitLab 14.7. + +WARNING: +This feature is in its end-of-life process. It is [deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/346485) +for use in GitLab 14.7, and is planned for removal in GitLab 15.0. Application tracing in GitLab is a way to measure an application's performance and health while it's running. After configuring your application to enable tracing, you @@ -65,7 +77,13 @@ microservices-based distributed systems - and displays results within GitLab. - [Trace the performance and health](tracing.md) of a deployed application. -## Aggregate and store logs +## Aggregate and store logs (DEPRECATED) + +> [Deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/346485) in GitLab 14.7. + +WARNING: +This feature is in its end-of-life process. It is [deprecated](https://gitlab.com/gitlab-org/gitlab/-/issues/346485) +for use in GitLab 14.7, and is planned for removal in GitLab 15.0. Developers need to troubleshoot application changes in development, and incident responders need aggregated, real-time logs when troubleshooting problems with diff --git a/lib/gitlab/database/gitlab_loose_foreign_keys.yml b/lib/gitlab/database/gitlab_loose_foreign_keys.yml index 7e14ed2724c..1c45bfbd0dc 100644 --- a/lib/gitlab/database/gitlab_loose_foreign_keys.yml +++ b/lib/gitlab/database/gitlab_loose_foreign_keys.yml @@ -14,7 +14,7 @@ dast_scanner_profiles_builds: - table: ci_builds column: ci_build_id on_delete: async_delete -dast_scanner_profiles_builds: +dast_site_profiles_builds: - table: ci_builds column: ci_build_id on_delete: async_delete @@ -115,3 +115,11 @@ ci_minutes_additional_packs: - table: namespaces column: namespace_id on_delete: async_delete +requirements_management_test_reports: + - table: ci_builds + column: build_id + on_delete: async_nullify +security_scans: + - table: ci_builds + column: build_id + on_delete: async_delete diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 8c844a10f87..76be660f74c 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -31642,12 +31642,18 @@ msgstr "" msgid "SecurityOrchestration|Scan Execution" msgstr "" +msgid "SecurityOrchestration|Scan Result" +msgstr "" + msgid "SecurityOrchestration|Scan execution" msgstr "" msgid "SecurityOrchestration|Scan execution policies can only be created by project owners." msgstr "" +msgid "SecurityOrchestration|Scan result" +msgstr "" + msgid "SecurityOrchestration|Scan to be performed %{cadence}" msgstr "" @@ -41916,6 +41922,9 @@ msgstr "" msgid "compliance violation has already been recorded" msgstr "" +msgid "contact with same email already exists in group hierarchy" +msgstr "" + msgid "container_name can contain only lowercase letters, digits, '-', and '.' and must start and end with an alphanumeric character" msgstr "" diff --git a/qa/lib/gitlab/page/main/welcome.rb b/qa/lib/gitlab/page/main/welcome.rb deleted file mode 100644 index a2df1da61c9..00000000000 --- a/qa/lib/gitlab/page/main/welcome.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -module Gitlab - module Page - module Main - class Welcome < Chemlab::Page - path '/users/sign_up/welcome' - - button :get_started_button - end - end - end -end diff --git a/qa/lib/gitlab/page/main/welcome.stub.rb b/qa/lib/gitlab/page/main/welcome.stub.rb deleted file mode 100644 index a10e697bcbf..00000000000 --- a/qa/lib/gitlab/page/main/welcome.stub.rb +++ /dev/null @@ -1,33 +0,0 @@ -# frozen_string_literal: true - -module Gitlab - module Page - module Main - module Welcome - # @note Defined as +button :get_started_button+ - # Clicks +get_started_button+ - def get_started_button - # This is a stub, used for indexing. The method is dynamically generated. - end - - # @example - # Gitlab::Page::Main::Welcome.perform do |welcome| - # expect(welcome.get_started_button_element).to exist - # end - # @return [Watir::Button] The raw +Button+ element - def get_started_button_element - # This is a stub, used for indexing. The method is dynamically generated. - end - - # @example - # Gitlab::Page::Main::Welcome.perform do |welcome| - # expect(welcome).to be_get_started_button - # end - # @return [Boolean] true if the +get_started_button+ element is present on the page - def get_started_button? - # This is a stub, used for indexing. The method is dynamically generated. - end - end - end - end -end diff --git a/qa/qa/flow/sign_up.rb b/qa/qa/flow/sign_up.rb index a2a62371092..ec7886ef969 100644 --- a/qa/qa/flow/sign_up.rb +++ b/qa/qa/flow/sign_up.rb @@ -26,9 +26,12 @@ module QA sign_up.click_new_user_register_button end - Page::Registration::Welcome.perform(&:click_get_started_button_if_available) + Flow::UserOnboarding.onboard_user success = if user.expect_fabrication_success + # In development env and .com the user is asked to create a group and a project which can be skipped for + # the purpose of signing up + Runtime::Browser.visit(:gitlab, Page::Dashboard::Welcome) Page::Main::Menu.perform(&:has_personal_area?) else Page::Main::Menu.perform(&:not_signed_in?) diff --git a/qa/qa/flow/user_onboarding.rb b/qa/qa/flow/user_onboarding.rb new file mode 100644 index 00000000000..066e1878869 --- /dev/null +++ b/qa/qa/flow/user_onboarding.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module QA + module Flow + module UserOnboarding + module_function + + def onboard_user + Page::Registration::Welcome.perform do |welcome_page| + if welcome_page.has_get_started_button? + welcome_page.select_role('Other') + welcome_page.choose_setup_for_company_if_available + welcome_page.click_get_started_button + end + end + end + end + end +end diff --git a/qa/qa/page/dashboard/welcome.rb b/qa/qa/page/dashboard/welcome.rb index b54205780d9..6f645e168c7 100644 --- a/qa/qa/page/dashboard/welcome.rb +++ b/qa/qa/page/dashboard/welcome.rb @@ -11,6 +11,10 @@ module QA def has_welcome_title?(text) has_element?(:welcome_title_content, text: text) end + + def self.path + '/' + end end end end diff --git a/qa/qa/page/registration/sign_up.rb b/qa/qa/page/registration/sign_up.rb index 6d1b9cb3615..4fedc05c702 100644 --- a/qa/qa/page/registration/sign_up.rb +++ b/qa/qa/page/registration/sign_up.rb @@ -16,10 +16,6 @@ module QA element :new_user_username_field end - view 'app/views/registrations/welcome/show.html.haml' do - element :get_started_button - end - def fill_new_user_first_name_field(first_name) fill_element :new_user_first_name_field, first_name end diff --git a/qa/qa/page/registration/welcome.rb b/qa/qa/page/registration/welcome.rb index ff22e62b63e..660b33b4f5b 100644 --- a/qa/qa/page/registration/welcome.rb +++ b/qa/qa/page/registration/welcome.rb @@ -6,14 +6,25 @@ module QA class Welcome < Page::Base view 'app/views/registrations/welcome/show.html.haml' do element :get_started_button + element :role_dropdown end - def click_get_started_button_if_available - if has_element?(:get_started_button) - Support::Retrier.retry_until do - click_element :get_started_button - has_no_element?(:get_started_button) - end + def has_get_started_button? + has_element?(:get_started_button) + end + + def select_role(role) + select_element(:role_dropdown, role) + end + + def choose_setup_for_company_if_available + # Only implemented in EE + end + + def click_get_started_button + Support::Retrier.retry_until do + click_element :get_started_button + has_no_element?(:get_started_button) end end end diff --git a/qa/qa/runtime/env.rb b/qa/qa/runtime/env.rb index 188ce375b88..17fb3996875 100644 --- a/qa/qa/runtime/env.rb +++ b/qa/qa/runtime/env.rb @@ -90,6 +90,20 @@ module QA enabled?(ENV['ACCEPT_INSECURE_CERTS']) end + def running_on_dot_com? + uri = URI.parse(Runtime::Scenario.gitlab_address) + uri.host.include?('.com') + end + + def running_on_dev? + uri = URI.parse(Runtime::Scenario.gitlab_address) + uri.port != 80 && uri.port != 443 + end + + def running_on_dev_or_dot_com? + running_on_dev? || running_on_dot_com? + end + def running_in_ci? ENV['CI'] || ENV['CI_SERVER'] end diff --git a/qa/qa/specs/features/browser_ui/1_manage/login/register_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/login/register_spec.rb index 3e14b05b801..4a95e7484da 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/login/register_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/login/register_spec.rb @@ -13,7 +13,7 @@ module QA end end - RSpec.describe 'Manage', :skip_signup_disabled, :requires_admin do + RSpec.describe 'Manage', :skip_signup_disabled, :requires_admin, quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/349626', type: :stale } do describe 'while LDAP is enabled', :orchestrated, :ldap_no_tls, testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347934' do before do # When LDAP is enabled, a previous test might have created a token for the LDAP 'tanuki' user who is not an admin @@ -118,11 +118,12 @@ module QA Flow::Login.sign_in(as: @user, skip_page_validation: true) - Page::Registration::Welcome.perform(&:click_get_started_button_if_available) + Flow::UserOnboarding.onboard_user - Page::Main::Menu.perform do |menu| - expect(menu).to have_personal_area - end + # In development env and .com the user is asked to create a group and a project which can be skipped for + # the purpose of this test + Runtime::Browser.visit(:gitlab, Page::Dashboard::Welcome) + Page::Main::Menu.perform(&:has_personal_area?) end after do diff --git a/qa/spec/runtime/env_spec.rb b/qa/spec/runtime/env_spec.rb index 89879add7e1..22603497019 100644 --- a/qa/spec/runtime/env_spec.rb +++ b/qa/spec/runtime/env_spec.rb @@ -83,6 +83,46 @@ RSpec.describe QA::Runtime::Env do end end + describe '.running_on_dot_com?' do + using RSpec::Parameterized::TableSyntax + + where(:url, :result) do + 'https://www.gitlab.com' | true + 'https://staging.gitlab.com' | true + 'http://www.gitlab.com' | true + 'http://localhost:3000' | false + 'http://localhost' | false + 'http://gdk.test:3000' | false + end + + with_them do + before do + QA::Runtime::Scenario.define(:gitlab_address, url) + end + + it { expect(described_class.running_on_dot_com?).to eq result } + end + end + + describe '.running_on_dev?' do + using RSpec::Parameterized::TableSyntax + + where(:url, :result) do + 'https://www.gitlab.com' | false + 'http://localhost:3000' | true + 'http://localhost' | false + 'http://gdk.test:3000' | true + end + + with_them do + before do + QA::Runtime::Scenario.define(:gitlab_address, url) + end + + it { expect(described_class.running_on_dev?).to eq result } + end + end + describe '.personal_access_token' do around do |example| described_class.instance_variable_set(:@personal_access_token, nil) diff --git a/spec/models/customer_relations/contact_spec.rb b/spec/models/customer_relations/contact_spec.rb index 7e26d324ac2..860dcb1f4d7 100644 --- a/spec/models/customer_relations/contact_spec.rb +++ b/spec/models/customer_relations/contact_spec.rb @@ -26,6 +26,38 @@ RSpec.describe CustomerRelations::Contact, type: :model do it_behaves_like 'an object with RFC3696 compliant email-formatted attributes', :email end + describe '#unique_email_for_group_hierarchy' do + let_it_be(:parent) { create(:group) } + let_it_be(:group) { create(:group, parent: parent) } + let_it_be(:subgroup) { create(:group, parent: group) } + + let_it_be(:existing_contact) { create(:contact, group: group) } + + context 'with unique email for group hierarchy' do + subject { build(:contact, group: group) } + + it { is_expected.to be_valid } + end + + context 'with duplicate email in group' do + subject { build(:contact, email: existing_contact.email, group: group) } + + it { is_expected.to be_invalid } + end + + context 'with duplicate email in parent group' do + subject { build(:contact, email: existing_contact.email, group: subgroup) } + + it { is_expected.to be_invalid } + end + + context 'with duplicate email in subgroup' do + subject { build(:contact, email: existing_contact.email, group: parent) } + + it { is_expected.to be_invalid } + end + end + describe '#before_validation' do it 'strips leading and trailing whitespace' do contact = described_class.new(first_name: ' First ', last_name: ' Last ', phone: ' 123456 ')