[APM] chore: Unify naming of 'apm/scripts/**/*' with snake_case (#118328) (#119040)

* [APM] chore: Unify naming of 'apm/scripts/**/*' with snake_case

* Fix wrong path

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kate Patticha <kate@kpatticha.com>
This commit is contained in:
Kibana Machine 2021-11-18 11:25:42 -05:00 committed by GitHub
parent da30f56896
commit 1ae6075740
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 23 additions and 24 deletions

View file

@ -57,7 +57,6 @@ export const IGNORE_FILE_GLOBS = [
// TODO fix file names in APM to remove these
'x-pack/plugins/apm/public/**/*',
'x-pack/plugins/apm/scripts/**/*',
'x-pack/plugins/maps/server/fonts/**/*',

View file

@ -40,7 +40,7 @@ elasticsearch.password: changeme
APM behaves differently depending on which the role and permissions a logged in user has. To create the users run:
```sh
node x-pack/plugins/apm/scripts/create-apm-users-and-roles.js --username admin --password changeme --kibana-url http://localhost:5601 --role-suffix <github-username-or-something-unique>
node x-pack/plugins/apm/scripts/create_apm_users_and_roles.js --username admin --password changeme --kibana-url http://localhost:5601 --role-suffix <github-username-or-something-unique>
```
This will create:

View file

@ -29,7 +29,7 @@ Once uploaded to the telemetry cluster, the data telemetry is stored in
### Generating sample data
The script in `scripts/upload-telemetry-data` can generate sample telemetry data and upload it to a cluster of your choosing.
The script in `scripts/upload_telemetry_data` can generate sample telemetry data and upload it to a cluster of your choosing.
You'll need to set the `GITHUB_TOKEN` environment variable to a token that has `repo` scope so it can read from the
[elastic/telemetry](https://github.com/elastic/telemetry) repository. (You probably have a token that works for this in

View file

@ -4,8 +4,8 @@ Kibana and X-Pack are very large TypeScript projects, and it comes at a cost. Ed
To run the optimization:
`$ node x-pack/plugins/apm/scripts/optimize-tsconfig`
`$ node x-pack/plugins/apm/scripts/optimize_tsconfig`
To undo the optimization:
`$ node x-pack/plugins/apm/scripts/unoptimize-tsconfig`
`$ node x-pack/plugins/apm/scripts/unoptimize_tsconfig`

View file

@ -3,6 +3,6 @@
Some of our API tests use an archive generated by the [`esarchiver`](https://www.elastic.co/guide/en/kibana/current/development-tests.html#development-functional-tests) script. Updating the main archive (`apm_8.0.0`) is a scripted process, where a 30m snapshot is downloaded from a cluster running the [APM Integration Testing server](https://github.com/elastic/apm-integration-testing). The script will copy the generated archives into the `fixtures/es_archiver` folders of our test suites (currently `basic` and `trial`). It will also generate a file that contains metadata about the archive, that can be imported to get the time range of the snapshot.
Usage:
`node x-pack/plugins/apm/scripts/create-functional-tests-archive --es-url=https://admin:changeme@localhost:9200 --kibana-url=https://localhost:5601`
`node x-pack/plugins/apm/scripts/create_functional_tests_archive --es-url=https://admin:changeme@localhost:9200 --kibana-url=https://localhost:5601`

View file

@ -11,7 +11,7 @@ import { argv } from 'yargs';
import Url from 'url';
import cypress from 'cypress';
import { FtrProviderContext } from './ftr_provider_context';
import { createApmUsersAndRoles } from '../scripts/create-apm-users-and-roles/create_apm_users_and_roles';
import { createApmUsersAndRoles } from '../scripts/create_apm_users_and_roles/create_apm_users_and_roles';
import { esArchiverLoad, esArchiverUnload } from './cypress/tasks/es_archiver';
export async function cypressStart(

View file

@ -10,7 +10,7 @@ require('@kbn/optimizer').registerNodeAutoTranspilation();
const {
aggregateLatencyMetrics,
} = require('./aggregate-latency-metrics/index.ts');
} = require('./aggregate_latency_metrics/index.ts');
aggregateLatencyMetrics().catch((err) => {
if (err.meta && err.meta.body) {

View file

@ -24,7 +24,7 @@ import {
TRANSACTION_RESULT,
PROCESSOR_EVENT,
} from '../../common/elasticsearch_fieldnames';
import { createOrUpdateIndex } from '../shared/create-or-update-index';
import { createOrUpdateIndex } from '../shared/create_or_update_index';
import { parseIndexUrl } from '../shared/parse_index_url';
import { ESClient, getEsClient } from '../shared/get_es_client';

View file

@ -20,4 +20,4 @@
// eslint-disable-next-line import/no-extraneous-dependencies
require('@kbn/optimizer').registerNodeAutoTranspilation();
require('./create-apm-users-and-roles/create_apm_users_and_roles_cli.ts');
require('./create_apm_users_and_roles/create_apm_users_and_roles_cli.ts');

View file

@ -9,4 +9,4 @@
// eslint-disable-next-line import/no-extraneous-dependencies
require('@kbn/optimizer').registerNodeAutoTranspilation();
require('./create-functional-tests-archive/index.ts');
require('./create_functional_tests_archive/index.ts');

View file

@ -5,7 +5,7 @@
* 2.0.
*/
const { optimizeTsConfig } = require('./optimize-tsconfig/optimize');
const { optimizeTsConfig } = require('./optimize_tsconfig/optimize');
optimizeTsConfig().catch((err) => {
console.error(err);

View file

@ -110,7 +110,7 @@ async function optimizeTsConfig() {
await setIgnoreChanges();
// eslint-disable-next-line no-console
console.log(
'Created an optimized tsconfig.json for APM. To undo these changes, run `./scripts/unoptimize-tsconfig.js`'
'Created an optimized tsconfig.json for APM. To undo these changes, run `./scripts/unoptimize_tsconfig.js`'
);
}

View file

@ -9,7 +9,7 @@ const path = require('path');
const kibanaRoot = path.resolve(__dirname, '../../../../..');
const tsconfigTpl = path.resolve(__dirname, './tsconfig.json');
const tsconfigTplTest = path.resolve(__dirname, './test-tsconfig.json');
const tsconfigTplTest = path.resolve(__dirname, './test_tsconfig.json');
const filesToIgnore = [
path.resolve(kibanaRoot, 'tsconfig.json'),

View file

@ -40,8 +40,8 @@ const tasks = new Listr(
resolve(
__dirname,
useOptimizedTsConfig
? './optimize-tsconfig.js'
: './unoptimize-tsconfig.js'
? './optimize_tsconfig.js'
: './unoptimize_tsconfig.js'
),
],
execaOpts

View file

@ -5,7 +5,7 @@
* 2.0.
*/
import { KibanaConfig } from './read-kibana-config';
import { KibanaConfig } from './read_kibana_config';
export const getHttpAuth = (config: KibanaConfig) => {
const httpAuth =

View file

@ -5,7 +5,7 @@
* 2.0.
*/
const { unoptimizeTsConfig } = require('./optimize-tsconfig/unoptimize');
const { unoptimizeTsConfig } = require('./optimize_tsconfig/unoptimize');
unoptimizeTsConfig().catch((err) => {
console.error(err);

View file

@ -9,4 +9,4 @@
// eslint-disable-next-line import/no-extraneous-dependencies
require('@kbn/optimizer').registerNodeAutoTranspilation();
require('./upload-telemetry-data/index.ts');
require('./upload_telemetry_data/index.ts');

View file

@ -17,12 +17,12 @@ import { argv } from 'yargs';
import { Logger } from 'kibana/server';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { CollectTelemetryParams } from '../../server/lib/apm_telemetry/collect_data_telemetry';
import { downloadTelemetryTemplate } from '../shared/download-telemetry-template';
import { downloadTelemetryTemplate } from '../shared/download_telemetry_template';
import { mergeApmTelemetryMapping } from '../../common/apm_telemetry';
import { generateSampleDocuments } from './generate-sample-documents';
import { readKibanaConfig } from '../shared/read-kibana-config';
import { getHttpAuth } from '../shared/get-http-auth';
import { createOrUpdateIndex } from '../shared/create-or-update-index';
import { generateSampleDocuments } from './generate_sample_documents';
import { readKibanaConfig } from '../shared/read_kibana_config';
import { getHttpAuth } from '../shared/get_http_auth';
import { createOrUpdateIndex } from '../shared/create_or_update_index';
import { getEsClient } from '../shared/get_es_client';
async function uploadData() {