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 #34673

Merged
merged 61 commits into from
Apr 19, 2019
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
61 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
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
5 changes: 5 additions & 0 deletions github_checks_reporter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"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 @@ -254,6 +254,7 @@
"@babel/parser": "^7.3.4",
"@babel/types": "^7.3.4",
"@elastic/eslint-config-kibana": "0.15.0",
"@elastic/github-checks-reporter": "0.0.1",
"@elastic/makelogs": "^4.4.0",
"@kbn/es": "1.0.0",
"@kbn/eslint-import-resolver-kibana": "2.0.0",
Expand Down
5 changes: 5 additions & 0 deletions src/dev/ci_setup/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,8 @@ if [ "$GIT_CHANGES" ]; then
echo -e "$GIT_CHANGES\n"
exit 1
fi

###
### for github-checks-reporter
###
export GITHUB_CHECKS_REPORTER_ID=26774
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels like this should go in github_checks_reporter.json

61 changes: 39 additions & 22 deletions tasks/config/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,77 +62,88 @@ module.exports = function (grunt) {
'--server.port=5610',
];

const githubChecksReporter = title => ['run', 'github-checks-reporter', title, 'node'];
const YARN = 'yarn';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should clean this up a bit by defining each task config with a helper, rather than splitting up the responsibilities into such tiny chunks.

I also think we should avoid using the grunt config identifiers. I'd prefer if the names of each of these checks represented the script that used to execute them, maybe by using the script filename as the check name, like scripts/eslint and scripts/check_file_casing.

I assume something like scripts/functional_tests --config test/api_integration/config.js doesn't fit well in the Github UI, so maybe we should create scripts/test_api_integration, scripts/test_server_integration, etc. which basically just set default arguments for scripts/functional_tests, and then use them... We might want to set this up as a separate effort though.

eslint: scriptWithGithubChecks({
  name: 'eslint',
  args: ['--no-cache']
}),

apiIntegrationTests: scriptWithGithubChecks({
  name: 'scripts/functional_tests',
  title: 'API Integration Tests',
  args: [
    '--config', 'test/api_integration/config.js',
    '--bail',
    '--debug'
  ]
})
const scriptWithGithubChecks = ({ name, title = name, args = [] }) => ({
  cmd: 'yarn',
  args: [
    'run',
    'github-checks-reporter',
    `scripts/${name}`,
    'node',
    `scripts/${name}`
    ...args
  ]
})


return {
// used by the test and jenkins:unit tasks
// runs the eslint script to check for linting errors
eslint: {
cmd: process.execPath,
cmd: YARN,
args: [
require.resolve('../../scripts/eslint'),
...githubChecksReporter('eslint'),
'scripts/eslint',
'--no-cache'
]
},

sasslint: {
cmd: process.execPath,
cmd: YARN,
args: [
require.resolve('../../scripts/sasslint')
...githubChecksReporter('sasslint'),
'scripts/sasslint'
]
},

// used by the test tasks
// runs the check_file_casing script to ensure filenames use correct casing
checkFileCasing: {
cmd: process.execPath,
cmd: YARN,
args: [
require.resolve('../../scripts/check_file_casing'),
...githubChecksReporter('checkFileCasing'),
'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,
cmd: YARN,
args: [
require.resolve('../../scripts/check_core_api_changes')
...githubChecksReporter('checkCoreApiChange'),
'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,
cmd: YARN,
args: [
require.resolve('../../scripts/type_check')
...githubChecksReporter('typeCheck'),
'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,
cmd: YARN,
args: [
require.resolve('../../scripts/check_ts_projects')
...githubChecksReporter('checkTsProjects'),
'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,
cmd: YARN,
args: [
require.resolve('../../scripts/i18n_check'),
...githubChecksReporter('i18nCheck'),
'scripts/i18n_check',
'--ignore-missing',
]
},

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

Expand Down Expand Up @@ -179,16 +190,18 @@ module.exports = function (grunt) {
options: {
wait: true,
},
cmd: process.execPath,
cmd: YARN,
args: [
...githubChecksReporter('verifyNotice'),
'scripts/notice',
'--validate'
]
},

apiIntegrationTests: {
cmd: process.execPath,
cmd: YARN,
args: [
...githubChecksReporter('apiIntegrationTests'),
'scripts/functional_tests',
'--config', 'test/api_integration/config.js',
'--bail',
Expand All @@ -197,8 +210,9 @@ module.exports = function (grunt) {
},

serverIntegrationTests: {
cmd: process.execPath,
cmd: YARN,
args: [
...githubChecksReporter('serverIntegrationTests'),
'scripts/functional_tests',
'--config', 'test/server_integration/http/ssl/config.js',
'--config', 'test/server_integration/http/ssl_redirect/config.js',
Expand All @@ -209,8 +223,9 @@ module.exports = function (grunt) {
},

interpreterFunctionalTestsRelease: {
cmd: process.execPath,
cmd: YARN,
args: [
...githubChecksReporter('interpreterFunctionalTestsRelease'),
'scripts/functional_tests',
'--config', 'test/interpreter_functional/config.js',
'--bail',
Expand All @@ -220,8 +235,9 @@ module.exports = function (grunt) {
},

pluginFunctionalTestsRelease: {
cmd: process.execPath,
cmd: YARN,
args: [
...githubChecksReporter('pluginFunctionalTestsRelease'),
'scripts/functional_tests',
'--config', 'test/plugin_functional/config.js',
'--bail',
Expand All @@ -231,8 +247,9 @@ module.exports = function (grunt) {
},

functionalTests: {
cmd: process.execPath,
cmd: YARN,
args: [
...githubChecksReporter('functionalTests'),
'scripts/functional_tests',
'--config', 'test/functional/config.js',
'--bail',
Expand Down
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}";
yarn run github-checks-reporter "functionalTests_ciGroup${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;
yarn run github-checks-reporter "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 github-checks-reporter "pluginFunctionalTestsRelease" yarn run grunt run:pluginFunctionalTestsRelease --from=source;
yarn run github-checks-reporter "interpreterFunctionalTestsRelease" 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
yarn run github-checks-reporter "xpack:mocha" yarn test
echo ""
echo ""

echo " -> Running jest tests"
cd "$XPACK_DIR"
node scripts/jest --ci --no-cache --verbose
yarn run github-checks-reporter "xpack: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"
yarn run github-checks-reporter "xpack:functionalTests_ciGroup${CI_GROUP}" node scripts/functional_tests --debug --bail --kibana-install-dir "$installDir" --include-tag "ciGroup$CI_GROUP"
echo ""
echo ""
Loading