diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-11 09:10:03 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-11 09:10:03 +0300 |
commit | 7adadf7e5b83c46f7e83051146624719e9b6bf0d (patch) | |
tree | 3439c6c97d3345ce9ce4e972e39c57eef5dc2d64 | |
parent | fb8d6a526f0ef2da9fb247e15f9ff19279dba3d6 (diff) |
Add latest changes from gitlab-org/gitlab@master
43 files changed, 132 insertions, 641 deletions
diff --git a/app/assets/images/cluster_app_logos/fluentd.png b/app/assets/images/cluster_app_logos/fluentd.png Binary files differdeleted file mode 100644 index 6d42578f2ce..00000000000 --- a/app/assets/images/cluster_app_logos/fluentd.png +++ /dev/null diff --git a/app/assets/javascripts/clusters/clusters_bundle.js b/app/assets/javascripts/clusters/clusters_bundle.js index 2a2f3ff2dc1..762b37a8216 100644 --- a/app/assets/javascripts/clusters/clusters_bundle.js +++ b/app/assets/javascripts/clusters/clusters_bundle.js @@ -11,7 +11,7 @@ import PersistentUserCallout from '../persistent_user_callout'; import initSettingsPanels from '../settings_panels'; import Applications from './components/applications.vue'; import RemoveClusterConfirmation from './components/remove_cluster_confirmation.vue'; -import { APPLICATION_STATUS, CROSSPLANE, KNATIVE, FLUENTD } from './constants'; +import { APPLICATION_STATUS, CROSSPLANE, KNATIVE } from './constants'; import eventHub from './event_hub'; import ClustersService from './services/clusters_service'; import ClustersStore from './stores/clusters_store'; @@ -42,7 +42,6 @@ export default class Clusters { installElasticStackPath, installCrossplanePath, installPrometheusPath, - installFluentdPath, managePrometheusPath, clusterEnvironmentsPath, hasRbac, @@ -98,7 +97,6 @@ export default class Clusters { updateKnativeEndpoint: updateKnativePath, installElasticStackEndpoint: installElasticStackPath, clusterEnvironmentsEndpoint: clusterEnvironmentsPath, - installFluentdEndpoint: installFluentdPath, }); this.installApplication = this.installApplication.bind(this); @@ -250,7 +248,6 @@ export default class Clusters { eventHub.$on('setKnativeDomain', (data) => this.setKnativeDomain(data)); eventHub.$on('uninstallApplication', (data) => this.uninstallApplication(data)); eventHub.$on('setCrossplaneProviderStack', (data) => this.setCrossplaneProviderStack(data)); - eventHub.$on('setFluentdSettings', (data) => this.setFluentdSettings(data)); // Add event listener to all the banner close buttons this.addBannerCloseHandler(this.unreachableContainer, 'unreachable'); this.addBannerCloseHandler(this.authenticationFailureContainer, 'authentication_failure'); @@ -267,8 +264,6 @@ export default class Clusters { eventHub.$off('setCrossplaneProviderStack'); // eslint-disable-next-line @gitlab/no-global-event-off eventHub.$off('uninstallApplication'); - // eslint-disable-next-line @gitlab/no-global-event-off - eventHub.$off('setFluentdSettings'); } initPolling(method, successCallback, errorCallback) { @@ -480,12 +475,6 @@ export default class Clusters { }); } - setFluentdSettings(settings = {}) { - Object.entries(settings).forEach(([key, value]) => { - this.store.updateAppProperty(FLUENTD, key, value); - }); - } - saveKnativeDomain(data) { const appId = data.id; this.store.updateApplication(appId); diff --git a/app/assets/javascripts/clusters/components/applications.vue b/app/assets/javascripts/clusters/components/applications.vue index e589b67fba0..ddee1711975 100644 --- a/app/assets/javascripts/clusters/components/applications.vue +++ b/app/assets/javascripts/clusters/components/applications.vue @@ -3,7 +3,6 @@ import { GlLoadingIcon, GlSprintf, GlLink, GlAlert } from '@gitlab/ui'; import certManagerLogo from 'images/cluster_app_logos/cert_manager.png'; import crossplaneLogo from 'images/cluster_app_logos/crossplane.png'; import elasticStackLogo from 'images/cluster_app_logos/elastic_stack.png'; -import fluentdLogo from 'images/cluster_app_logos/fluentd.png'; import gitlabLogo from 'images/cluster_app_logos/gitlab.png'; import helmLogo from 'images/cluster_app_logos/helm.png'; import jupyterhubLogo from 'images/cluster_app_logos/jupyterhub.png'; @@ -15,7 +14,6 @@ import clipboardButton from '../../vue_shared/components/clipboard_button.vue'; import { CLUSTER_TYPE, PROVIDER_TYPE, APPLICATION_STATUS, INGRESS } from '../constants'; import applicationRow from './application_row.vue'; import CrossplaneProviderStack from './crossplane_provider_stack.vue'; -import FluentdOutputSettings from './fluentd_output_settings.vue'; import KnativeDomainEditor from './knative_domain_editor.vue'; export default { @@ -27,7 +25,6 @@ export default { GlLink, KnativeDomainEditor, CrossplaneProviderStack, - FluentdOutputSettings, GlAlert, }, props: { @@ -159,7 +156,6 @@ export default { knativeLogo, prometheusLogo, elasticStackLogo, - fluentdLogo, }, }; </script> @@ -629,48 +625,6 @@ export default { </template> </application-row> - <application-row - id="fluentd" - :logo-url="$options.logos.fluentdLogo" - :title="applications.fluentd.title" - :status="applications.fluentd.status" - :status-reason="applications.fluentd.statusReason" - :request-status="applications.fluentd.requestStatus" - :request-reason="applications.fluentd.requestReason" - :installed="applications.fluentd.installed" - :install-failed="applications.fluentd.installFailed" - :install-application-request-params="{ - host: applications.fluentd.host, - port: applications.fluentd.port, - protocol: applications.fluentd.protocol, - cilium_log_enabled: applications.fluentd.ciliumLogEnabled, - }" - :uninstallable="applications.fluentd.uninstallable" - :uninstall-successful="applications.fluentd.uninstallSuccessful" - :uninstall-failed="applications.fluentd.uninstallFailed" - :updateable="false" - title-link="https://github.com/helm/charts/tree/master/stable/fluentd" - > - <template #description> - <p> - {{ - s__( - `ClusterIntegration|Fluentd is an open source data collector, which lets you unify the data collection and consumption for a better use and understanding of data. It requires at least one of the following logs to be successfully installed.`, - ) - }} - </p> - - <fluentd-output-settings - :port="applications.fluentd.port" - :protocol="applications.fluentd.protocol" - :host="applications.fluentd.host" - :cilium-log-enabled="applications.fluentd.ciliumLogEnabled" - :status="applications.fluentd.status" - :update-failed="applications.fluentd.updateFailed" - /> - </template> - </application-row> - <div class="gl-mt-7 gl-border-1 gl-border-t-solid gl-border-gray-100"> <!-- This empty div serves as a separator. The applications below can be externally installed using a cluster-management project. --> </div> diff --git a/app/assets/javascripts/clusters/components/fluentd_output_settings.vue b/app/assets/javascripts/clusters/components/fluentd_output_settings.vue deleted file mode 100644 index d167b8f89dd..00000000000 --- a/app/assets/javascripts/clusters/components/fluentd_output_settings.vue +++ /dev/null @@ -1,226 +0,0 @@ -<script> -import { GlAlert, GlButton, GlDropdown, GlDropdownItem, GlFormCheckbox } from '@gitlab/ui'; -import { mapValues } from 'lodash'; -import { APPLICATION_STATUS, FLUENTD } from '~/clusters/constants'; -import eventHub from '~/clusters/event_hub'; -import { __ } from '~/locale'; - -const { UPDATING, UNINSTALLING, INSTALLING, INSTALLED, UPDATED } = APPLICATION_STATUS; - -export default { - components: { - GlAlert, - GlButton, - GlDropdown, - GlDropdownItem, - GlFormCheckbox, - }, - props: { - protocols: { - type: Array, - required: false, - default: () => ['TCP', 'UDP'], - }, - status: { - type: String, - required: false, - default: '', - }, - updateFailed: { - type: Boolean, - required: false, - }, - protocol: { - type: String, - required: false, - default: () => __('Protocol'), - }, - port: { - type: Number, - required: false, - default: 514, - }, - host: { - type: String, - required: false, - default: '', - }, - ciliumLogEnabled: { - type: Boolean, - required: false, - }, - }, - data() { - return { - currentServerSideSettings: { - host: null, - port: null, - protocol: null, - ciliumLogEnabled: null, - }, - }; - }, - computed: { - isSaving() { - return [UPDATING].includes(this.status); - }, - saveButtonDisabled() { - return [UNINSTALLING, UPDATING, INSTALLING].includes(this.status); - }, - saveButtonLabel() { - return this.isSaving ? __('Saving') : __('Save changes'); - }, - /** - * Returns true either when: - * - The application is getting updated. - * - The user has changed some of the settings for an application which is - * neither getting installed nor updated. - */ - showButtons() { - return this.isSaving || (this.changedByUser && [INSTALLED, UPDATED].includes(this.status)); - }, - protocolName() { - if (this.protocol) { - return this.protocol.toUpperCase(); - } - return __('Protocol'); - }, - changedByUser() { - return Object.entries(this.currentServerSideSettings).some(([key, value]) => { - return value !== null && value !== this[key]; - }); - }, - }, - watch: { - status() { - this.resetCurrentServerSideSettings(); - }, - }, - methods: { - updateApplication() { - eventHub.$emit('updateApplication', { - id: FLUENTD, - params: { - port: this.port, - protocol: this.protocol, - host: this.host, - cilium_log_enabled: this.ciliumLogEnabled, - }, - }); - }, - resetCurrentServerSideSettings() { - this.currentServerSideSettings = mapValues(this.currentServerSideSettings, () => { - return null; - }); - }, - resetStatus() { - const newSettings = mapValues(this.currentServerSideSettings, (value, key) => { - return value === null ? this[key] : value; - }); - eventHub.$emit('setFluentdSettings', { - ...newSettings, - isEditingSettings: false, - }); - }, - updateCurrentServerSideSettings(settings) { - Object.keys(settings).forEach((key) => { - if (this.currentServerSideSettings[key] === null) { - this.currentServerSideSettings[key] = this[key]; - } - }); - }, - setFluentdSettings(settings) { - this.updateCurrentServerSideSettings(settings); - eventHub.$emit('setFluentdSettings', { - ...settings, - isEditingSettings: true, - }); - }, - selectProtocol(protocol) { - this.setFluentdSettings({ protocol }); - }, - hostChanged(host) { - this.setFluentdSettings({ host }); - }, - portChanged(port) { - this.setFluentdSettings({ port: Number(port) }); - }, - ciliumLogChanged(ciliumLogEnabled) { - this.setFluentdSettings({ ciliumLogEnabled }); - }, - }, -}; -</script> - -<template> - <div> - <gl-alert v-if="updateFailed" class="mb-3" variant="danger" :dismissible="false"> - {{ - s__( - 'ClusterIntegration|Something went wrong while trying to save your settings. Please try again.', - ) - }} - </gl-alert> - <div class="form-horizontal"> - <div class="form-group"> - <label for="fluentd-host"> - <strong>{{ s__('ClusterIntegration|SIEM Hostname') }}</strong> - </label> - <input - id="fluentd-host" - :value="host" - type="text" - class="form-control" - @input="hostChanged($event.target.value)" - /> - </div> - <div class="form-group"> - <label for="fluentd-port"> - <strong>{{ s__('ClusterIntegration|SIEM Port') }}</strong> - </label> - <input - id="fluentd-port" - :value="port" - type="number" - class="form-control" - @input="portChanged($event.target.value)" - /> - </div> - <div class="form-group"> - <label for="fluentd-protocol"> - <strong>{{ s__('ClusterIntegration|SIEM Protocol') }}</strong> - </label> - <gl-dropdown :text="protocolName" class="w-100"> - <gl-dropdown-item - v-for="(value, index) in protocols" - :key="index" - @click="selectProtocol(value.toLowerCase())" - > - {{ value }} - </gl-dropdown-item> - </gl-dropdown> - </div> - <div class="form-group flex flex-wrap"> - <gl-form-checkbox :checked="ciliumLogEnabled" @input="ciliumLogChanged"> - <strong>{{ s__('ClusterIntegration|Send Container Network Policies Logs') }}</strong> - </gl-form-checkbox> - </div> - <div v-if="showButtons" class="gl-mt-5 gl-display-flex"> - <gl-button - ref="saveBtn" - class="gl-mr-3" - variant="success" - category="primary" - :loading="isSaving" - :disabled="saveButtonDisabled" - @click="updateApplication" - > - {{ saveButtonLabel }} - </gl-button> - <gl-button ref="cancelBtn" :disabled="saveButtonDisabled" @click="resetStatus"> - {{ __('Cancel') }} - </gl-button> - </div> - </div> - </div> -</template> diff --git a/app/assets/javascripts/clusters/constants.js b/app/assets/javascripts/clusters/constants.js index 90ec3f2377c..846e5950b8b 100644 --- a/app/assets/javascripts/clusters/constants.js +++ b/app/assets/javascripts/clusters/constants.js @@ -55,7 +55,6 @@ export const CERT_MANAGER = 'cert_manager'; export const CROSSPLANE = 'crossplane'; export const PROMETHEUS = 'prometheus'; export const ELASTIC_STACK = 'elastic_stack'; -export const FLUENTD = 'fluentd'; export const APPLICATIONS = [ HELM, @@ -66,7 +65,6 @@ export const APPLICATIONS = [ CERT_MANAGER, PROMETHEUS, ELASTIC_STACK, - FLUENTD, ]; export const INGRESS_DOMAIN_SUFFIX = '.nip.io'; diff --git a/app/assets/javascripts/clusters/services/clusters_service.js b/app/assets/javascripts/clusters/services/clusters_service.js index 2a6c6965dab..333fb293a15 100644 --- a/app/assets/javascripts/clusters/services/clusters_service.js +++ b/app/assets/javascripts/clusters/services/clusters_service.js @@ -13,7 +13,6 @@ export default class ClusterService { jupyter: this.options.installJupyterEndpoint, knative: this.options.installKnativeEndpoint, elastic_stack: this.options.installElasticStackEndpoint, - fluentd: this.options.installFluentdEndpoint, }; this.appUpdateEndpointMap = { knative: this.options.updateKnativeEndpoint, diff --git a/app/assets/javascripts/clusters/stores/clusters_store.js b/app/assets/javascripts/clusters/stores/clusters_store.js index 88a1d648451..50689a6142f 100644 --- a/app/assets/javascripts/clusters/stores/clusters_store.js +++ b/app/assets/javascripts/clusters/stores/clusters_store.js @@ -13,7 +13,6 @@ import { UPDATE_EVENT, UNINSTALL_EVENT, ELASTIC_STACK, - FLUENTD, } from '../constants'; import transitionApplicationState from '../services/application_state_machine'; @@ -102,15 +101,6 @@ export default class ClusterStore { ...applicationInitialState, title: s__('ClusterIntegration|Elastic Stack'), }, - fluentd: { - ...applicationInitialState, - title: s__('ClusterIntegration|Fluentd'), - host: null, - port: null, - protocol: null, - ciliumLogEnabled: null, - isEditingSettings: false, - }, cilium: { ...applicationInitialState, title: s__('ClusterIntegration|GitLab Container Network Policies'), @@ -246,13 +236,6 @@ export default class ClusterStore { } else if (appId === ELASTIC_STACK) { this.state.applications.elastic_stack.version = version; this.state.applications.elastic_stack.updateAvailable = updateAvailable; - } else if (appId === FLUENTD) { - if (!this.state.applications.fluentd.isEditingSettings) { - this.state.applications.fluentd.port = serverAppEntry.port; - this.state.applications.fluentd.host = serverAppEntry.host; - this.state.applications.fluentd.protocol = serverAppEntry.protocol; - this.state.applications.fluentd.ciliumLogEnabled = serverAppEntry.cilium_log_enabled; - } } }); } diff --git a/app/assets/javascripts/sidebar/components/assignees/assignee_title.vue b/app/assets/javascripts/sidebar/components/assignees/assignee_title.vue index 26e88523abb..adb573db652 100644 --- a/app/assets/javascripts/sidebar/components/assignees/assignee_title.vue +++ b/app/assets/javascripts/sidebar/components/assignees/assignee_title.vue @@ -45,7 +45,7 @@ export default { }; </script> <template> - <div class="title hide-collapsed"> + <div class="hide-collapsed gl-line-height-20 gl-mb-2 gl-text-gray-900"> {{ assigneeTitle }} <gl-loading-icon v-if="loading" inline class="align-bottom" /> <a diff --git a/app/assets/javascripts/sidebar/components/assignees/assignees.vue b/app/assets/javascripts/sidebar/components/assignees/assignees.vue index c3c009e680a..e41bb41dc05 100644 --- a/app/assets/javascripts/sidebar/components/assignees/assignees.vue +++ b/app/assets/javascripts/sidebar/components/assignees/assignees.vue @@ -48,17 +48,15 @@ export default { <collapsed-assignee-list :users="sortedAssigness" :issuable-type="issuableType" /> <div data-testid="expanded-assignee" class="value hide-collapsed"> - <template v-if="hasNoUsers"> - <span class="assign-yourself no-value"> - {{ __('None') }} - <template v-if="editable"> - - - <button type="button" class="btn-link" @click="assignSelf"> - {{ __('assign yourself') }} - </button> - </template> - </span> - </template> + <span v-if="hasNoUsers" class="no-value" data-testid="no-value"> + {{ __('None') }} + <template v-if="editable"> + - + <button type="button" class="btn-link" data-testid="assign-yourself" @click="assignSelf"> + {{ __('assign yourself') }} + </button> + </template> + </span> <uncollapsed-assignee-list v-else :users="sortedAssigness" :issuable-type="issuableType" /> </div> diff --git a/app/assets/javascripts/sidebar/components/assignees/sidebar_assignees.vue b/app/assets/javascripts/sidebar/components/assignees/sidebar_assignees.vue index ca95599742a..9840aa4ed66 100644 --- a/app/assets/javascripts/sidebar/components/assignees/sidebar_assignees.vue +++ b/app/assets/javascripts/sidebar/components/assignees/sidebar_assignees.vue @@ -149,7 +149,6 @@ export default { :users="exposeAvailabilityStatus(store.assignees)" :editable="store.editable" :issuable-type="issuableType" - class="value" @assign-self="assignSelf" /> </div> diff --git a/app/assets/javascripts/sidebar/components/lock/issuable_lock_form.vue b/app/assets/javascripts/sidebar/components/lock/issuable_lock_form.vue index 3468acb38e7..81ee0a73739 100644 --- a/app/assets/javascripts/sidebar/components/lock/issuable_lock_form.vue +++ b/app/assets/javascripts/sidebar/components/lock/issuable_lock_form.vue @@ -86,7 +86,7 @@ export default { <gl-icon :name="lockStatus.icon" class="sidebar-item-icon is-active" /> </div> - <div class="title hide-collapsed"> + <div class="hide-collapsed gl-line-height-20 gl-mb-2 gl-text-gray-900"> {{ sprintf(__('Lock %{issuableDisplayName}'), { issuableDisplayName: issuableDisplayName }) }} <a v-if="isEditable" diff --git a/app/assets/javascripts/sidebar/components/reviewers/reviewer_title.vue b/app/assets/javascripts/sidebar/components/reviewers/reviewer_title.vue index a461d992222..88c0b18ccc7 100644 --- a/app/assets/javascripts/sidebar/components/reviewers/reviewer_title.vue +++ b/app/assets/javascripts/sidebar/components/reviewers/reviewer_title.vue @@ -33,7 +33,7 @@ export default { }; </script> <template> - <div class="title hide-collapsed"> + <div class="hide-collapsed gl-line-height-20 gl-mb-2 gl-text-gray-900"> {{ reviewerTitle }} <gl-loading-icon v-if="loading" inline class="align-bottom" /> <a diff --git a/app/assets/javascripts/sidebar/components/reviewers/reviewers.vue b/app/assets/javascripts/sidebar/components/reviewers/reviewers.vue index 2c52d7142f7..5729b958b5d 100644 --- a/app/assets/javascripts/sidebar/components/reviewers/reviewers.vue +++ b/app/assets/javascripts/sidebar/components/reviewers/reviewers.vue @@ -59,7 +59,7 @@ export default { <div class="value hide-collapsed"> <template v-if="hasNoUsers"> - <span class="assign-yourself no-value"> + <span class="no-value"> {{ __('None') }} </span> </template> diff --git a/app/assets/javascripts/sidebar/components/reviewers/sidebar_reviewers.vue b/app/assets/javascripts/sidebar/components/reviewers/sidebar_reviewers.vue index b5cf5df4957..c0bd54c60da 100644 --- a/app/assets/javascripts/sidebar/components/reviewers/sidebar_reviewers.vue +++ b/app/assets/javascripts/sidebar/components/reviewers/sidebar_reviewers.vue @@ -103,7 +103,6 @@ export default { :users="store.reviewers" :editable="store.editable" :issuable-type="issuableType" - class="value" @request-review="requestReview" /> </div> diff --git a/app/assets/javascripts/sidebar/components/sidebar_editable_item.vue b/app/assets/javascripts/sidebar/components/sidebar_editable_item.vue index 0fb8d762c7c..825d7ff5841 100644 --- a/app/assets/javascripts/sidebar/components/sidebar_editable_item.vue +++ b/app/assets/javascripts/sidebar/components/sidebar_editable_item.vue @@ -109,8 +109,13 @@ export default { <template> <div> - <div class="gl-display-flex gl-align-items-center" @click.self="collapse"> - <span class="hide-collapsed" data-testid="title" @click="collapse">{{ title }}</span> + <div + class="gl-display-flex gl-align-items-center gl-line-height-20 gl-mb-2 gl-text-gray-900" + @click.self="collapse" + > + <span class="hide-collapsed" data-testid="title" @click="collapse"> + {{ title }} + </span> <slot name="title-extra"></slot> <gl-loading-icon v-if="loading || initialLoading" inline class="gl-ml-2 hide-collapsed" /> <gl-loading-icon @@ -135,7 +140,7 @@ export default { </gl-button> </div> <template v-if="!initialLoading"> - <div v-show="!edit" data-testid="collapsed-content"> + <div v-show="!edit" data-testid="collapsed-content" class="gl-line-height-14"> <slot name="collapsed">{{ __('None') }}</slot> </div> <div v-show="edit" data-testid="expanded-content" :class="{ 'gl-mt-3': !isClassicSidebar }"> diff --git a/app/assets/javascripts/sidebar/components/time_tracking/comparison_pane.vue b/app/assets/javascripts/sidebar/components/time_tracking/comparison_pane.vue index 99302993b9a..3705d725a15 100644 --- a/app/assets/javascripts/sidebar/components/time_tracking/comparison_pane.vue +++ b/app/assets/javascripts/sidebar/components/time_tracking/comparison_pane.vue @@ -70,7 +70,7 @@ export default { </script> <template> - <div data-testid="timeTrackingComparisonPane"> + <div class="gl-mt-2" data-testid="timeTrackingComparisonPane"> <div v-gl-tooltip data-testid="compareMeter" diff --git a/app/assets/javascripts/sidebar/components/time_tracking/time_tracker.vue b/app/assets/javascripts/sidebar/components/time_tracking/time_tracker.vue index 0015aadfdf1..a424a51f17e 100644 --- a/app/assets/javascripts/sidebar/components/time_tracking/time_tracker.vue +++ b/app/assets/javascripts/sidebar/components/time_tracking/time_tracker.vue @@ -141,7 +141,7 @@ export default { :time-spent-human-readable="humanTimeSpent" :time-estimate-human-readable="humanTimeEstimate" /> - <div class="title hide-collapsed gl-mb-3"> + <div class="hide-collapsed gl-line-height-20 gl-text-gray-900"> {{ __('Time tracking') }} <div v-if="!showHelpState" @@ -160,7 +160,7 @@ export default { <gl-icon name="close" /> </div> </div> - <div class="time-tracking-content hide-collapsed"> + <div class="hide-collapsed"> <div v-if="showEstimateOnlyState" data-testid="estimateOnlyPane"> <span class="gl-font-weight-bold">{{ $options.i18n.estimatedOnlyText }} </span >{{ humanTimeEstimate }} @@ -186,9 +186,9 @@ export default { v-gl-modal="'time-tracking-report'" data-testid="reportLink" href="#" - class="btn-link" - >{{ __('Time tracking report') }}</gl-link > + {{ __('Time tracking report') }} + </gl-link> <gl-modal modal-id="time-tracking-report" :title="__('Time tracking report')" diff --git a/app/assets/javascripts/sidebar/mount_sidebar.js b/app/assets/javascripts/sidebar/mount_sidebar.js index d28450e431f..d728c3e1cc5 100644 --- a/app/assets/javascripts/sidebar/mount_sidebar.js +++ b/app/assets/javascripts/sidebar/mount_sidebar.js @@ -206,6 +206,7 @@ function mountConfidentialComponent() { }, provide: { canUpdate: initialData.is_editable, + isClassicSidebar: true, }, render: (createElement) => diff --git a/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/dropdown_title.vue b/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/dropdown_title.vue index 110202af778..813de528c0b 100644 --- a/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/dropdown_title.vue +++ b/app/assets/javascripts/vue_shared/components/sidebar/labels_select_vue/dropdown_title.vue @@ -23,17 +23,18 @@ export default { </script> <template> - <div class="title hide-collapsed gl-mb-3"> + <div class="hide-collapsed gl-line-height-20 gl-mb-2 gl-text-gray-900"> {{ __('Labels') }} <template v-if="allowLabelEdit"> <gl-loading-icon v-show="labelsSelectInProgress" inline /> <gl-button variant="link" - class="gl-text-gray-800! float-right js-sidebar-dropdown-toggle" + class="float-right gl-text-gray-900! gl-hover-text-blue-800! js-sidebar-dropdown-toggle" data-qa-selector="labels_edit_button" @click="toggleDropdownContents" - >{{ __('Edit') }}</gl-button > + {{ __('Edit') }} + </gl-button> </template> </div> </template> diff --git a/app/assets/stylesheets/pages/issuable.scss b/app/assets/stylesheets/pages/issuable.scss index d238e7764a3..1bc6dfbd84a 100644 --- a/app/assets/stylesheets/pages/issuable.scss +++ b/app/assets/stylesheets/pages/issuable.scss @@ -267,11 +267,6 @@ .value { line-height: 1; - - .assign-yourself { - margin-top: 10px; - display: block; - } } .issuable-sidebar { @@ -288,10 +283,6 @@ } } - .assign-yourself .btn-link { - padding-left: 0; - } - .light { font-weight: $gl-font-weight-normal; } diff --git a/app/controllers/dashboard/projects_controller.rb b/app/controllers/dashboard/projects_controller.rb index 7cb39625371..01bb930a51b 100644 --- a/app/controllers/dashboard/projects_controller.rb +++ b/app/controllers/dashboard/projects_controller.rb @@ -36,7 +36,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController # rubocop: disable CodeReuse/ActiveRecord def starred @projects = load_projects(params.merge(starred: true)) - .includes(:forked_from_project, :tags) + .includes(:forked_from_project, :topics) @groups = [] diff --git a/app/models/project.rb b/app/models/project.rb index 519bc53c26c..3af1e671f1c 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -127,14 +127,10 @@ class Project < ApplicationRecord after_create :check_repository_absence! acts_as_ordered_taggable_on :topics - # The 'tag_list' alias and the 'tags' association are required during the 'tags -> topics' migration - # TODO: eliminate 'tag_list' and 'tags' in the further process of the migration + # The 'tag_list' alias is required during the 'tags -> topics' migration + # TODO: eliminate 'tag_list' in the further process of the migration # https://gitlab.com/gitlab-org/gitlab/-/issues/328226 alias_attribute :tag_list, :topic_list - has_many :tags, -> { order("#{ActsAsTaggableOn::Tagging.table_name}.id") }, - class_name: 'ActsAsTaggableOn::Tag', - through: :topic_taggings, - source: :tag attr_accessor :old_path_with_namespace attr_accessor :template_name @@ -637,7 +633,7 @@ class Project < ApplicationRecord mount_uploader :bfg_object_map, AttachmentUploader def self.with_api_entity_associations - preload(:project_feature, :route, :tags, :group, :timelogs, namespace: [:route, :owner]) + preload(:project_feature, :route, :topics, :group, :timelogs, namespace: [:route, :owner]) end def self.with_web_entity_associations diff --git a/app/services/jira.rb b/app/services/jira.rb deleted file mode 100644 index 4c4baff00e7..00000000000 --- a/app/services/jira.rb +++ /dev/null @@ -1,4 +0,0 @@ -# frozen_string_literal: true - -module Jira -end diff --git a/app/views/clusters/clusters/show.html.haml b/app/views/clusters/clusters/show.html.haml index 654fcab8bf1..7336b9fe86b 100644 --- a/app/views/clusters/clusters/show.html.haml +++ b/app/views/clusters/clusters/show.html.haml @@ -17,7 +17,6 @@ install_knative_path: clusterable.install_applications_cluster_path(@cluster, :knative), update_knative_path: clusterable.update_applications_cluster_path(@cluster, :knative), install_elastic_stack_path: clusterable.install_applications_cluster_path(@cluster, :elastic_stack), - install_fluentd_path: clusterable.install_applications_cluster_path(@cluster, :fluentd), cluster_environments_path: cluster_environments_path, toggle_status: @cluster.enabled? ? 'true': 'false', has_rbac: has_rbac_enabled?(@cluster) ? 'true': 'false', diff --git a/app/views/devise/shared/_signup_box.html.haml b/app/views/devise/shared/_signup_box.html.haml index fd40188ac03..09b7f247450 100644 --- a/app/views/devise/shared/_signup_box.html.haml +++ b/app/views/devise/shared/_signup_box.html.haml @@ -9,7 +9,7 @@ .devise-errors = render 'devise/shared/error_messages', resource: resource - if Gitlab::CurrentSettings.invisible_captcha_enabled - = invisible_captcha nonce: true + = invisible_captcha nonce: true, autocomplete: SecureRandom.alphanumeric(12) .name.form-row .col.form-group = f.label :first_name, _('First name'), for: 'new_user_first_name', class: 'label-bold' diff --git a/app/views/shared/issuable/_sidebar.html.haml b/app/views/shared/issuable/_sidebar.html.haml index 6df9ef8513c..416c788603a 100644 --- a/app/views/shared/issuable/_sidebar.html.haml +++ b/app/views/shared/issuable/_sidebar.html.haml @@ -43,7 +43,7 @@ = milestone[:title] - else = _('None') - .title.hide-collapsed + .hide-collapsed.gl-line-height-20.gl-mb-2.gl-text-gray-900{ data: { testid: "milestone_title" } } = _('Milestone') = loading_icon(css_class: 'gl-vertical-align-text-bottom hidden block-loading') - if can_edit_issuable diff --git a/config/application.rb b/config/application.rb index fe10afab8ce..58b3164ec9f 100644 --- a/config/application.rb +++ b/config/application.rb @@ -47,7 +47,6 @@ module Gitlab config.eager_load_paths.push(*%W[#{config.root}/lib #{config.root}/app/models/badges #{config.root}/app/models/hooks - #{config.root}/app/models/integrations #{config.root}/app/models/members #{config.root}/app/models/project_services #{config.root}/app/graphql/resolvers/concerns diff --git a/doc/administration/gitaly/configure_gitaly.md b/doc/administration/gitaly/configure_gitaly.md index d79fcec336f..0b22df5a115 100644 --- a/doc/administration/gitaly/configure_gitaly.md +++ b/doc/administration/gitaly/configure_gitaly.md @@ -247,7 +247,6 @@ disable enforcement. For more information, see the documentation on configuring # node_exporter['enable'] = false # Prevent database connections during 'gitlab-ctl reconfigure' - gitlab_rails['rake_cache_clear'] = false gitlab_rails['auto_migrate'] = false # Configure the gitlab-shell API callback URL. Without this, `git push` will diff --git a/doc/administration/gitaly/praefect.md b/doc/administration/gitaly/praefect.md index 3b82a492f34..d50b394a94e 100644 --- a/doc/administration/gitaly/praefect.md +++ b/doc/administration/gitaly/praefect.md @@ -9,13 +9,21 @@ type: reference Configure Gitaly Cluster using either: -- The Gitaly Cluster configuration instructions available as part of - [reference architectures](../reference_architectures/index.md) for installations for more than - 2000 users. -- The advanced configuration instructions that follow on this page. +- Gitaly Cluster configuration instructions available as part of + [reference architectures](../reference_architectures/index.md) for installations of up to: + - [3000 users](../reference_architectures/3k_users.md#configure-gitaly-cluster). + - [5000 users](../reference_architectures/5k_users.md#configure-gitaly-cluster). + - [10,000 users](../reference_architectures/10k_users.md#configure-gitaly-cluster). + - [25,000 users](../reference_architectures/25k_users.md#configure-gitaly-cluster). + - [50,000 users](../reference_architectures/50k_users.md#configure-gitaly-cluster). +- The custom configuration instructions that follow on this page. Smaller GitLab installations may need only [Gitaly itself](index.md). +NOTE: +Upgrade instructions for Omnibus GitLab installations +[are available](https://docs.gitlab.com/omnibus/update/#gitaly-cluster). + ## Requirements for configuring a Gitaly Cluster The minimum recommended configuration for a Gitaly Cluster requires: @@ -226,8 +234,10 @@ PostgreSQL instances. Otherwise you should change the configuration parameter > [Introduced](https://gitlab.com/gitlab-org/gitaly/-/issues/2634) in GitLab 13.4, Praefect nodes can no longer be designated as `primary`. -NOTE: -If there are multiple Praefect nodes, complete these steps for **each** node. +If there are multiple Praefect nodes: + +- Complete the following steps for **each** node. +- Designate one node as the "deploy node", and configure it first. To complete this section you need a [configured PostgreSQL server](#postgresql), including: @@ -262,8 +272,8 @@ application server, or a Gitaly node. praefect['enable'] = true # Prevent database connections during 'gitlab-ctl reconfigure' - gitlab_rails['rake_cache_clear'] = false gitlab_rails['auto_migrate'] = false + praefect['auto_migrate'] = false ``` 1. Configure **Praefect** to listen on network interfaces by editing @@ -384,6 +394,30 @@ application server, or a Gitaly node. gitlab-ctl reconfigure ``` +1. For: + + - The "deploy node": + 1. Enable Praefect auto-migration again by setting `praefect['auto_migrate'] = true` in + `/etc/gitlab/gitlab.rb`. + 1. To ensure database migrations are only run during reconfigure and not automatically on + upgrade, run: + + ```shell + sudo touch /etc/gitlab/skip-auto-reconfigure + ``` + + - The other nodes, you can leave the settings as they are. Though + `/etc/gitlab/skip-auto-reconfigure` isn't required, you may want to set it to prevent GitLab + running reconfigure automatically when running commands such as `apt-get update`. This way any + additional configuration changes can be done and then reconfigure can be run manually. + +1. Save the changes to `/etc/gitlab/gitlab.rb` and [reconfigure + Praefect](../restart_gitlab.md#omnibus-gitlab-reconfigure): + + ```shell + gitlab-ctl reconfigure + ``` + 1. To ensure that Praefect [has updated its Prometheus listen address](https://gitlab.com/gitlab-org/gitaly/-/issues/2734), [restart Praefect](../restart_gitlab.md#omnibus-gitlab-restart): @@ -602,7 +636,6 @@ documentation](configure_gitaly.md#configure-gitaly-servers). prometheus['enable'] = true # Prevent database connections during 'gitlab-ctl reconfigure' - gitlab_rails['rake_cache_clear'] = false gitlab_rails['auto_migrate'] = false ``` @@ -699,7 +732,7 @@ documentation](configure_gitaly.md#configure-gitaly-servers). **The steps above must be completed for each Gitaly node!** -After all Gitaly nodes are configured, you can run the Praefect connection +After all Gitaly nodes are configured, run the Praefect connection checker to verify Praefect can connect to all Gitaly servers in the Praefect configuration. diff --git a/doc/development/usage_ping/dictionary.md b/doc/development/usage_ping/dictionary.md index cf3c8bd8663..ea9d43ace8c 100644 --- a/doc/development/usage_ping/dictionary.md +++ b/doc/development/usage_ping/dictionary.md @@ -2454,7 +2454,7 @@ Whether or not ModSecurity is set to blocking mode Group: `group::container security` -Status: `deprecated` +Status: `removed` Tiers: `free`, `premium`, `ultimate` @@ -2466,7 +2466,7 @@ Whether or not ModSecurity is disabled within Ingress Group: `group::container security` -Status: `deprecated` +Status: `removed` Tiers: `free`, `premium`, `ultimate` @@ -2478,7 +2478,7 @@ Whether or not ModSecurity is set to logging mode Group: `group::container security` -Status: `deprecated` +Status: `removed` Tiers: `free`, `premium`, `ultimate` @@ -2490,7 +2490,7 @@ Whether or not ModSecurity has not been installed into the cluster Group: `group::container security` -Status: `deprecated` +Status: `removed` Tiers: `free`, `premium`, `ultimate` @@ -2502,7 +2502,7 @@ Cumulative count of packets identified as anomalous by ModSecurity since Usage P Group: `group::container security` -Status: `deprecated` +Status: `removed` Tiers: `free`, `premium`, `ultimate` @@ -2514,7 +2514,7 @@ Cumulative count of packets processed by ModSecurity since Usage Ping was last r Group: `group::container security` -Status: `deprecated` +Status: `removed` Tiers: `free`, `premium`, `ultimate` @@ -2526,7 +2526,7 @@ Whether or not ModSecurity statistics are unavailable Group: `group::container security` -Status: `deprecated` +Status: `removed` Tiers: `ultimate` @@ -11206,6 +11206,30 @@ Status: `data_available` Tiers: `premium`, `ultimate` +### `redis_hll_counters.epics_usage.g_project_management_users_epic_issue_added_from_epic_monthly` + +Number of users creating an issue from an epic + +[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_28d/20210608191652_g_project_management_users_epic_issue_added_from_epic_monthly.yml) + +Group: `group::product planning` + +Status: `implemented` + +Tiers: `premium` + +### `redis_hll_counters.epics_usage.g_project_management_users_epic_issue_added_from_epic_weekly` + +Number of users creating an issue from an epic + +[YAML definition](https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/config/metrics/counts_7d/20210608191647_g_project_management_users_epic_issue_added_from_epic_weekly.yml) + +Group: `group::product planning` + +Status: `implemented` + +Tiers: `premium` + ### `redis_hll_counters.epics_usage.g_project_management_users_removing_epic_emoji_monthly` Counts of MAU removing emoji on epic diff --git a/lib/api/entities/basic_project_details.rb b/lib/api/entities/basic_project_details.rb index 91831fe2bdf..c75b74b4368 100644 --- a/lib/api/entities/basic_project_details.rb +++ b/lib/api/entities/basic_project_details.rb @@ -38,12 +38,12 @@ module API # rubocop: disable CodeReuse/ActiveRecord def self.preload_relation(projects_relation, options = {}) - # Preloading topics, should be done with using only `:tags`, - # as `:tags` are defined as: `has_many :tags, through: :taggings` - # N+1 is solved then by using `subject.tags.map(&:name)` + # Preloading topics, should be done with using only `:topics`, + # as `:topics` are defined as: `has_many :topics, through: :taggings` + # N+1 is solved then by using `subject.topics.map(&:name)` # MR describing the solution: https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/20555 projects_relation.preload(:project_feature, :route) - .preload(:import_state, :tags) + .preload(:import_state, :topics) .preload(:auto_devops) .preload(namespace: [:route, :owner]) end @@ -58,7 +58,7 @@ module API # through the database, it will trigger a new query, ending up # in an N+1 if we have several projects strong_memoize(:topic_names) do - project.tags.pluck(:name).sort # rubocop:disable CodeReuse/ActiveRecord + project.topics.pluck(:name).sort # rubocop:disable CodeReuse/ActiveRecord end end end diff --git a/lib/api/entities/project.rb b/lib/api/entities/project.rb index 9f13586b24a..fabad33f52a 100644 --- a/lib/api/entities/project.rb +++ b/lib/api/entities/project.rb @@ -123,9 +123,9 @@ module API # rubocop: disable CodeReuse/ActiveRecord def self.preload_relation(projects_relation, options = {}) - # Preloading tags, should be done with using only `:tags`, - # as `:tags` are defined as: `has_many :tags, through: :taggings` - # N+1 is solved then by using `subject.tags.map(&:name)` + # Preloading topics, should be done with using only `:topics`, + # as `:topics` are defined as: `has_many :topics, through: :taggings` + # N+1 is solved then by using `subject.topics.map(&:name)` # MR describing the solution: https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/20555 super(projects_relation).preload(group: :namespace_settings) .preload(:ci_cd_settings) @@ -136,7 +136,7 @@ module API .preload(project_group_links: { group: :route }, fork_network: :root_project, fork_network_member: :forked_from_project, - forked_from_project: [:route, :tags, :group, :project_feature, namespace: [:route, :owner]]) + forked_from_project: [:route, :topics, :group, :project_feature, namespace: [:route, :owner]]) end # rubocop: enable CodeReuse/ActiveRecord diff --git a/lib/gitlab/usage_data_counters/known_events/epic_events.yml b/lib/gitlab/usage_data_counters/known_events/epic_events.yml index d1864cd569b..62b0d6dea86 100644 --- a/lib/gitlab/usage_data_counters/known_events/epic_events.yml +++ b/lib/gitlab/usage_data_counters/known_events/epic_events.yml @@ -182,3 +182,9 @@ redis_slot: project_management aggregation: daily feature_flag: track_epics_activity + +- name: g_project_management_users_epic_issue_added_from_epic + category: epics_usage + redis_slot: project_management + aggregation: daily + feature_flag: track_epics_activity diff --git a/locale/gitlab.pot b/locale/gitlab.pot index d6f791b64ea..1cdedf752fc 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -7231,12 +7231,6 @@ msgstr "" msgid "ClusterIntegration|Fetching zones" msgstr "" -msgid "ClusterIntegration|Fluentd" -msgstr "" - -msgid "ClusterIntegration|Fluentd is an open source data collector, which lets you unify the data collection and consumption for a better use and understanding of data. It requires at least one of the following logs to be successfully installed." -msgstr "" - msgid "ClusterIntegration|GitLab Agent managed clusters" msgstr "" @@ -7555,15 +7549,6 @@ msgstr "" msgid "ClusterIntegration|Request to begin uninstalling failed" msgstr "" -msgid "ClusterIntegration|SIEM Hostname" -msgstr "" - -msgid "ClusterIntegration|SIEM Port" -msgstr "" - -msgid "ClusterIntegration|SIEM Protocol" -msgstr "" - msgid "ClusterIntegration|Save changes" msgstr "" @@ -7660,9 +7645,6 @@ msgstr "" msgid "ClusterIntegration|Select zone to choose machine type" msgstr "" -msgid "ClusterIntegration|Send Container Network Policies Logs" -msgstr "" - msgid "ClusterIntegration|Service Token" msgstr "" @@ -7684,9 +7666,6 @@ msgstr "" msgid "ClusterIntegration|Something went wrong while installing %{title}" msgstr "" -msgid "ClusterIntegration|Something went wrong while trying to save your settings. Please try again." -msgstr "" - msgid "ClusterIntegration|Something went wrong while uninstalling %{title}" msgstr "" @@ -26600,9 +26579,6 @@ msgstr "" msgid "Protip: %{linkStart}Auto DevOps%{linkEnd} uses Kubernetes clusters to deploy your code!" msgstr "" -msgid "Protocol" -msgstr "" - msgid "Provider" msgstr "" diff --git a/spec/features/issues/issue_sidebar_spec.rb b/spec/features/issues/issue_sidebar_spec.rb index 1512504b93c..d828b1c1f0c 100644 --- a/spec/features/issues/issue_sidebar_spec.rb +++ b/spec/features/issues/issue_sidebar_spec.rb @@ -266,7 +266,7 @@ RSpec.describe 'Issue Sidebar' do let_it_be(:milestone3) { create(:milestone, project: project, title: 'Milestone-3', due_date: 10.days.from_now) } before do - page.within('.block.milestone > .title') do + page.within('[data-testid="milestone_title"]') do click_on 'Edit' end end diff --git a/spec/features/issues/user_edits_issue_spec.rb b/spec/features/issues/user_edits_issue_spec.rb index cb4a5a32762..c59cc99467c 100644 --- a/spec/features/issues/user_edits_issue_spec.rb +++ b/spec/features/issues/user_edits_issue_spec.rb @@ -187,7 +187,8 @@ RSpec.describe "Issues > User edits issue", :js do click_link 'Edit' click_link 'Unassigned' - first('.title').click + + close_dropdown_menu_if_visible expect(page).to have_content 'None - assign yourself' end @@ -227,7 +228,7 @@ RSpec.describe "Issues > User edits issue", :js do close_dropdown_menu_if_visible - page.within '.value .assign-yourself' do + page.within '[data-testid="no-value"]' do expect(page).to have_content "None" end end diff --git a/spec/frontend/clusters/components/applications_spec.js b/spec/frontend/clusters/components/applications_spec.js index e371ad998d2..511f5fc1d89 100644 --- a/spec/frontend/clusters/components/applications_spec.js +++ b/spec/frontend/clusters/components/applications_spec.js @@ -2,7 +2,6 @@ import { shallowMount, mount } from '@vue/test-utils'; import ApplicationRow from '~/clusters/components/application_row.vue'; import Applications from '~/clusters/components/applications.vue'; import CrossplaneProviderStack from '~/clusters/components/crossplane_provider_stack.vue'; -import FluentdOutputSettings from '~/clusters/components/fluentd_output_settings.vue'; import KnativeDomainEditor from '~/clusters/components/knative_domain_editor.vue'; import { CLUSTER_TYPE, PROVIDER_TYPE } from '~/clusters/constants'; import eventHub from '~/clusters/event_hub'; @@ -71,9 +70,6 @@ describe('Applications', () => { expect(wrapper.find('.js-cluster-application-row-elastic_stack').exists()).toBe(true); }); - it('renders a row for Fluentd', () => { - expect(wrapper.find('.js-cluster-application-row-fluentd').exists()).toBe(true); - }); it('renders a row for Cilium', () => { expect(wrapper.find('.js-cluster-application-row-cilium').exists()).toBe(true); }); @@ -116,10 +112,6 @@ describe('Applications', () => { expect(wrapper.find('.js-cluster-application-row-elastic_stack').exists()).toBe(true); }); - it('renders a row for Fluentd', () => { - expect(wrapper.find('.js-cluster-application-row-fluentd').exists()).toBe(true); - }); - it('renders a row for Cilium', () => { expect(wrapper.find('.js-cluster-application-row-cilium').exists()).toBe(true); }); @@ -162,10 +154,6 @@ describe('Applications', () => { expect(wrapper.find('.js-cluster-application-row-elastic_stack').exists()).toBe(true); }); - it('renders a row for Fluentd', () => { - expect(wrapper.find('.js-cluster-application-row-fluentd').exists()).toBe(true); - }); - it('renders a row for Cilium', () => { expect(wrapper.find('.js-cluster-application-row-cilium').exists()).toBe(true); }); @@ -220,7 +208,6 @@ describe('Applications', () => { jupyter: { title: 'JupyterHub', hostname: '' }, knative: { title: 'Knative', hostname: '' }, elastic_stack: { title: 'Elastic Stack' }, - fluentd: { title: 'Fluentd' }, cilium: { title: 'GitLab Container Network Policies' }, }, }); @@ -514,14 +501,6 @@ describe('Applications', () => { }); }); - describe('Fluentd application', () => { - beforeEach(() => createShallowComponent()); - - it('renders the correct Component', () => { - expect(wrapper.find(FluentdOutputSettings).exists()).toBe(true); - }); - }); - describe('Cilium application', () => { it('shows the correct description', () => { createComponent({ propsData: { ciliumHelpPath: 'cilium-help-path' } }); diff --git a/spec/frontend/clusters/components/fluentd_output_settings_spec.js b/spec/frontend/clusters/components/fluentd_output_settings_spec.js deleted file mode 100644 index fdb67a0426a..00000000000 --- a/spec/frontend/clusters/components/fluentd_output_settings_spec.js +++ /dev/null @@ -1,183 +0,0 @@ -import { GlAlert, GlDropdown, GlFormCheckbox } from '@gitlab/ui'; -import { shallowMount } from '@vue/test-utils'; -import FluentdOutputSettings from '~/clusters/components/fluentd_output_settings.vue'; -import { APPLICATION_STATUS, FLUENTD } from '~/clusters/constants'; -import eventHub from '~/clusters/event_hub'; - -const { UPDATING } = APPLICATION_STATUS; - -describe('FluentdOutputSettings', () => { - let wrapper; - - const defaultSettings = { - protocol: 'tcp', - host: '127.0.0.1', - port: 514, - ciliumLogEnabled: false, - }; - const defaultProps = { - status: 'installable', - updateFailed: false, - ...defaultSettings, - }; - - const createComponent = (props = {}) => { - wrapper = shallowMount(FluentdOutputSettings, { - propsData: { - ...defaultProps, - ...props, - }, - }); - }; - const updateComponentPropsFromEvent = () => { - const { isEditingSettings, ...props } = eventHub.$emit.mock.calls[0][1]; - wrapper.setProps(props); - }; - const findSaveButton = () => wrapper.find({ ref: 'saveBtn' }); - const findCancelButton = () => wrapper.find({ ref: 'cancelBtn' }); - const findProtocolDropdown = () => wrapper.find(GlDropdown); - const findCheckbox = (name) => - wrapper.findAll(GlFormCheckbox).wrappers.find((x) => x.text() === name); - const findHost = () => wrapper.find('#fluentd-host'); - const findPort = () => wrapper.find('#fluentd-port'); - const changeCheckbox = (checkbox) => { - const currentValue = checkbox.attributes('checked')?.toString() === 'true'; - checkbox.vm.$emit('input', !currentValue); - }; - const changeInput = ({ element }, val) => { - element.value = val; - element.dispatchEvent(new Event('input')); - }; - const changePort = (val) => changeInput(findPort(), val); - const changeHost = (val) => changeInput(findHost(), val); - const changeProtocol = (idx) => findProtocolDropdown().vm.$children[idx].$emit('click'); - const toApplicationSettings = ({ ciliumLogEnabled, ...settings }) => ({ - ...settings, - cilium_log_enabled: ciliumLogEnabled, - }); - - describe('when fluentd is installed', () => { - beforeEach(() => { - createComponent({ status: 'installed' }); - jest.spyOn(eventHub, '$emit'); - }); - - it('does not render save and cancel buttons', () => { - expect(findSaveButton().exists()).toBe(false); - expect(findCancelButton().exists()).toBe(false); - }); - - describe.each` - desc | changeFn | key | value - ${'when protocol dropdown is triggered'} | ${() => changeProtocol(1)} | ${'protocol'} | ${'udp'} - ${'when host is changed'} | ${() => changeHost('test-host')} | ${'host'} | ${'test-host'} - ${'when port is changed'} | ${() => changePort(123)} | ${'port'} | ${123} - ${'when ciliumLogEnabled changes'} | ${() => changeCheckbox(findCheckbox('Send Container Network Policies Logs'))} | ${'ciliumLogEnabled'} | ${!defaultSettings.ciliumLogEnabled} - `('$desc', ({ changeFn, key, value }) => { - beforeEach(() => { - changeFn(); - }); - - it('triggers set event to be propagated with the current value', () => { - expect(eventHub.$emit).toHaveBeenCalledWith('setFluentdSettings', { - [key]: value, - isEditingSettings: true, - }); - }); - - describe('when value is updated from store', () => { - beforeEach(() => { - updateComponentPropsFromEvent(); - }); - - it('enables save and cancel buttons', () => { - expect(findSaveButton().exists()).toBe(true); - expect(findSaveButton().attributes().disabled).toBeUndefined(); - expect(findCancelButton().exists()).toBe(true); - expect(findCancelButton().attributes().disabled).toBeUndefined(); - }); - - describe('and the save changes button is clicked', () => { - beforeEach(() => { - eventHub.$emit.mockClear(); - findSaveButton().vm.$emit('click'); - }); - - it('triggers save event and pass current values', () => { - expect(eventHub.$emit).toHaveBeenCalledWith('updateApplication', { - id: FLUENTD, - params: toApplicationSettings({ - ...defaultSettings, - [key]: value, - }), - }); - }); - }); - - describe('and the cancel button is clicked', () => { - beforeEach(() => { - eventHub.$emit.mockClear(); - findCancelButton().vm.$emit('click'); - }); - - it('triggers reset event', () => { - expect(eventHub.$emit).toHaveBeenCalledWith('setFluentdSettings', { - ...defaultSettings, - isEditingSettings: false, - }); - }); - - describe('when value is updated from store', () => { - beforeEach(() => { - updateComponentPropsFromEvent(); - }); - - it('does not render save and cancel buttons', () => { - expect(findSaveButton().exists()).toBe(false); - expect(findCancelButton().exists()).toBe(false); - }); - }); - }); - }); - }); - - describe(`when fluentd status is ${UPDATING}`, () => { - beforeEach(() => { - createComponent({ installed: true, status: UPDATING }); - }); - - it('renders loading spinner in save button', () => { - expect(findSaveButton().props('loading')).toBe(true); - }); - - it('renders disabled save button', () => { - expect(findSaveButton().props('disabled')).toBe(true); - }); - - it('renders save button with "Saving" label', () => { - expect(findSaveButton().text()).toBe('Saving'); - }); - }); - - describe('when fluentd fails to update', () => { - beforeEach(() => { - createComponent({ updateFailed: true }); - }); - - it('displays a error message', () => { - expect(wrapper.find(GlAlert).exists()).toBe(true); - }); - }); - }); - - describe('when fluentd is not installed', () => { - beforeEach(() => { - createComponent(); - }); - - it('does not render the save button', () => { - expect(findSaveButton().exists()).toBe(false); - expect(findCancelButton().exists()).toBe(false); - }); - }); -}); diff --git a/spec/frontend/clusters/services/mock_data.js b/spec/frontend/clusters/services/mock_data.js index 6ab94d6d95b..a75fcb0cb06 100644 --- a/spec/frontend/clusters/services/mock_data.js +++ b/spec/frontend/clusters/services/mock_data.js @@ -161,7 +161,6 @@ const APPLICATIONS_MOCK_STATE = { jupyter: { title: 'JupyterHub', status: 'installable', hostname: '' }, knative: { title: 'Knative ', status: 'installable', hostname: '' }, elastic_stack: { title: 'Elastic Stack', status: 'installable' }, - fluentd: { title: 'Fluentd', status: 'installable' }, cilium: { title: 'GitLab Container Network Policies', status: 'not_installable', diff --git a/spec/frontend/clusters/stores/clusters_store_spec.js b/spec/frontend/clusters/stores/clusters_store_spec.js index 8fa373349b8..cdba6fc6ab8 100644 --- a/spec/frontend/clusters/stores/clusters_store_spec.js +++ b/spec/frontend/clusters/stores/clusters_store_spec.js @@ -122,24 +122,6 @@ describe('Clusters Store', () => { uninstallFailed: false, validationError: null, }, - fluentd: { - title: 'Fluentd', - status: null, - statusReason: null, - requestReason: null, - port: null, - ciliumLogEnabled: null, - host: null, - protocol: null, - installable: true, - installed: false, - isEditingSettings: false, - installFailed: false, - uninstallable: false, - uninstallSuccessful: false, - uninstallFailed: false, - validationError: null, - }, jupyter: { title: 'JupyterHub', status: mockResponseData.applications[4].status, diff --git a/spec/frontend/sidebar/assignees_spec.js b/spec/frontend/sidebar/assignees_spec.js index 74dce499999..be27a800418 100644 --- a/spec/frontend/sidebar/assignees_spec.js +++ b/spec/frontend/sidebar/assignees_spec.js @@ -19,7 +19,7 @@ describe('Assignee component', () => { }); }; - const findComponentTextNoUsers = () => wrapper.find('.assign-yourself'); + const findComponentTextNoUsers = () => wrapper.find('[data-testid="no-value"]'); const findCollapsedChildren = () => wrapper.findAll('.sidebar-collapsed-icon > *'); afterEach(() => { @@ -64,7 +64,7 @@ describe('Assignee component', () => { }); jest.spyOn(wrapper.vm, '$emit'); - wrapper.find('.assign-yourself .btn-link').trigger('click'); + wrapper.find('[data-testid="assign-yourself"]').trigger('click'); return wrapper.vm.$nextTick().then(() => { expect(wrapper.emitted('assign-self')).toBeTruthy(); diff --git a/spec/lib/gitlab/import_export/all_models.yml b/spec/lib/gitlab/import_export/all_models.yml index b6d89bd13c4..8d27e61450b 100644 --- a/spec/lib/gitlab/import_export/all_models.yml +++ b/spec/lib/gitlab/import_export/all_models.yml @@ -345,7 +345,6 @@ project: - external_approval_rules - taggings - base_tags -- tags - topic_taggings - topics - chat_services diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index f70f4eafb6b..48353323fb2 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -6930,11 +6930,6 @@ RSpec.describe Project, factory_default: :keep do it 'tag_list returns correct string array' do expect(project.tag_list).to match_array(%w[topic1 topic2 topic3]) end - - it 'tags returns correct tag records' do - expect(project.tags.first.class.name).to eq('ActsAsTaggableOn::Tag') - expect(project.tags.map(&:name)).to match_array(%w[topic1 topic2 topic3]) - end end end |