diff options
Diffstat (limited to 'app')
47 files changed, 117 insertions, 115 deletions
diff --git a/app/assets/javascripts/monitoring/stores/actions.js b/app/assets/javascripts/monitoring/stores/actions.js index 3a052200ab9..8bb5047ef04 100644 --- a/app/assets/javascripts/monitoring/stores/actions.js +++ b/app/assets/javascripts/monitoring/stores/actions.js @@ -6,7 +6,7 @@ import { gqClient, parseEnvironmentsResponse, removeLeadingSlash } from './utils import trackDashboardLoad from '../monitoring_tracking_helper'; import getEnvironments from '../queries/getEnvironments.query.graphql'; import statusCodes from '../../lib/utils/http_status'; -import { backOff } from '../../lib/utils/common_utils'; +import { backOff, convertObjectPropsToCamelCase } from '../../lib/utils/common_utils'; import { s__, sprintf } from '../../locale'; import { PROMETHEUS_TIMEOUT } from '../constants'; @@ -52,6 +52,8 @@ export const requestMetricsDashboard = ({ commit }) => { export const receiveMetricsDashboardSuccess = ({ commit, dispatch }, { response, params }) => { commit(types.SET_ALL_DASHBOARDS, response.all_dashboards); commit(types.RECEIVE_METRICS_DATA_SUCCESS, response.dashboard); + commit(types.SET_ENDPOINTS, convertObjectPropsToCamelCase(response.metrics_data)); + return dispatch('fetchPrometheusMetrics', params); }; export const receiveMetricsDashboardFailure = ({ commit }, error) => { diff --git a/app/assets/javascripts/monitoring/stores/mutations.js b/app/assets/javascripts/monitoring/stores/mutations.js index 5f559290ff7..8bd53a24b61 100644 --- a/app/assets/javascripts/monitoring/stores/mutations.js +++ b/app/assets/javascripts/monitoring/stores/mutations.js @@ -1,4 +1,5 @@ import Vue from 'vue'; +import pick from 'lodash/pick'; import { slugify } from '~/lib/utils/text_utility'; import * as types from './mutation_types'; import { normalizeMetric, normalizeQueryResult } from './utils'; @@ -174,15 +175,19 @@ export default { state: emptyStateFromError(error), }); }, - - [types.SET_ENDPOINTS](state, endpoints) { - state.metricsEndpoint = endpoints.metricsEndpoint; - state.deploymentsEndpoint = endpoints.deploymentsEndpoint; - state.dashboardEndpoint = endpoints.dashboardEndpoint; - state.dashboardsEndpoint = endpoints.dashboardsEndpoint; - state.currentDashboard = endpoints.currentDashboard; - state.projectPath = endpoints.projectPath; - state.logsPath = endpoints.logsPath || state.logsPath; + [types.SET_ENDPOINTS](state, endpoints = {}) { + const endpointKeys = [ + 'metricsEndpoint', + 'deploymentsEndpoint', + 'dashboardEndpoint', + 'dashboardsEndpoint', + 'currentDashboard', + 'projectPath', + 'logsPath', + ]; + Object.entries(pick(endpoints, endpointKeys)).forEach(([key, value]) => { + state[key] = value; + }); }, [types.SET_TIME_RANGE](state, timeRange) { state.timeRange = timeRange; diff --git a/app/assets/javascripts/pages/projects/releases/edit/index.js b/app/assets/javascripts/pages/projects/releases/edit/index.js index 98ec196fc37..efa059dcd6d 100644 --- a/app/assets/javascripts/pages/projects/releases/edit/index.js +++ b/app/assets/javascripts/pages/projects/releases/edit/index.js @@ -1,5 +1,5 @@ import ZenMode from '~/zen_mode'; -import initEditRelease from '~/releases/detail'; +import initEditRelease from '~/releases/mount_edit'; document.addEventListener('DOMContentLoaded', () => { new ZenMode(); // eslint-disable-line no-new diff --git a/app/assets/javascripts/pages/projects/releases/index/index.js b/app/assets/javascripts/pages/projects/releases/index/index.js index 6402023149f..24c9cd528b3 100644 --- a/app/assets/javascripts/pages/projects/releases/index/index.js +++ b/app/assets/javascripts/pages/projects/releases/index/index.js @@ -1,3 +1,3 @@ -import initReleases from '~/releases/list'; +import initReleases from '~/releases/mount_index'; document.addEventListener('DOMContentLoaded', initReleases); diff --git a/app/assets/javascripts/releases/detail/components/app.vue b/app/assets/javascripts/releases/components/app_edit.vue index 073cfcd7694..bdc2b3abb8c 100644 --- a/app/assets/javascripts/releases/detail/components/app.vue +++ b/app/assets/javascripts/releases/components/app_edit.vue @@ -7,7 +7,7 @@ import MarkdownField from '~/vue_shared/components/markdown/field.vue'; import autofocusonshow from '~/vue_shared/directives/autofocusonshow'; export default { - name: 'ReleaseDetailApp', + name: 'ReleaseEditApp', components: { GlFormInput, GlFormGroup, @@ -18,7 +18,7 @@ export default { autofocusonshow, }, computed: { - ...mapState([ + ...mapState('detail', [ 'isFetchingRelease', 'fetchError', 'markdownDocsPath', @@ -42,7 +42,7 @@ export default { ); }, tagName() { - return this.$store.state.release.tagName; + return this.$store.state.detail.release.tagName; }, tagNameHintText() { return sprintf( @@ -60,7 +60,7 @@ export default { }, releaseTitle: { get() { - return this.$store.state.release.name; + return this.$store.state.detail.release.name; }, set(title) { this.updateReleaseTitle(title); @@ -68,7 +68,7 @@ export default { }, releaseNotes: { get() { - return this.$store.state.release.description; + return this.$store.state.detail.release.description; }, set(notes) { this.updateReleaseNotes(notes); @@ -79,7 +79,7 @@ export default { this.fetchRelease(); }, methods: { - ...mapActions([ + ...mapActions('detail', [ 'fetchRelease', 'updateRelease', 'updateReleaseTitle', diff --git a/app/assets/javascripts/releases/list/components/app.vue b/app/assets/javascripts/releases/components/app_index.vue index eb63e709ebd..f602c9fdda2 100644 --- a/app/assets/javascripts/releases/list/components/app.vue +++ b/app/assets/javascripts/releases/components/app_index.vue @@ -32,7 +32,7 @@ export default { }, }, computed: { - ...mapState(['isLoading', 'releases', 'hasError', 'pageInfo']), + ...mapState('list', ['isLoading', 'releases', 'hasError', 'pageInfo']), shouldRenderEmptyState() { return !this.releases.length && !this.hasError && !this.isLoading; }, @@ -47,7 +47,7 @@ export default { }); }, methods: { - ...mapActions(['fetchReleases']), + ...mapActions('list', ['fetchReleases']), onChangePage(page) { historyPushState(buildUrlWithCurrentLocation(`?page=${page}`)); this.fetchReleases({ page, projectId: this.projectId }); diff --git a/app/assets/javascripts/releases/list/components/evidence_block.vue b/app/assets/javascripts/releases/components/evidence_block.vue index d9abd195fee..d9abd195fee 100644 --- a/app/assets/javascripts/releases/list/components/evidence_block.vue +++ b/app/assets/javascripts/releases/components/evidence_block.vue diff --git a/app/assets/javascripts/releases/list/components/release_block.vue b/app/assets/javascripts/releases/components/release_block.vue index e6bb5325120..e6bb5325120 100644 --- a/app/assets/javascripts/releases/list/components/release_block.vue +++ b/app/assets/javascripts/releases/components/release_block.vue diff --git a/app/assets/javascripts/releases/list/components/release_block_assets.vue b/app/assets/javascripts/releases/components/release_block_assets.vue index 06b7f97a8de..06b7f97a8de 100644 --- a/app/assets/javascripts/releases/list/components/release_block_assets.vue +++ b/app/assets/javascripts/releases/components/release_block_assets.vue diff --git a/app/assets/javascripts/releases/list/components/release_block_author.vue b/app/assets/javascripts/releases/components/release_block_author.vue index e7075d4d67a..e7075d4d67a 100644 --- a/app/assets/javascripts/releases/list/components/release_block_author.vue +++ b/app/assets/javascripts/releases/components/release_block_author.vue diff --git a/app/assets/javascripts/releases/list/components/release_block_footer.vue b/app/assets/javascripts/releases/components/release_block_footer.vue index 8533fc17ffd..8533fc17ffd 100644 --- a/app/assets/javascripts/releases/list/components/release_block_footer.vue +++ b/app/assets/javascripts/releases/components/release_block_footer.vue diff --git a/app/assets/javascripts/releases/list/components/release_block_header.vue b/app/assets/javascripts/releases/components/release_block_header.vue index b459418aef2..b459418aef2 100644 --- a/app/assets/javascripts/releases/list/components/release_block_header.vue +++ b/app/assets/javascripts/releases/components/release_block_header.vue diff --git a/app/assets/javascripts/releases/list/components/release_block_metadata.vue b/app/assets/javascripts/releases/components/release_block_metadata.vue index f0aad594062..f0aad594062 100644 --- a/app/assets/javascripts/releases/list/components/release_block_metadata.vue +++ b/app/assets/javascripts/releases/components/release_block_metadata.vue diff --git a/app/assets/javascripts/releases/list/components/release_block_milestone_info.vue b/app/assets/javascripts/releases/components/release_block_milestone_info.vue index d3e354d6157..d3e354d6157 100644 --- a/app/assets/javascripts/releases/list/components/release_block_milestone_info.vue +++ b/app/assets/javascripts/releases/components/release_block_milestone_info.vue diff --git a/app/assets/javascripts/releases/list/components/release_block_milestones.vue b/app/assets/javascripts/releases/components/release_block_milestones.vue index a3dff75b828..a3dff75b828 100644 --- a/app/assets/javascripts/releases/list/components/release_block_milestones.vue +++ b/app/assets/javascripts/releases/components/release_block_milestones.vue diff --git a/app/assets/javascripts/releases/list/constants.js b/app/assets/javascripts/releases/constants.js index defcd917465..defcd917465 100644 --- a/app/assets/javascripts/releases/list/constants.js +++ b/app/assets/javascripts/releases/constants.js diff --git a/app/assets/javascripts/releases/detail/index.js b/app/assets/javascripts/releases/detail/index.js deleted file mode 100644 index 0dab90a1ede..00000000000 --- a/app/assets/javascripts/releases/detail/index.js +++ /dev/null @@ -1,19 +0,0 @@ -import Vue from 'vue'; -import ReleaseDetailApp from './components/app.vue'; -import createStore from './store'; - -export default () => { - const el = document.getElementById('js-edit-release-page'); - - const store = createStore(); - store.dispatch('setInitialState', el.dataset); - - return new Vue({ - el, - store, - components: { ReleaseDetailApp }, - render(createElement) { - return createElement('release-detail-app'); - }, - }); -}; diff --git a/app/assets/javascripts/releases/detail/store/index.js b/app/assets/javascripts/releases/detail/store/index.js deleted file mode 100644 index e8623a49356..00000000000 --- a/app/assets/javascripts/releases/detail/store/index.js +++ /dev/null @@ -1,14 +0,0 @@ -import Vue from 'vue'; -import Vuex from 'vuex'; -import * as actions from './actions'; -import mutations from './mutations'; -import state from './state'; - -Vue.use(Vuex); - -export default () => - new Vuex.Store({ - actions, - mutations, - state, - }); diff --git a/app/assets/javascripts/releases/list/index.js b/app/assets/javascripts/releases/list/index.js deleted file mode 100644 index adbed3cb8e2..00000000000 --- a/app/assets/javascripts/releases/list/index.js +++ /dev/null @@ -1,24 +0,0 @@ -import Vue from 'vue'; -import App from './components/app.vue'; -import createStore from './store'; - -export default () => { - const element = document.getElementById('js-releases-page'); - - return new Vue({ - el: element, - store: createStore(), - components: { - App, - }, - render(createElement) { - return createElement('app', { - props: { - projectId: element.dataset.projectId, - documentationLink: element.dataset.documentationPath, - illustrationPath: element.dataset.illustrationPath, - }, - }); - }, - }); -}; diff --git a/app/assets/javascripts/releases/list/store/index.js b/app/assets/javascripts/releases/list/store/index.js deleted file mode 100644 index 968b94f0e0d..00000000000 --- a/app/assets/javascripts/releases/list/store/index.js +++ /dev/null @@ -1,14 +0,0 @@ -import Vue from 'vue'; -import Vuex from 'vuex'; -import state from './state'; -import * as actions from './actions'; -import mutations from './mutations'; - -Vue.use(Vuex); - -export default () => - new Vuex.Store({ - actions, - mutations, - state: state(), - }); diff --git a/app/assets/javascripts/releases/mount_edit.js b/app/assets/javascripts/releases/mount_edit.js new file mode 100644 index 00000000000..343de8c56d3 --- /dev/null +++ b/app/assets/javascripts/releases/mount_edit.js @@ -0,0 +1,17 @@ +import Vue from 'vue'; +import ReleaseEditApp from './components/app_edit.vue'; +import createStore from './stores'; +import detailModule from './stores/modules/detail'; + +export default () => { + const el = document.getElementById('js-edit-release-page'); + + const store = createStore({ detail: detailModule }); + store.dispatch('setInitialState', el.dataset); + + return new Vue({ + el, + store, + render: h => h(ReleaseEditApp), + }); +}; diff --git a/app/assets/javascripts/releases/mount_index.js b/app/assets/javascripts/releases/mount_index.js new file mode 100644 index 00000000000..6fcb6d802e4 --- /dev/null +++ b/app/assets/javascripts/releases/mount_index.js @@ -0,0 +1,21 @@ +import Vue from 'vue'; +import ReleaseListApp from './components/app_index.vue'; +import createStore from './stores'; +import listModule from './stores/modules/list'; + +export default () => { + const el = document.getElementById('js-releases-page'); + + return new Vue({ + el, + store: createStore({ list: listModule }), + render: h => + h(ReleaseListApp, { + props: { + projectId: el.dataset.projectId, + documentationLink: el.dataset.documentationPath, + illustrationPath: el.dataset.illustrationPath, + }, + }), + }); +}; diff --git a/app/assets/javascripts/releases/stores/index.js b/app/assets/javascripts/releases/stores/index.js new file mode 100644 index 00000000000..aa607906a0e --- /dev/null +++ b/app/assets/javascripts/releases/stores/index.js @@ -0,0 +1,6 @@ +import Vue from 'vue'; +import Vuex from 'vuex'; + +Vue.use(Vuex); + +export default modules => new Vuex.Store({ modules }); diff --git a/app/assets/javascripts/releases/detail/store/actions.js b/app/assets/javascripts/releases/stores/modules/detail/actions.js index c9749582f5c..c9749582f5c 100644 --- a/app/assets/javascripts/releases/detail/store/actions.js +++ b/app/assets/javascripts/releases/stores/modules/detail/actions.js diff --git a/app/assets/javascripts/releases/stores/modules/detail/index.js b/app/assets/javascripts/releases/stores/modules/detail/index.js new file mode 100644 index 00000000000..243c2389d8c --- /dev/null +++ b/app/assets/javascripts/releases/stores/modules/detail/index.js @@ -0,0 +1,10 @@ +import * as actions from './actions'; +import mutations from './mutations'; +import state from './state'; + +export default { + namespaced: true, + actions, + mutations, + state, +}; diff --git a/app/assets/javascripts/releases/detail/store/mutation_types.js b/app/assets/javascripts/releases/stores/modules/detail/mutation_types.js index 75e1d78a645..75e1d78a645 100644 --- a/app/assets/javascripts/releases/detail/store/mutation_types.js +++ b/app/assets/javascripts/releases/stores/modules/detail/mutation_types.js diff --git a/app/assets/javascripts/releases/detail/store/mutations.js b/app/assets/javascripts/releases/stores/modules/detail/mutations.js index d739978d755..d739978d755 100644 --- a/app/assets/javascripts/releases/detail/store/mutations.js +++ b/app/assets/javascripts/releases/stores/modules/detail/mutations.js diff --git a/app/assets/javascripts/releases/detail/store/state.js b/app/assets/javascripts/releases/stores/modules/detail/state.js index 7e3d975f1ae..7e3d975f1ae 100644 --- a/app/assets/javascripts/releases/detail/store/state.js +++ b/app/assets/javascripts/releases/stores/modules/detail/state.js diff --git a/app/assets/javascripts/releases/list/store/actions.js b/app/assets/javascripts/releases/stores/modules/list/actions.js index b15fb69226f..b15fb69226f 100644 --- a/app/assets/javascripts/releases/list/store/actions.js +++ b/app/assets/javascripts/releases/stores/modules/list/actions.js diff --git a/app/assets/javascripts/releases/stores/modules/list/index.js b/app/assets/javascripts/releases/stores/modules/list/index.js new file mode 100644 index 00000000000..e4633b15a0c --- /dev/null +++ b/app/assets/javascripts/releases/stores/modules/list/index.js @@ -0,0 +1,10 @@ +import state from './state'; +import * as actions from './actions'; +import mutations from './mutations'; + +export default { + namespaced: true, + actions, + mutations, + state, +}; diff --git a/app/assets/javascripts/releases/list/store/mutation_types.js b/app/assets/javascripts/releases/stores/modules/list/mutation_types.js index a74bf15c515..a74bf15c515 100644 --- a/app/assets/javascripts/releases/list/store/mutation_types.js +++ b/app/assets/javascripts/releases/stores/modules/list/mutation_types.js diff --git a/app/assets/javascripts/releases/list/store/mutations.js b/app/assets/javascripts/releases/stores/modules/list/mutations.js index 99fc096264a..99fc096264a 100644 --- a/app/assets/javascripts/releases/list/store/mutations.js +++ b/app/assets/javascripts/releases/stores/modules/list/mutations.js diff --git a/app/assets/javascripts/releases/list/store/state.js b/app/assets/javascripts/releases/stores/modules/list/state.js index c251f56c9c5..c251f56c9c5 100644 --- a/app/assets/javascripts/releases/list/store/state.js +++ b/app/assets/javascripts/releases/stores/modules/list/state.js diff --git a/app/controllers/admin/application_settings_controller.rb b/app/controllers/admin/application_settings_controller.rb index 8a583e16c0b..54c9bde067d 100644 --- a/app/controllers/admin/application_settings_controller.rb +++ b/app/controllers/admin/application_settings_controller.rb @@ -56,7 +56,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController end def clear_repository_check_states - RepositoryCheck::ClearWorker.perform_async + RepositoryCheck::ClearWorker.perform_async # rubocop:disable CodeReuse/Worker redirect_to( general_admin_application_settings_path, @@ -73,7 +73,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController # Specs are in spec/requests/self_monitoring_project_spec.rb def create_self_monitoring_project - job_id = SelfMonitoringProjectCreateWorker.perform_async + job_id = SelfMonitoringProjectCreateWorker.perform_async # rubocop:disable CodeReuse/Worker render status: :accepted, json: { job_id: job_id, @@ -92,7 +92,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController } end - if SelfMonitoringProjectCreateWorker.in_progress?(job_id) + if SelfMonitoringProjectCreateWorker.in_progress?(job_id) # rubocop:disable CodeReuse/Worker ::Gitlab::PollingInterval.set_header(response, interval: 3_000) return render status: :accepted, json: { @@ -112,7 +112,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController # Specs are in spec/requests/self_monitoring_project_spec.rb def delete_self_monitoring_project - job_id = SelfMonitoringProjectDeleteWorker.perform_async + job_id = SelfMonitoringProjectDeleteWorker.perform_async # rubocop:disable CodeReuse/Worker render status: :accepted, json: { job_id: job_id, @@ -131,7 +131,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController } end - if SelfMonitoringProjectDeleteWorker.in_progress?(job_id) + if SelfMonitoringProjectDeleteWorker.in_progress?(job_id) # rubocop:disable CodeReuse/Worker ::Gitlab::PollingInterval.set_header(response, interval: 3_000) return render status: :accepted, json: { diff --git a/app/controllers/admin/projects_controller.rb b/app/controllers/admin/projects_controller.rb index cdedc34e634..7015da8bd50 100644 --- a/app/controllers/admin/projects_controller.rb +++ b/app/controllers/admin/projects_controller.rb @@ -55,7 +55,7 @@ class Admin::ProjectsController < Admin::ApplicationController # rubocop: enable CodeReuse/ActiveRecord def repository_check - RepositoryCheck::SingleRepositoryWorker.perform_async(@project.id) + RepositoryCheck::SingleRepositoryWorker.perform_async(@project.id) # rubocop:disable CodeReuse/Worker redirect_to( admin_project_path(@project), diff --git a/app/controllers/admin/services_controller.rb b/app/controllers/admin/services_controller.rb index e31e0e09978..50b79cde5c5 100644 --- a/app/controllers/admin/services_controller.rb +++ b/app/controllers/admin/services_controller.rb @@ -19,7 +19,7 @@ class Admin::ServicesController < Admin::ApplicationController def update if service.update(service_params[:service]) - PropagateServiceTemplateWorker.perform_async(service.id) if service.active? + PropagateServiceTemplateWorker.perform_async(service.id) if service.active? # rubocop:disable CodeReuse/Worker redirect_to admin_application_settings_services_path, notice: 'Application settings saved successfully' diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb index 0944d7b47bf..35f803302eb 100644 --- a/app/controllers/projects/issues_controller.rb +++ b/app/controllers/projects/issues_controller.rb @@ -188,7 +188,7 @@ class Projects::IssuesController < Projects::ApplicationController def import_csv if uploader = UploadService.new(project, params[:file]).execute - ImportIssuesCsvWorker.perform_async(current_user.id, project.id, uploader.upload.id) + ImportIssuesCsvWorker.perform_async(current_user.id, project.id, uploader.upload.id) # rubocop:disable CodeReuse/Worker flash[:notice] = _("Your issues are being imported. Once finished, you'll get a confirmation email.") else diff --git a/app/controllers/projects/pipeline_schedules_controller.rb b/app/controllers/projects/pipeline_schedules_controller.rb index 6a7e2b69652..ead839e8441 100644 --- a/app/controllers/projects/pipeline_schedules_controller.rb +++ b/app/controllers/projects/pipeline_schedules_controller.rb @@ -47,7 +47,7 @@ class Projects::PipelineSchedulesController < Projects::ApplicationController end def play - job_id = RunPipelineScheduleWorker.perform_async(schedule.id, current_user.id) + job_id = RunPipelineScheduleWorker.perform_async(schedule.id, current_user.id) # rubocop:disable CodeReuse/Worker if job_id pipelines_link_start = "<a href=\"#{project_pipelines_path(@project)}\">" diff --git a/app/controllers/projects/registry/repositories_controller.rb b/app/controllers/projects/registry/repositories_controller.rb index b31a74540e2..e524d1c29a2 100644 --- a/app/controllers/projects/registry/repositories_controller.rb +++ b/app/controllers/projects/registry/repositories_controller.rb @@ -32,7 +32,7 @@ module Projects end def destroy - DeleteContainerRepositoryWorker.perform_async(current_user.id, image.id) + DeleteContainerRepositoryWorker.perform_async(current_user.id, image.id) # rubocop:disable CodeReuse/Worker track_event(:delete_repository) respond_to do |format| diff --git a/app/controllers/projects/settings/ci_cd_controller.rb b/app/controllers/projects/settings/ci_cd_controller.rb index 6af815b8daa..bf0c2d885f8 100644 --- a/app/controllers/projects/settings/ci_cd_controller.rb +++ b/app/controllers/projects/settings/ci_cd_controller.rb @@ -69,7 +69,9 @@ module Projects return end + # rubocop:disable CodeReuse/Worker CreatePipelineWorker.perform_async(project.id, current_user.id, project.default_branch, :web, ignore_skip_ci: true, save_on_errors: false) + # rubocop:enable CodeReuse/Worker pipelines_link_start = '<a href="%{url}">'.html_safe % { url: project_pipelines_path(@project) } flash[:toast] = _("A new Auto DevOps pipeline has been created, go to %{pipelines_link_start}Pipelines page%{pipelines_link_end} for details") % { pipelines_link_start: pipelines_link_start, pipelines_link_end: "</a>".html_safe } diff --git a/app/controllers/projects/settings/repository_controller.rb b/app/controllers/projects/settings/repository_controller.rb index 0c634bbea03..63f5d5073a7 100644 --- a/app/controllers/projects/settings/repository_controller.rb +++ b/app/controllers/projects/settings/repository_controller.rb @@ -25,7 +25,7 @@ module Projects result = Projects::UpdateService.new(project, current_user, cleanup_params).execute if result[:status] == :success - RepositoryCleanupWorker.perform_async(project.id, current_user.id) + RepositoryCleanupWorker.perform_async(project.id, current_user.id) # rubocop:disable CodeReuse/Worker flash[:notice] = _('Repository cleanup has started. You will receive an email once the cleanup operation is complete.') else flash[:alert] = _('Failed to upload object map file') diff --git a/app/controllers/repositories/git_http_controller.rb b/app/controllers/repositories/git_http_controller.rb index 82431ae286a..75c79881264 100644 --- a/app/controllers/repositories/git_http_controller.rb +++ b/app/controllers/repositories/git_http_controller.rb @@ -80,7 +80,7 @@ module Repositories return unless repo_type.project? return unless project&.daily_statistics_enabled? - ProjectDailyStatisticsWorker.perform_async(project.id) + ProjectDailyStatisticsWorker.perform_async(project.id) # rubocop:disable CodeReuse/Worker end def access diff --git a/app/helpers/analytics_navbar_helper.rb b/app/helpers/analytics_navbar_helper.rb index bbb7470d1fd..021b9bb10cd 100644 --- a/app/helpers/analytics_navbar_helper.rb +++ b/app/helpers/analytics_navbar_helper.rb @@ -31,7 +31,7 @@ module AnalyticsNavbarHelper end def cycle_analytics_navbar_link(project, current_user) - return unless Feature.enabled?(:analytics_pages_under_project_analytics_sidebar, project) + return unless Feature.enabled?(:analytics_pages_under_project_analytics_sidebar, project, default_enabled: true) return unless project_nav_tab?(:cycle_analytics) navbar_sub_item( @@ -43,7 +43,7 @@ module AnalyticsNavbarHelper end def repository_analytics_navbar_link(project, current_user) - return if Feature.disabled?(:analytics_pages_under_project_analytics_sidebar, project) + return if Feature.disabled?(:analytics_pages_under_project_analytics_sidebar, project, default_enabled: true) return if project.empty_repo? navbar_sub_item( @@ -55,7 +55,7 @@ module AnalyticsNavbarHelper end def ci_cd_analytics_navbar_link(project, current_user) - return unless Feature.enabled?(:analytics_pages_under_project_analytics_sidebar, project) + return unless Feature.enabled?(:analytics_pages_under_project_analytics_sidebar, project, default_enabled: true) return unless project_nav_tab?(:pipelines) return unless project.feature_available?(:builds, current_user) || !project.empty_repo? diff --git a/app/services/ci/process_build_service.rb b/app/services/ci/process_build_service.rb index eb92c7d1a27..12cdca24066 100644 --- a/app/services/ci/process_build_service.rb +++ b/app/services/ci/process_build_service.rb @@ -3,7 +3,7 @@ module Ci class ProcessBuildService < BaseService def execute(build, current_status) - if valid_statuses_for_when(build.when).include?(current_status) + if valid_statuses_for_build(build).include?(current_status) if build.schedulable? build.schedule elsif build.action? @@ -25,10 +25,10 @@ module Ci build.enqueue end - def valid_statuses_for_when(value) - case value + def valid_statuses_for_build(build) + case build.when when 'on_success' - %w[success skipped] + build.scheduling_type_dag? ? %w[success] : %w[success skipped] when 'on_failure' %w[failed] when 'always' diff --git a/app/views/layouts/nav/sidebar/_analytics_links.html.haml b/app/views/layouts/nav/sidebar/_analytics_links.html.haml index b859a1ade66..e87cf92374a 100644 --- a/app/views/layouts/nav/sidebar/_analytics_links.html.haml +++ b/app/views/layouts/nav/sidebar/_analytics_links.html.haml @@ -6,10 +6,10 @@ = link_to navbar_links.first.link do .nav-icon-container = sprite_icon('chart') - %span.nav-item-name + %span.nav-item-name{ data: { qa_selector: 'analytics_link' } } = _('Analytics') - %ul.sidebar-sub-level-items + %ul.sidebar-sub-level-items{ data: { qa_selector: 'analytics_sidebar_submenu' } } - navbar_links.each do |menu_item| = nav_link(path: menu_item.path) do = link_to(menu_item.link, menu_item.link_to_options) do diff --git a/app/views/layouts/nav/sidebar/_group.html.haml b/app/views/layouts/nav/sidebar/_group.html.haml index 60c5ef3877f..c00c48b623c 100644 --- a/app/views/layouts/nav/sidebar/_group.html.haml +++ b/app/views/layouts/nav/sidebar/_group.html.haml @@ -1,4 +1,4 @@ -- should_display_analytics_pages_in_sidebar = Feature.enabled?(:analytics_pages_under_group_analytics_sidebar, @group) +- should_display_analytics_pages_in_sidebar = Feature.enabled?(:analytics_pages_under_group_analytics_sidebar, @group, default_enabled: true) - issues_count = group_issues_count(state: 'opened') - merge_requests_count = group_merge_requests_count(state: 'opened') diff --git a/app/views/layouts/nav/sidebar/_project.html.haml b/app/views/layouts/nav/sidebar/_project.html.haml index c587d0ca053..b9324f0596c 100644 --- a/app/views/layouts/nav/sidebar/_project.html.haml +++ b/app/views/layouts/nav/sidebar/_project.html.haml @@ -1,4 +1,4 @@ -- should_display_analytics_pages_in_sidebar = Feature.enabled?(:analytics_pages_under_project_analytics_sidebar, @project) +- should_display_analytics_pages_in_sidebar = Feature.enabled?(:analytics_pages_under_project_analytics_sidebar, @project, default_enabled: true) .nav-sidebar{ class: ("sidebar-collapsed-desktop" if collapsed_sidebar?) } .nav-sidebar-inner-scroll @@ -9,7 +9,7 @@ = project_icon(@project, alt: @project.name, class: 'avatar s40 avatar-tile', width: 40, height: 40) .sidebar-context-title = @project.name - %ul.sidebar-top-level-items + %ul.sidebar-top-level-items.qa-project-sidebar - paths = sidebar_projects_paths - paths << 'cycle_analytics#show' unless should_display_analytics_pages_in_sidebar = nav_link(path: paths, html_options: { class: 'home' }) do |