diff options
25 files changed, 95 insertions, 87 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index c4d238b2999..a432b091c7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,23 @@ documentation](doc/development/changelog.md) for instructions on adding your own entry. +## 12.2.4 + +### Fixed (7 changes) + +- Add syntax highlighting for line expansion. !31821 +- Fix issuable sidebar icon on notification disabled. !32134 +- Upgrade Mermaid to v8.2.4. !32186 +- Fix Piwik not working. !32234 +- Fix snippets API not working with visibility level. !32286 +- Fix upload URLs in Markdown for users without access to project repository. !32448 +- Update Mermaid to v8.2.6. !32502 + +### Performance (1 change) + +- Fix N+1 Gitaly calls in /api/v4/projects/:id/issues. !32171 + + ## 12.2.3 ### Security (22 changes) diff --git a/changelogs/unreleased/66066-dark-theme-style-for-expansion-on-mr-diffs.yml b/changelogs/unreleased/66066-dark-theme-style-for-expansion-on-mr-diffs.yml deleted file mode 100644 index 13607ae938a..00000000000 --- a/changelogs/unreleased/66066-dark-theme-style-for-expansion-on-mr-diffs.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Add syntax highlighting for line expansion -merge_request: 31821 -author: -type: fixed diff --git a/changelogs/unreleased/66803-fix-uploads-relative-link-filter.yml b/changelogs/unreleased/66803-fix-uploads-relative-link-filter.yml deleted file mode 100644 index 523e5c8c545..00000000000 --- a/changelogs/unreleased/66803-fix-uploads-relative-link-filter.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Fix upload URLs in Markdown for users without access to project repository -merge_request: 32448 -author: -type: fixed diff --git a/changelogs/unreleased/ab-admin-page-user-active-count.yml b/changelogs/unreleased/ab-admin-page-user-active-count.yml new file mode 100644 index 00000000000..e08715a1586 --- /dev/null +++ b/changelogs/unreleased/ab-admin-page-user-active-count.yml @@ -0,0 +1,5 @@ +--- +title: Replace indexes for counting active users +merge_request: 32538 +author: +type: performance diff --git a/changelogs/unreleased/fe-fix-issuable-sidebar-icon-of-notification-disabled.yml b/changelogs/unreleased/fe-fix-issuable-sidebar-icon-of-notification-disabled.yml deleted file mode 100644 index 736e12ff694..00000000000 --- a/changelogs/unreleased/fe-fix-issuable-sidebar-icon-of-notification-disabled.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Fix issuable sidebar icon on notification disabled -merge_request: 32134 -author: -type: fixed diff --git a/changelogs/unreleased/sh-fix-nplusone-issues.yml b/changelogs/unreleased/sh-fix-nplusone-issues.yml deleted file mode 100644 index f749b5eeb40..00000000000 --- a/changelogs/unreleased/sh-fix-nplusone-issues.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Fix N+1 Gitaly calls in /api/v4/projects/:id/issues -merge_request: 32171 -author: -type: performance diff --git a/changelogs/unreleased/sh-fix-piwik-template.yml b/changelogs/unreleased/sh-fix-piwik-template.yml deleted file mode 100644 index f0baed6a2e0..00000000000 --- a/changelogs/unreleased/sh-fix-piwik-template.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Fix Piwik not working -merge_request: 32234 -author: -type: fixed diff --git a/changelogs/unreleased/sh-fix-snippet-visibility-api.yml b/changelogs/unreleased/sh-fix-snippet-visibility-api.yml deleted file mode 100644 index 5cfb9cdedc0..00000000000 --- a/changelogs/unreleased/sh-fix-snippet-visibility-api.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Fix snippets API not working with visibility level -merge_request: 32286 -author: -type: fixed diff --git a/changelogs/unreleased/sh-mermaid-8-2-6.yml b/changelogs/unreleased/sh-mermaid-8-2-6.yml deleted file mode 100644 index d5cee250385..00000000000 --- a/changelogs/unreleased/sh-mermaid-8-2-6.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Update Mermaid to v8.2.6 -merge_request: 32502 -author: -type: fixed diff --git a/changelogs/unreleased/sh-upgrade-mermaid-8-2-4.yml b/changelogs/unreleased/sh-upgrade-mermaid-8-2-4.yml deleted file mode 100644 index bdb64e43ecf..00000000000 --- a/changelogs/unreleased/sh-upgrade-mermaid-8-2-4.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Upgrade Mermaid to v8.2.4 -merge_request: 32186 -author: -type: fixed diff --git a/db/migrate/20190902131045_replace_indexes_for_counting_active_users.rb b/db/migrate/20190902131045_replace_indexes_for_counting_active_users.rb new file mode 100644 index 00000000000..2c7c47bee96 --- /dev/null +++ b/db/migrate/20190902131045_replace_indexes_for_counting_active_users.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class ReplaceIndexesForCountingActiveUsers < ActiveRecord::Migration[5.2] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name(:users, 'index_users_on_state_and_internal') + + add_concurrent_index(:users, :state, where: 'ghost IS NOT TRUE', name: 'index_users_on_state_and_internal') + add_concurrent_index(:users, :state, where: 'ghost IS NOT TRUE AND bot_type IS NULL', name: 'index_users_on_state_and_internal_ee') + end + + def down + remove_concurrent_index_by_name(:users, 'index_users_on_state_and_internal_ee') + remove_concurrent_index_by_name(:users, 'index_users_on_state_and_internal') + + add_concurrent_index(:users, :state, where: 'ghost <> true AND bot_type IS NULL', name: 'index_users_on_state_and_internal') + end +end diff --git a/db/schema.rb b/db/schema.rb index 5999a859e77..5b89cdf0b98 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2019_08_28_083843) do +ActiveRecord::Schema.define(version: 2019_09_02_131045) do # These are extensions that must be enabled in order to support this database enable_extension "pg_trgm" @@ -3551,7 +3551,8 @@ ActiveRecord::Schema.define(version: 2019_08_28_083843) do t.index ["public_email"], name: "index_users_on_public_email", where: "((public_email)::text <> ''::text)" t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true t.index ["state"], name: "index_users_on_state" - t.index ["state"], name: "index_users_on_state_and_internal", where: "((ghost <> true) AND (bot_type IS NULL))" + t.index ["state"], name: "index_users_on_state_and_internal", where: "(ghost IS NOT TRUE)" + t.index ["state"], name: "index_users_on_state_and_internal_ee", where: "((ghost IS NOT TRUE) AND (bot_type IS NULL))" t.index ["username"], name: "index_users_on_username" t.index ["username"], name: "index_users_on_username_trigram", opclass: :gin_trgm_ops, using: :gin end diff --git a/doc/user/application_security/index.md b/doc/user/application_security/index.md index 5a1cc0561fc..69529d7420b 100644 --- a/doc/user/application_security/index.md +++ b/doc/user/application_security/index.md @@ -28,7 +28,7 @@ GitLab can scan and report any vulnerabilities found in your project. | [Dependency List](dependency_list/index.md) **(ULTIMATE)** | View your project's dependencies and their known vulnerabilities. | | [Dependency Scanning](dependency_scanning/index.md) **(ULTIMATE)** | Analyze your dependencies for known vulnerabilities. | | [Dynamic Application Security Testing (DAST)](dast/index.md) **(ULTIMATE)** | Analyze running web applications for known vulnerabilities. | -| [License Compliance](license_management/index.md) **(ULTIMATE)** | Search your project's dependencies for their licenses. | +| [License Compliance](license_compliance/index.md) **(ULTIMATE)** | Search your project's dependencies for their licenses. | | [Security Dashboard](security_dashboard/index.md) **(ULTIMATE)** | View vulnerabilities in all your projects and groups. | | [Static Application Security Testing (SAST)](sast/index.md) **(ULTIMATE)** | Analyze source code for known vulnerabilities. | diff --git a/doc/user/application_security/license_compliance/img/license_compliance_add_license.png b/doc/user/application_security/license_compliance/img/license_compliance_add_license.png Binary files differdeleted file mode 100644 index c9a5dc14c57..00000000000 --- a/doc/user/application_security/license_compliance/img/license_compliance_add_license.png +++ /dev/null diff --git a/doc/user/application_security/license_compliance/img/license_compliance_add_license_v12_3.png b/doc/user/application_security/license_compliance/img/license_compliance_add_license_v12_3.png Binary files differnew file mode 100644 index 00000000000..79f6160e63f --- /dev/null +++ b/doc/user/application_security/license_compliance/img/license_compliance_add_license_v12_3.png diff --git a/doc/user/application_security/license_compliance/img/license_compliance_pipeline_tab.png b/doc/user/application_security/license_compliance/img/license_compliance_pipeline_tab.png Binary files differdeleted file mode 100644 index 80ffca815b9..00000000000 --- a/doc/user/application_security/license_compliance/img/license_compliance_pipeline_tab.png +++ /dev/null diff --git a/doc/user/application_security/license_compliance/img/license_compliance_pipeline_tab_v12_3.png b/doc/user/application_security/license_compliance/img/license_compliance_pipeline_tab_v12_3.png Binary files differnew file mode 100644 index 00000000000..fd519d63b3e --- /dev/null +++ b/doc/user/application_security/license_compliance/img/license_compliance_pipeline_tab_v12_3.png diff --git a/doc/user/application_security/license_compliance/img/license_compliance_search.png b/doc/user/application_security/license_compliance/img/license_compliance_search.png Binary files differdeleted file mode 100644 index b3ffd8d95a1..00000000000 --- a/doc/user/application_security/license_compliance/img/license_compliance_search.png +++ /dev/null diff --git a/doc/user/application_security/license_compliance/img/license_compliance_search_v12_3.png b/doc/user/application_security/license_compliance/img/license_compliance_search_v12_3.png Binary files differnew file mode 100644 index 00000000000..4a7cff2e85c --- /dev/null +++ b/doc/user/application_security/license_compliance/img/license_compliance_search_v12_3.png diff --git a/doc/user/application_security/license_compliance/img/license_compliance_settings.png b/doc/user/application_security/license_compliance/img/license_compliance_settings.png Binary files differdeleted file mode 100644 index 2e3e8888e93..00000000000 --- a/doc/user/application_security/license_compliance/img/license_compliance_settings.png +++ /dev/null diff --git a/doc/user/application_security/license_compliance/img/license_compliance_settings_v12_3.png b/doc/user/application_security/license_compliance/img/license_compliance_settings_v12_3.png Binary files differnew file mode 100644 index 00000000000..72d0888a9dc --- /dev/null +++ b/doc/user/application_security/license_compliance/img/license_compliance_settings_v12_3.png diff --git a/doc/user/application_security/license_compliance/index.md b/doc/user/application_security/license_compliance/index.md index f74b958cf67..6de1db8650d 100644 --- a/doc/user/application_security/license_compliance/index.md +++ b/doc/user/application_security/license_compliance/index.md @@ -198,7 +198,7 @@ To approve or blacklist a license: **License Compliance** section. 1. Click the **Add a license** button. - ![License Compliance Add License](img/license_compliance_add_license.png) + ![License Compliance Add License](img/license_compliance_add_license_v12_3.png) 1. In the **License name** dropdown, either: - Select one of the available licenses. You can search for licenses in the field @@ -212,13 +212,13 @@ To modify an existing license: 1. In the **License Compliance** list, click the **Approved/Declined** dropdown to change it to the desired status. - ![License Compliance Settings](img/license_compliance_settings.png) + ![License Compliance Settings](img/license_compliance_settings_v12_3.png) Searching for Licenses: 1. Use the **Search** box to search for a specific license. - ![License Compliance Search](img/license_compliance_search.png) + ![License Compliance Search](img/license_compliance_search_v12_3.png) ## License Compliance report under pipelines @@ -228,7 +228,7 @@ From your project's left sidebar, navigate to **CI/CD > Pipelines** and click on pipeline ID that has a `license_management` job to see the Licenses tab with the listed licenses (if any). -![License Compliance Pipeline Tab](img/license_compliance_pipeline_tab.png) +![License Compliance Pipeline Tab](img/license_compliance_pipeline_tab_v12_3.png) <!-- ## Troubleshooting diff --git a/lib/gitlab/database_importers/self_monitoring/project/create_service.rb b/lib/gitlab/database_importers/self_monitoring/project/create_service.rb index 3a170e8b5f8..5422a8631a0 100644 --- a/lib/gitlab/database_importers/self_monitoring/project/create_service.rb +++ b/lib/gitlab/database_importers/self_monitoring/project/create_service.rb @@ -45,20 +45,20 @@ module Gitlab def validate_application_settings return success if application_settings - log_error(_('No application_settings found')) + log_error('No application_settings found') error(_('No application_settings found')) end def validate_project_created return success unless project_created? - log_error(_('Project already created')) + log_error('Project already created') error(_('Project already created')) end def validate_admins unless instance_admins.any? - log_error(_('No active admin user found')) + log_error('No active admin user found') return error(_('No active admin user found')) end @@ -83,7 +83,7 @@ module Gitlab def create_project if project_created? - log_info(_('Instance administration project already exists')) + log_info('Instance administration project already exists') @project = application_settings.instance_administration_project return success(project: project) end @@ -93,7 +93,7 @@ module Gitlab if project.persisted? success(project: project) else - log_error(_("Could not create instance administration project. Errors: %{errors}") % { errors: project.errors.full_messages }) + log_error("Could not create instance administration project. Errors: %{errors}" % { errors: project.errors.full_messages }) error(_('Could not create project')) end end @@ -106,7 +106,7 @@ module Gitlab if result success else - log_error(_("Could not save instance administration project ID, errors: %{errors}") % { errors: application_settings.errors.full_messages }) + log_error("Could not save instance administration project ID, errors: %{errors}" % { errors: application_settings.errors.full_messages }) error(_('Could not save project ID')) end end @@ -116,7 +116,7 @@ module Gitlab errors = members.flat_map { |member| member.errors.full_messages } if errors.any? - log_error(_('Could not add admins as members to self-monitoring project. Errors: %{errors}') % { errors: errors }) + log_error('Could not add admins as members to self-monitoring project. Errors: %{errors}' % { errors: errors }) error(_('Could not add admins as members')) else success @@ -128,7 +128,7 @@ module Gitlab return success unless prometheus_listen_address.present? uri = parse_url(internal_prometheus_listen_address_uri) - return error(_('Prometheus listen_address is not a valid URI')) unless uri + return error(_('Prometheus listen_address in config/gitlab.yml is not a valid URI')) unless uri application_settings.add_to_outbound_local_requests_whitelist([uri.normalized_host]) result = application_settings.save @@ -140,7 +140,7 @@ module Gitlab Gitlab::CurrentSettings.expire_current_application_settings success else - log_error(_("Could not add prometheus URL to whitelist, errors: %{errors}") % { errors: application_settings.errors.full_messages }) + log_error("Could not add prometheus URL to whitelist, errors: %{errors}" % { errors: application_settings.errors.full_messages }) error(_('Could not add prometheus URL to whitelist')) end end @@ -152,7 +152,7 @@ module Gitlab service = project.find_or_initialize_service('prometheus') unless service.update(prometheus_service_attributes) - log_error(_('Could not save prometheus manual configuration for self-monitoring project. Errors: %{errors}') % { errors: service.errors.full_messages }) + log_error('Could not save prometheus manual configuration for self-monitoring project. Errors: %{errors}' % { errors: service.errors.full_messages }) return error(_('Could not save prometheus manual configuration')) end @@ -175,15 +175,15 @@ module Gitlab def prometheus_enabled? Gitlab.config.prometheus.enable if Gitlab.config.prometheus rescue Settingslogic::MissingSetting - log_error(_('prometheus.enable is not present in gitlab.yml')) + log_error('prometheus.enable is not present in config/gitlab.yml') false end def prometheus_listen_address - Gitlab.config.prometheus.listen_address if Gitlab.config.prometheus + Gitlab.config.prometheus.listen_address.to_s if Gitlab.config.prometheus rescue Settingslogic::MissingSetting - log_error(_('prometheus.listen_address is not present in gitlab.yml')) + log_error('Prometheus listen_address is not present in config/gitlab.yml') nil end @@ -228,9 +228,21 @@ module Gitlab end def internal_prometheus_listen_address_uri - if prometheus_listen_address.starts_with?('http') + if prometheus_listen_address.starts_with?('0.0.0.0:') + # 0.0.0.0:9090 + port = ':' + prometheus_listen_address.split(':').second + 'http://localhost' + port + + elsif prometheus_listen_address.starts_with?(':') + # :9090 + 'http://localhost' + prometheus_listen_address + + elsif prometheus_listen_address.starts_with?('http') + # https://localhost:9090 prometheus_listen_address + else + # localhost:9090 'http://' + prometheus_listen_address end end diff --git a/locale/gitlab.pot b/locale/gitlab.pot index e91061e74c2..a1836646b1a 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -3374,15 +3374,9 @@ msgstr "" msgid "Could not add admins as members" msgstr "" -msgid "Could not add admins as members to self-monitoring project. Errors: %{errors}" -msgstr "" - msgid "Could not add prometheus URL to whitelist" msgstr "" -msgid "Could not add prometheus URL to whitelist, errors: %{errors}" -msgstr "" - msgid "Could not authorize chat nickname. Try again!" msgstr "" @@ -3398,9 +3392,6 @@ msgstr "" msgid "Could not create group" msgstr "" -msgid "Could not create instance administration project. Errors: %{errors}" -msgstr "" - msgid "Could not create project" msgstr "" @@ -3419,18 +3410,12 @@ msgstr "" msgid "Could not revoke personal access token %{personal_access_token_name}." msgstr "" -msgid "Could not save instance administration project ID, errors: %{errors}" -msgstr "" - msgid "Could not save project ID" msgstr "" msgid "Could not save prometheus manual configuration" msgstr "" -msgid "Could not save prometheus manual configuration for self-monitoring project. Errors: %{errors}" -msgstr "" - msgid "Coverage" msgstr "" @@ -6098,9 +6083,6 @@ msgstr "" msgid "Instance Statistics visibility" msgstr "" -msgid "Instance administration project already exists" -msgstr "" - msgid "Instance administrators group already exists" msgstr "" @@ -9202,7 +9184,7 @@ msgstr "" msgid "ProjectsNew|Want to house several dependent projects under the same namespace? %{link_start}Create a group.%{link_end}" msgstr "" -msgid "Prometheus listen_address is not a valid URI" +msgid "Prometheus listen_address in config/gitlab.yml is not a valid URI" msgstr "" msgid "PrometheusService|%{exporters} with %{metrics} were found" @@ -14177,12 +14159,6 @@ msgstr "" msgid "project avatar" msgstr "" -msgid "prometheus.enable is not present in gitlab.yml" -msgstr "" - -msgid "prometheus.listen_address is not present in gitlab.yml" -msgstr "" - msgid "quick actions" msgstr "" diff --git a/spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb b/spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb index b3dedfe1f77..aab6fbcbbd1 100644 --- a/spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb +++ b/spec/lib/gitlab/database_importers/self_monitoring/project/create_service_spec.rb @@ -176,14 +176,28 @@ describe Gitlab::DatabaseImporters::SelfMonitoring::Project::CreateService do end context 'with non default prometheus address' do + let(:listen_address) { 'https://localhost:9090' } + let(:prometheus_settings) do { enable: true, - listen_address: 'https://localhost:9090' + listen_address: listen_address } end it_behaves_like 'has prometheus service', 'https://localhost:9090' + + context 'with :9090 symbol' do + let(:listen_address) { :':9090' } + + it_behaves_like 'has prometheus service', 'http://localhost:9090' + end + + context 'with 0.0.0.0:9090' do + let(:listen_address) { '0.0.0.0:9090' } + + it_behaves_like 'has prometheus service', 'http://localhost:9090' + end end context 'when prometheus setting is not present in gitlab.yml' do |