diff --git a/app/assets/javascripts/monitoring/components/variables_section.vue b/app/assets/javascripts/monitoring/components/variables_section.vue index 1175e3bb461..3d1d111d5b3 100644 --- a/app/assets/javascripts/monitoring/components/variables_section.vue +++ b/app/assets/javascripts/monitoring/components/variables_section.vue @@ -13,20 +13,18 @@ export default { ...mapState('monitoringDashboard', ['variables']), }, methods: { - ...mapActions('monitoringDashboard', ['fetchDashboardData', 'updateVariableValues']), + ...mapActions('monitoringDashboard', ['updateVariablesAndFetchData']), refreshDashboard(variable, value) { if (this.variables[variable].value !== value) { const changedVariable = { key: variable, value }; // update the Vuex store - this.updateVariableValues(changedVariable); + this.updateVariablesAndFetchData(changedVariable); // the below calls can ideally be moved out of the // component and into the actions and let the // mutation respond directly. // This can be further investigate in // https://gitlab.com/gitlab-org/gitlab/-/issues/217713 setCustomVariablesFromUrl(this.variables); - // fetch data - this.fetchDashboardData(); } }, variableComponent(type) { diff --git a/app/assets/javascripts/monitoring/stores/actions.js b/app/assets/javascripts/monitoring/stores/actions.js index 0de0c362b0c..be796e80ba9 100644 --- a/app/assets/javascripts/monitoring/stores/actions.js +++ b/app/assets/javascripts/monitoring/stores/actions.js @@ -415,8 +415,10 @@ export const duplicateSystemDashboard = ({ state }, payload) => { // Variables manipulation -export const updateVariableValues = ({ commit }, updatedVariable) => { - commit(types.UPDATE_VARIABLE_VALUES, updatedVariable); +export const updateVariablesAndFetchData = ({ commit, dispatch }, updatedVariable) => { + commit(types.UPDATE_VARIABLES, updatedVariable); + + return dispatch('fetchDashboardData'); }; // prevent babel-plugin-rewire from generating an invalid default during karma tests diff --git a/app/assets/javascripts/monitoring/stores/mutation_types.js b/app/assets/javascripts/monitoring/stores/mutation_types.js index d60334609fd..4593461776b 100644 --- a/app/assets/javascripts/monitoring/stores/mutation_types.js +++ b/app/assets/javascripts/monitoring/stores/mutation_types.js @@ -3,7 +3,7 @@ export const REQUEST_METRICS_DASHBOARD = 'REQUEST_METRICS_DASHBOARD'; export const RECEIVE_METRICS_DASHBOARD_SUCCESS = 'RECEIVE_METRICS_DASHBOARD_SUCCESS'; export const RECEIVE_METRICS_DASHBOARD_FAILURE = 'RECEIVE_METRICS_DASHBOARD_FAILURE'; export const SET_VARIABLES = 'SET_VARIABLES'; -export const UPDATE_VARIABLE_VALUES = 'UPDATE_VARIABLE_VALUES'; +export const UPDATE_VARIABLES = 'UPDATE_VARIABLES'; export const REQUEST_DASHBOARD_STARRING = 'REQUEST_DASHBOARD_STARRING'; export const RECEIVE_DASHBOARD_STARRING_SUCCESS = 'RECEIVE_DASHBOARD_STARRING_SUCCESS'; diff --git a/app/assets/javascripts/monitoring/stores/mutations.js b/app/assets/javascripts/monitoring/stores/mutations.js index 36e4014e766..92151a8c40e 100644 --- a/app/assets/javascripts/monitoring/stores/mutations.js +++ b/app/assets/javascripts/monitoring/stores/mutations.js @@ -191,7 +191,7 @@ export default { [types.SET_VARIABLES](state, variables) { state.variables = variables; }, - [types.UPDATE_VARIABLE_VALUES](state, updatedVariable) { + [types.UPDATE_VARIABLES](state, updatedVariable) { Object.assign(state.variables[updatedVariable.key], { ...state.variables[updatedVariable.key], value: updatedVariable.value, diff --git a/app/views/clusters/clusters/show.html.haml b/app/views/clusters/clusters/show.html.haml index 1cc68d927bd..83b8092fb48 100644 --- a/app/views/clusters/clusters/show.html.haml +++ b/app/views/clusters/clusters/show.html.haml @@ -30,7 +30,7 @@ ingress_help_path: help_page_path('user/project/clusters/index.md', anchor: 'getting-the-external-endpoint'), ingress_dns_help_path: help_page_path('user/clusters/applications.md', anchor: 'pointing-your-dns-at-the-external-endpoint'), ingress_mod_security_help_path: help_page_path('user/clusters/applications.md', anchor: 'web-application-firewall-modsecurity'), - environments_help_path: help_page_path('ci/environments', anchor: 'defining-environments'), + environments_help_path: help_page_path('ci/environments/index.md', anchor: 'defining-environments'), clusters_help_path: help_page_path('user/project/clusters/index.md', anchor: 'deploying-to-a-kubernetes-cluster'), deploy_boards_help_path: help_page_path('user/project/deploy_boards.html', anchor: 'enabling-deploy-boards'), cloud_run_help_path: help_page_path('user/project/clusters/add_remove_clusters.md', anchor: 'cloud-run-for-anthos'), diff --git a/app/views/projects/blob/viewers/_route_map.html.haml b/app/views/projects/blob/viewers/_route_map.html.haml index 07b9378ba97..024e9b4ddb2 100644 --- a/app/views/projects/blob/viewers/_route_map.html.haml +++ b/app/views/projects/blob/viewers/_route_map.html.haml @@ -6,4 +6,4 @@ This Route Map is invalid: = viewer.validation_message -= link_to 'Learn more', help_page_path('ci/environments', anchor: 'going-from-source-files-to-public-pages') += link_to 'Learn more', help_page_path('ci/environments/index.md', anchor: 'going-from-source-files-to-public-pages') diff --git a/app/views/projects/blob/viewers/_route_map_loading.html.haml b/app/views/projects/blob/viewers/_route_map_loading.html.haml index f11c047e85a..1d768bd1ca4 100644 --- a/app/views/projects/blob/viewers/_route_map_loading.html.haml +++ b/app/views/projects/blob/viewers/_route_map_loading.html.haml @@ -1,4 +1,4 @@ = icon('spinner spin fw') Validating Route Map… -= link_to 'Learn more', help_page_path('ci/environments', anchor: 'going-from-source-files-to-public-pages') += link_to 'Learn more', help_page_path('ci/environments/index.md', anchor: 'going-from-source-files-to-public-pages') diff --git a/app/views/projects/environments/_form.html.haml b/app/views/projects/environments/_form.html.haml index a62cd368f3a..efe80a4877c 100644 --- a/app/views/projects/environments/_form.html.haml +++ b/app/views/projects/environments/_form.html.haml @@ -3,7 +3,7 @@ %h4.gl-mt-0 = _("Environments") %p - - link_to_read_more = link_to(_("Read more about environments"), help_page_path("ci/environments")) + - link_to_read_more = link_to(_("Read more about environments"), help_page_path("ci/environments/index.md")) = _("Environments allow you to track deployments of your application %{link_to_read_more}.").html_safe % { link_to_read_more: link_to_read_more } = form_for [@project.namespace.becomes(Namespace), @project, @environment], html: { class: 'col-lg-9' } do |f| diff --git a/app/views/projects/environments/empty_metrics.html.haml b/app/views/projects/environments/empty_metrics.html.haml index dad93290fbd..5642fb34da9 100644 --- a/app/views/projects/environments/empty_metrics.html.haml +++ b/app/views/projects/environments/empty_metrics.html.haml @@ -11,4 +11,4 @@ %p.state-description = s_('Metrics|Check out the CI/CD documentation on deploying to an environment') .text-center - = link_to s_("Environments|Learn about environments"), help_page_path('ci/environments'), class: 'btn btn-success' + = link_to s_("Environments|Learn about environments"), help_page_path('ci/environments/index.md'), class: 'btn btn-success' diff --git a/app/views/projects/environments/index.html.haml b/app/views/projects/environments/index.html.haml index 2ba88da3375..445196ed449 100644 --- a/app/views/projects/environments/index.html.haml +++ b/app/views/projects/environments/index.html.haml @@ -4,5 +4,5 @@ "can-read-environment" => can?(current_user, :read_environment, @project).to_s, "can-create-environment" => can?(current_user, :create_environment, @project).to_s, "new-environment-path" => new_project_environment_path(@project), - "help-page-path" => help_page_path("ci/environments"), + "help-page-path" => help_page_path("ci/environments/index.md"), "deploy-boards-help-path" => help_page_path("user/project/deploy_boards", anchor: "enabling-deploy-boards") } } diff --git a/app/views/projects/environments/show.html.haml b/app/views/projects/environments/show.html.haml index 3a7a93dc4e6..d030b2c07a5 100644 --- a/app/views/projects/environments/show.html.haml +++ b/app/views/projects/environments/show.html.haml @@ -23,7 +23,7 @@ emphasis_end: ''.html_safe, ci_config_link_start: ''.html_safe, ci_config_link_end: ''.html_safe } - %a{ href: 'https://docs.gitlab.com/ee/ci/environments.html#stopping-an-environment', + %a{ href: 'https://docs.gitlab.com/ee/ci/environments/index.html#stopping-an-environment', target: '_blank', rel: 'noopener noreferrer' } = s_('Environments|Learn more about stopping environments') diff --git a/app/views/projects/logs/empty_logs.html.haml b/app/views/projects/logs/empty_logs.html.haml index 52598e0be8d..afae2d30f6e 100644 --- a/app/views/projects/logs/empty_logs.html.haml +++ b/app/views/projects/logs/empty_logs.html.haml @@ -11,4 +11,4 @@ %p.state-description.text-center = s_('Logs|To see the logs, deploy your code to an environment.') .text-center - = link_to s_('Environments|Learn about environments'), help_page_path('ci/environments'), class: 'btn btn-success' + = link_to s_('Environments|Learn about environments'), help_page_path('ci/environments/index.md'), class: 'btn btn-success' diff --git a/changelogs/unreleased/218557-geo-design-thumbnails-are-not-replicated.yml b/changelogs/unreleased/218557-geo-design-thumbnails-are-not-replicated.yml new file mode 100644 index 00000000000..73ebbb06630 --- /dev/null +++ b/changelogs/unreleased/218557-geo-design-thumbnails-are-not-replicated.yml @@ -0,0 +1,5 @@ +--- +title: Fix Geo replication for design thumbnails +merge_request: 32703 +author: +type: fixed diff --git a/changelogs/unreleased/sh-extend-remember-me-token.yml b/changelogs/unreleased/sh-extend-remember-me-token.yml new file mode 100644 index 00000000000..ddee3f8be7e --- /dev/null +++ b/changelogs/unreleased/sh-extend-remember-me-token.yml @@ -0,0 +1,5 @@ +--- +title: Extend "Remember me" token after each login +merge_request: 32730 +author: +type: other diff --git a/config/initializers/7_prometheus_metrics.rb b/config/initializers/7_prometheus_metrics.rb index 267a1f0b1a5..62a02781154 100644 --- a/config/initializers/7_prometheus_metrics.rb +++ b/config/initializers/7_prometheus_metrics.rb @@ -43,10 +43,7 @@ if !Rails.env.test? && Gitlab::Metrics.prometheus_metrics_enabled? defined?(::Prometheus::Client.reinitialize_on_pid_change) && Prometheus::Client.reinitialize_on_pid_change Gitlab::Metrics::Samplers::RubySampler.initialize_instance(Settings.monitoring.ruby_sampler_interval).start - - if Gitlab::Utils.to_boolean(ENV['ENABLE_DATABASE_CONNECTION_POOL_METRICS']) - Gitlab::Metrics::Samplers::DatabaseSampler.initialize_instance(Gitlab::Metrics::Samplers::DatabaseSampler::SAMPLING_INTERVAL_SECONDS).start - end + Gitlab::Metrics::Samplers::DatabaseSampler.initialize_instance(Gitlab::Metrics::Samplers::DatabaseSampler::SAMPLING_INTERVAL_SECONDS).start if Gitlab.ee? && Gitlab::Runtime.sidekiq? Gitlab::Metrics::Samplers::GlobalSearchSampler.instance(Settings.monitoring.global_search_sampler_interval).start diff --git a/config/initializers/8_devise.rb b/config/initializers/8_devise.rb index 3daddb10b29..6b4dc91ed86 100644 --- a/config/initializers/8_devise.rb +++ b/config/initializers/8_devise.rb @@ -102,7 +102,7 @@ Devise.setup do |config| # config.remember_across_browsers = true # If true, extends the user's remember period when remembered via cookie. - # config.extend_remember_period = false + config.extend_remember_period = true # Options to be passed to the created cookie. For instance, you can set # secure: true in order to force SSL only cookies. diff --git a/doc/administration/monitoring/prometheus/gitlab_metrics.md b/doc/administration/monitoring/prometheus/gitlab_metrics.md index dde2767a15d..11ea6b0f150 100644 --- a/doc/administration/monitoring/prometheus/gitlab_metrics.md +++ b/doc/administration/monitoring/prometheus/gitlab_metrics.md @@ -178,6 +178,30 @@ The following metrics are available: |:--------------------------------- |:--------- |:------------------------------------------------------------- |:-------------------------------------- | | `db_load_balancing_hosts` | Gauge | [12.3](https://gitlab.com/gitlab-org/gitlab/-/issues/13630) | Current number of load balancing hosts | +## Connection pool metrics + +These metrics record the status of the database [connection pools](https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/ConnectionPool.html). + +They all have these labels: + +1. `class` - the Ruby class being recorded. + 1. `ActiveRecord::Base` is the main database connection. + 1. `Geo::TrackingBase` is the connection to the Geo tracking database, if + enabled. + 1. `Gitlab::Database::LoadBalancing::Host` is a connection used by [database + load balancing](../../database_load_balancing.md), if enabled. +1. `host` - the host name used to connect to the database. +1. `port` - the port used to connect to the database. + +| Metric | Type | Since | Description | +|:----------------------------------------------|:------|:------|:--------------------------------------------------| +| `gitlab_database_connection_pool_size` | Gauge | 13.0 | Total connection pool capacity | +| `gitlab_database_connection_pool_connections` | Gauge | 13.0 | Current connections in the pool | +| `gitlab_database_connection_pool_busy` | Gauge | 13.0 | Connections in use where the owner is still alive | +| `gitlab_database_connection_pool_dead` | Gauge | 13.0 | Connections in use where the owner is not alive | +| `gitlab_database_connection_pool_idle` | Gauge | 13.0 | Connections not in use | +| `gitlab_database_connection_pool_waiting` | Gauge | 13.0 | Threads currently waiting on this queue | + ## Ruby metrics Some basic Ruby runtime metrics are available: diff --git a/lib/gitlab/git_access_wiki.rb b/lib/gitlab/git_access_wiki.rb index 3c0dbba64bf..aad46937c32 100644 --- a/lib/gitlab/git_access_wiki.rb +++ b/lib/gitlab/git_access_wiki.rb @@ -2,6 +2,8 @@ module Gitlab class GitAccessWiki < GitAccess + prepend_if_ee('EE::Gitlab::GitAccessWiki') # rubocop: disable Cop/InjectEnterpriseEditionModule + ERROR_MESSAGES = { read_only: "You can't push code to a read-only GitLab instance.", write_to_wiki: "You are not allowed to write to this project's wiki." @@ -31,8 +33,10 @@ module Gitlab ERROR_MESSAGES[:read_only] end - def container - project.wiki + private + + def repository + project.wiki.repository end end end diff --git a/locale/gitlab.pot b/locale/gitlab.pot index aafdd18c64a..f8f9275bde6 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -10065,6 +10065,12 @@ msgstr "" msgid "GeoNodes|secondary nodes" msgstr "" +msgid "Geo|%{label} can't be blank" +msgstr "" + +msgid "Geo|%{label} should be between 1-999" +msgstr "" + msgid "Geo|%{name} is scheduled for forced re-download" msgstr "" @@ -10128,6 +10134,12 @@ msgstr "" msgid "Geo|Next sync scheduled at" msgstr "" +msgid "Geo|Node name can't be blank" +msgstr "" + +msgid "Geo|Node name should be between 1 and 255 characters" +msgstr "" + msgid "Geo|Not synced yet" msgstr "" @@ -10212,6 +10224,12 @@ msgstr "" msgid "Geo|Tracking entry for upload (%{type}/%{id}) was successfully removed." msgstr "" +msgid "Geo|URL can't be blank" +msgstr "" + +msgid "Geo|URL must be a valid url (ex: https://gitlab.com)" +msgstr "" + msgid "Geo|Unknown state" msgstr "" @@ -14047,9 +14065,6 @@ msgstr "" msgid "Name has already been taken" msgstr "" -msgid "Name must be between 1 and 255 characters" -msgstr "" - msgid "Name new label" msgstr "" @@ -23107,9 +23122,6 @@ msgstr "" msgid "URL is required" msgstr "" -msgid "URL must be a valid url (ex: https://gitlab.com)" -msgstr "" - msgid "URL must start with %{codeStart}http://%{codeEnd}, %{codeStart}https://%{codeEnd}, or %{codeStart}ftp://%{codeEnd}" msgstr "" diff --git a/package.json b/package.json index 25a95178d7a..a0a078efb5d 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "@babel/preset-env": "^7.8.4", "@gitlab/at.js": "1.5.5", "@gitlab/svgs": "1.128.0", - "@gitlab/ui": "^14.14.2", + "@gitlab/ui": "14.14.2", "@gitlab/visual-review-tools": "1.6.1", "@rails/actioncable": "^6.0.3", "@sentry/browser": "^5.10.2", diff --git a/spec/frontend/monitoring/components/variables_section_spec.js b/spec/frontend/monitoring/components/variables_section_spec.js index 8f3748d3ff9..fd814e81c8f 100644 --- a/spec/frontend/monitoring/components/variables_section_spec.js +++ b/spec/frontend/monitoring/components/variables_section_spec.js @@ -57,8 +57,7 @@ describe('Metrics dashboard/variables section component', () => { }); describe('when changing the variable inputs', () => { - const fetchDashboardData = jest.fn(); - const updateVariableValues = jest.fn(); + const updateVariablesAndFetchData = jest.fn(); beforeEach(() => { store = new Vuex.Store({ @@ -70,8 +69,7 @@ describe('Metrics dashboard/variables section component', () => { variables: sampleVariables, }, actions: { - fetchDashboardData, - updateVariableValues, + updateVariablesAndFetchData, }, }, }, @@ -86,13 +84,12 @@ describe('Metrics dashboard/variables section component', () => { firstInput.vm.$emit('onUpdate', 'label1', 'test'); return wrapper.vm.$nextTick(() => { - expect(updateVariableValues).toHaveBeenCalled(); + expect(updateVariablesAndFetchData).toHaveBeenCalled(); expect(mergeUrlParams).toHaveBeenCalledWith( convertVariablesForURL(sampleVariables), window.location.href, ); expect(updateHistory).toHaveBeenCalled(); - expect(fetchDashboardData).toHaveBeenCalled(); }); }); @@ -102,13 +99,12 @@ describe('Metrics dashboard/variables section component', () => { firstInput.vm.$emit('onUpdate', 'label1', 'test'); return wrapper.vm.$nextTick(() => { - expect(updateVariableValues).toHaveBeenCalled(); + expect(updateVariablesAndFetchData).toHaveBeenCalled(); expect(mergeUrlParams).toHaveBeenCalledWith( convertVariablesForURL(sampleVariables), window.location.href, ); expect(updateHistory).toHaveBeenCalled(); - expect(fetchDashboardData).toHaveBeenCalled(); }); }); @@ -117,10 +113,9 @@ describe('Metrics dashboard/variables section component', () => { firstInput.vm.$emit('onUpdate', 'label1', 'Simple text'); - expect(updateVariableValues).not.toHaveBeenCalled(); + expect(updateVariablesAndFetchData).not.toHaveBeenCalled(); expect(mergeUrlParams).not.toHaveBeenCalled(); expect(updateHistory).not.toHaveBeenCalled(); - expect(fetchDashboardData).not.toHaveBeenCalled(); }); }); }); diff --git a/spec/frontend/monitoring/store/actions_spec.js b/spec/frontend/monitoring/store/actions_spec.js index 423ff59188d..aac7f022fd4 100644 --- a/spec/frontend/monitoring/store/actions_spec.js +++ b/spec/frontend/monitoring/store/actions_spec.js @@ -26,7 +26,7 @@ import { clearExpandedPanel, setGettingStartedEmptyState, duplicateSystemDashboard, - updateVariableValues, + updateVariablesAndFetchData, } from '~/monitoring/stores/actions'; import { gqClient, @@ -417,19 +417,23 @@ describe('Monitoring store actions', () => { }); }); - describe('updateVariableValues', () => { - it('should commit UPDATE_VARIABLE_VALUES mutation', done => { + describe('updateVariablesAndFetchData', () => { + it('should commit UPDATE_VARIABLES mutation and fetch data', done => { testAction( - updateVariableValues, + updateVariablesAndFetchData, { pod: 'POD' }, state, [ { - type: types.UPDATE_VARIABLE_VALUES, + type: types.UPDATE_VARIABLES, payload: { pod: 'POD' }, }, ], - [], + [ + { + type: 'fetchDashboardData', + }, + ], done, ); }); diff --git a/spec/frontend/monitoring/store/mutations_spec.js b/spec/frontend/monitoring/store/mutations_spec.js index 31002ebd860..49acb830a58 100644 --- a/spec/frontend/monitoring/store/mutations_spec.js +++ b/spec/frontend/monitoring/store/mutations_spec.js @@ -418,14 +418,14 @@ describe('Monitoring mutations', () => { }); }); - describe('UPDATE_VARIABLE_VALUES', () => { + describe('UPDATE_VARIABLES', () => { afterEach(() => { mutations[types.SET_VARIABLES](stateCopy, {}); }); it('updates only the value of the variable in variables', () => { mutations[types.SET_VARIABLES](stateCopy, { environment: { value: 'prod', type: 'text' } }); - mutations[types.UPDATE_VARIABLE_VALUES](stateCopy, { key: 'environment', value: 'new prod' }); + mutations[types.UPDATE_VARIABLES](stateCopy, { key: 'environment', value: 'new prod' }); expect(stateCopy.variables).toEqual({ environment: { value: 'new prod', type: 'text' } }); }); diff --git a/yarn.lock b/yarn.lock index d34ee5c4f55..a56c0f61371 100644 --- a/yarn.lock +++ b/yarn.lock @@ -787,7 +787,7 @@ resolved "https://registry.yarnpkg.com/@gitlab/svgs/-/svgs-1.128.0.tgz#c510050d5646d73b52e684248a186dbd1f55cbb0" integrity sha512-RqgF6k2xPptbz58RB1nNgeo6gy3l1u7+1rxXvALzIAsazmrAw708NYCT3PALg2RoyH0G/fpUa6yPQ0HbR+OtEg== -"@gitlab/ui@^14.14.2": +"@gitlab/ui@14.14.2": version "14.14.2" resolved "https://registry.yarnpkg.com/@gitlab/ui/-/ui-14.14.2.tgz#7cc81d90d5b5394345d6781ff02e974e24b97387" integrity sha512-Fq7fGjhofnN64xckTuuuX4EE23ZXcndwCfFBFrCTCbDfrDSa0l0xkmkrvYCSrNNTp6CyL5Ec/LWgGcnGCPWaFw==