diff --git a/app/assets/javascripts/editor/extensions/editor_lite_extension_base.js b/app/assets/javascripts/editor/extensions/editor_lite_extension_base.js index 447d8e9b8c6..6f6b0a04356 100644 --- a/app/assets/javascripts/editor/extensions/editor_lite_extension_base.js +++ b/app/assets/javascripts/editor/extensions/editor_lite_extension_base.js @@ -1,4 +1,5 @@ import { Range } from 'monaco-editor'; +import { waitForCSSLoaded } from '~/helpers/startup_css_helper'; import { ERROR_INSTANCE_REQUIRED_FOR_EXTENSION, EDITOR_TYPE_CODE } from '../constants'; const hashRegexp = new RegExp('#?L', 'g'); @@ -25,11 +26,18 @@ export class EditorLiteExtension { if (instance.getEditorType && instance.getEditorType() === EDITOR_TYPE_CODE) { EditorLiteExtension.setupLineLinking(instance); } + EditorLiteExtension.deferRerender(instance); } else if (Object.entries(options).length) { throw new Error(ERROR_INSTANCE_REQUIRED_FOR_EXTENSION); } } + static deferRerender(instance) { + waitForCSSLoaded(() => { + instance.layout(); + }); + } + static highlightLines(instance) { const { hash } = window.location; if (!hash) { diff --git a/app/views/profiles/two_factor_auths/show.html.haml b/app/views/profiles/two_factor_auths/show.html.haml index 3df39339901..71262f4bcb9 100644 --- a/app/views/profiles/two_factor_auths/show.html.haml +++ b/app/views/profiles/two_factor_auths/show.html.haml @@ -29,7 +29,7 @@ - register_2fa_token = _('We recommend cloud-based mobile authenticator apps such as Authy, Duo Mobile, and LastPass. They can restore access if you lose your hardware device.') = register_2fa_token.html_safe .row.gl-mb-3 - .col-md-4 + .col-md-4.gl-pt-2{ style: 'background: #fff' } = raw @qr_code .col-md-8 .account-well diff --git a/app/views/shared/members/_invite_member.html.haml b/app/views/shared/members/_invite_member.html.haml index ad0ba6dcedf..49111c821b1 100644 --- a/app/views/shared/members/_invite_member.html.haml +++ b/app/views/shared/members/_invite_member.html.haml @@ -23,6 +23,6 @@ .clearable-input = text_field_tag :expires_at, nil, class: 'form-control js-access-expiration-date', placeholder: 'Expiration date' = sprite_icon('close', size: 16, css_class: 'clear-icon js-clear-input gl-text-gray-200') - = submit_tag _("Invite"), class: "gl-button btn btn-confirm gl-mr-3", data: { qa_selector: 'invite_member_button' } + = submit_tag _("Invite"), class: "gl-button btn btn-confirm gl-mr-2", data: { qa_selector: 'invite_member_button' } - if can_import_members = link_to _("Import"), import_path, class: "gl-button btn btn-default", title: _("Import members from another project") diff --git a/changelogs/unreleased/273308-fy21q4-foundations-kr2-audit-and-update-buttons-on-projects-projec.yml b/changelogs/unreleased/273308-fy21q4-foundations-kr2-audit-and-update-buttons-on-projects-projec.yml new file mode 100644 index 00000000000..2d04c7aaa9c --- /dev/null +++ b/changelogs/unreleased/273308-fy21q4-foundations-kr2-audit-and-update-buttons-on-projects-projec.yml @@ -0,0 +1,6 @@ +--- +title: Decrease space between invite and import members buttons to align with Pajamas + spacing +merge_request: 61396 +author: +type: other diff --git a/changelogs/unreleased/dmishunov-editor-fix-rendering.yml b/changelogs/unreleased/dmishunov-editor-fix-rendering.yml new file mode 100644 index 00000000000..075eeee9e07 --- /dev/null +++ b/changelogs/unreleased/dmishunov-editor-fix-rendering.yml @@ -0,0 +1,5 @@ +--- +title: Reset Source Editor's layout after Startup CSS +merge_request: 61426 +author: +type: fixed diff --git a/config/metrics/license/20210201124932_recorded_at.yml b/config/metrics/license/20210201124932_recorded_at.yml index 4b9cfc900d6..88f27fff377 100644 --- a/config/metrics/license/20210201124932_recorded_at.yml +++ b/config/metrics/license/20210201124932_recorded_at.yml @@ -10,7 +10,7 @@ status: data_available milestone: "8.10" introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/557 time_frame: none -data_source: ruby +data_source: system distribution: - ee - ce diff --git a/config/metrics/license/20210204124827_hostname.yml b/config/metrics/license/20210204124827_hostname.yml index c1055ba714d..8b3ba10f890 100644 --- a/config/metrics/license/20210204124827_hostname.yml +++ b/config/metrics/license/20210204124827_hostname.yml @@ -8,7 +8,7 @@ product_category: collection value_type: string status: data_available time_frame: none -data_source: ruby +data_source: system instrumentation_class: 'Gitlab::Usage::Metrics::Instrumentations::HostnameMetric' distribution: - ce diff --git a/config/metrics/license/20210204124926_license_trial_ends_on.yml b/config/metrics/license/20210204124926_license_trial_ends_on.yml index e3c3303975f..fb9ec099a46 100644 --- a/config/metrics/license/20210204124926_license_trial_ends_on.yml +++ b/config/metrics/license/20210204124926_license_trial_ends_on.yml @@ -8,7 +8,7 @@ product_category: collection value_type: string status: data_available time_frame: none -data_source: +data_source: system distribution: - ce tier: diff --git a/config/metrics/license/20210204124928_version.yml b/config/metrics/license/20210204124928_version.yml index b39552b220e..9aea9f8fde5 100644 --- a/config/metrics/license/20210204124928_version.yml +++ b/config/metrics/license/20210204124928_version.yml @@ -8,7 +8,7 @@ product_category: collection value_type: string status: data_available time_frame: none -data_source: +data_source: system distribution: - ce tier: diff --git a/config/metrics/license/20210204124936_version.yml b/config/metrics/license/20210204124936_version.yml index 2d161e15fd0..ef87a6ed9e6 100644 --- a/config/metrics/license/20210204124936_version.yml +++ b/config/metrics/license/20210204124936_version.yml @@ -8,7 +8,7 @@ product_category: collection value_type: string status: data_available time_frame: none -data_source: +data_source: system distribution: - ce tier: diff --git a/config/metrics/license/20210204124938_recording_ce_finished_at.yml b/config/metrics/license/20210204124938_recording_ce_finished_at.yml index b1fd0589e4a..d07580730c1 100644 --- a/config/metrics/license/20210204124938_recording_ce_finished_at.yml +++ b/config/metrics/license/20210204124938_recording_ce_finished_at.yml @@ -8,7 +8,7 @@ product_category: collection value_type: string status: data_available time_frame: none -data_source: ruby +data_source: system distribution: - ce - ee diff --git a/config/metrics/license/20210216175601_version.yml b/config/metrics/license/20210216175601_version.yml index b3099eb76bd..5e5c1ad05ec 100644 --- a/config/metrics/license/20210216175601_version.yml +++ b/config/metrics/license/20210216175601_version.yml @@ -8,7 +8,7 @@ product_category: collection value_type: string status: data_available time_frame: none -data_source: +data_source: system distribution: - ce - ee diff --git a/config/metrics/license/20210216175602_installation_type.yml b/config/metrics/license/20210216175602_installation_type.yml index ae5f26ff0a2..6e907b4a823 100644 --- a/config/metrics/license/20210216175602_installation_type.yml +++ b/config/metrics/license/20210216175602_installation_type.yml @@ -8,7 +8,7 @@ product_category: collection value_type: string status: data_available time_frame: none -data_source: ruby +data_source: system distribution: - ce - ee diff --git a/config/metrics/license/20210216181053_version.yml b/config/metrics/license/20210216181053_version.yml index 3570a041b8f..824167c8d97 100644 --- a/config/metrics/license/20210216181053_version.yml +++ b/config/metrics/license/20210216181053_version.yml @@ -8,7 +8,7 @@ product_category: value_type: string status: data_available time_frame: none -data_source: +data_source: system distribution: - ce tier: diff --git a/config/metrics/license/20210216183237_version.yml b/config/metrics/license/20210216183237_version.yml index 4f74963801a..69d97e17f20 100644 --- a/config/metrics/license/20210216183237_version.yml +++ b/config/metrics/license/20210216183237_version.yml @@ -8,7 +8,7 @@ product_category: '' value_type: string status: data_available time_frame: none -data_source: +data_source: system distribution: - ce tier: diff --git a/config/metrics/schema.json b/config/metrics/schema.json index 66d2ee4ca03..fba2365845b 100644 --- a/config/metrics/schema.json +++ b/config/metrics/schema.json @@ -52,7 +52,7 @@ }, "data_source": { "type": "string", - "enum": ["database", "redis", "redis_hll", "prometheus", "ruby"] + "enum": ["database", "redis", "redis_hll", "prometheus", "system"] }, "instrumentation_class": { "type": "string", diff --git a/config/metrics/settings/20210201124935_database_adapter.yml b/config/metrics/settings/20210201124935_database_adapter.yml index 020325995b1..66a9e5fd52a 100644 --- a/config/metrics/settings/20210201124935_database_adapter.yml +++ b/config/metrics/settings/20210201124935_database_adapter.yml @@ -8,7 +8,7 @@ product_category: collection value_type: string status: data_available time_frame: none -data_source: database +data_source: system distribution: - ee - ce diff --git a/config/metrics/settings/20210204124856_instance_auto_devops_enabled.yml b/config/metrics/settings/20210204124856_instance_auto_devops_enabled.yml index bda8d4f856d..dc6db53f8ab 100644 --- a/config/metrics/settings/20210204124856_instance_auto_devops_enabled.yml +++ b/config/metrics/settings/20210204124856_instance_auto_devops_enabled.yml @@ -8,7 +8,7 @@ product_category: auto_devops value_type: boolean status: data_available time_frame: none -data_source: database +data_source: system distribution: - ce - ee diff --git a/config/metrics/settings/20210204124858_container_registry_enabled.yml b/config/metrics/settings/20210204124858_container_registry_enabled.yml index 6c50cb9144e..d8a47a39912 100644 --- a/config/metrics/settings/20210204124858_container_registry_enabled.yml +++ b/config/metrics/settings/20210204124858_container_registry_enabled.yml @@ -8,7 +8,7 @@ product_category: collection value_type: boolean status: data_available time_frame: none -data_source: +data_source: system distribution: - ce tier: diff --git a/config/metrics/settings/20210204124900_dependency_proxy_enabled.yml b/config/metrics/settings/20210204124900_dependency_proxy_enabled.yml index 01feb7157d9..f7aa195f284 100644 --- a/config/metrics/settings/20210204124900_dependency_proxy_enabled.yml +++ b/config/metrics/settings/20210204124900_dependency_proxy_enabled.yml @@ -8,7 +8,7 @@ product_category: collection value_type: boolean status: data_available time_frame: none -data_source: +data_source: system distribution: - ce tier: diff --git a/config/metrics/settings/20210204124902_gitlab_shared_runners_enabled.yml b/config/metrics/settings/20210204124902_gitlab_shared_runners_enabled.yml index 5ec4b9fdc09..2b6f1d41413 100644 --- a/config/metrics/settings/20210204124902_gitlab_shared_runners_enabled.yml +++ b/config/metrics/settings/20210204124902_gitlab_shared_runners_enabled.yml @@ -8,7 +8,7 @@ product_category: runner value_type: boolean status: data_available time_frame: none -data_source: database +data_source: system distribution: - ce - ee diff --git a/config/metrics/settings/20210204124904_gravatar_enabled.yml b/config/metrics/settings/20210204124904_gravatar_enabled.yml index 21758753b35..b0280347b9f 100644 --- a/config/metrics/settings/20210204124904_gravatar_enabled.yml +++ b/config/metrics/settings/20210204124904_gravatar_enabled.yml @@ -8,7 +8,7 @@ product_category: collection value_type: boolean status: data_available time_frame: none -data_source: +data_source: system distribution: - ce tier: diff --git a/config/metrics/settings/20210204124906_ldap_enabled.yml b/config/metrics/settings/20210204124906_ldap_enabled.yml index 6dc1a62d337..589897fb15b 100644 --- a/config/metrics/settings/20210204124906_ldap_enabled.yml +++ b/config/metrics/settings/20210204124906_ldap_enabled.yml @@ -8,7 +8,7 @@ product_category: collection value_type: boolean status: data_available time_frame: none -data_source: +data_source: system distribution: - ce tier: diff --git a/config/metrics/settings/20210204124908_mattermost_enabled.yml b/config/metrics/settings/20210204124908_mattermost_enabled.yml index 425f3c44511..a3c88cf976e 100644 --- a/config/metrics/settings/20210204124908_mattermost_enabled.yml +++ b/config/metrics/settings/20210204124908_mattermost_enabled.yml @@ -8,7 +8,7 @@ product_category: collection value_type: boolean status: data_available time_frame: none -data_source: +data_source: system distribution: - ce tier: diff --git a/config/metrics/settings/20210204124910_omniauth_enabled.yml b/config/metrics/settings/20210204124910_omniauth_enabled.yml index f9e691b0516..67d1515abc5 100644 --- a/config/metrics/settings/20210204124910_omniauth_enabled.yml +++ b/config/metrics/settings/20210204124910_omniauth_enabled.yml @@ -8,7 +8,7 @@ product_category: collection value_type: boolean status: data_available time_frame: none -data_source: +data_source: system distribution: - ce tier: diff --git a/config/metrics/settings/20210204124912_prometheus_enabled.yml b/config/metrics/settings/20210204124912_prometheus_enabled.yml index ca829933eda..092f273e237 100644 --- a/config/metrics/settings/20210204124912_prometheus_enabled.yml +++ b/config/metrics/settings/20210204124912_prometheus_enabled.yml @@ -8,7 +8,7 @@ product_category: collection value_type: boolean status: data_available time_frame: none -data_source: +data_source: system distribution: - ce tier: diff --git a/config/metrics/settings/20210204124914_prometheus_metrics_enabled.yml b/config/metrics/settings/20210204124914_prometheus_metrics_enabled.yml index f9566076c9e..43a13aff5e1 100644 --- a/config/metrics/settings/20210204124914_prometheus_metrics_enabled.yml +++ b/config/metrics/settings/20210204124914_prometheus_metrics_enabled.yml @@ -8,7 +8,7 @@ product_category: collection value_type: boolean status: data_available time_frame: none -data_source: +data_source: system distribution: - ce tier: diff --git a/config/metrics/settings/20210204124916_reply_by_email_enabled.yml b/config/metrics/settings/20210204124916_reply_by_email_enabled.yml index f2fb58e33ec..40b863cd225 100644 --- a/config/metrics/settings/20210204124916_reply_by_email_enabled.yml +++ b/config/metrics/settings/20210204124916_reply_by_email_enabled.yml @@ -8,7 +8,7 @@ product_category: collection value_type: boolean status: data_available time_frame: none -data_source: +data_source: system distribution: - ce tier: diff --git a/config/metrics/settings/20210204124918_signup_enabled.yml b/config/metrics/settings/20210204124918_signup_enabled.yml index 36e228bf927..b63a571c6b9 100644 --- a/config/metrics/settings/20210204124918_signup_enabled.yml +++ b/config/metrics/settings/20210204124918_signup_enabled.yml @@ -8,7 +8,7 @@ product_category: authentication_and_authorization value_type: boolean status: data_available time_frame: none -data_source: database +data_source: system distribution: - ce - ee diff --git a/config/metrics/settings/20210204124920_web_ide_clientside_preview_enabled.yml b/config/metrics/settings/20210204124920_web_ide_clientside_preview_enabled.yml index 4f21c0f2f18..bfb143d2013 100644 --- a/config/metrics/settings/20210204124920_web_ide_clientside_preview_enabled.yml +++ b/config/metrics/settings/20210204124920_web_ide_clientside_preview_enabled.yml @@ -8,7 +8,7 @@ product_category: collection value_type: boolean status: data_available time_frame: none -data_source: +data_source: system distribution: - ce tier: diff --git a/config/metrics/settings/20210204124922_grafana_link_enabled.yml b/config/metrics/settings/20210204124922_grafana_link_enabled.yml index 90f825dfc36..c7e971f1a27 100644 --- a/config/metrics/settings/20210204124922_grafana_link_enabled.yml +++ b/config/metrics/settings/20210204124922_grafana_link_enabled.yml @@ -8,7 +8,7 @@ product_category: collection value_type: boolean status: data_available time_frame: none -data_source: database +data_source: system distribution: - ce tier: diff --git a/config/metrics/settings/20210204124934_enabled.yml b/config/metrics/settings/20210204124934_enabled.yml index 2f2586ad8f4..def857192eb 100644 --- a/config/metrics/settings/20210204124934_enabled.yml +++ b/config/metrics/settings/20210204124934_enabled.yml @@ -8,7 +8,7 @@ product_category: collection value_type: boolean status: data_available time_frame: none -data_source: +data_source: system distribution: - ce tier: diff --git a/config/metrics/settings/20210216174829_smtp_server.yml b/config/metrics/settings/20210216174829_smtp_server.yml index afee13f5534..c3aa121a826 100644 --- a/config/metrics/settings/20210216174829_smtp_server.yml +++ b/config/metrics/settings/20210216174829_smtp_server.yml @@ -8,7 +8,7 @@ product_category: onboarding value_type: number status: data_available time_frame: all -data_source: ruby +data_source: system distribution: - ce - ee diff --git a/config/metrics/settings/20210216175459_ingress_modsecurity_enabled.yml b/config/metrics/settings/20210216175459_ingress_modsecurity_enabled.yml index ee3741581b4..f76bd0593b6 100644 --- a/config/metrics/settings/20210216175459_ingress_modsecurity_enabled.yml +++ b/config/metrics/settings/20210216175459_ingress_modsecurity_enabled.yml @@ -8,7 +8,7 @@ product_category: web_firewall value_type: boolean status: deprecated time_frame: none -data_source: database +data_source: system distribution: - ce - ee diff --git a/config/metrics/settings/20210216175604_edition.yml b/config/metrics/settings/20210216175604_edition.yml index c06c494d688..58d61ad5d88 100644 --- a/config/metrics/settings/20210216175604_edition.yml +++ b/config/metrics/settings/20210216175604_edition.yml @@ -8,7 +8,7 @@ product_category: collection value_type: string status: data_available time_frame: none -data_source: ruby +data_source: system distribution: - ce - ee diff --git a/config/metrics/settings/20210216175606_ldap_encrypted_secrets_enabled.yml b/config/metrics/settings/20210216175606_ldap_encrypted_secrets_enabled.yml index 37b12a982bb..dfc7222ebcf 100644 --- a/config/metrics/settings/20210216175606_ldap_encrypted_secrets_enabled.yml +++ b/config/metrics/settings/20210216175606_ldap_encrypted_secrets_enabled.yml @@ -8,7 +8,7 @@ product_category: global_search value_type: boolean status: data_available time_frame: none -data_source: ruby +data_source: system distribution: - ce - ee diff --git a/config/metrics/settings/20210216180314_gitpod_enabled.yml b/config/metrics/settings/20210216180314_gitpod_enabled.yml index f716f3985f6..0bad75fe3db 100644 --- a/config/metrics/settings/20210216180314_gitpod_enabled.yml +++ b/config/metrics/settings/20210216180314_gitpod_enabled.yml @@ -8,7 +8,7 @@ product_category: integrations value_type: boolean status: data_available time_frame: none -data_source: +data_source: system distribution: - ce - ee diff --git a/config/metrics/settings/20210216180836_enabled.yml b/config/metrics/settings/20210216180836_enabled.yml index 1e7e5a226c2..df71de8d4c2 100644 --- a/config/metrics/settings/20210216180836_enabled.yml +++ b/config/metrics/settings/20210216180836_enabled.yml @@ -8,7 +8,7 @@ product_category: operational_metrics value_type: boolean status: data_available time_frame: none -data_source: +data_source: system distribution: - ce - ee diff --git a/config/metrics/settings/20210216180838_enabled.yml b/config/metrics/settings/20210216180838_enabled.yml index 8524f525917..7bb1135ee08 100644 --- a/config/metrics/settings/20210216180838_enabled.yml +++ b/config/metrics/settings/20210216180838_enabled.yml @@ -8,7 +8,7 @@ product_category: operational_metrics value_type: boolean status: data_available time_frame: none -data_source: +data_source: system distribution: - ce - ee diff --git a/config/metrics/settings/20210216180840_direct_upload.yml b/config/metrics/settings/20210216180840_direct_upload.yml index 08ef5e1ece1..788d101ba22 100644 --- a/config/metrics/settings/20210216180840_direct_upload.yml +++ b/config/metrics/settings/20210216180840_direct_upload.yml @@ -8,7 +8,7 @@ product_category: operational_metrics value_type: boolean status: data_available time_frame: none -data_source: +data_source: system distribution: - ce - ee diff --git a/config/metrics/settings/20210216180841_background_upload.yml b/config/metrics/settings/20210216180841_background_upload.yml index c7b943be3b8..77788a696d0 100644 --- a/config/metrics/settings/20210216180841_background_upload.yml +++ b/config/metrics/settings/20210216180841_background_upload.yml @@ -8,7 +8,7 @@ product_category: operational_metrics value_type: boolean status: data_available time_frame: none -data_source: +data_source: system distribution: - ce - ee diff --git a/config/metrics/counts_all/20210216180843_provider.yml b/config/metrics/settings/20210216180843_provider.yml similarity index 90% rename from config/metrics/counts_all/20210216180843_provider.yml rename to config/metrics/settings/20210216180843_provider.yml index 002fb0e7186..c2d684605cb 100644 --- a/config/metrics/counts_all/20210216180843_provider.yml +++ b/config/metrics/settings/20210216180843_provider.yml @@ -5,10 +5,10 @@ product_section: enablement product_stage: enablement product_group: group::memory product_category: operational_metrics -value_type: number +value_type: string status: data_available time_frame: all -data_source: +data_source: system distribution: - ce - ee diff --git a/config/metrics/settings/20210216180845_enabled.yml b/config/metrics/settings/20210216180845_enabled.yml index 45148c406dc..9b5c02e3e16 100644 --- a/config/metrics/settings/20210216180845_enabled.yml +++ b/config/metrics/settings/20210216180845_enabled.yml @@ -8,7 +8,7 @@ product_category: operational_metrics value_type: boolean status: data_available time_frame: none -data_source: +data_source: system distribution: - ce - ee diff --git a/config/metrics/settings/20210216180847_enabled.yml b/config/metrics/settings/20210216180847_enabled.yml index 8323bd9f5ab..5babfc27fbf 100644 --- a/config/metrics/settings/20210216180847_enabled.yml +++ b/config/metrics/settings/20210216180847_enabled.yml @@ -8,7 +8,7 @@ product_category: operational_metrics value_type: boolean status: data_available time_frame: none -data_source: +data_source: system distribution: - ce - ee diff --git a/config/metrics/settings/20210216180849_direct_upload.yml b/config/metrics/settings/20210216180849_direct_upload.yml index e67b87e0bce..56b17b7b44e 100644 --- a/config/metrics/settings/20210216180849_direct_upload.yml +++ b/config/metrics/settings/20210216180849_direct_upload.yml @@ -8,7 +8,7 @@ product_category: operational_metrics value_type: boolean status: data_available time_frame: none -data_source: +data_source: system distribution: - ce - ee diff --git a/config/metrics/settings/20210216180851_background_upload.yml b/config/metrics/settings/20210216180851_background_upload.yml index 058c80a536d..2108d35f4bf 100644 --- a/config/metrics/settings/20210216180851_background_upload.yml +++ b/config/metrics/settings/20210216180851_background_upload.yml @@ -9,7 +9,7 @@ product_category: operational_metrics value_type: boolean status: data_available time_frame: none -data_source: +data_source: system distribution: - ce - ee diff --git a/config/metrics/counts_all/20210216180852_provider.yml b/config/metrics/settings/20210216180852_provider.yml similarity index 90% rename from config/metrics/counts_all/20210216180852_provider.yml rename to config/metrics/settings/20210216180852_provider.yml index 0b22e1ce412..2d6d48d4be8 100644 --- a/config/metrics/counts_all/20210216180852_provider.yml +++ b/config/metrics/settings/20210216180852_provider.yml @@ -5,10 +5,10 @@ product_section: enablement product_stage: enablement product_group: group::memory product_category: operational_metrics -value_type: number +value_type: string status: data_available time_frame: all -data_source: +data_source: system distribution: - ce - ee diff --git a/config/metrics/settings/20210216180854_enabled.yml b/config/metrics/settings/20210216180854_enabled.yml index 40be02cb34a..f61f15622d7 100644 --- a/config/metrics/settings/20210216180854_enabled.yml +++ b/config/metrics/settings/20210216180854_enabled.yml @@ -8,7 +8,7 @@ product_category: operational_metrics value_type: boolean status: data_available time_frame: none -data_source: +data_source: system distribution: - ce - ee diff --git a/config/metrics/settings/20210216180856_enabled.yml b/config/metrics/settings/20210216180856_enabled.yml index 0646a211e31..1c94354afc7 100644 --- a/config/metrics/settings/20210216180856_enabled.yml +++ b/config/metrics/settings/20210216180856_enabled.yml @@ -8,7 +8,7 @@ product_category: operational_metrics value_type: boolean status: data_available time_frame: none -data_source: +data_source: system distribution: - ce - ee diff --git a/config/metrics/settings/20210216180858_direct_upload.yml b/config/metrics/settings/20210216180858_direct_upload.yml index d4f14bc35fc..acceccafa5f 100644 --- a/config/metrics/settings/20210216180858_direct_upload.yml +++ b/config/metrics/settings/20210216180858_direct_upload.yml @@ -8,7 +8,7 @@ product_category: operational_metrics value_type: boolean status: data_available time_frame: none -data_source: +data_source: system distribution: - ce - ee diff --git a/config/metrics/settings/20210216180900_background_upload.yml b/config/metrics/settings/20210216180900_background_upload.yml index 850c7ae04e2..e9545888d6e 100644 --- a/config/metrics/settings/20210216180900_background_upload.yml +++ b/config/metrics/settings/20210216180900_background_upload.yml @@ -8,7 +8,7 @@ product_category: operational_metrics value_type: boolean status: data_available time_frame: none -data_source: +data_source: system distribution: - ce - ee diff --git a/config/metrics/counts_all/20210216180902_provider.yml b/config/metrics/settings/20210216180902_provider.yml similarity index 90% rename from config/metrics/counts_all/20210216180902_provider.yml rename to config/metrics/settings/20210216180902_provider.yml index e5752e274b7..d275a7ea535 100644 --- a/config/metrics/counts_all/20210216180902_provider.yml +++ b/config/metrics/settings/20210216180902_provider.yml @@ -5,10 +5,10 @@ product_section: enablement product_stage: enablement product_group: group::memory product_category: operational_metrics -value_type: number +value_type: string status: data_available time_frame: all -data_source: +data_source: system distribution: - ce - ee diff --git a/config/metrics/counts_all/20210216180903_enabled.yml b/config/metrics/settings/20210216180903_enabled.yml similarity index 89% rename from config/metrics/counts_all/20210216180903_enabled.yml rename to config/metrics/settings/20210216180903_enabled.yml index cc97f1fbacc..5955ed2aa83 100644 --- a/config/metrics/counts_all/20210216180903_enabled.yml +++ b/config/metrics/settings/20210216180903_enabled.yml @@ -5,10 +5,10 @@ product_section: enablement product_stage: enablement product_group: group::memory product_category: operational_metrics -value_type: number +value_type: string status: data_available time_frame: all -data_source: +data_source: system distribution: - ce - ee diff --git a/config/metrics/settings/20210216180905_enabled.yml b/config/metrics/settings/20210216180905_enabled.yml index ef22d960a95..475a38bc190 100644 --- a/config/metrics/settings/20210216180905_enabled.yml +++ b/config/metrics/settings/20210216180905_enabled.yml @@ -8,7 +8,7 @@ product_category: operational_metrics value_type: boolean status: data_available time_frame: none -data_source: +data_source: system distribution: - ce - ee diff --git a/config/metrics/settings/20210216180907_direct_upload.yml b/config/metrics/settings/20210216180907_direct_upload.yml index b34ab887fc6..d6d8d46706b 100644 --- a/config/metrics/settings/20210216180907_direct_upload.yml +++ b/config/metrics/settings/20210216180907_direct_upload.yml @@ -8,7 +8,7 @@ product_category: operational_metrics value_type: boolean status: data_available time_frame: none -data_source: +data_source: system distribution: - ce - ee diff --git a/config/metrics/settings/20210216180909_background_upload.yml b/config/metrics/settings/20210216180909_background_upload.yml index 497f7ef7926..3f7317974c0 100644 --- a/config/metrics/settings/20210216180909_background_upload.yml +++ b/config/metrics/settings/20210216180909_background_upload.yml @@ -8,7 +8,7 @@ product_category: operational_metrics value_type: boolean status: data_available time_frame: none -data_source: +data_source: system distribution: - ce - ee diff --git a/config/metrics/counts_all/20210216180911_provider.yml b/config/metrics/settings/20210216180911_provider.yml similarity index 90% rename from config/metrics/counts_all/20210216180911_provider.yml rename to config/metrics/settings/20210216180911_provider.yml index 53286df6724..17cbafdd04a 100644 --- a/config/metrics/counts_all/20210216180911_provider.yml +++ b/config/metrics/settings/20210216180911_provider.yml @@ -5,10 +5,10 @@ product_section: enablement product_stage: enablement product_group: group::memory product_category: operational_metrics -value_type: number +value_type: string status: data_available time_frame: all -data_source: +data_source: system distribution: - ce - ee diff --git a/config/metrics/settings/20210216180913_enabled.yml b/config/metrics/settings/20210216180913_enabled.yml index 732a6364a3a..e5b38853325 100644 --- a/config/metrics/settings/20210216180913_enabled.yml +++ b/config/metrics/settings/20210216180913_enabled.yml @@ -8,7 +8,7 @@ product_category: operational_metrics value_type: boolean status: data_available time_frame: none -data_source: +data_source: system distribution: - ce - ee diff --git a/config/metrics/settings/20210216180915_enabled.yml b/config/metrics/settings/20210216180915_enabled.yml index eb78ef5f9e9..d1b2c7a3e91 100644 --- a/config/metrics/settings/20210216180915_enabled.yml +++ b/config/metrics/settings/20210216180915_enabled.yml @@ -8,7 +8,7 @@ product_category: operational_metrics value_type: boolean status: data_available time_frame: none -data_source: +data_source: system distribution: - ce - ee diff --git a/config/metrics/settings/20210216180916_direct_upload.yml b/config/metrics/settings/20210216180916_direct_upload.yml index 20785f2f8d7..11c70c327b2 100644 --- a/config/metrics/settings/20210216180916_direct_upload.yml +++ b/config/metrics/settings/20210216180916_direct_upload.yml @@ -8,7 +8,7 @@ product_category: operational_metrics value_type: boolean status: data_available time_frame: none -data_source: +data_source: system distribution: - ce - ee diff --git a/config/metrics/settings/20210216180918_background_upload.yml b/config/metrics/settings/20210216180918_background_upload.yml index 3ef8daaa685..066fc31a62d 100644 --- a/config/metrics/settings/20210216180918_background_upload.yml +++ b/config/metrics/settings/20210216180918_background_upload.yml @@ -8,7 +8,7 @@ product_category: operational_metrics value_type: boolean status: data_available time_frame: none -data_source: +data_source: system distribution: - ce - ee diff --git a/config/metrics/counts_all/20210216180920_provider.yml b/config/metrics/settings/20210216180920_provider.yml similarity index 90% rename from config/metrics/counts_all/20210216180920_provider.yml rename to config/metrics/settings/20210216180920_provider.yml index 133b65f6d51..94f34244840 100644 --- a/config/metrics/counts_all/20210216180920_provider.yml +++ b/config/metrics/settings/20210216180920_provider.yml @@ -5,10 +5,10 @@ product_section: enablement product_stage: enablement product_group: group::memory product_category: operational_metrics -value_type: number +value_type: string status: data_available time_frame: all -data_source: +data_source: system distribution: - ce - ee diff --git a/config/metrics/counts_all/20210216183241_filesystems.yml b/config/metrics/settings/20210216183241_filesystems.yml similarity index 92% rename from config/metrics/counts_all/20210216183241_filesystems.yml rename to config/metrics/settings/20210216183241_filesystems.yml index ffb3f0d5cca..3585fda1771 100644 --- a/config/metrics/counts_all/20210216183241_filesystems.yml +++ b/config/metrics/settings/20210216183241_filesystems.yml @@ -8,7 +8,7 @@ product_category: '' value_type: number status: data_available time_frame: all -data_source: +data_source: system distribution: - ce tier: diff --git a/config/metrics/counts_all/20210216183248_pg_system_id.yml b/config/metrics/settings/20210216183248_pg_system_id.yml similarity index 93% rename from config/metrics/counts_all/20210216183248_pg_system_id.yml rename to config/metrics/settings/20210216183248_pg_system_id.yml index 0fd54f58567..28905c62ce0 100644 --- a/config/metrics/counts_all/20210216183248_pg_system_id.yml +++ b/config/metrics/settings/20210216183248_pg_system_id.yml @@ -8,7 +8,7 @@ product_category: value_type: number status: data_available time_frame: all -data_source: +data_source: system distribution: - ce tier: diff --git a/config/metrics/settings/20210225045628_operating_system.yml b/config/metrics/settings/20210225045628_operating_system.yml index 0d60bc309b4..41b65a1bd6a 100644 --- a/config/metrics/settings/20210225045628_operating_system.yml +++ b/config/metrics/settings/20210225045628_operating_system.yml @@ -10,7 +10,7 @@ status: data_available milestone: "13.10" introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/54778 time_frame: none -data_source: ruby +data_source: system distribution: - ce - ee diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md index 48df512fb42..18183766519 100644 --- a/doc/ci/yaml/README.md +++ b/doc/ci/yaml/README.md @@ -4466,6 +4466,7 @@ These keywords are supported: - [`ref`](#releaseref) (optional) - [`milestones`](#releasemilestones) (optional) - [`released_at`](#releasereleased_at) (optional) +- [`assets:links`](#releaseassetslinks) (optional) The release is created only if the job processes without error. If the Rails API returns an error during release creation, the `release` job fails. @@ -4674,6 +4675,26 @@ defined. Should be enclosed in quotes and expressed in ISO 8601 format. released_at: '2021-03-15T08:00:00Z' ``` +#### `release:assets:links` + +> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/271454) in GitLab 13.12. + +Include [asset links](../../user/project/releases/index.md#release-assets) in the release. + +NOTE: +Requires `release-cli` version v0.4.0 or higher. + +```yaml +assets: + links: + - name: 'asset1' + url: 'https://example.com/assets/1' + - name: 'asset2' + url: 'https://example.com/assets/2' + filepath: '/pretty/url/1' # optional + link_type: 'other' # optional +``` + #### Complete example for `release` If you combine the previous examples for `release`, you get two options, depending on how you generate the @@ -4700,6 +4721,14 @@ tags. You can't use these options together, so choose one: - 'm2' - 'm3' released_at: '2020-07-15T08:00:00Z' # Optional, is auto generated if not defined, or can use a variable. + assets: # Optional, multiple asset links + links: + - name: 'asset1' + url: 'https://example.com/assets/1' + - name: 'asset2' + url: 'https://example.com/assets/2' + filepath: '/pretty/url/1' # optional + link_type: 'other' # optional ``` - To create a release automatically when commits are pushed or merged to the default branch, @@ -4746,6 +4775,14 @@ tags. You can't use these options together, so choose one: - 'm2' - 'm3' released_at: '2020-07-15T08:00:00Z' # Optional, is auto generated if not defined, or can use a variable. + assets: + links: + - name: 'asset1' + url: 'https://example.com/assets/1' + - name: 'asset2' + url: 'https://example.com/assets/2' + filepath: '/pretty/url/1' # optional + link_type: 'other' # optional ``` #### Release assets as Generic packages @@ -4763,7 +4800,7 @@ You can also call the `release-cli` directly from a `script` entry. For example, if you use the YAML described previously: ```shell -release-cli create --name "Release $CI_COMMIT_SHA" --description "Created using the release-cli $EXTRA_DESCRIPTION" --tag-name "v${MAJOR}.${MINOR}.${REVISION}" --ref "$CI_COMMIT_SHA" --released-at "2020-07-15T08:00:00Z" --milestone "m1" --milestone "m2" --milestone "m3" +release-cli create --name "Release $CI_COMMIT_SHA" --description "Created using the release-cli $EXTRA_DESCRIPTION" --tag-name "v${MAJOR}.${MINOR}.${REVISION}" --ref "$CI_COMMIT_SHA" --released-at "2020-07-15T08:00:00Z" --milestone "m1" --milestone "m2" --milestone "m3" --assets-link "{\"name\":\"asset1\",\"url\":\"https://example.com/assets/1\",\"link_type\":\"other\"} ``` ### `secrets` diff --git a/doc/development/usage_ping/dictionary.md b/doc/development/usage_ping/dictionary.md index f64dd1c7d4d..d63fbf96336 100644 --- a/doc/development/usage_ping/dictionary.md +++ b/doc/development/usage_ping/dictionary.md @@ -6494,7 +6494,7 @@ Tiers: `free`, `premium`, `ultimate` TBD -[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216183248_pg_system_id.yml) +[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/settings/20210216183248_pg_system_id.yml) Group: `group::distribution` @@ -6590,7 +6590,7 @@ Tiers: `free` Missing description -[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216183241_filesystems.yml) +[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/settings/20210216183241_filesystems.yml) Group: `` @@ -6986,7 +6986,7 @@ Tiers: `free`, `premium`, `ultimate` What Object Storage provider has been configured for Artifacts -[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180843_provider.yml) +[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/settings/20210216180843_provider.yml) Group: `group::memory` @@ -7046,7 +7046,7 @@ Tiers: `free`, `premium`, `ultimate` What Object Storage provider has been configured for External Diffs -[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180852_provider.yml) +[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/settings/20210216180852_provider.yml) Group: `group::memory` @@ -7106,7 +7106,7 @@ Tiers: `free`, `premium`, `ultimate` What Object Storage provider has been configured for LFS -[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180902_provider.yml) +[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/settings/20210216180902_provider.yml) Group: `group::memory` @@ -7166,7 +7166,7 @@ Tiers: `free`, `premium`, `ultimate` What Object Storage provider has been configured for Packages -[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180920_provider.yml) +[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/settings/20210216180920_provider.yml) Group: `group::memory` @@ -7178,7 +7178,7 @@ Tiers: `free`, `premium`, `ultimate` Whether Object Storage is enabled for Uploads -[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180903_enabled.yml) +[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/settings/20210216180903_enabled.yml) Group: `group::memory` @@ -7226,7 +7226,7 @@ Tiers: `free`, `premium`, `ultimate` What Object Storage provider has been configured for Uploads -[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_all/20210216180911_provider.yml) +[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/settings/20210216180911_provider.yml) Group: `group::memory` diff --git a/doc/development/usage_ping/metrics_dictionary.md b/doc/development/usage_ping/metrics_dictionary.md index 93102bc6275..40beee3c408 100644 --- a/doc/development/usage_ping/metrics_dictionary.md +++ b/doc/development/usage_ping/metrics_dictionary.md @@ -36,7 +36,7 @@ Each metric is defined in a separate YAML file consisting of a number of fields: | `value_type` | yes | `string`; one of [`string`, `number`, `boolean`, `object`](https://json-schema.org/understanding-json-schema/reference/type.html). | | `status` | yes | `string`; [status](#metric-statuses) of the metric, may be set to `data_available`, `implemented`, `not_used`, `deprecated`, `removed`. | | `time_frame` | yes | `string`; may be set to a value like `7d`, `28d`, `all`, `none`. | -| `data_source` | yes | `string`; may be set to a value like `database`, `redis`, `redis_hll`, `prometheus`, `ruby`. | +| `data_source` | yes | `string`; may be set to a value like `database`, `redis`, `redis_hll`, `prometheus`, `system`. | | `instrumentation_class` | no | `string`; [the class that implements the metric](metrics_instrumentation.md). | | `distribution` | yes | `array`; may be set to one of `ce, ee` or `ee`. The [distribution](https://about.gitlab.com/handbook/marketing/strategic-marketing/tiers/#definitions) where the tracked feature is available. | | `tier` | yes | `array`; may be set to one of `free, premium, ultimate`, `premium, ultimate` or `ultimate`. The [tier]( https://about.gitlab.com/handbook/marketing/strategic-marketing/tiers/) where the tracked feature is available. | @@ -121,10 +121,10 @@ only the single prompt to be replaced by the person working with metrics YAML. `{subject}_{verb}{ing|ed}_{object}`, such as `user_creating_epics`, `users_triggering_security_scans`, or `merge_requests_viewed_in_single_file_mode` -#### Metric with `data_source: prometheus` or `ruby` +#### Metric with `data_source: prometheus` or `system` -For metrics instrumented with Prometheus or Ruby, the suggested name includes only -the single prompt by person working with metrics YAML. +For metrics instrumented with Prometheus or coming from the operating system, +the suggested name includes only the single prompt by person working with metrics YAML. - **Prompt**: `` - **Final metric name**: Due to the variety of cases that can apply to this kind of metric, diff --git a/doc/user/project/releases/index.md b/doc/user/project/releases/index.md index 22ccab54380..1ea21b1f269 100644 --- a/doc/user/project/releases/index.md +++ b/doc/user/project/releases/index.md @@ -271,10 +271,15 @@ Release note descriptions are unrelated. Description supports [Markdown](../../m ### Release assets -You can add the following types of assets to each release: +A release contains the following types of assets: - [Source code](#source-code) -- [Links](#links) +- [Permanent links to release assets](#permanent-links-to-release-assets) + +#### Source code + +GitLab automatically generates `zip`, `tar.gz`, `tar.bz2`, and `tar` +archived source code from the given Git tag. These are read-only assets. #### Permanent links to release assets @@ -285,9 +290,21 @@ GitLab always redirects this URL to the actual asset location, so even if the assets move to a different location, you can continue to use the same URL. This is defined during [link creation](../../../api/releases/links.md#create-a-link) or [updating](../../../api/releases/links.md#update-a-link). -Each asset has a name, a URL of the *actual* asset location, and optionally, a -`filepath` parameter, which, if you specify it, creates a URL pointing -to the asset for the Release. The format of the URL is: +Each asset has a `name`, a `url` of the *actual* asset location, and optionally, +`filepath` and `link_type` parameters. + +A `filepath` creates a URL pointing to the asset for the Release. + +The `link_type` parameter accepts one of the following four values: + +- `runbook` +- `package` +- `image` +- `other` (default) + +This field has no effect on the URL and it's only used for visual purposes in the Releases page of your project. + +The format of the URL is: ```plaintext https://host/namespace/project/releases/:release/downloads/:filepath @@ -300,7 +317,8 @@ namespace and `gitlab-runner` project on `gitlab.com`, for example: { "name": "linux amd64", "filepath": "/binaries/gitlab-runner-linux-amd64", - "url": "https://gitlab-runner-downloads.s3.amazonaws.com/v11.9.0-rc2/binaries/gitlab-runner-linux-amd64" + "url": "https://gitlab-runner-downloads.s3.amazonaws.com/v11.9.0-rc2/binaries/gitlab-runner-linux-amd64", + "link_type": "other" } ``` @@ -312,11 +330,6 @@ https://gitlab.com/gitlab-org/gitlab-runner/releases/v11.9.0-rc2/downloads/binar The physical location of the asset can change at any time and the direct link remains unchanged. -### Source code - -GitLab automatically generates `zip`, `tar.gz`, `tar.bz2` and `tar` -archived source code from the given Git tag. These are read-only assets. - ### Links A link is any URL which can point to whatever you like: documentation, built diff --git a/lib/feature/active_support_cache_store_adapter.rb b/lib/feature/active_support_cache_store_adapter.rb index ea133853f5f..431f1169a86 100644 --- a/lib/feature/active_support_cache_store_adapter.rb +++ b/lib/feature/active_support_cache_store_adapter.rb @@ -4,6 +4,10 @@ # This class was already nested this way before moving to a separate file class Feature class ActiveSupportCacheStoreAdapter < Flipper::Adapters::ActiveSupportCacheStore + # This patch represents https://github.com/jnunemaker/flipper/pull/512. In + # Flipper 0.21.0 and later, we can remove this and just pass `write_through: + # true` to the constructor in `Feature.build_flipper_instance`. + extend ::Gitlab::Utils::Override override :enable diff --git a/lib/gitlab/i18n.rb b/lib/gitlab/i18n.rb index a2c1c96815c..023dbd1c601 100644 --- a/lib/gitlab/i18n.rb +++ b/lib/gitlab/i18n.rb @@ -40,24 +40,24 @@ module Gitlab TRANSLATION_LEVELS = { 'bg' => 1, 'cs_CZ' => 1, - 'de' => 20, + 'de' => 19, 'en' => 100, 'eo' => 1, - 'es' => 44, + 'es' => 41, 'fil_PH' => 1, 'fr' => 14, 'gl_ES' => 1, 'id_ID' => 0, - 'it' => 3, - 'ja' => 49, - 'ko' => 15, + 'it' => 2, + 'ja' => 45, + 'ko' => 14, 'nl_NL' => 1, 'pl_PL' => 1, - 'pt_BR' => 23, - 'ru' => 34, - 'tr_TR' => 18, - 'uk' => 46, - 'zh_CN' => 78, + 'pt_BR' => 22, + 'ru' => 32, + 'tr_TR' => 17, + 'uk' => 43, + 'zh_CN' => 72, 'zh_HK' => 3, 'zh_TW' => 4 }.freeze diff --git a/lib/sidebars/projects/menus/analytics_menu.rb b/lib/sidebars/projects/menus/analytics_menu.rb index ef10a389572..c9e9200f174 100644 --- a/lib/sidebars/projects/menus/analytics_menu.rb +++ b/lib/sidebars/projects/menus/analytics_menu.rb @@ -19,7 +19,7 @@ module Sidebars override :link def link - return cycle_analytics_menu_item.link if cycle_analytics_menu_item + return cycle_analytics_menu_item.link if cycle_analytics_menu_item.render? renderable_items.first.link end @@ -44,9 +44,11 @@ module Sidebars private def ci_cd_analytics_menu_item - return if context.project.empty_repo? - return unless context.project.feature_available?(:builds, context.current_user) - return unless can?(context.current_user, :read_build, context.project) + if !context.project.feature_available?(:builds, context.current_user) || + !can?(context.current_user, :read_build, context.project) || + context.project.empty_repo? + return ::Sidebars::NilMenuItem.new(item_id: :ci_cd_analytics) + end ::Sidebars::MenuItem.new( title: _('CI/CD'), @@ -57,7 +59,9 @@ module Sidebars end def repository_analytics_menu_item - return if context.project.empty_repo? + if context.project.empty_repo? + return ::Sidebars::NilMenuItem.new(item_id: :repository_analytics) + end ::Sidebars::MenuItem.new( title: _('Repository'), @@ -70,7 +74,9 @@ module Sidebars def cycle_analytics_menu_item strong_memoize(:cycle_analytics_menu_item) do - next unless can?(context.current_user, :read_cycle_analytics, context.project) + unless can?(context.current_user, :read_cycle_analytics, context.project) + next ::Sidebars::NilMenuItem.new(item_id: :cycle_analytics) + end ::Sidebars::MenuItem.new( title: _('Value Stream'), diff --git a/lib/sidebars/projects/menus/ci_cd_menu.rb b/lib/sidebars/projects/menus/ci_cd_menu.rb index c0336d8dfbc..29bfaa4f7e0 100644 --- a/lib/sidebars/projects/menus/ci_cd_menu.rb +++ b/lib/sidebars/projects/menus/ci_cd_menu.rb @@ -65,7 +65,9 @@ module Sidebars end def pipelines_editor_menu_item - return unless context.can_view_pipeline_editor + unless context.can_view_pipeline_editor + return ::Sidebars::NilMenuItem.new(item_id: :pipelines_editor) + end ::Sidebars::MenuItem.new( title: s_('Pipelines|Editor'), @@ -86,7 +88,9 @@ module Sidebars end def artifacts_menu_item - return unless Feature.enabled?(:artifacts_management_page, context.project) + unless Feature.enabled?(:artifacts_management_page, context.project) + return ::Sidebars::NilMenuItem.new(item_id: :artifacts) + end ::Sidebars::MenuItem.new( title: _('Artifacts'), diff --git a/lib/sidebars/projects/menus/hidden_menu.rb b/lib/sidebars/projects/menus/hidden_menu.rb index 19c77c67e1a..c273ee8b74f 100644 --- a/lib/sidebars/projects/menus/hidden_menu.rb +++ b/lib/sidebars/projects/menus/hidden_menu.rb @@ -29,8 +29,10 @@ module Sidebars end def graph_menu_item - return unless can?(context.current_user, :download_code, context.project) - return if context.project.empty_repo? + if !can?(context.current_user, :download_code, context.project) || + context.project.empty_repo? + return ::Sidebars::NilMenuItem.new(item_id: :graph) + end ::Sidebars::MenuItem.new( title: _('Graph'), @@ -42,7 +44,9 @@ module Sidebars end def new_issue_menu_item - return unless can?(context.current_user, :read_issue, context.project) + unless can?(context.current_user, :read_issue, context.project) + return ::Sidebars::NilMenuItem.new(item_id: :new_issue) + end ::Sidebars::MenuItem.new( title: _('Create a new issue'), @@ -54,7 +58,9 @@ module Sidebars end def jobs_menu_item - return unless can?(context.current_user, :read_build, context.project) + unless can?(context.current_user, :read_build, context.project) + return ::Sidebars::NilMenuItem.new(item_id: :jobs) + end ::Sidebars::MenuItem.new( title: _('Jobs'), @@ -66,8 +72,10 @@ module Sidebars end def commits_menu_item - return unless can?(context.current_user, :download_code, context.project) - return if context.project.empty_repo? + if !can?(context.current_user, :download_code, context.project) || + context.project.empty_repo? + return ::Sidebars::NilMenuItem.new(item_id: :commits) + end ::Sidebars::MenuItem.new( title: _('Commits'), @@ -79,7 +87,9 @@ module Sidebars end def issue_boards_menu_item - return unless can?(context.current_user, :read_issue, context.project) + unless can?(context.current_user, :read_issue, context.project) + return ::Sidebars::NilMenuItem.new(item_id: :issue_boards) + end ::Sidebars::MenuItem.new( title: _('Issue Boards'), diff --git a/lib/sidebars/projects/menus/infrastructure_menu.rb b/lib/sidebars/projects/menus/infrastructure_menu.rb index eccf264873e..75b6cae295f 100644 --- a/lib/sidebars/projects/menus/infrastructure_menu.rb +++ b/lib/sidebars/projects/menus/infrastructure_menu.rb @@ -41,7 +41,9 @@ module Sidebars private def kubernetes_menu_item - return unless can?(context.current_user, :read_cluster, context.project) + unless can?(context.current_user, :read_cluster, context.project) + return ::Sidebars::NilMenuItem.new(item_id: :kubernetes) + end ::Sidebars::MenuItem.new( title: _('Kubernetes clusters'), @@ -67,7 +69,9 @@ module Sidebars end def serverless_menu_item - return unless can?(context.current_user, :read_cluster, context.project) + unless can?(context.current_user, :read_cluster, context.project) + return ::Sidebars::NilMenuItem.new(item_id: :serverless) + end ::Sidebars::MenuItem.new( title: _('Serverless platform'), @@ -78,7 +82,9 @@ module Sidebars end def terraform_menu_item - return unless can?(context.current_user, :read_terraform_state, context.project) + unless can?(context.current_user, :read_terraform_state, context.project) + return ::Sidebars::NilMenuItem.new(item_id: :terraform) + end ::Sidebars::MenuItem.new( title: _('Terraform'), diff --git a/lib/sidebars/projects/menus/operations_menu.rb b/lib/sidebars/projects/menus/operations_menu.rb index 7678dedde24..ff112906dca 100644 --- a/lib/sidebars/projects/menus/operations_menu.rb +++ b/lib/sidebars/projects/menus/operations_menu.rb @@ -58,7 +58,9 @@ module Sidebars private def metrics_dashboard_menu_item - return unless can?(context.current_user, :metrics_dashboard, context.project) + unless can?(context.current_user, :metrics_dashboard, context.project) + return ::Sidebars::NilMenuItem.new(item_id: :metrics) + end ::Sidebars::MenuItem.new( title: _('Metrics'), @@ -70,8 +72,10 @@ module Sidebars end def logs_menu_item - return unless can?(context.current_user, :read_environment, context.project) - return unless can?(context.current_user, :read_pod_logs, context.project) + if !can?(context.current_user, :read_environment, context.project) || + !can?(context.current_user, :read_pod_logs, context.project) + return ::Sidebars::NilMenuItem.new(item_id: :logs) + end ::Sidebars::MenuItem.new( title: _('Logs'), @@ -82,8 +86,10 @@ module Sidebars end def tracing_menu_item - return unless can?(context.current_user, :read_environment, context.project) - return unless can?(context.current_user, :admin_project, context.project) + if !can?(context.current_user, :read_environment, context.project) || + !can?(context.current_user, :admin_project, context.project) + return ::Sidebars::NilMenuItem.new(item_id: :tracing) + end ::Sidebars::MenuItem.new( title: _('Tracing'), @@ -94,7 +100,9 @@ module Sidebars end def error_tracking_menu_item - return unless can?(context.current_user, :read_sentry_issue, context.project) + unless can?(context.current_user, :read_sentry_issue, context.project) + return ::Sidebars::NilMenuItem.new(item_id: :error_tracking) + end ::Sidebars::MenuItem.new( title: _('Error Tracking'), @@ -105,7 +113,9 @@ module Sidebars end def alert_management_menu_item - return unless can?(context.current_user, :read_alert_management_alert, context.project) + unless can?(context.current_user, :read_alert_management_alert, context.project) + return ::Sidebars::NilMenuItem.new(item_id: :alert_management) + end ::Sidebars::MenuItem.new( title: _('Alerts'), @@ -116,7 +126,9 @@ module Sidebars end def incidents_menu_item - return unless can?(context.current_user, :read_issue, context.project) + unless can?(context.current_user, :read_issue, context.project) + return ::Sidebars::NilMenuItem.new(item_id: :incidents) + end ::Sidebars::MenuItem.new( title: _('Incidents'), @@ -127,8 +139,10 @@ module Sidebars end def serverless_menu_item - return if Feature.enabled?(:sidebar_refactor, context.current_user) - return unless can?(context.current_user, :read_cluster, context.project) + if Feature.enabled?(:sidebar_refactor, context.current_user) || + !can?(context.current_user, :read_cluster, context.project) + return ::Sidebars::NilMenuItem.new(item_id: :serverless) + end ::Sidebars::MenuItem.new( title: _('Serverless'), @@ -139,8 +153,10 @@ module Sidebars end def terraform_menu_item - return if Feature.enabled?(:sidebar_refactor, context.current_user) - return unless can?(context.current_user, :read_terraform_state, context.project) + if Feature.enabled?(:sidebar_refactor, context.current_user) || + !can?(context.current_user, :read_terraform_state, context.project) + return ::Sidebars::NilMenuItem.new(item_id: :terraform) + end ::Sidebars::MenuItem.new( title: _('Terraform'), @@ -151,8 +167,10 @@ module Sidebars end def kubernetes_menu_item - return if Feature.enabled?(:sidebar_refactor, context.current_user) - return unless can?(context.current_user, :read_cluster, context.project) + if Feature.enabled?(:sidebar_refactor, context.current_user) || + !can?(context.current_user, :read_cluster, context.project) + return ::Sidebars::NilMenuItem.new(item_id: :kubernetes) + end ::Sidebars::MenuItem.new( title: _('Kubernetes'), @@ -178,7 +196,9 @@ module Sidebars end def environments_menu_item - return unless can?(context.current_user, :read_environment, context.project) + unless can?(context.current_user, :read_environment, context.project) + return ::Sidebars::NilMenuItem.new(item_id: :environments) + end ::Sidebars::MenuItem.new( title: _('Environments'), @@ -190,7 +210,9 @@ module Sidebars end def feature_flags_menu_item - return unless can?(context.current_user, :read_feature_flag, context.project) + unless can?(context.current_user, :read_feature_flag, context.project) + return ::Sidebars::NilMenuItem.new(item_id: :feature_flags) + end ::Sidebars::MenuItem.new( title: _('Feature Flags'), @@ -202,8 +224,10 @@ module Sidebars end def product_analytics_menu_item - return if Feature.disabled?(:product_analytics, context.project) - return unless can?(context.current_user, :read_product_analytics, context.project) + if Feature.disabled?(:product_analytics, context.project) || + !can?(context.current_user, :read_product_analytics, context.project) + return ::Sidebars::NilMenuItem.new(item_id: :product_analytics) + end ::Sidebars::MenuItem.new( title: _('Product Analytics'), diff --git a/lib/sidebars/projects/menus/packages_registries_menu.rb b/lib/sidebars/projects/menus/packages_registries_menu.rb index ed790db85ed..7087916bb04 100644 --- a/lib/sidebars/projects/menus/packages_registries_menu.rb +++ b/lib/sidebars/projects/menus/packages_registries_menu.rb @@ -31,8 +31,9 @@ module Sidebars private def packages_registry_menu_item - return unless ::Gitlab.config.packages.enabled - return unless can?(context.current_user, :read_package, context.project) + if !::Gitlab.config.packages.enabled || !can?(context.current_user, :read_package, context.project) + return ::Sidebars::NilMenuItem.new(item_id: :packages_registry) + end ::Sidebars::MenuItem.new( title: _('Package Registry'), @@ -44,8 +45,9 @@ module Sidebars end def container_registry_menu_item - return unless ::Gitlab.config.registry.enabled - return unless can?(context.current_user, :read_container_image, context.project) + if !::Gitlab.config.registry.enabled || !can?(context.current_user, :read_container_image, context.project) + return ::Sidebars::NilMenuItem.new(item_id: :container_registry) + end ::Sidebars::MenuItem.new( title: _('Container Registry'), @@ -56,7 +58,9 @@ module Sidebars end def infrastructure_registry_menu_item - return if Feature.disabled?(:infrastructure_registry_page, context.current_user) + if Feature.disabled?(:infrastructure_registry_page, context.current_user) + return ::Sidebars::NilMenuItem.new(item_id: :infrastructure_registry) + end ::Sidebars::MenuItem.new( title: _('Infrastructure Registry'), diff --git a/lib/sidebars/projects/menus/project_information_menu.rb b/lib/sidebars/projects/menus/project_information_menu.rb index 3d6362cf187..c78f6843ec1 100644 --- a/lib/sidebars/projects/menus/project_information_menu.rb +++ b/lib/sidebars/projects/menus/project_information_menu.rb @@ -83,8 +83,9 @@ module Sidebars end def releases_menu_item - return unless can?(context.current_user, :read_release, context.project) - return if context.project.empty_repo? + if !can?(context.current_user, :read_release, context.project) || context.project.empty_repo? + return ::Sidebars::NilMenuItem.new(item_id: :releases) + end ::Sidebars::MenuItem.new( title: _('Releases'), diff --git a/lib/sidebars/projects/menus/security_compliance_menu.rb b/lib/sidebars/projects/menus/security_compliance_menu.rb index 2aa4743e92c..615fdd682af 100644 --- a/lib/sidebars/projects/menus/security_compliance_menu.rb +++ b/lib/sidebars/projects/menus/security_compliance_menu.rb @@ -34,7 +34,9 @@ module Sidebars def configuration_menu_item strong_memoize(:configuration_menu_item) do - next unless render_configuration_menu_item? + unless render_configuration_menu_item? + next ::Sidebars::NilMenuItem.new(item_id: :configuration) + end ::Sidebars::MenuItem.new( title: _('Configuration'), diff --git a/lib/sidebars/projects/menus/settings_menu.rb b/lib/sidebars/projects/menus/settings_menu.rb index 8aec769d8d5..e2b40264e50 100644 --- a/lib/sidebars/projects/menus/settings_menu.rb +++ b/lib/sidebars/projects/menus/settings_menu.rb @@ -73,7 +73,9 @@ module Sidebars end def access_tokens_menu_item - return unless can?(context.current_user, :read_resource_access_tokens, context.project) + unless can?(context.current_user, :read_resource_access_tokens, context.project) + return ::Sidebars::NilMenuItem.new(item_id: :access_tokens) + end ::Sidebars::MenuItem.new( title: _('Access Tokens'), @@ -93,8 +95,9 @@ module Sidebars end def ci_cd_menu_item - return if context.project.archived? - return unless context.project.feature_available?(:builds, context.current_user) + if context.project.archived? || !context.project.feature_available?(:builds, context.current_user) + return ::Sidebars::NilMenuItem.new(item_id: :ci_cd) + end ::Sidebars::MenuItem.new( title: _('CI/CD'), @@ -105,8 +108,9 @@ module Sidebars end def operations_menu_item - return if context.project.archived? - return unless can?(context.current_user, :admin_operations, context.project) + if context.project.archived? || !can?(context.current_user, :admin_operations, context.project) + return ::Sidebars::NilMenuItem.new(item_id: :operations) + end ::Sidebars::MenuItem.new( title: _('Operations'), @@ -117,7 +121,9 @@ module Sidebars end def pages_menu_item - return unless context.project.pages_available? + unless context.project.pages_available? + return ::Sidebars::NilMenuItem.new(item_id: :pages) + end ::Sidebars::MenuItem.new( title: _('Pages'), @@ -128,9 +134,11 @@ module Sidebars end def packages_and_registries_menu_item - return unless Gitlab.config.registry.enabled - return if Feature.disabled?(:sidebar_refactor, context.current_user) - return unless can?(context.current_user, :destroy_container_image, context.project) + if !Gitlab.config.registry.enabled || + Feature.disabled?(:sidebar_refactor, context.current_user) || + !can?(context.current_user, :destroy_container_image, context.project) + return ::Sidebars::NilMenuItem.new(item_id: :packages_and_registries) + end ::Sidebars::MenuItem.new( title: _('Packages & Registries'), diff --git a/locale/gitlab.pot b/locale/gitlab.pot index f746f203033..b8dde3291b8 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -5043,7 +5043,7 @@ msgstr "" msgid "BillingPlan|Upgrade for free" msgstr "" -msgid "Billings|As a user on a free or trial namespace, you'll need to verify your account with a credit card to run pipelines. This is required to help prevent cryptomining attacks on GitLab infrastructure. %{strongStart}GitLab will not charge or store your credit card, it will only be used for validation.%{strongEnd} %{linkStart}Learn more%{linkEnd}." +msgid "Billings|As a user on a free or trial namespace, you'll need to verify your account with a credit card to run pipelines. This is required to help prevent cryptomining attacks on GitLab infrastructure. %{strongStart}GitLab will not charge or store your credit card, it will only be used for validation.%{strongEnd}" msgstr "" msgid "Billings|User Verification Required" diff --git a/spec/frontend/editor/editor_lite_extension_base_spec.js b/spec/frontend/editor/editor_lite_extension_base_spec.js index 1ae8c70c741..59e1b8968eb 100644 --- a/spec/frontend/editor/editor_lite_extension_base_spec.js +++ b/spec/frontend/editor/editor_lite_extension_base_spec.js @@ -7,6 +7,21 @@ import { } from '~/editor/constants'; import { EditorLiteExtension } from '~/editor/extensions/editor_lite_extension_base'; +jest.mock('~/helpers/startup_css_helper', () => { + return { + waitForCSSLoaded: jest.fn().mockImplementation((cb) => { + // We have to artificially put the callback's execution + // to the end of the current call stack to be able to + // test that the callback is called after waitForCSSLoaded. + // setTimeout with 0 delay does exactly that. + // Otherwise we might end up with false positive results + setTimeout(() => { + cb.apply(); + }, 0); + }), + }; +}); + describe('The basis for an Editor Lite extension', () => { const defaultLine = 3; let ext; @@ -44,6 +59,19 @@ describe('The basis for an Editor Lite extension', () => { }); describe('constructor', () => { + it('resets the layout in waitForCSSLoaded callback', async () => { + const instance = { + layout: jest.fn(), + }; + ext = new EditorLiteExtension({ instance }); + expect(instance.layout).not.toHaveBeenCalled(); + + // We're waiting for the waitForCSSLoaded mock to kick in + await jest.runOnlyPendingTimers(); + + expect(instance.layout).toHaveBeenCalled(); + }); + it.each` description | instance | options ${'accepts configuration options and instance'} | ${{}} | ${defaultOptions} @@ -51,6 +79,7 @@ describe('The basis for an Editor Lite extension', () => { ${'does not fail if both instance and the options are omitted'} | ${undefined} | ${undefined} ${'throws if only options are passed'} | ${undefined} | ${defaultOptions} `('$description', ({ instance, options } = {}) => { + EditorLiteExtension.deferRerender = jest.fn(); const originalInstance = { ...instance }; if (instance) { @@ -82,12 +111,14 @@ describe('The basis for an Editor Lite extension', () => { }); it('initializes the line highlighting', () => { + EditorLiteExtension.deferRerender = jest.fn(); const spy = jest.spyOn(EditorLiteExtension, 'highlightLines'); ext = new EditorLiteExtension({ instance: {} }); expect(spy).toHaveBeenCalled(); }); it('sets up the line linking for code instance', () => { + EditorLiteExtension.deferRerender = jest.fn(); const spy = jest.spyOn(EditorLiteExtension, 'setupLineLinking'); const instance = { getEditorType: jest.fn().mockReturnValue(EDITOR_TYPE_CODE), @@ -99,6 +130,7 @@ describe('The basis for an Editor Lite extension', () => { }); it('does not set up the line linking for diff instance', () => { + EditorLiteExtension.deferRerender = jest.fn(); const spy = jest.spyOn(EditorLiteExtension, 'setupLineLinking'); const instance = { getEditorType: jest.fn().mockReturnValue(EDITOR_TYPE_DIFF), diff --git a/spec/frontend/pipeline_editor/components/editor/text_editor_spec.js b/spec/frontend/pipeline_editor/components/editor/text_editor_spec.js index 3bf5a291c69..7a5b01fb04a 100644 --- a/spec/frontend/pipeline_editor/components/editor/text_editor_spec.js +++ b/spec/frontend/pipeline_editor/components/editor/text_editor_spec.js @@ -1,6 +1,7 @@ import { shallowMount } from '@vue/test-utils'; import { EDITOR_READY_EVENT } from '~/editor/constants'; +import { EditorLiteExtension } from '~/editor/extensions/editor_lite_extension_base'; import TextEditor from '~/pipeline_editor/components/editor/text_editor.vue'; import { mockCiConfigPath, @@ -59,6 +60,10 @@ describe('Pipeline Editor | Text editor component', () => { const findEditor = () => wrapper.findComponent(MockEditorLite); + beforeEach(() => { + EditorLiteExtension.deferRerender = jest.fn(); + }); + afterEach(() => { wrapper.destroy(); wrapper = null; diff --git a/spec/lib/sidebars/projects/menus/analytics_menu_spec.rb b/spec/lib/sidebars/projects/menus/analytics_menu_spec.rb index 87ef9e162e2..ed94b81520e 100644 --- a/spec/lib/sidebars/projects/menus/analytics_menu_spec.rb +++ b/spec/lib/sidebars/projects/menus/analytics_menu_spec.rb @@ -47,7 +47,7 @@ RSpec.describe Sidebars::Projects::Menus::AnalyticsMenu do context 'when Value Stream is not visible' do it 'returns link to the the first visible menu item' do - allow(subject).to receive(:cycle_analytics_menu_item).and_return(nil) + allow(subject).to receive(:cycle_analytics_menu_item).and_return(double(render?: false)) expect(subject.link).to eq subject.renderable_items.first.link end