summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-11-23 14:57:46 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-11-23 14:57:46 +0000
commit64fc6a9b19faca58ad0087b1a1cb11f7ed910015 (patch)
treefe4e98cfab4289850ee15965ae0b04648ee90207 /app
parent6317794da29af0bccf95dece5b57b2be2c0977a4 (diff)
downloadgitlab-ce-64fc6a9b19faca58ad0087b1a1cb11f7ed910015.tar.gz
Add latest changes from gitlab-org/gitlab@13-6-stable-ee
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/analytics/instance_statistics/components/instance_counts.vue2
-rw-r--r--app/assets/javascripts/gfm_auto_complete.js2
-rw-r--r--app/assets/javascripts/pages/admin/runners/index.js13
-rw-r--r--app/assets/javascripts/pages/groups/clusters/destroy/index.js4
-rw-r--r--app/assets/javascripts/pages/groups/clusters/edit/index.js4
-rw-r--r--app/assets/javascripts/pages/groups/clusters/index.js6
-rw-r--r--app/assets/javascripts/pages/groups/clusters/index/index.js8
-rw-r--r--app/assets/javascripts/pages/groups/clusters/new/index.js4
-rw-r--r--app/assets/javascripts/pages/groups/clusters/show/index.js6
-rw-r--r--app/assets/javascripts/pages/groups/settings/ci_cd/show/index.js24
-rw-r--r--app/assets/javascripts/pages/projects/settings/ci_cd/show/index.js46
-rw-r--r--app/assets/javascripts/pages/shared/mount_runner_instructions.js32
-rw-r--r--app/assets/javascripts/vue_shared/components/runner_instructions/graphql/queries/get_runner_platforms.query.graphql20
-rw-r--r--app/assets/javascripts/vue_shared/components/runner_instructions/graphql/queries/get_runner_setup.query.graphql16
-rw-r--r--app/assets/javascripts/vue_shared/components/runner_instructions/runner_instructions.vue220
-rw-r--r--app/finders/ci/commit_statuses_finder.rb2
-rw-r--r--app/helpers/projects/alert_management_helper.rb6
-rw-r--r--app/services/concerns/users/participable_service.rb3
-rw-r--r--app/services/packages/create_event_service.rb2
-rw-r--r--app/services/projects/transfer_service.rb16
-rw-r--r--app/views/admin/instance_statistics/index.html.haml4
-rw-r--r--app/views/admin/runners/index.html.haml4
-rw-r--r--app/views/ci/runner/_how_to_setup_runner.html.haml2
-rw-r--r--app/views/groups/runners/_group_runners.html.haml4
-rw-r--r--app/views/layouts/nav/sidebar/_admin.html.haml4
-rw-r--r--app/views/projects/runners/_specific_runners.html.haml4
-rw-r--r--app/views/shared/_new_project_item_select.html.haml2
27 files changed, 93 insertions, 367 deletions
diff --git a/app/assets/javascripts/analytics/instance_statistics/components/instance_counts.vue b/app/assets/javascripts/analytics/instance_statistics/components/instance_counts.vue
index 4fbfb4daf22..b331e659a92 100644
--- a/app/assets/javascripts/analytics/instance_statistics/components/instance_counts.vue
+++ b/app/assets/javascripts/analytics/instance_statistics/components/instance_counts.vue
@@ -56,7 +56,7 @@ export default {
<template>
<metric-card
- :title="__('Instance Statistics')"
+ :title="__('Usage Trends')"
:metrics="counts"
:is-loading="$apollo.queries.counts.loading"
class="gl-mt-4"
diff --git a/app/assets/javascripts/gfm_auto_complete.js b/app/assets/javascripts/gfm_auto_complete.js
index 202f04f98f6..14538ad7237 100644
--- a/app/assets/javascripts/gfm_auto_complete.js
+++ b/app/assets/javascripts/gfm_auto_complete.js
@@ -42,7 +42,7 @@ export function membersBeforeSave(members) {
title: sanitize(title),
search: sanitize(`${member.username} ${member.name}`),
icon: avatarIcon,
- availability: member.availability,
+ availability: member?.availability,
};
});
}
diff --git a/app/assets/javascripts/pages/admin/runners/index.js b/app/assets/javascripts/pages/admin/runners/index.js
index 104b7eeaf96..e60c6133c7c 100644
--- a/app/assets/javascripts/pages/admin/runners/index.js
+++ b/app/assets/javascripts/pages/admin/runners/index.js
@@ -1,12 +1,11 @@
import initFilteredSearch from '~/pages/search/init_filtered_search';
import AdminRunnersFilteredSearchTokenKeys from '~/filtered_search/admin_runners_filtered_search_token_keys';
import { FILTERED_SEARCH } from '~/pages/constants';
-import { initInstallRunner } from '~/pages/shared/mount_runner_instructions';
-initFilteredSearch({
- page: FILTERED_SEARCH.ADMIN_RUNNERS,
- filteredSearchTokenKeys: AdminRunnersFilteredSearchTokenKeys,
- useDefaultState: true,
+document.addEventListener('DOMContentLoaded', () => {
+ initFilteredSearch({
+ page: FILTERED_SEARCH.ADMIN_RUNNERS,
+ filteredSearchTokenKeys: AdminRunnersFilteredSearchTokenKeys,
+ useDefaultState: true,
+ });
});
-
-initInstallRunner();
diff --git a/app/assets/javascripts/pages/groups/clusters/destroy/index.js b/app/assets/javascripts/pages/groups/clusters/destroy/index.js
index 487e7a14a16..8001d2dd1da 100644
--- a/app/assets/javascripts/pages/groups/clusters/destroy/index.js
+++ b/app/assets/javascripts/pages/groups/clusters/destroy/index.js
@@ -1,3 +1,5 @@
import ClustersBundle from '~/clusters/clusters_bundle';
-new ClustersBundle(); // eslint-disable-line no-new
+document.addEventListener('DOMContentLoaded', () => {
+ new ClustersBundle(); // eslint-disable-line no-new
+});
diff --git a/app/assets/javascripts/pages/groups/clusters/edit/index.js b/app/assets/javascripts/pages/groups/clusters/edit/index.js
index 487e7a14a16..8001d2dd1da 100644
--- a/app/assets/javascripts/pages/groups/clusters/edit/index.js
+++ b/app/assets/javascripts/pages/groups/clusters/edit/index.js
@@ -1,3 +1,5 @@
import ClustersBundle from '~/clusters/clusters_bundle';
-new ClustersBundle(); // eslint-disable-line no-new
+document.addEventListener('DOMContentLoaded', () => {
+ new ClustersBundle(); // eslint-disable-line no-new
+});
diff --git a/app/assets/javascripts/pages/groups/clusters/index.js b/app/assets/javascripts/pages/groups/clusters/index.js
index 3b92c244346..9f466e0d60a 100644
--- a/app/assets/javascripts/pages/groups/clusters/index.js
+++ b/app/assets/javascripts/pages/groups/clusters/index.js
@@ -1,5 +1,7 @@
import initCreateCluster from '~/create_cluster/init_create_cluster';
import initIntegrationForm from '~/clusters/forms/show/index';
-initCreateCluster(document, gon);
-initIntegrationForm();
+document.addEventListener('DOMContentLoaded', () => {
+ initCreateCluster(document, gon);
+ initIntegrationForm();
+});
diff --git a/app/assets/javascripts/pages/groups/clusters/index/index.js b/app/assets/javascripts/pages/groups/clusters/index/index.js
index 3b71517f017..744be65bfbe 100644
--- a/app/assets/javascripts/pages/groups/clusters/index/index.js
+++ b/app/assets/javascripts/pages/groups/clusters/index/index.js
@@ -1,6 +1,8 @@
import PersistentUserCallout from '~/persistent_user_callout';
import initClustersListApp from '~/clusters_list';
-const callout = document.querySelector('.gcp-signup-offer');
-PersistentUserCallout.factory(callout);
-initClustersListApp();
+document.addEventListener('DOMContentLoaded', () => {
+ const callout = document.querySelector('.gcp-signup-offer');
+ PersistentUserCallout.factory(callout);
+ initClustersListApp();
+});
diff --git a/app/assets/javascripts/pages/groups/clusters/new/index.js b/app/assets/javascripts/pages/groups/clusters/new/index.js
index de9ded87ef3..876bab0b339 100644
--- a/app/assets/javascripts/pages/groups/clusters/new/index.js
+++ b/app/assets/javascripts/pages/groups/clusters/new/index.js
@@ -1,3 +1,5 @@
import initNewCluster from '~/clusters/new_cluster';
-initNewCluster();
+document.addEventListener('DOMContentLoaded', () => {
+ initNewCluster();
+});
diff --git a/app/assets/javascripts/pages/groups/clusters/show/index.js b/app/assets/javascripts/pages/groups/clusters/show/index.js
index 5d202a8824f..ccf631b2c53 100644
--- a/app/assets/javascripts/pages/groups/clusters/show/index.js
+++ b/app/assets/javascripts/pages/groups/clusters/show/index.js
@@ -1,5 +1,7 @@
import ClustersBundle from '~/clusters/clusters_bundle';
import initClusterHealth from '~/pages/projects/clusters/show/cluster_health';
-new ClustersBundle(); // eslint-disable-line no-new
-initClusterHealth();
+document.addEventListener('DOMContentLoaded', () => {
+ new ClustersBundle(); // eslint-disable-line no-new
+ initClusterHealth();
+});
diff --git a/app/assets/javascripts/pages/groups/settings/ci_cd/show/index.js b/app/assets/javascripts/pages/groups/settings/ci_cd/show/index.js
index 3456048d718..e8d8c985ade 100644
--- a/app/assets/javascripts/pages/groups/settings/ci_cd/show/index.js
+++ b/app/assets/javascripts/pages/groups/settings/ci_cd/show/index.js
@@ -4,18 +4,18 @@ import initFilteredSearch from '~/pages/search/init_filtered_search';
import GroupRunnersFilteredSearchTokenKeys from '~/filtered_search/group_runners_filtered_search_token_keys';
import { FILTERED_SEARCH } from '~/pages/constants';
import initSharedRunnersForm from '~/group_settings/mount_shared_runners';
-import { initInstallRunner } from '~/pages/shared/mount_runner_instructions';
-// Initialize expandable settings panels
-initSettingsPanels();
+document.addEventListener('DOMContentLoaded', () => {
+ // Initialize expandable settings panels
+ initSettingsPanels();
-initFilteredSearch({
- page: FILTERED_SEARCH.ADMIN_RUNNERS,
- filteredSearchTokenKeys: GroupRunnersFilteredSearchTokenKeys,
- anchor: FILTERED_SEARCH.GROUP_RUNNERS_ANCHOR,
- useDefaultState: false,
-});
+ initFilteredSearch({
+ page: FILTERED_SEARCH.ADMIN_RUNNERS,
+ filteredSearchTokenKeys: GroupRunnersFilteredSearchTokenKeys,
+ anchor: FILTERED_SEARCH.GROUP_RUNNERS_ANCHOR,
+ useDefaultState: false,
+ });
-initSharedRunnersForm();
-initVariableList();
-initInstallRunner();
+ initSharedRunnersForm();
+ initVariableList();
+});
diff --git a/app/assets/javascripts/pages/projects/settings/ci_cd/show/index.js b/app/assets/javascripts/pages/projects/settings/ci_cd/show/index.js
index 5d4c1595342..d18cde4ac87 100644
--- a/app/assets/javascripts/pages/projects/settings/ci_cd/show/index.js
+++ b/app/assets/javascripts/pages/projects/settings/ci_cd/show/index.js
@@ -4,32 +4,32 @@ import registrySettingsApp from '~/registry/settings/registry_settings_bundle';
import initVariableList from '~/ci_variable_list';
import initDeployFreeze from '~/deploy_freeze';
import initSettingsPipelinesTriggers from '~/ci_settings_pipeline_triggers';
-import { initInstallRunner } from '~/pages/shared/mount_runner_instructions';
-// Initialize expandable settings panels
-initSettingsPanels();
+document.addEventListener('DOMContentLoaded', () => {
+ // Initialize expandable settings panels
+ initSettingsPanels();
-const runnerToken = document.querySelector('.js-secret-runner-token');
-if (runnerToken) {
- const runnerTokenSecretValue = new SecretValues({
- container: runnerToken,
- });
- runnerTokenSecretValue.init();
-}
+ const runnerToken = document.querySelector('.js-secret-runner-token');
+ if (runnerToken) {
+ const runnerTokenSecretValue = new SecretValues({
+ container: runnerToken,
+ });
+ runnerTokenSecretValue.init();
+ }
-initVariableList();
+ initVariableList();
-// hide extra auto devops settings based checkbox state
-const autoDevOpsExtraSettings = document.querySelector('.js-extra-settings');
-const instanceDefaultBadge = document.querySelector('.js-instance-default-badge');
-document.querySelector('.js-toggle-extra-settings').addEventListener('click', event => {
- const { target } = event;
- if (instanceDefaultBadge) instanceDefaultBadge.style.display = 'none';
- autoDevOpsExtraSettings.classList.toggle('hidden', !target.checked);
-});
+ // hide extra auto devops settings based checkbox state
+ const autoDevOpsExtraSettings = document.querySelector('.js-extra-settings');
+ const instanceDefaultBadge = document.querySelector('.js-instance-default-badge');
+ document.querySelector('.js-toggle-extra-settings').addEventListener('click', event => {
+ const { target } = event;
+ if (instanceDefaultBadge) instanceDefaultBadge.style.display = 'none';
+ autoDevOpsExtraSettings.classList.toggle('hidden', !target.checked);
+ });
-registrySettingsApp();
-initDeployFreeze();
+ registrySettingsApp();
+ initDeployFreeze();
-initSettingsPipelinesTriggers();
-initInstallRunner();
+ initSettingsPipelinesTriggers();
+});
diff --git a/app/assets/javascripts/pages/shared/mount_runner_instructions.js b/app/assets/javascripts/pages/shared/mount_runner_instructions.js
deleted file mode 100644
index b7662155339..00000000000
--- a/app/assets/javascripts/pages/shared/mount_runner_instructions.js
+++ /dev/null
@@ -1,32 +0,0 @@
-import Vue from 'vue';
-import VueApollo from 'vue-apollo';
-import createDefaultClient from '~/lib/graphql';
-import InstallRunnerInstructions from '~/vue_shared/components/runner_instructions/runner_instructions.vue';
-
-Vue.use(VueApollo);
-
-export function initInstallRunner(componentId = 'js-install-runner') {
- const installRunnerEl = document.getElementById(componentId);
- const { projectPath, groupPath } = installRunnerEl?.dataset;
-
- if (installRunnerEl) {
- const defaultClient = createDefaultClient();
-
- const apolloProvider = new VueApollo({
- defaultClient,
- });
-
- // eslint-disable-next-line no-new
- new Vue({
- el: installRunnerEl,
- apolloProvider,
- provide: {
- projectPath,
- groupPath,
- },
- render(createElement) {
- return createElement(InstallRunnerInstructions);
- },
- });
- }
-}
diff --git a/app/assets/javascripts/vue_shared/components/runner_instructions/graphql/queries/get_runner_platforms.query.graphql b/app/assets/javascripts/vue_shared/components/runner_instructions/graphql/queries/get_runner_platforms.query.graphql
deleted file mode 100644
index ff0626167a9..00000000000
--- a/app/assets/javascripts/vue_shared/components/runner_instructions/graphql/queries/get_runner_platforms.query.graphql
+++ /dev/null
@@ -1,20 +0,0 @@
-query getRunnerPlatforms($projectPath: ID!, $groupPath: ID!) {
- runnerPlatforms {
- nodes {
- name
- humanReadableName
- architectures {
- nodes {
- name
- downloadLocation
- }
- }
- }
- }
- project(fullPath: $projectPath) {
- id
- }
- group(fullPath: $groupPath) {
- id
- }
-}
diff --git a/app/assets/javascripts/vue_shared/components/runner_instructions/graphql/queries/get_runner_setup.query.graphql b/app/assets/javascripts/vue_shared/components/runner_instructions/graphql/queries/get_runner_setup.query.graphql
deleted file mode 100644
index 643c1991807..00000000000
--- a/app/assets/javascripts/vue_shared/components/runner_instructions/graphql/queries/get_runner_setup.query.graphql
+++ /dev/null
@@ -1,16 +0,0 @@
-query runnerSetupInstructions(
- $platform: String!
- $architecture: String!
- $projectId: ID!
- $groupId: ID!
-) {
- runnerSetup(
- platform: $platform
- architecture: $architecture
- projectId: $projectId
- groupId: $groupId
- ) {
- installInstructions
- registerInstructions
- }
-}
diff --git a/app/assets/javascripts/vue_shared/components/runner_instructions/runner_instructions.vue b/app/assets/javascripts/vue_shared/components/runner_instructions/runner_instructions.vue
deleted file mode 100644
index b70b1277155..00000000000
--- a/app/assets/javascripts/vue_shared/components/runner_instructions/runner_instructions.vue
+++ /dev/null
@@ -1,220 +0,0 @@
-<script>
-import {
- GlAlert,
- GlButton,
- GlModal,
- GlModalDirective,
- GlButtonGroup,
- GlDropdown,
- GlDropdownItem,
- GlIcon,
-} from '@gitlab/ui';
-import { __, s__ } from '~/locale';
-import getRunnerPlatforms from './graphql/queries/get_runner_platforms.query.graphql';
-import getRunnerSetupInstructions from './graphql/queries/get_runner_setup.query.graphql';
-
-export default {
- components: {
- GlAlert,
- GlButton,
- GlButtonGroup,
- GlDropdown,
- GlDropdownItem,
- GlModal,
- GlIcon,
- },
- directives: {
- GlModalDirective,
- },
- inject: {
- projectPath: {
- default: '',
- },
- groupPath: {
- default: '',
- },
- },
- apollo: {
- runnerPlatforms: {
- query: getRunnerPlatforms,
- variables() {
- return {
- projectPath: this.projectPath,
- groupPath: this.groupPath,
- };
- },
- update(data) {
- return data;
- },
- error() {
- this.showAlert = true;
- },
- },
- },
- data() {
- return {
- showAlert: false,
- selectedPlatformArchitectures: [],
- selectedPlatform: {},
- selectedArchitecture: {},
- runnerPlatforms: {},
- instructions: {},
- };
- },
- computed: {
- isPlatformSelected() {
- return Object.keys(this.selectedPlatform).length > 0;
- },
- instructionsEmpty() {
- return this.instructions && Object.keys(this.instructions).length === 0;
- },
- groupId() {
- return this.runnerPlatforms?.group?.id ?? '';
- },
- projectId() {
- return this.runnerPlatforms?.project?.id ?? '';
- },
- platforms() {
- return this.runnerPlatforms.runnerPlatforms?.nodes;
- },
- },
- methods: {
- selectPlatform(name) {
- this.selectedPlatform = this.platforms.find(platform => platform.name === name);
- this.selectedPlatformArchitectures = this.selectedPlatform?.architectures?.nodes;
- [this.selectedArchitecture] = this.selectedPlatformArchitectures;
- this.selectArchitecture(this.selectedArchitecture);
- },
- selectArchitecture(architecture) {
- this.selectedArchitecture = architecture;
-
- this.$apollo.addSmartQuery('instructions', {
- variables() {
- return {
- platform: this.selectedPlatform.name,
- architecture: this.selectedArchitecture.name,
- projectId: this.projectId,
- groupId: this.groupId,
- };
- },
- query: getRunnerSetupInstructions,
- update(data) {
- return data?.runnerSetup;
- },
- error() {
- this.showAlert = true;
- },
- });
- },
- toggleAlert(state) {
- this.showAlert = state;
- },
- },
- modalId: 'installation-instructions-modal',
- i18n: {
- installARunner: __('Install a Runner'),
- architecture: s__('Runners|Architecture'),
- downloadInstallBinary: s__('Runners|Download and Install Binary'),
- downloadLatestBinary: s__('Runners|Download Latest Binary'),
- registerRunner: s__('Runners|Register Runner'),
- method: __('Method'),
- fetchError: s__('An error has occurred fetching instructions'),
- instructions: __('Show Runner installation instructions'),
- },
- closeButton: {
- text: __('Close'),
- attributes: [{ variant: 'default' }],
- },
-};
-</script>
-<template>
- <div>
- <gl-button v-gl-modal-directive="$options.modalId" data-testid="show-modal-button">
- {{ $options.i18n.instructions }}
- </gl-button>
- <gl-modal
- :modal-id="$options.modalId"
- :title="$options.i18n.installARunner"
- :action-secondary="$options.closeButton"
- >
- <gl-alert v-if="showAlert" variant="danger" @dismiss="toggleAlert(false)">
- {{ $options.i18n.fetchError }}
- </gl-alert>
- <h5>{{ __('Environment') }}</h5>
- <gl-button-group class="gl-mb-5">
- <gl-button
- v-for="platform in platforms"
- :key="platform.name"
- data-testid="platform-button"
- @click="selectPlatform(platform.name)"
- >
- {{ platform.humanReadableName }}
- </gl-button>
- </gl-button-group>
- <template v-if="isPlatformSelected">
- <h5>
- {{ $options.i18n.architecture }}
- </h5>
- <gl-dropdown class="gl-mb-5" :text="selectedArchitecture.name">
- <gl-dropdown-item
- v-for="architecture in selectedPlatformArchitectures"
- :key="architecture.name"
- data-testid="architecture-dropdown-item"
- @click="selectArchitecture(architecture)"
- >
- {{ architecture.name }}
- </gl-dropdown-item>
- </gl-dropdown>
- <div class="gl-display-flex gl-align-items-center gl-mb-5">
- <h5>{{ $options.i18n.downloadInstallBinary }}</h5>
- <gl-button
- class="gl-ml-auto"
- :href="selectedArchitecture.downloadLocation"
- download
- data-testid="binary-download-button"
- >
- {{ $options.i18n.downloadLatestBinary }}
- </gl-button>
- </div>
- </template>
- <template v-if="!instructionsEmpty">
- <div class="gl-display-flex">
- <pre
- class="bg-light gl-flex-fill-1 gl-white-space-pre-line"
- data-testid="binary-instructions"
- >
- {{ instructions.installInstructions }}
- </pre>
- <gl-button
- class="gl-align-self-start gl-ml-2 gl-mt-2"
- category="tertiary"
- variant="link"
- :data-clipboard-text="instructions.installationInstructions"
- >
- <gl-icon name="copy-to-clipboard" />
- </gl-button>
- </div>
-
- <hr />
- <h5 class="gl-mb-5">{{ $options.i18n.registerRunner }}</h5>
- <h5 class="gl-mb-5">{{ $options.i18n.method }}</h5>
- <div class="gl-display-flex">
- <pre
- class="bg-light gl-flex-fill-1 gl-white-space-pre-line"
- data-testid="runner-instructions"
- >
- {{ instructions.registerInstructions }}
- </pre>
- <gl-button
- class="gl-align-self-start gl-ml-2 gl-mt-2"
- category="tertiary"
- variant="link"
- :data-clipboard-text="instructions.registerInstructions"
- >
- <gl-icon name="copy-to-clipboard" />
- </gl-button>
- </div>
- </template>
- </gl-modal>
- </div>
-</template>
diff --git a/app/finders/ci/commit_statuses_finder.rb b/app/finders/ci/commit_statuses_finder.rb
index 3c465eb88f3..d49ec7ebb40 100644
--- a/app/finders/ci/commit_statuses_finder.rb
+++ b/app/finders/ci/commit_statuses_finder.rb
@@ -12,7 +12,7 @@ module Ci
end
def execute
- return [] unless Ability.allowed?(@current_user, :read_pipeline, @project)
+ return {} unless Ability.allowed?(@current_user, :read_pipeline, @project)
commit_statuses
end
diff --git a/app/helpers/projects/alert_management_helper.rb b/app/helpers/projects/alert_management_helper.rb
index 5ce3736c8ef..c6ad6bfac01 100644
--- a/app/helpers/projects/alert_management_helper.rb
+++ b/app/helpers/projects/alert_management_helper.rb
@@ -27,7 +27,11 @@ module Projects::AlertManagementHelper
private
def alert_management_enabled?(project)
- !!(project.alerts_service_activated? || project.prometheus_service_active?)
+ !!(
+ project.alerts_service_activated? ||
+ project.prometheus_service_active? ||
+ AlertManagement::HttpIntegrationsFinder.new(project, active: true).execute.any?
+ )
end
end
diff --git a/app/services/concerns/users/participable_service.rb b/app/services/concerns/users/participable_service.rb
index fac8e91d216..4f4032e77b9 100644
--- a/app/services/concerns/users/participable_service.rb
+++ b/app/services/concerns/users/participable_service.rb
@@ -46,8 +46,9 @@ module Users
username: user.username,
name: user.name,
avatar_url: user.avatar_url,
- availability: user&.status&.availability
+ availability: nil
}
+ # Return nil for availability for now due to https://gitlab.com/gitlab-org/gitlab/-/issues/285442
end
def group_as_hash(group, group_counts)
diff --git a/app/services/packages/create_event_service.rb b/app/services/packages/create_event_service.rb
index 8350ff993bf..c4492389da9 100644
--- a/app/services/packages/create_event_service.rb
+++ b/app/services/packages/create_event_service.rb
@@ -7,7 +7,7 @@ module Packages
::Gitlab::UsageDataCounters::HLLRedisCounter.track_event(current_user.id, redis_event_name)
end
- if Feature.enabled?(:collect_package_events)
+ if Feature.enabled?(:collect_package_events) && Gitlab::Database.read_write?
::Packages::Event.create!(
event_type: event_name,
originator: current_user&.id,
diff --git a/app/services/projects/transfer_service.rb b/app/services/projects/transfer_service.rb
index 5743efab81b..5178c76f0fc 100644
--- a/app/services/projects/transfer_service.rb
+++ b/app/services/projects/transfer_service.rb
@@ -71,7 +71,10 @@ module Projects
Project.transaction do
project.expire_caches_before_rename(@old_path)
+ # Apply changes to the project
update_namespace_and_visibility(@new_namespace)
+ update_shared_runners_settings
+ project.save!
# Notifications
project.send_move_instructions(@old_path)
@@ -84,10 +87,6 @@ module Projects
# Move uploads
move_project_uploads(project)
- # If a project is being transferred to another group it means it can already
- # have shared runners enabled but we need to check whether the new group allows that.
- project.shared_runners_enabled = false if project.group && project.group.shared_runners_setting == 'disabled_and_unoverridable'
-
project.old_path_with_namespace = @old_path
update_repository_configuration(@new_path)
@@ -120,7 +119,6 @@ module Projects
# Apply new namespace id and visibility level
project.namespace = to_namespace
project.visibility_level = to_namespace.visibility_level unless project.visibility_level_allowed_by_group?
- project.save!
end
def update_repository_configuration(full_path)
@@ -208,6 +206,14 @@ module Projects
def new_design_repo_path
"#{new_path}#{::Gitlab::GlRepository::DESIGN.path_suffix}"
end
+
+ def update_shared_runners_settings
+ # If a project is being transferred to another group it means it can already
+ # have shared runners enabled but we need to check whether the new group allows that.
+ if project.group && project.group.shared_runners_setting == 'disabled_and_unoverridable'
+ project.shared_runners_enabled = false
+ end
+ end
end
end
diff --git a/app/views/admin/instance_statistics/index.html.haml b/app/views/admin/instance_statistics/index.html.haml
index ab28a2471e6..d5902f702e5 100644
--- a/app/views/admin/instance_statistics/index.html.haml
+++ b/app/views/admin/instance_statistics/index.html.haml
@@ -1,4 +1,4 @@
-- breadcrumb_title _("Instance Statistics")
-- page_title _("Instance Statistics")
+- breadcrumb_title _("Usage Trends")
+- page_title _("Usage Trends")
#js-instance-statistics-app
diff --git a/app/views/admin/runners/index.html.haml b/app/views/admin/runners/index.html.haml
index c2d7b63f1f9..3d3b8c28a17 100644
--- a/app/views/admin/runners/index.html.haml
+++ b/app/views/admin/runners/index.html.haml
@@ -39,9 +39,7 @@
= render partial: 'ci/runner/how_to_setup_runner',
locals: { registration_token: Gitlab::CurrentSettings.runners_registration_token,
type: 'shared',
- reset_token_url: reset_registration_token_admin_application_settings_path,
- project_path: '',
- group_path: '' }
+ reset_token_url: reset_registration_token_admin_application_settings_path }
.row
.col-sm-9
diff --git a/app/views/ci/runner/_how_to_setup_runner.html.haml b/app/views/ci/runner/_how_to_setup_runner.html.haml
index 0ff6fdc6354..4ea3b0f0fb9 100644
--- a/app/views/ci/runner/_how_to_setup_runner.html.haml
+++ b/app/views/ci/runner/_how_to_setup_runner.html.haml
@@ -19,5 +19,3 @@
data: { confirm: _("Are you sure you want to reset registration token?") }
%li
= _("Start the Runner!")
-
-#js-install-runner{ data: { project_path: project_path, group_path: group_path } }
diff --git a/app/views/groups/runners/_group_runners.html.haml b/app/views/groups/runners/_group_runners.html.haml
index 087c38c7b86..554240b7aef 100644
--- a/app/views/groups/runners/_group_runners.html.haml
+++ b/app/views/groups/runners/_group_runners.html.haml
@@ -17,6 +17,4 @@
= render partial: 'ci/runner/how_to_setup_runner',
locals: { registration_token: @group.runners_token,
type: 'group',
- reset_token_url: reset_registration_token_group_settings_ci_cd_path,
- project_path: '',
- group_path: @group.path }
+ reset_token_url: reset_registration_token_group_settings_ci_cd_path }
diff --git a/app/views/layouts/nav/sidebar/_admin.html.haml b/app/views/layouts/nav/sidebar/_admin.html.haml
index 1e0e9628c89..da16be707eb 100644
--- a/app/views/layouts/nav/sidebar/_admin.html.haml
+++ b/app/views/layouts/nav/sidebar/_admin.html.haml
@@ -71,9 +71,9 @@
= _('Cohorts')
- if Feature.enabled?(:instance_statistics, default_enabled: true)
= nav_link(controller: :instance_statistics) do
- = link_to admin_instance_statistics_path, title: _('Instance Statistics') do
+ = link_to admin_instance_statistics_path, title: _('Usage Trends') do
%span
- = _('Instance Statistics')
+ = _('Usage Trends')
= nav_link(controller: admin_monitoring_nav_links) do
= link_to admin_system_info_path, data: { qa_selector: 'admin_monitoring_link' } do
diff --git a/app/views/projects/runners/_specific_runners.html.haml b/app/views/projects/runners/_specific_runners.html.haml
index e02e2cc784a..ed9e6aac346 100644
--- a/app/views/projects/runners/_specific_runners.html.haml
+++ b/app/views/projects/runners/_specific_runners.html.haml
@@ -9,9 +9,7 @@
= render partial: 'ci/runner/how_to_setup_runner',
locals: { registration_token: @project.runners_token,
type: 'specific',
- reset_token_url: reset_registration_token_namespace_project_settings_ci_cd_path,
- project_path: @project.path_with_namespace,
- group_path: '' }
+ reset_token_url: reset_registration_token_namespace_project_settings_ci_cd_path }
- if @project_runners.any?
%h4.underlined-title= _('Runners activated for this project')
diff --git a/app/views/shared/_new_project_item_select.html.haml b/app/views/shared/_new_project_item_select.html.haml
index 4340a34dc26..b327b6f7ee8 100644
--- a/app/views/shared/_new_project_item_select.html.haml
+++ b/app/views/shared/_new_project_item_select.html.haml
@@ -2,6 +2,6 @@
.project-item-select-holder.btn-group.gl-ml-auto.gl-mr-auto.gl-py-3.gl-relative.gl-display-flex.gl-overflow-hidden
%a.btn.gl-button.btn-success.new-project-item-link.block-truncated.qa-new-project-item-link{ href: '', data: { label: local_assigns[:label], type: local_assigns[:type] }, class: "gl-m-0!" }
= loading_icon(color: 'light')
- = project_select_tag :project_path, class: "project-item-select gl-absolute gl-visibility-hidden", data: { include_groups: local_assigns[:include_groups], order_by: 'last_activity_at', relative_path: local_assigns[:path], with_shared: local_assigns[:with_shared], include_projects_in_subgroups: local_assigns[:include_projects_in_subgroups] }, with_feature_enabled: local_assigns[:with_feature_enabled]
+ = project_select_tag :project_path, class: "project-item-select gl-absolute! gl-visibility-hidden", data: { include_groups: local_assigns[:include_groups], order_by: 'last_activity_at', relative_path: local_assigns[:path], with_shared: local_assigns[:with_shared], include_projects_in_subgroups: local_assigns[:include_projects_in_subgroups] }, with_feature_enabled: local_assigns[:with_feature_enabled]
%button.btn.dropdown-toggle.btn-success.btn-md.gl-button.gl-dropdown-toggle.dropdown-toggle-split.new-project-item-select-button.qa-new-project-item-select-button.gl-p-0.gl-w-100{ class: "gl-m-0!", 'aria-label': _('Toggle project select') }
= sprite_icon('chevron-down')