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

[CI] skip stages if only docs changes #18315

Merged
merged 16 commits into from
May 8, 2020
12 changes: 12 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,19 @@ pipeline {
}
stage('Lint'){
options { skipDefaultCheckout() }
when {
beforeAgent true
expression { return env.ONLY_DOCS == "false" }
}
v1v marked this conversation as resolved.
Show resolved Hide resolved
steps {
makeTarget("Lint", "check")
}
}
stage('Build and Test'){
when {
beforeAgent true
expression { return env.ONLY_DOCS == "false" }
}
failFast false
parallel {
stage('Elastic Agent x-pack'){
Expand Down Expand Up @@ -1100,6 +1108,10 @@ def loadConfigEnvVars(){
generatorPatterns.addAll(getVendorPatterns('generator/common/beatgen'))
generatorPatterns.addAll(getVendorPatterns('metricbeat/beater'))
env.BUILD_GENERATOR = isChangedOSSCode(generatorPatterns)

// Skip all the stages for PRs with changes in the docs only
env.ONLY_DOCS = !params.runAllStages &&
isGitRegionMatch(patterns: [ '^docs/.*' ], shouldMatchAll: true)
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this catch changes to files with paths such as ./auditbeat/build/docs/shared/settings60.asciidoc?

Copy link
Contributor

@ycombinator ycombinator May 6, 2020

Choose a reason for hiding this comment

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

Additionally there are also "source" doc files such as ./filebeat/docs/modules/apache.asciidoc. So I'm wondering if this check needs be more about catching changes to any files (regardless of path) that end in .asciidoc?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's indeed a good point, I actually thought it was just this initial PR, and then I found I missed the make update, so working on supporting those particular scenarios too. Thanks for the heads up :) I just moved the PR to draft to work on it.

Regarding the files, I see png files too, I don't know if there are some other type of files. If no, then I can include it in the filter to be file based rather than folder based as you suggested

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point re: png files. And, as you said, there might be others too.

How about we start with asciidoc for now, since those do change relatively often, compared to other "non-code" types. And maybe we can add more types later?

Copy link
Member Author

Choose a reason for hiding this comment

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

png is also in the list of allowed files, let's then plan the following support files, if any, with some follow-ups. :)

}

/**
Expand Down