-
Notifications
You must be signed in to change notification settings - Fork 340
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
Make build_pr
script more specific
#3183
base: master
Are you sure you want to change the base?
Conversation
A documentation preview will be available soon. Request a new doc build by commenting
If your PR continues to fail for an unknown reason, the doc build pipeline may be broken. Elastic employees can check the pipeline status here. |
.buildkite/scripts/build_pr.sh
Outdated
git fetch origin "$GITHUB_PR_TARGET_BRANCH" | ||
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs/guide) | ||
;; | ||
|
||
"elasticsearch") | ||
git fetch origin "$GITHUB_PR_TARGET_BRANCH" | ||
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./buildSrc ./build-tools-internal ./build-tools/src/main/resources ./client ./docs ./modules/reindex/src/internalClusterTest/java/org/elasticsearch/client/documentation ./modules/reindex/src/test/java/org/elasticsearch/client/documentation ./plugins/examples ./server/src/internalClusterTest/java/org/elasticsearch/client/documentation ./server/src/main/resources/org/elasticsearch/common ./server/src/test/java/org/elasticsearch/client/documentation ./x-pack/docs ./x-pack/plugin/esql/qa/testFixtures/src/main/resources ./x-pack/plugin/sql/qa ./x-pack/qa/sql) | ||
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./buildSrc ./build-tools-internal ./build-tools/src/main/resources ./client ./docs/**/*.asciidoc ./modules/reindex/src/internalClusterTest/java/org/elasticsearch/client/documentation ./modules/reindex/src/test/java/org/elasticsearch/client/documentation ./plugins/examples ./server/src/internalClusterTest/java/org/elasticsearch/client/documentation ./server/src/main/resources/org/elasticsearch/common ./server/src/test/java/org/elasticsearch/client/documentation ./x-pack/docs ./x-pack/plugin/esql/qa/testFixtures/src/main/resources ./x-pack/plugin/sql/qa ./x-pack/qa/sql) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@leemthompo I'm not sure if we should update any of the other directories in this list to be more specific. Any ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really not sure, but might want to add **/*.asciidoc
to the other docs paths to be consistent with your other changes? :)
@florent-leborgne I don't see a specific command for |
build_pr
script more specificbuild_pr
script more specific
I can confirm it always runs and makes some people complain every now and then 😅 |
Ok. This is unblocked now thanks to #3186 working in the latest commit in elastic/ecs-logging#88. @bmorelli25 do you have any concerns about updating all these at once? 😬 Hopefully not too many commits are being pushed to update AsciiDoc files, but I'm a little concerned that one of these could be wrong and could prevent the check from running and cause a build failure. Am I being overly cautious? |
build_pr
script more specificbuild_pr
script more specific
@@ -90,7 +90,7 @@ if [[ "${GITHUB_PR_BASE_REPO}" != 'docs' ]]; then | |||
|
|||
"beats") | |||
git fetch origin "$GITHUB_PR_TARGET_BRANCH" | |||
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./auditbeat ./CHANGELOG.asciidoc ./docs ./filebeat ./heartbeat ./journalbeat ./libbeat/docs ./libbeat/outputs/*/docs/* ./libbeat/processors/*/docs/* ./metricbeat ./packetbeat ./topbeat/docs ./winlogbeat ./x-pack/auditbeat ./x-pack/dockerlogbeat/docs ./x-pack/filebeat/docs ./x-pack/filebeat/processors/*/docs/* ./x-pack/functionbeat ./x-pack/libbeat/docs ./x-pack/libbeat/processors/*/docs/* ./x-pack/metricbeat/module) | |||
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- "./auditbeat/**/*.asciidoc" ./CHANGELOG.asciidoc "./docs/**/*.asciidoc" "./filebeat/**/*.asciidoc" "./heartbeat/**/*.asciidoc" "./journalbeat/**/*.asciidoc" "./libbeat/docs/**/*.asciidoc" "./libbeat/outputs/*/docs/*/**/*.asciidoc" "./libbeat/processors/*/docs/*/**/*.asciidoc" "./metricbeat/**/*.asciidoc" "./packetbeat/**/*.asciidoc" "./topbeat/docs/**/*.asciidoc" "./winlogbeat/**/*.asciidoc" "./x-pack/auditbeat/**/*.asciidoc" "./x-pack/dockerlogbeat/docs/**/*.asciidoc" "./x-pack/filebeat/docs/**/*.asciidoc" "./x-pack/filebeat/processors/*/docs/*/**/*.asciidoc" "./x-pack/functionbeat/**/*.asciidoc" "./x-pack/libbeat/docs/**/*.asciidoc" "./x-pack/libbeat/processors/*/docs/*/**/*.asciidoc" "./x-pack/metricbeat/module/**/*.asciidoc") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think some of these are incorrect. For example, running git diff
from the beats dir:
git diff --name-only -- ./x-pack/libbeat/processors/*/docs/*/**/*.asciidoc
returns
zsh: no matches found: ./x-pack/libbeat/processors/*/docs/*/**/*.asciidoc
but this works:
git diff --name-only -- ./x-pack/libbeat/processors/*/docs/**/*.asciidoc
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- "./auditbeat/**/*.asciidoc" ./CHANGELOG.asciidoc "./docs/**/*.asciidoc" "./filebeat/**/*.asciidoc" "./heartbeat/**/*.asciidoc" "./journalbeat/**/*.asciidoc" "./libbeat/docs/**/*.asciidoc" "./libbeat/outputs/*/docs/*/**/*.asciidoc" "./libbeat/processors/*/docs/*/**/*.asciidoc" "./metricbeat/**/*.asciidoc" "./packetbeat/**/*.asciidoc" "./topbeat/docs/**/*.asciidoc" "./winlogbeat/**/*.asciidoc" "./x-pack/auditbeat/**/*.asciidoc" "./x-pack/dockerlogbeat/docs/**/*.asciidoc" "./x-pack/filebeat/docs/**/*.asciidoc" "./x-pack/filebeat/processors/*/docs/*/**/*.asciidoc" "./x-pack/functionbeat/**/*.asciidoc" "./x-pack/libbeat/docs/**/*.asciidoc" "./x-pack/libbeat/processors/*/docs/*/**/*.asciidoc" "./x-pack/metricbeat/module/**/*.asciidoc") | |
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- "./auditbeat/**.asciidoc" ./CHANGELOG.asciidoc "./docs/**.asciidoc" "./filebeat/**.asciidoc" "./heartbeat/**.asciidoc" "./journalbeat/**.asciidoc" "./libbeat/docs/**.asciidoc" "./libbeat/outputs/*/docs/**.asciidoc" "./libbeat/processors/*/docs/**.asciidoc" "./metricbeat/**/*.asciidoc" "./packetbeat/**.asciidoc" "./topbeat/docs/**.asciidoc" "./winlogbeat/**.asciidoc" "./x-pack/auditbeat/**/*.asciidoc" "./x-pack/dockerlogbeat/docs/**.asciidoc" "./x-pack/filebeat/docs/**.asciidoc" "./x-pack/filebeat/processors/*/docs/**.asciidoc" "./x-pack/functionbeat/**.asciidoc" "./x-pack/libbeat/docs/**.asciidoc" "./x-pack/libbeat/processors/*/docs/**.asciidoc" "./x-pack/metricbeat/module/**.asciidoc") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"./libbeat/outputs/*/docs/*/**/*.asciidoc"
needs to be updated as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've edited my suggestion above to include that update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interestingly, I can only get the first of these to indicate a changed file locally. The latter should work as well since **
matches zero or more directories. But it doesn't 🤔
➜ beats git:(migrate-docs) ✗ git diff --name-only -- "./x-pack/libbeat/processors/*/docs/*.asciidoc"
➜ beats git:(migrate-docs) ✗ git diff --name-only -- "./x-pack/libbeat/processors/*/docs/**/*.asciidoc"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated my suggestion again 🙃
@@ -90,7 +90,7 @@ if [[ "${GITHUB_PR_BASE_REPO}" != 'docs' ]]; then | |||
|
|||
"beats") | |||
git fetch origin "$GITHUB_PR_TARGET_BRANCH" | |||
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./auditbeat ./CHANGELOG.asciidoc ./docs ./filebeat ./heartbeat ./journalbeat ./libbeat/docs ./libbeat/outputs/*/docs/* ./libbeat/processors/*/docs/* ./metricbeat ./packetbeat ./topbeat/docs ./winlogbeat ./x-pack/auditbeat ./x-pack/dockerlogbeat/docs ./x-pack/filebeat/docs ./x-pack/filebeat/processors/*/docs/* ./x-pack/functionbeat ./x-pack/libbeat/docs ./x-pack/libbeat/processors/*/docs/* ./x-pack/metricbeat/module) | |||
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- "./auditbeat/**/*.asciidoc" ./CHANGELOG.asciidoc "./docs/**/*.asciidoc" "./filebeat/**/*.asciidoc" "./heartbeat/**/*.asciidoc" "./journalbeat/**/*.asciidoc" "./libbeat/docs/**/*.asciidoc" "./libbeat/outputs/*/docs/*/**/*.asciidoc" "./libbeat/processors/*/docs/*/**/*.asciidoc" "./metricbeat/**/*.asciidoc" "./packetbeat/**/*.asciidoc" "./topbeat/docs/**/*.asciidoc" "./winlogbeat/**/*.asciidoc" "./x-pack/auditbeat/**/*.asciidoc" "./x-pack/dockerlogbeat/docs/**/*.asciidoc" "./x-pack/filebeat/docs/**/*.asciidoc" "./x-pack/filebeat/processors/*/docs/*/**/*.asciidoc" "./x-pack/functionbeat/**/*.asciidoc" "./x-pack/libbeat/docs/**/*.asciidoc" "./x-pack/libbeat/processors/*/docs/*/**/*.asciidoc" "./x-pack/metricbeat/module/**/*.asciidoc") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've edited my suggestion above to include that update.
git fetch origin "$GITHUB_PR_TARGET_BRANCH" | ||
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs/guide) | ||
;; | ||
|
||
"elasticsearch") | ||
git fetch origin "$GITHUB_PR_TARGET_BRANCH" | ||
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./buildSrc ./build-tools-internal ./build-tools/src/main/resources ./client ./docs ./modules/reindex/src/internalClusterTest/java/org/elasticsearch/client/documentation ./modules/reindex/src/test/java/org/elasticsearch/client/documentation ./plugins/examples ./server/src/internalClusterTest/java/org/elasticsearch/client/documentation ./server/src/main/resources/org/elasticsearch/common ./server/src/test/java/org/elasticsearch/client/documentation ./x-pack/docs ./x-pack/plugin/esql/qa/testFixtures/src/main/resources ./x-pack/plugin/sql/qa ./x-pack/qa/sql) | ||
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./buildSrc ./build-tools-internal ./build-tools/src/main/resources ./client "./docs/**/*.asciidoc" ./modules/reindex/src/internalClusterTest/java/org/elasticsearch/client/documentation ./modules/reindex/src/test/java/org/elasticsearch/client/documentation ./plugins/examples ./server/src/internalClusterTest/java/org/elasticsearch/client/documentation ./server/src/main/resources/org/elasticsearch/common ./server/src/test/java/org/elasticsearch/client/documentation ./x-pack/docs ./x-pack/plugin/esql/qa/testFixtures/src/main/resources ./x-pack/plugin/sql/qa ./x-pack/qa/sql) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm noticing the same thing here. **
appears to only match one or more directory. This means changes to files in the root of the dir directly before **
will not correctly indicate changes with git log
. For example: in the es repo, update docs/versions.asciidoc
, and run:
git diff --name-only -- "./docs/**/*.asciidoc"
git diff does not indicate any changed files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, TIL a lot about pattern matching in git commands. From the git docs:

That's why using a pattern like ./docs/**/*.asciidoc
, matches .asciidoc
files in subdirectories of docs/
, but not directly within docs/
. The pattern expects at least one directory level after docs/
before matching .asciidoc
files.
I think we can include docs/
as well as its subdirectories with ./docs/**/**/*.asciidoc
. Testing that now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay that didn't work but what does work is "./docs/**.asciidoc"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./buildSrc ./build-tools-internal ./build-tools/src/main/resources ./client "./docs/**/*.asciidoc" ./modules/reindex/src/internalClusterTest/java/org/elasticsearch/client/documentation ./modules/reindex/src/test/java/org/elasticsearch/client/documentation ./plugins/examples ./server/src/internalClusterTest/java/org/elasticsearch/client/documentation ./server/src/main/resources/org/elasticsearch/common ./server/src/test/java/org/elasticsearch/client/documentation ./x-pack/docs ./x-pack/plugin/esql/qa/testFixtures/src/main/resources ./x-pack/plugin/sql/qa ./x-pack/qa/sql) | |
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./buildSrc ./build-tools-internal ./build-tools/src/main/resources ./client "./docs/**.asciidoc" ./modules/reindex/src/internalClusterTest/java/org/elasticsearch/client/documentation ./modules/reindex/src/test/java/org/elasticsearch/client/documentation ./plugins/examples ./server/src/internalClusterTest/java/org/elasticsearch/client/documentation ./server/src/main/resources/org/elasticsearch/common ./server/src/test/java/org/elasticsearch/client/documentation ./x-pack/docs ./x-pack/plugin/esql/qa/testFixtures/src/main/resources ./x-pack/plugin/sql/qa ./x-pack/qa/sql) |
@@ -62,25 +62,25 @@ if [[ "${GITHUB_PR_BASE_REPO}" != 'docs' ]]; then | |||
# repositories with a docs dir and changelog | |||
"apm-aws-lambda" | "apm-agent-android" | "apm-agent-nodejs" | "apm-agent-python" | "apm-agent-ruby" | "apm-agent-rum-js" | "apm-agent-go" | "apm-agent-java" | "apm-agent-dotnet" | "apm-agent-php" | "apm-agent-ios") | |||
git fetch origin "$GITHUB_PR_TARGET_BRANCH" | |||
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs CHANGELOG.asciidoc) | |||
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- "./docs/**/*.asciidoc" CHANGELOG.asciidoc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- "./docs/**/*.asciidoc" CHANGELOG.asciidoc) | |
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- "./docs/**.asciidoc" CHANGELOG.asciidoc) |
git fetch origin "$GITHUB_PR_TARGET_BRANCH" | ||
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- "**/*.asciidoc") | ||
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- "./docs/**/*.asciidoc") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- "./docs/**/*.asciidoc") | |
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- "./docs/**.asciidoc") |
git fetch origin "$GITHUB_PR_TARGET_BRANCH" | ||
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs) | ||
;; | ||
|
||
# repositories with a docs dir, changelogs dir, and changelog | ||
"apm-server") | ||
git fetch origin "$GITHUB_PR_TARGET_BRANCH" | ||
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs ./changelogs CHANGELOG.asciidoc) | ||
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- "./docs/**/*.asciidoc" "./changelogs/**/*.asciidoc" CHANGELOG.asciidoc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- "./docs/**/*.asciidoc" "./changelogs/**/*.asciidoc" CHANGELOG.asciidoc) | |
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- "./docs/**.asciidoc" "./changelogs/**.asciidoc" CHANGELOG.asciidoc) |
"eland" | "enterprise-search-php" | "enterprise-search-python" | "enterprise-search-ruby") | ||
"eland") | ||
git fetch origin "$GITHUB_PR_TARGET_BRANCH" | ||
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- "./docs/guide/**/*.asciidoc") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- "./docs/guide/**/*.asciidoc") | |
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- "./docs/guide/**.asciidoc") |
@@ -120,22 +125,22 @@ if [[ "${GITHUB_PR_BASE_REPO}" != 'docs' ]]; then | |||
|
|||
"elasticsearch-java") | |||
git fetch origin "$GITHUB_PR_TARGET_BRANCH" | |||
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs ./java-client/src/test/java/co/elastic/clients/documentation) | |||
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs "./java-client/src/test/java/co/elastic/clients/documentation/**/*.asciidoc") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs "./java-client/src/test/java/co/elastic/clients/documentation/**/*.asciidoc") | |
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs "./java-client/src/test/java/co/elastic/clients/documentation/**.asciidoc") |
;; | ||
|
||
"elasticsearch-py") | ||
git fetch origin "$GITHUB_PR_TARGET_BRANCH" | ||
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs/guide ./docs/examples) | ||
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- "./docs/guide/**/*.asciidoc" ./docs/examples) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- "./docs/guide/**/*.asciidoc" ./docs/examples) | |
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- "./docs/guide/**.asciidoc" ./docs/examples) |
;; | ||
|
||
"go-elasticsearch") | ||
git fetch origin "$GITHUB_PR_TARGET_BRANCH" | ||
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./.doc) | ||
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- "./.doc/**/*.asciidoc") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- "./.doc/**/*.asciidoc") | |
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- "./.doc/**.asciidoc") |
git fetch origin "$GITHUB_PR_TARGET_BRANCH" | ||
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs/en) | ||
;; | ||
|
||
"esf" | "ingest-docs" | "observability-docs" | "stack-docs" | "x-pack-logstash") | ||
git fetch origin "$GITHUB_PR_TARGET_BRANCH" | ||
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- "./docs/en/**/*.asciidoc") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- "./docs/en/**/*.asciidoc") | |
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- "./docs/en/**.asciidoc") |
git fetch origin "$GITHUB_PR_TARGET_BRANCH" | ||
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs/guide) | ||
;; | ||
|
||
"elasticsearch") | ||
git fetch origin "$GITHUB_PR_TARGET_BRANCH" | ||
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./buildSrc ./build-tools-internal ./build-tools/src/main/resources ./client ./docs ./modules/reindex/src/internalClusterTest/java/org/elasticsearch/client/documentation ./modules/reindex/src/test/java/org/elasticsearch/client/documentation ./plugins/examples ./server/src/internalClusterTest/java/org/elasticsearch/client/documentation ./server/src/main/resources/org/elasticsearch/common ./server/src/test/java/org/elasticsearch/client/documentation ./x-pack/docs ./x-pack/plugin/esql/qa/testFixtures/src/main/resources ./x-pack/plugin/sql/qa ./x-pack/qa/sql) | ||
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./buildSrc ./build-tools-internal ./build-tools/src/main/resources ./client "./docs/**/*.asciidoc" ./modules/reindex/src/internalClusterTest/java/org/elasticsearch/client/documentation ./modules/reindex/src/test/java/org/elasticsearch/client/documentation ./plugins/examples ./server/src/internalClusterTest/java/org/elasticsearch/client/documentation ./server/src/main/resources/org/elasticsearch/common ./server/src/test/java/org/elasticsearch/client/documentation ./x-pack/docs ./x-pack/plugin/esql/qa/testFixtures/src/main/resources ./x-pack/plugin/sql/qa ./x-pack/qa/sql) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./buildSrc ./build-tools-internal ./build-tools/src/main/resources ./client "./docs/**/*.asciidoc" ./modules/reindex/src/internalClusterTest/java/org/elasticsearch/client/documentation ./modules/reindex/src/test/java/org/elasticsearch/client/documentation ./plugins/examples ./server/src/internalClusterTest/java/org/elasticsearch/client/documentation ./server/src/main/resources/org/elasticsearch/common ./server/src/test/java/org/elasticsearch/client/documentation ./x-pack/docs ./x-pack/plugin/esql/qa/testFixtures/src/main/resources ./x-pack/plugin/sql/qa ./x-pack/qa/sql) | |
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./buildSrc ./build-tools-internal ./build-tools/src/main/resources ./client "./docs/**.asciidoc" ./modules/reindex/src/internalClusterTest/java/org/elasticsearch/client/documentation ./modules/reindex/src/test/java/org/elasticsearch/client/documentation ./plugins/examples ./server/src/internalClusterTest/java/org/elasticsearch/client/documentation ./server/src/main/resources/org/elasticsearch/common ./server/src/test/java/org/elasticsearch/client/documentation ./x-pack/docs ./x-pack/plugin/esql/qa/testFixtures/src/main/resources ./x-pack/plugin/sql/qa ./x-pack/qa/sql) |
@@ -90,7 +90,7 @@ if [[ "${GITHUB_PR_BASE_REPO}" != 'docs' ]]; then | |||
|
|||
"beats") | |||
git fetch origin "$GITHUB_PR_TARGET_BRANCH" | |||
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./auditbeat ./CHANGELOG.asciidoc ./docs ./filebeat ./heartbeat ./journalbeat ./libbeat/docs ./libbeat/outputs/*/docs/* ./libbeat/processors/*/docs/* ./metricbeat ./packetbeat ./topbeat/docs ./winlogbeat ./x-pack/auditbeat ./x-pack/dockerlogbeat/docs ./x-pack/filebeat/docs ./x-pack/filebeat/processors/*/docs/* ./x-pack/functionbeat ./x-pack/libbeat/docs ./x-pack/libbeat/processors/*/docs/* ./x-pack/metricbeat/module) | |||
docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- "./auditbeat/**/*.asciidoc" ./CHANGELOG.asciidoc "./docs/**/*.asciidoc" "./filebeat/**/*.asciidoc" "./heartbeat/**/*.asciidoc" "./journalbeat/**/*.asciidoc" "./libbeat/docs/**/*.asciidoc" "./libbeat/outputs/*/docs/*/**/*.asciidoc" "./libbeat/processors/*/docs/*/**/*.asciidoc" "./metricbeat/**/*.asciidoc" "./packetbeat/**/*.asciidoc" "./topbeat/docs/**/*.asciidoc" "./winlogbeat/**/*.asciidoc" "./x-pack/auditbeat/**/*.asciidoc" "./x-pack/dockerlogbeat/docs/**/*.asciidoc" "./x-pack/filebeat/docs/**/*.asciidoc" "./x-pack/filebeat/processors/*/docs/*/**/*.asciidoc" "./x-pack/functionbeat/**/*.asciidoc" "./x-pack/libbeat/docs/**/*.asciidoc" "./x-pack/libbeat/processors/*/docs/*/**/*.asciidoc" "./x-pack/metricbeat/module/**/*.asciidoc") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated my suggestion again 🙃
Follow up to #3182
Only run the docs PR preview job when an AsciiDoc file is edited.
Note: This is an imperfect solution because it would not build if only an image was updated in a PR, but that might be ok at this point. 🤷