Skip to content

Commit

Permalink
[APM] chore: Unify naming of 'apm/scripts/**/*' with snake_case (elas…
Browse files Browse the repository at this point in the history
…tic#118328)

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

* Fix wrong path

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
kpatticha and kibanamachine authored Nov 16, 2021
1 parent b3d58a4 commit e56627a
Show file tree
Hide file tree
Showing 34 changed files with 23 additions and 24 deletions.
1 change: 0 additions & 1 deletion src/dev/precommit_hook/casing_check_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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/**/*',

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/apm/dev_docs/local_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/apm/dev_docs/telemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/apm/dev_docs/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Original file line number Diff line number Diff line change
Expand Up @@ -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`


2 changes: 1 addition & 1 deletion x-pack/plugins/apm/ftr_e2e/cypress_start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

const { optimizeTsConfig } = require('./optimize-tsconfig/optimize');
const { optimizeTsConfig } = require('./optimize_tsconfig/optimize');

optimizeTsConfig().catch((err) => {
console.error(err);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`'
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/apm/scripts/precommit.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ const tasks = new Listr(
resolve(
__dirname,
useOptimizedTsConfig
? './optimize-tsconfig.js'
: './unoptimize-tsconfig.js'
? './optimize_tsconfig.js'
: './unoptimize_tsconfig.js'
),
],
execaOpts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

const { unoptimizeTsConfig } = require('./optimize-tsconfig/unoptimize');
const { unoptimizeTsConfig } = require('./optimize_tsconfig/unoptimize');

unoptimizeTsConfig().catch((err) => {
console.error(err);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit e56627a

Please sign in to comment.