Skip to content

Commit

Permalink
Gets rid of github-checks-reporter
Browse files Browse the repository at this point in the history
Signed-off-by: Miki <[email protected]>
  • Loading branch information
AMoo-Miki committed Dec 22, 2022
1 parent 5764d6c commit aed7d21
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 511 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@
"@elastic/eslint-config-kibana": "0.15.0",
"@elastic/eslint-plugin-eui": "0.0.2",
"@elastic/filesaver": "1.1.2",
"@elastic/github-checks-reporter": "0.0.20b3",
"@elastic/makelogs": "^6.1.0",
"@microsoft/api-documenter": "^7.13.78",
"@microsoft/api-extractor": "^7.19.3",
Expand Down
23 changes: 1 addition & 22 deletions src/dev/ci_setup/setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,13 @@ yarn config set yarn-offline-mirror "$cacheDir/yarn-offline-cache"
yarnGlobalDir="$(yarn global bin)"
export PATH="$PATH:$yarnGlobalDir"

# TODO: Find out if these are OSD's or if this entire file should be removed
# use a proxy to fetch chromedriver/geckodriver asset
export GECKODRIVER_CDNURL="https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache"
export CHROMEDRIVER_CDNURL="https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache"
export RE2_DOWNLOAD_MIRROR="https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache"
export CYPRESS_DOWNLOAD_MIRROR="https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/cypress"

export CHECKS_REPORTER_ACTIVE=false

# This is mainly for release-manager builds, which run in an environment that doesn't have Chrome installed
if [[ "$(which google-chrome-stable)" || "$(which google-chrome)" ]]; then
echo "Chrome detected, setting DETECT_CHROMEDRIVER_VERSION=true"
Expand All @@ -143,26 +142,6 @@ else
echo "Chrome not detected, installing default chromedriver binary for the package version"
fi

### only run on pr jobs for opensearch-project/OpenSearch-Dashboards, checks-reporter doesn't work for other repos
if [[ "$ghprbPullId" && "$ghprbGhRepository" == 'opensearch-project/OpenSearch-Dashboards' ]] ; then
export CHECKS_REPORTER_ACTIVE=true
fi

###
### Implements github-checks-reporter kill switch when scripts are called from the command line
### $@ - all arguments
###
function checks-reporter-with-killswitch() {
if [ "$CHECKS_REPORTER_ACTIVE" == "true" ] ; then
yarn run github-checks-reporter "$@"
else
arguments=("$@");
"${arguments[@]:1}";
fi
}

export -f checks-reporter-with-killswitch

source "$OPENSEARCH_DASHBOARDS_DIR/src/dev/ci_setup/load_env_keys.sh"

OPENSEARCH_DIR="$WORKSPACE/opensearch"
Expand Down
132 changes: 52 additions & 80 deletions tasks/config/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,107 +38,82 @@ const OPENSEARCH_DASHBOARDS_INSTALL_DIR =
module.exports = function () {
const NODE = 'node';
const YARN = 'yarn';
const scriptWithGithubChecks = ({ title, options, cmd, args }) =>
process.env.CHECKS_REPORTER_ACTIVE === 'true'
? {
options,
cmd: YARN,
args: ['run', 'github-checks-reporter', title, cmd, ...args],
}
: { options, cmd, args };
const gruntTaskWithGithubChecks = (title, task) =>
scriptWithGithubChecks({
title,
cmd: YARN,
args: ['run', 'grunt', task],
});

return {
// used by the test and jenkins:unit tasks
// runs the eslint script to check for linting errors
eslint: scriptWithGithubChecks({
title: 'eslint',
eslint: {
cmd: NODE,
args: ['scripts/eslint', '--no-cache'],
}),
},

stylelint: scriptWithGithubChecks({
title: 'stylelint',
stylelint: {
cmd: NODE,
args: ['scripts/stylelint'],
}),
},

// used by the test tasks
// runs the check_file_casing script to ensure filenames use correct casing
checkFileCasing: scriptWithGithubChecks({
title: 'Check file casing',
checkFileCasing: {
cmd: NODE,
args: [
'scripts/check_file_casing',
'--quiet', // only log errors, not warnings
],
}),
},

// used by the test tasks
// runs the check_lockfile_symlinks script to ensure manifests with non-dev dependencies have adjacent lockfile symlinks
checkLockfileSymlinks: scriptWithGithubChecks({
title: 'Check lockfile symlinks',
checkLockfileSymlinks: {
cmd: NODE,
args: [
'scripts/check_lockfile_symlinks',
'--quiet', // only log errors, not warnings
],
}),
},

// used by the test tasks
// runs the check_published_api_changes script to ensure API changes are explictily accepted
checkDocApiChanges: scriptWithGithubChecks({
title: 'Check core API changes',
checkDocApiChanges: {
cmd: NODE,
args: ['scripts/check_published_api_changes'],
}),
},

// used by the test and jenkins:unit tasks
// runs the typecheck script to check for Typescript type errors
typeCheck: scriptWithGithubChecks({
title: 'Type check',
typeCheck: {
cmd: NODE,
args: ['scripts/type_check'],
}),
},

// used by the test and jenkins:unit tasks
// ensures that all typescript files belong to a typescript project
checkTsProjects: scriptWithGithubChecks({
title: 'TypeScript - all files belong to a TypeScript project',
checkTsProjects: {
cmd: NODE,
args: ['scripts/check_ts_projects'],
}),
},

// used by the test and jenkins:unit tasks
// runs the i18n_check script to check i18n engine usage
i18nCheck: scriptWithGithubChecks({
title: 'Internationalization check',
i18nCheck: {
cmd: NODE,
args: ['scripts/i18n_check', '--ignore-missing'],
}),
},

telemetryCheck: scriptWithGithubChecks({
title: 'Telemetry Schema check',
telemetryCheck: {
cmd: NODE,
args: ['scripts/telemetry_check'],
}),
},

// used by the test:quick task
// runs all node.js/server mocha tests
mocha: scriptWithGithubChecks({
title: 'Mocha tests',
mocha: {
cmd: NODE,
args: ['scripts/mocha'],
}),
},

// used by the test:mochaCoverage task
mochaCoverage: scriptWithGithubChecks({
title: 'Mocha tests coverage',
mochaCoverage: {
cmd: YARN,
args: [
'nyc',
Expand All @@ -147,25 +122,22 @@ module.exports = function () {
NODE,
'scripts/mocha',
],
}),
},

verifyNotice: scriptWithGithubChecks({
title: 'Verify NOTICE.txt',
verifyNotice: {
options: {
wait: true,
},
cmd: NODE,
args: ['scripts/notice', '--validate'],
}),
},

test_hardening: scriptWithGithubChecks({
title: 'Node.js hardening tests',
test_hardening: {
cmd: NODE,
args: ['scripts/test_hardening.js'],
}),
},

apiIntegrationTests: scriptWithGithubChecks({
title: 'API integration tests',
apiIntegrationTests: {
cmd: NODE,
args: [
'scripts/functional_tests',
Expand All @@ -174,10 +146,9 @@ module.exports = function () {
'--bail',
'--debug',
],
}),
},

serverIntegrationTests: scriptWithGithubChecks({
title: 'Server integration tests',
serverIntegrationTests: {
cmd: NODE,
args: [
'scripts/functional_tests',
Expand All @@ -196,10 +167,9 @@ module.exports = function () {
'--opensearch-dashboards-install-dir',
OPENSEARCH_DASHBOARDS_INSTALL_DIR,
],
}),
},

interpreterFunctionalTestsRelease: scriptWithGithubChecks({
title: 'Interpreter functional tests',
interpreterFunctionalTestsRelease: {
cmd: NODE,
args: [
'scripts/functional_tests',
Expand All @@ -210,10 +180,9 @@ module.exports = function () {
'--opensearch-dashboards-install-dir',
OPENSEARCH_DASHBOARDS_INSTALL_DIR,
],
}),
},

pluginFunctionalTestsRelease: scriptWithGithubChecks({
title: 'Plugin functional tests',
pluginFunctionalTestsRelease: {
cmd: NODE,
args: [
'scripts/functional_tests',
Expand All @@ -222,10 +191,9 @@ module.exports = function () {
'--bail',
'--debug',
],
}),
},

exampleFunctionalTestsRelease: scriptWithGithubChecks({
title: 'Example functional tests',
exampleFunctionalTestsRelease: {
cmd: NODE,
args: [
'scripts/functional_tests',
Expand All @@ -234,10 +202,9 @@ module.exports = function () {
'--bail',
'--debug',
],
}),
},

functionalTests: scriptWithGithubChecks({
title: 'Functional tests',
functionalTests: {
cmd: NODE,
args: [
'scripts/functional_tests',
Expand All @@ -246,20 +213,25 @@ module.exports = function () {
'--bail',
'--debug',
],
}),
},

licenses: scriptWithGithubChecks({
title: 'Check licenses',
licenses: {
cmd: NODE,
args: ['scripts/check_licenses', '--dev'],
}),
},

test_jest: gruntTaskWithGithubChecks('Jest tests', 'test:jest'),
test_jest_integration: gruntTaskWithGithubChecks(
'Jest integration tests',
'test:jest_integration'
),
test_projects: gruntTaskWithGithubChecks('Project tests', 'test:projects'),
test_jest: {
cmd: YARN,
args: ['run', 'grunt', 'test:jest'],
},
test_jest_integration: {
cmd: YARN,
args: ['run', 'grunt', 'test:jest_integration'],
},
test_projects: {
cmd: YARN,
args: ['run', 'grunt', 'test:projects'],
},

...getFunctionalTestGroupRunConfigs({
opensearchDashboardsInstallDir: OPENSEARCH_DASHBOARDS_INSTALL_DIR,
Expand Down
Loading

0 comments on commit aed7d21

Please sign in to comment.