Skip to content

Commit a2b30b4

Browse files
committed
Add proper args per spec and
fixup names.
1 parent ca8736a commit a2b30b4

File tree

3 files changed

+16
-15
lines changed

3 files changed

+16
-15
lines changed

src/dev/code_coverage/ingest_coverage/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ export const TEAM_ASSIGNMENT_PIPELINE_NAME = process.env.PIPELINE_NAME || 'team_
3232
export const CODE_COVERAGE_CI_JOB_NAME = 'elastic+kibana+code-coverage';
3333
export const RESEARCH_CI_JOB_NAME = 'elastic+kibana+qa-research';
3434
export const CI_JOB_NAME = process.env.COVERAGE_JOB_NAME || RESEARCH_CI_JOB_NAME;
35-
export const RESEARCH_CLUSTER_ES_HOST = process.env.ES_HOST || 'http://localhost:9200';
35+
export const ES_HOST = process.env.ES_HOST || 'http://localhost:9200';

src/dev/code_coverage/ingest_coverage/team_assignment/index.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,30 @@
2020
import { run } from '@kbn/dev-utils';
2121
import { TEAM_ASSIGNMENT_PIPELINE_NAME } from '../constants';
2222
import { fetch } from './get_data';
23-
// import { noop } from '../utils';
23+
import { noop } from '../utils';
2424
import { update } from './update_ingest_pipeline';
2525

26-
export const uploadTeamAssignmentJson = () => run(execute, { description });
27-
2826
const updatePipeline = update(TEAM_ASSIGNMENT_PIPELINE_NAME);
2927

30-
function execute({ flags, log }) {
28+
const execute = ({ flags, log }) => {
3129
if (flags.verbose) log.verbose(`### Verbose logging enabled`);
3230

33-
fetch().fold((leftX) => log.error(`\n### Left: ${leftX}`), updatePipeline(log));
34-
}
31+
fetch().fold(noop, updatePipeline(log));
32+
};
3533

36-
function description() {
37-
return `
34+
const description = `
3835
3936
Upload the latest team assignment pipeline def from src,
4037
to the cluster.
4138
39+
`;
4240

43-
Examples:
41+
const flags = {
42+
help: `
43+
--path Required, path to the file to extract coverage data
44+
`,
45+
};
4446

45-
node scripts/load_team_assignment.js --verbose
47+
const usage = 'node scripts/load_team_assignment.js --verbose';
4648

47-
`;
48-
}
49+
export const uploadTeamAssignmentJson = () => run(execute, { description, flags, usage });

src/dev/code_coverage/ingest_coverage/team_assignment/update_ingest_pipeline.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
*/
1919

2020
import { createFailError } from '@kbn/dev-utils';
21-
import { RESEARCH_CLUSTER_ES_HOST } from '../constants';
21+
import { ES_HOST } from '../constants';
2222
import { pretty, green } from '../utils';
2323

2424
const { Client } = require('@elastic/elasticsearch');
2525

26-
const node = RESEARCH_CLUSTER_ES_HOST;
26+
const node = ES_HOST;
2727
const client = new Client({ node });
2828

2929
export const update = (id) => (log) => async (body) => {

0 commit comments

Comments
 (0)