Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implementing github checks - second attempt #35757

Merged
merged 82 commits into from
May 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
05978fb
lets try it as a node module
mattkime Apr 6, 2019
ea16b0b
diagnostic
mattkime Apr 6, 2019
e038dae
lets add yarn bin
mattkime Apr 6, 2019
6c1bed8
lets add yarn bin
mattkime Apr 6, 2019
2cdd558
poking around
mattkime Apr 6, 2019
32fc41e
can we find eslint in path?
mattkime Apr 6, 2019
13295b0
blah blah blah computers are dumb
mattkime Apr 6, 2019
54c092d
comment out a bunch of stuff
mattkime Apr 6, 2019
452786e
which which is which
mattkime Apr 6, 2019
397e61b
provide app id
mattkime Apr 6, 2019
780c119
remove appid from schema for now
mattkime Apr 6, 2019
ba7859c
boooooootstrap
mattkime Apr 6, 2019
bdf8963
commit comments....why even?
mattkime Apr 7, 2019
36f47c3
commit comments....why even?
mattkime Apr 7, 2019
5dc3280
commit comments....why even?
mattkime Apr 7, 2019
c79888e
bump package
mattkime Apr 7, 2019
486700b
bump package
mattkime Apr 7, 2019
85ca6eb
rename config file to support SNAKES
mattkime Apr 7, 2019
eee0c0f
remove unneeded changes
mattkime Apr 7, 2019
4939c73
more checks
mattkime Apr 7, 2019
461d8d9
forgot the spread operator
mattkime Apr 7, 2019
90df9ad
simpler script paths
mattkime Apr 7, 2019
43f3ad5
implement xpack checks
mattkime Apr 7, 2019
3a34748
implement xpack checks
mattkime Apr 7, 2019
30c2bb2
bump package
mattkime Apr 7, 2019
d870d66
bump package
mattkime Apr 7, 2019
f698889
bump package
mattkime Apr 7, 2019
3cb7b0c
fix sample_panel_action thing
mattkime Apr 8, 2019
d10d49d
bump dependency - one config
mattkime Apr 8, 2019
069045b
fix check name and purposely fail eslint
mattkime Apr 8, 2019
2a47f89
use env var for app id
mattkime Apr 8, 2019
0d4e270
yarn.lock
mattkime Apr 8, 2019
a66c85a
fix purposeful mistake
mattkime Apr 9, 2019
fd66398
use correct package
mattkime Apr 11, 2019
29f9279
Merge branch 'github_checks' of github.com:mattkime/kibana into githu…
mattkime Apr 11, 2019
497c404
Merge branch 'master' into github_checks
mattkime Apr 17, 2019
fea3783
move appId to config file, refactor command abstraction
mattkime Apr 17, 2019
2bdf16c
add appId to config file
mattkime Apr 17, 2019
fd9aa69
better human readable title
mattkime Apr 17, 2019
edf31e0
copy changes
mattkime Apr 17, 2019
fd1c3b6
add license test
mattkime Apr 17, 2019
5132ba0
forgot to prefix run to the target
mattkime Apr 18, 2019
c40be8c
apply github-checks-reporter to a couple more items
mattkime Apr 18, 2019
5b6cbc2
fix browser ci
mattkime Apr 18, 2019
3a3e332
bump github-check-reporter - fix time to run calculations
mattkime Apr 18, 2019
2a342cd
respect the yarn.lock file
mattkime Apr 18, 2019
c1553fa
log start and completion time stamps, better summary and text field u…
mattkime Apr 18, 2019
eeb80bb
more debugging info
mattkime Apr 18, 2019
8eb2247
respect the yarn.lock
mattkime Apr 18, 2019
53eddbe
bump gcr version, update checks instead of recreating
mattkime Apr 18, 2019
a70415a
bump gcr to fix check update
mattkime Apr 18, 2019
5e93457
run task cleanup
mattkime Apr 18, 2019
2f499ba
add killswitch
mattkime Apr 18, 2019
2468edf
move checks-reporter-with-killswitch to its own file
mattkime Apr 18, 2019
4518f66
add shebang to functions
mattkime Apr 18, 2019
7afca50
another attempt at sourcing from same dir
mattkime Apr 18, 2019
5754c39
another attempt at sourcing from same dir
mattkime Apr 18, 2019
b6fc022
another attempt at sourcing from same dir
mattkime Apr 18, 2019
3bd63d1
another attempt at sourcing from same dir
mattkime Apr 19, 2019
c1b9aa0
fix killswitch
mattkime Apr 19, 2019
1f3105b
Double quote array expansions to avoid re-splitting elements
mattkime Apr 19, 2019
09cd960
Merge branch 'master' into github_checks
mattkime Apr 29, 2019
4ff2bee
check for boolean value, only run on pr jobs
mattkime Apr 29, 2019
b8d0450
Update setup.sh
mattkime Apr 29, 2019
c13335f
Update run.js
mattkime Apr 29, 2019
6b975cd
Update run.js
mattkime Apr 29, 2019
74c3302
fix conditionals related to killswitch
mattkime Apr 29, 2019
1f62f38
fix conditionals related to killswitch
mattkime Apr 29, 2019
0b9d0a5
apparently env vars become strings even if they are booleans
mattkime Apr 29, 2019
834bd5d
Update setup.sh
mattkime Apr 29, 2019
e51f3cb
Update run.js
mattkime Apr 29, 2019
8de9395
increment github checks reporter
mattkime Apr 30, 2019
a31b1ca
bump github-checks-reporter
mattkime Apr 30, 2019
2aff451
Update run.js
mattkime Apr 30, 2019
5448757
Update setup.sh
mattkime Apr 30, 2019
295d4ba
bump githuck-checks-reporter
mattkime Apr 30, 2019
c3259bc
Update setup.sh
mattkime Apr 30, 2019
586b00e
lint lint
mattkime Apr 30, 2019
92253b2
Merge branch 'github_checks' of github.com:mattkime/kibana into githu…
mattkime Apr 30, 2019
899a482
better kill switch
mattkime Apr 30, 2019
c9fd928
bump github-checks-reporter
mattkime May 1, 2019
2dca82e
Update setup.sh
mattkime May 1, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions github_checks_reporter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"appId": 26774,
"envVars": {
"appKey": "KIBANA_CI_REPORTER_KEY"
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@
"@babel/parser": "^7.3.4",
"@babel/types": "^7.3.4",
"@elastic/eslint-config-kibana": "0.15.0",
"@elastic/github-checks-reporter": "0.0.11",
"@elastic/makelogs": "^4.4.0",
"@kbn/es": "1.0.0",
"@kbn/eslint-import-resolver-kibana": "2.0.0",
Expand Down
25 changes: 25 additions & 0 deletions src/dev/ci_setup/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,28 @@ if [ "$GIT_CHANGES" ]; then
echo -e "$GIT_CHANGES\n"
exit 1
fi

###
### github-checks-reporter kill switch. Remove to disable
###
export CHECKS_REPORTER_ACTIVE=true
spalger marked this conversation as resolved.
Show resolved Hide resolved

### only run on pr jobs
if [[ "$JOB_NAME" != "elastic+kibana+pull-request"* ]] ; then
export CHECKS_REPORTER_ACTIVE=false
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
140 changes: 90 additions & 50 deletions tasks/config/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,79 +62,101 @@ module.exports = function (grunt) {
'--server.port=5610',
];

const NODE = 'node';
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: {
cmd: process.execPath,
eslint: scriptWithGithubChecks({
title: 'eslint',
cmd: NODE,
args: [
require.resolve('../../scripts/eslint'),
'scripts/eslint',
'--no-cache'
]
},
}),

sasslint: {
cmd: process.execPath,
sasslint: scriptWithGithubChecks({
title: 'sasslint',
cmd: NODE,
args: [
require.resolve('../../scripts/sasslint')
'scripts/sasslint'
]
},
}),

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

// used by the test tasks
// runs the check_core_api_changes script to ensure API changes are explictily accepted
checkCoreApiChanges: {
cmd: process.execPath,
checkCoreApiChanges: scriptWithGithubChecks({
title: 'Check core API changes',
cmd: NODE,
args: [
require.resolve('../../scripts/check_core_api_changes')
'scripts/check_core_api_changes'
]
},
}),

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

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

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

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

// used by the test:browser task
// runs the kibana server to serve the browser test bundle
Expand Down Expand Up @@ -175,29 +197,32 @@ module.exports = function (grunt) {
]
}),

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

apiIntegrationTests: {
cmd: process.execPath,
apiIntegrationTests: scriptWithGithubChecks({
title: 'API integration tests',
cmd: NODE,
args: [
'scripts/functional_tests',
'--config', 'test/api_integration/config.js',
'--bail',
'--debug',
],
},
}),

serverIntegrationTests: {
cmd: process.execPath,
serverIntegrationTests: scriptWithGithubChecks({
title: 'Server integration tests',
cmd: NODE,
args: [
'scripts/functional_tests',
'--config', 'test/server_integration/http/ssl/config.js',
Expand All @@ -206,39 +231,54 @@ module.exports = function (grunt) {
'--debug',
'--kibana-install-dir', KIBANA_INSTALL_DIR,
],
},
}),

interpreterFunctionalTestsRelease: {
cmd: process.execPath,
interpreterFunctionalTestsRelease: scriptWithGithubChecks({
title: 'Interpreter functional tests',
cmd: NODE,
args: [
'scripts/functional_tests',
'--config', 'test/interpreter_functional/config.js',
'--bail',
'--debug',
'--kibana-install-dir', KIBANA_INSTALL_DIR,
],
},
}),

pluginFunctionalTestsRelease: {
cmd: process.execPath,
pluginFunctionalTestsRelease: scriptWithGithubChecks({
title: 'Plugin functional tests',
cmd: NODE,
args: [
'scripts/functional_tests',
'--config', 'test/plugin_functional/config.js',
'--bail',
'--debug',
'--kibana-install-dir', KIBANA_INSTALL_DIR,
],
},
}),

functionalTests: {
cmd: process.execPath,
functionalTests: scriptWithGithubChecks({
title: 'Functional tests',
cmd: NODE,
args: [
'scripts/functional_tests',
'--config', 'test/functional/config.js',
'--bail',
'--debug',
],
},
}),

licenses: gruntTaskWithGithubChecks('Licenses', 'licenses'),
verifyDependencyVersions:
gruntTaskWithGithubChecks('Verify dependency versions', 'verifyDependencyVersions'),
test_server:
gruntTaskWithGithubChecks('Server tests', 'test:server'),
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_browser_ci:
gruntTaskWithGithubChecks('Browser tests', 'test:browser-ci'),

...getFunctionalTestGroupRunConfigs({
kibanaInstallDir: KIBANA_INSTALL_DIR
Expand Down
14 changes: 7 additions & 7 deletions tasks/jenkins.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ module.exports = function (grunt) {
'run:typeCheck',
'run:i18nCheck',
'run:checkFileCasing',
'licenses',
'verifyDependencyVersions',
'run:licenses',
'run:verifyDependencyVersions',
'run:verifyNotice',
'test:server',
'test:jest',
'test:jest_integration',
'test:projects',
'test:browser-ci',
'run:test_server',
'run:test_jest',
'run:test_jest_integration',
'run:test_projects',
'run:test_browser_ci',
'run:apiIntegrationTests',
]);
};
8 changes: 4 additions & 4 deletions test/scripts/jenkins_ci_group.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ node scripts/build --debug --oss;

export TEST_BROWSER_HEADLESS=1

"$(FORCE_COLOR=0 yarn bin)/grunt" "run:functionalTests_ciGroup${CI_GROUP}";
checks-reporter-with-killswitch "Functional tests / Group ${CI_GROUP}" yarn run grunt "run:functionalTests_ciGroup${CI_GROUP}";

if [ "$CI_GROUP" == "1" ]; then
# build kbn_tp_sample_panel_action
cd test/plugin_functional/plugins/kbn_tp_sample_panel_action;
yarn build;
checks-reporter-with-killswitch "Build kbn_tp_sample_panel_action" yarn build;
cd -;
"$(FORCE_COLOR=0 yarn bin)/grunt" run:pluginFunctionalTestsRelease --from=source;
"$(FORCE_COLOR=0 yarn bin)/grunt" run:interpreterFunctionalTestsRelease;
yarn run grunt run:pluginFunctionalTestsRelease --from=source;
yarn run grunt run:interpreterFunctionalTestsRelease;
fi
4 changes: 2 additions & 2 deletions test/scripts/jenkins_xpack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ export TEST_BROWSER_HEADLESS=1

echo " -> Running mocha tests"
cd "$XPACK_DIR"
yarn test
checks-reporter-with-killswitch "X-Pack Mocha" yarn test
echo ""
echo ""

echo " -> Running jest tests"
cd "$XPACK_DIR"
node scripts/jest --ci --no-cache --verbose
checks-reporter-with-killswitch "X-Pack Jest" node scripts/jest --ci --no-cache --verbose
echo ""
echo ""

Expand Down
2 changes: 1 addition & 1 deletion test/scripts/jenkins_xpack_ci_group.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ tar -xzf "$linuxBuild" -C "$installDir" --strip=1

echo " -> Running functional and api tests"
cd "$XPACK_DIR"
node scripts/functional_tests --debug --bail --kibana-install-dir "$installDir" --include-tag "ciGroup$CI_GROUP"
checks-reporter-with-killswitch "X-Pack Functional tests / Group ${CI_GROUP}" node scripts/functional_tests --debug --bail --kibana-install-dir "$installDir" --include-tag "ciGroup$CI_GROUP"
echo ""
echo ""
Loading