Skip to content

Commit

Permalink
Add proper args per spec and
Browse files Browse the repository at this point in the history
fixup names.
  • Loading branch information
wayneseymour committed Jul 20, 2020
1 parent ca8736a commit a2b30b4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/dev/code_coverage/ingest_coverage/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ export const TEAM_ASSIGNMENT_PIPELINE_NAME = process.env.PIPELINE_NAME || 'team_
export const CODE_COVERAGE_CI_JOB_NAME = 'elastic+kibana+code-coverage';
export const RESEARCH_CI_JOB_NAME = 'elastic+kibana+qa-research';
export const CI_JOB_NAME = process.env.COVERAGE_JOB_NAME || RESEARCH_CI_JOB_NAME;
export const RESEARCH_CLUSTER_ES_HOST = process.env.ES_HOST || 'http://localhost:9200';
export const ES_HOST = process.env.ES_HOST || 'http://localhost:9200';
25 changes: 13 additions & 12 deletions src/dev/code_coverage/ingest_coverage/team_assignment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,30 @@
import { run } from '@kbn/dev-utils';
import { TEAM_ASSIGNMENT_PIPELINE_NAME } from '../constants';
import { fetch } from './get_data';
// import { noop } from '../utils';
import { noop } from '../utils';
import { update } from './update_ingest_pipeline';

export const uploadTeamAssignmentJson = () => run(execute, { description });

const updatePipeline = update(TEAM_ASSIGNMENT_PIPELINE_NAME);

function execute({ flags, log }) {
const execute = ({ flags, log }) => {
if (flags.verbose) log.verbose(`### Verbose logging enabled`);

fetch().fold((leftX) => log.error(`\n### Left: ${leftX}`), updatePipeline(log));
}
fetch().fold(noop, updatePipeline(log));
};

function description() {
return `
const description = `
Upload the latest team assignment pipeline def from src,
to the cluster.
`;

Examples:
const flags = {
help: `
--path Required, path to the file to extract coverage data
`,
};

node scripts/load_team_assignment.js --verbose
const usage = 'node scripts/load_team_assignment.js --verbose';

`;
}
export const uploadTeamAssignmentJson = () => run(execute, { description, flags, usage });
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
*/

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

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

const node = RESEARCH_CLUSTER_ES_HOST;
const node = ES_HOST;
const client = new Client({ node });

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

0 comments on commit a2b30b4

Please sign in to comment.