Skip to content

Commit

Permalink
update functional tests and i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
Bamieh committed Aug 5, 2021
1 parent 4d5fa7e commit 91a8edd
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
17 changes: 12 additions & 5 deletions src/plugins/telemetry/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const clusterEnvSchema: [Type<'prod'>, Type<'staging'>] = [
schema.literal('staging'),
];

export const configSchema = schema.object({
const configSchema = schema.object({
enabled: schema.boolean({ defaultValue: true }),
allowChangingOptInStatus: schema.boolean({ defaultValue: true }),
optIn: schema.conditional(
Expand All @@ -36,6 +36,10 @@ export const configSchema = schema.object({
schema.oneOf(clusterEnvSchema, { defaultValue: 'staging' }),
schema.oneOf(clusterEnvSchema, { defaultValue: 'prod' })
),
/**
* REMOVE IN 8.0 - INTERNAL CONFIG DEPRECATED IN 7.15
* REPLACED WITH `telemetry.sendUsageTo: staging | prod`
*/
url: schema.conditional(
schema.contextRef('dist'),
schema.literal(false), // Point to staging if it's not a distributable release
Expand All @@ -46,6 +50,10 @@ export const configSchema = schema.object({
defaultValue: TELEMETRY_ENDPOINT.MAIN_CHANNEL.PROD,
})
),
/**
* REMOVE IN 8.0 - INTERNAL CONFIG DEPRECATED IN 7.15
* REPLACED WITH `telemetry.sendUsageTo: staging | prod`
*/
optInStatusUrl: schema.conditional(
schema.contextRef('dist'),
schema.literal(false), // Point to staging if it's not a distributable release
Expand Down Expand Up @@ -93,19 +101,18 @@ export const config: PluginConfigDescriptor<TelemetryConfigType> = {
addDeprecation({
message: i18n.translate('telemetry.config.url.deprecationMessage', {
defaultMessage:
'"{{configPath}}" has been deprecated. Set "telemetry.sendUsageTo: staging" to the Kibana configurations to send usage to the staging telemetry cluster.',
'"{configPath}" has been deprecated. Set "telemetry.sendUsageTo: staging" to the Kibana configurations to send usage to the staging endpoint.',
values: { configPath: fullConfigPath },
}),
correctiveActions: {
manualSteps: [
i18n.translate('telemetry.config.url.deprecationManualStep1', {
defaultMessage: 'Remove "{{configPath}}" from the Kibana configuration',
defaultMessage: 'Remove "{configPath}" from the Kibana configuration.',
values: { configPath: fullConfigPath },
}),
i18n.translate('telemetry.config.url.deprecationManualStep2', {
defaultMessage:
'To send usage to staging, add "telemetry.sendUsageTo: staging" to the Kibana configuration.',
values: { configPath: fullConfigPath },
'To send usage to the staging endpoint add "telemetry.sendUsageTo: staging" to the Kibana configuration.',
}),
],
},
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/telemetry/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
* Side Public License, v 1.
*/

import { PluginInitializerContext } from 'kibana/server';
import type { PluginInitializerContext } from 'kibana/server';
import type { TelemetryConfigType } from './config';
import { TelemetryPlugin } from './plugin';
import { TelemetryConfigType } from './config';

export { config } from './config';
export type { TelemetryPluginSetup, TelemetryPluginStart } from './plugin';
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/telemetry/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
registerTelemetryUsageCollector,
registerTelemetryPluginUsageCollector,
} from './collectors';
import { TelemetryConfigType } from './config';
import type { TelemetryConfigType } from './config';
import { FetcherTask } from './fetcher';
import { handleOldSettings } from './handle_old_settings';
import { getTelemetrySavedObject } from './telemetry_repository';
Expand Down
2 changes: 1 addition & 1 deletion test/common/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function () {
'--telemetry.banner=false',
'--telemetry.optIn=false',
// These are *very* important to have them pointing to staging
'--telemetry.sentUsageTo=staging',
'--telemetry.sendUsageTo=staging',
`--server.maxPayload=1679958`,
// newsfeed mock service
`--plugin-path=${path.join(__dirname, 'fixtures', 'plugins', 'newsfeed')}`,
Expand Down

0 comments on commit 91a8edd

Please sign in to comment.