kibana/vars/tasks.groovy

186 lines
6.4 KiB
Groovy
Raw Normal View History

def call(List<Closure> closures) {
withTaskQueue.addTasks(closures)
}
def check() {
tasks([
chore(NA): removes auto install of pre-commit hook (#83566) * chore(NA): remove kibana pre-commit hook installation from bootstrap * chore(NA): add support for git ref flag on run precommit hook script * chore(NA): integrate quick commit checks within the CI * chore(NA): introduce logging trap to warn about quick commit checks failure and how to reproduce it * chore(NA): update quick commit checks message * fix(NA): quick commit checks function def * chore(NA): fix quick commit checks message quotes * chore(NA): fix functional call * chore(NA): fix script to run * chore(NA): add unexpected debugger statement to test quick commit checks * chore(NA): update message to log before quick commit checks * chore(NA): remove extra debugger statement * chore(NA): add echo message inline with script execution * chore(NA): add unexpected debugger statement to test quick commit checks * chore(NA): remove extra usage of debug statement * chore(NA): wrapping quick commit checks in a func * chore(NA): export function to use later * chore(NA): export function to use later * chore(NA): use child bash script on github checks reporter * chore(NA): define dir context for commit_check_runner.sh * fix(NA): permissions for commit_check_runner.sh * fix(NA): permissions for commit.sh * chore(NA): format message to log * chore(NA): add unexpected debugger statement to test quick commit checks * chore(NA): remove extra usage of debug statement * chore(NA): format runner message * chore(NA): replace log.info by log.warning * docs(NA): include docs for removing the pre-commit hook auto installation Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-12-04 15:43:33 +01:00
kibanaPipeline.scriptTask('Quick Commit Checks', 'test/scripts/checks/commit/commit.sh'),
kibanaPipeline.scriptTask('Check Telemetry Schema', 'test/scripts/checks/telemetry.sh'),
kibanaPipeline.scriptTask('Check TypeScript Projects', 'test/scripts/checks/ts_projects.sh'),
kibanaPipeline.scriptTask('Check Jest Configs', 'test/scripts/checks/jest_configs.sh'),
kibanaPipeline.scriptTask('Check Doc API Changes', 'test/scripts/checks/doc_api_changes.sh'),
kibanaPipeline.scriptTask('Check @kbn/pm Distributable', 'test/scripts/checks/kbn_pm_dist.sh'),
kibanaPipeline.scriptTask('Check Plugin List Docs', 'test/scripts/checks/plugin_list_docs.sh'),
kibanaPipeline.scriptTask('Check Types and Public API Docs', 'test/scripts/checks/type_check_plugin_public_api_docs.sh'),
kibanaPipeline.scriptTask('Check Bundle Limits', 'test/scripts/checks/bundle_limits.sh'),
kibanaPipeline.scriptTask('Check i18n', 'test/scripts/checks/i18n.sh'),
kibanaPipeline.scriptTask('Check File Casing', 'test/scripts/checks/file_casing.sh'),
kibanaPipeline.scriptTask('Check Licenses', 'test/scripts/checks/licenses.sh'),
chore(NA): tool to find plugins circular dependencies between plugins (#82867) * chore(NA): update gitignore to include first changes from moving into a single package.json * chore(NA): update gitignore * chore(NA): move all the dependencies into the single package.json and apply changes to bootstrap * chore(NA): fix types problems after the single package json * chore(NA): include code to find the dependencies used across the code * chore(NA): introduce pure lockfile for install dependencies on build * chore(NA): update clean task to not delete anything from xpack node_modules * chore(NA): update gitignore to remove development temporary rules * chore(NA): update notice file * chore(NA): update jest snapshots * chore(NA): fix whitelisted licenses to include a new specify form of an already included one * chore(NA): remove check lockfile symlinks from child projects * chore(NA): fix eslint and add missing declared deps on single pkg json * chore(NA): correctly update notice * chore(NA): fix failing jest test for storyshots.test.tsx * chore(NA): fix cypress multi reporter path * chore(NA): fix Project tests check * chore(NA): fix problem with logic to detect used dependes on oss build * chore(NA): include correct x-pack plugins dep discovery * chore(NA): discover entries under dynamic requires on vis_type_timelion * chore(NA): remove canvas * chore(NA): add initial code to find circular deps * chore(NA): ground work to integrate the circular deps scripts * chore(NA): add correct filtering to find circular dependenices feature * chore(NA): add ci mode flag into circular deps script * chore(NA): feature complete circular dependencies detect script * chore(NA): merge and solve conflicts with master * chore(NA): remove unwanted changes * chore(NA): remove unwanted changes on kbn storybook * chore(NA): hook find circular deps tool into ci * chore(NA): remove previous find plugin circular deps script * chore(NA): add type for circular dep list * chore(NA): add type for circular dep list for allowed list * chore(NA): allow CI to fail check * chore(NA): update deps allowed list * chore(NA): run search circular deps script over examples too * docs(NA): adds cli description * chore(NA): use plugin search paths to build entries to find circular deps * chore(NA): update allowed list * chore(NA): snapshot update for kbn optimizer test * chore(NA): update dpdm version * chore(NA): remove thirdParty flag * chore(NA): update docs to include info about the new tool * docs(NA): update to link PR instead of the issue * chore(NA): update debug logs to always output allowedList * fix(NA): correctly list found differences number * chore(NA): remove quiet flag * fix(NA): correctly fail the CI if circular deps are found * chore(NA): complete list of found circular deps * chore(NA): used named capturing group into the regex * docs(NA): update typescript best practices docs and styleguide * chore(NA): introduce quick filter option flag Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-11-30 23:19:32 +01:00
kibanaPipeline.scriptTask('Check Plugins With Circular Dependencies', 'test/scripts/checks/plugins_with_circular_deps.sh'),
kibanaPipeline.scriptTask('Verify NOTICE', 'test/scripts/checks/verify_notice.sh'),
kibanaPipeline.scriptTask('Test Projects', 'test/scripts/checks/test_projects.sh'),
kibanaPipeline.scriptTask('Test Hardening', 'test/scripts/checks/test_hardening.sh'),
])
}
def lint() {
tasks([
kibanaPipeline.scriptTask('Lint: eslint', 'test/scripts/lint/eslint.sh'),
kibanaPipeline.scriptTask('Lint: stylelint', 'test/scripts/lint/stylelint.sh'),
])
}
def test() {
tasks([
// This task requires isolation because of hard-coded, conflicting ports and such, so let's use Docker here
kibanaPipeline.scriptTaskDocker('Jest Integration Tests', 'test/scripts/test/jest_integration.sh'),
kibanaPipeline.scriptTask('API Integration Tests', 'test/scripts/test/api_integration.sh'),
])
}
def ossCiGroups() {
def ciGroups = 1..11
tasks(ciGroups.collect { kibanaPipeline.ossCiGroupProcess(it, true) })
}
def xpackCiGroups() {
def ciGroups = 1..13
tasks(ciGroups.collect { kibanaPipeline.xpackCiGroupProcess(it, true) })
}
def xpackCiGroupDocker() {
task {
workers.ci(name: 'xpack-cigroups-docker', size: 'm', ramDisk: true) {
kibanaPipeline.downloadDefaultBuildArtifacts()
kibanaPipeline.bash("""
cd '${env.WORKSPACE}'
mkdir -p kibana-build
tar -xzf kibana-default.tar.gz -C kibana-build --strip=1
tar -xzf kibana-default-plugins.tar.gz -C kibana
""", "Extract Default Build artifacts")
kibanaPipeline.xpackCiGroupProcess('Docker', true)()
}
}
}
def functionalOss(Map params = [:]) {
def config = params ?: [
serverIntegration: true,
ciGroups: true,
firefox: true,
accessibility: true,
pluginFunctional: true,
visualRegression: false,
]
task {
if (config.ciGroups) {
ossCiGroups()
}
if (config.firefox) {
task(kibanaPipeline.functionalTestProcess('oss-firefox', './test/scripts/jenkins_firefox_smoke.sh'))
}
if (config.accessibility) {
task(kibanaPipeline.functionalTestProcess('oss-accessibility', './test/scripts/jenkins_accessibility.sh'))
}
if (config.pluginFunctional) {
task(kibanaPipeline.functionalTestProcess('oss-pluginFunctional', './test/scripts/jenkins_plugin_functional.sh'))
}
if (config.visualRegression) {
task(kibanaPipeline.functionalTestProcess('oss-visualRegression', './test/scripts/jenkins_visual_regression.sh'))
}
if (config.serverIntegration) {
task(kibanaPipeline.scriptTaskDocker('serverIntegration', './test/scripts/test/server_integration.sh'))
}
}
}
def functionalXpack(Map params = [:]) {
def config = params ?: [
ciGroups: true,
firefox: true,
accessibility: true,
pluginFunctional: true,
savedObjectsFieldMetrics:true,
pageLoadMetrics: false,
visualRegression: false,
]
task {
if (config.ciGroups) {
xpackCiGroups()
xpackCiGroupDocker()
}
if (config.firefox) {
task(kibanaPipeline.functionalTestProcess('xpack-firefox', './test/scripts/jenkins_xpack_firefox_smoke.sh'))
}
if (config.accessibility) {
task(kibanaPipeline.functionalTestProcess('xpack-accessibility', './test/scripts/jenkins_xpack_accessibility.sh'))
}
if (config.visualRegression) {
task(kibanaPipeline.functionalTestProcess('xpack-visualRegression', './test/scripts/jenkins_xpack_visual_regression.sh'))
}
if (config.savedObjectsFieldMetrics) {
task(kibanaPipeline.functionalTestProcess('xpack-savedObjectsFieldMetrics', './test/scripts/jenkins_xpack_saved_objects_field_metrics.sh'))
}
whenChanged([
'x-pack/plugins/security_solution/',
'x-pack/plugins/cases/',
'x-pack/plugins/timelines/',
'x-pack/plugins/lists/',
'x-pack/test/security_solution_cypress/',
'x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/',
'x-pack/plugins/triggers_actions_ui/public/application/context/actions_connectors_context.tsx',
]) {
if (githubPr.isPr()) {
task(kibanaPipeline.functionalTestProcess('xpack-securitySolutionCypressChrome', './test/scripts/jenkins_security_solution_cypress_chrome.sh'))
// Temporarily disabled to figure out test flake
// task(kibanaPipeline.functionalTestProcess('xpack-securitySolutionCypressFirefox', './test/scripts/jenkins_security_solution_cypress_firefox.sh'))
}
}
whenChanged([
'x-pack/plugins/apm/',
]) {
if (githubPr.isPr()) {
task(kibanaPipeline.functionalTestProcess('xpack-APMCypress', './test/scripts/jenkins_apm_cypress.sh'))
}
}
whenChanged([
'x-pack/plugins/uptime/',
]) {
if (githubPr.isPr()) {
task(kibanaPipeline.functionalTestProcess('xpack-UptimePlaywright', './test/scripts/jenkins_uptime_playwright.sh'))
}
}
whenChanged([
'x-pack/plugins/fleet/',
]) {
if (githubPr.isPr()) {
task(kibanaPipeline.functionalTestProcess('xpack-FleetCypress', './test/scripts/jenkins_fleet_cypress.sh'))
}
}
}
}
def storybooksCi() {
task {
storybooks.buildAndUpload()
}
}
return this