Skip to content

Make build_pr script more specific #3183

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

Merged
merged 5 commits into from
Apr 9, 2025
Merged

Make build_pr script more specific #3183

merged 5 commits into from
Apr 9, 2025

Conversation

colleenmcginnis
Copy link
Contributor

@colleenmcginnis colleenmcginnis commented Mar 4, 2025

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. 🤷

Copy link

github-actions bot commented Mar 4, 2025

A documentation preview will be available soon.

Request a new doc build by commenting
  • Rebuild this PR: run docs-build
  • Rebuild this PR and all Elastic docs: run docs-build rebuild

run docs-build is much faster than run docs-build rebuild. A rebuild should only be needed in rare situations.

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.

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)
Copy link
Contributor Author

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?

Copy link
Contributor

@leemthompo leemthompo Mar 5, 2025

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? :)

@colleenmcginnis colleenmcginnis self-assigned this Mar 4, 2025
@colleenmcginnis
Copy link
Contributor Author

@florent-leborgne I don't see a specific command for kibana so it must just always run (https://github.com/elastic/docs/pull/3183/files#diff-5ea8cc5083302320861aeb6d2dc6d73f688d94c1ed975a3c4bd1ad351cd23a74R203-R205). Should we add a specific command to only run the AsciiDoc PR preview job when an AsciiDoc file is edited?

@colleenmcginnis colleenmcginnis changed the title Make build_pr script more specific [DO NOT MERGE] Make build_pr script more specific Mar 4, 2025
@florent-leborgne
Copy link
Contributor

so it must just always run

I can confirm it always runs and makes some people complain every now and then 😅
If we can do that, that'd be nice.

@colleenmcginnis
Copy link
Contributor Author

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?

@colleenmcginnis colleenmcginnis changed the title [DO NOT MERGE] Make build_pr script more specific Make build_pr script more specific Mar 13, 2025
@colleenmcginnis colleenmcginnis marked this pull request as ready for review March 13, 2025 17:52
@colleenmcginnis colleenmcginnis requested a review from a team as a code owner March 13, 2025 17:52
@colleenmcginnis colleenmcginnis merged commit 7bd889c into master Apr 9, 2025
3 checks passed
@colleenmcginnis colleenmcginnis deleted the update-build_pr branch April 9, 2025 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants