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

Set build type for scheduled builds based on doc repo changes #2931

Merged
merged 36 commits into from
Feb 9, 2024

Conversation

bmorelli25
Copy link
Member

@bmorelli25 bmorelli25 commented Feb 9, 2024

Summary

In #2929, we reverted to incremental builds run every 30 minutes. This works great, until a PR is merged to the elastic/docs repository. Almost every PR merged in this repo requires a rebuild in order for the changes to take effect on elastic.co/guide/*.

This PR updates our scheduled builds to first check to see if the build commit of elastic/docs has changed since the previous successful, scheduled run. If the commit has changed, we run a full docs rebuild to ensure the elastic/docs changes are propagated to all corners of elastic.co/guide. If the commit hasn't changed, there's no need for a full rebuild, and we instead run an incremental build—the faster and cheaper option.

Testing

Testing this PR is fun and easy!

Copy link

github-actions bot commented Feb 9, 2024

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.

@bmorelli25 bmorelli25 marked this pull request as ready for review February 9, 2024 15:57
@bmorelli25 bmorelli25 requested a review from a team as a code owner February 9, 2024 15:57
@bmorelli25 bmorelli25 changed the title Test conditional builds Set build type for scheduled builds based on doc repo changes Feb 9, 2024
@@ -25,6 +25,9 @@ steps:
value: ""
hint: "Should we ignore checking broken links? Should we allow to run the build without failing if there's a broken link? Ignoring broken links is dangerous not just because bad links will leak into the public site but because subsequent builds and pull requests that do not fix the links fail."
- wait
- label: "Full rebuild or incremental build?"
if: build.source == "schedule"
command: ".buildkite/scripts/compare_commits.sh"
Copy link
Member Author

@bmorelli25 bmorelli25 Feb 9, 2024

Choose a reason for hiding this comment

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

@nkammah why does L30 not need bash in the command but L35 does?

Copy link
Contributor

Choose a reason for hiding this comment

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

We specify the script interpreter in the first line of the script here - that's what we call the "shebang". If the script is executable (ex. running "chmod a+x" on it), the pipeline will know how to call it.

As for the discrepancy on L35, it could be legacy, or that we explicitly specified it at the time. Both approaches will work.

@nkammah nkammah merged commit 84035af into master Feb 9, 2024
3 checks passed
@nkammah nkammah deleted the test-conditional-builds branch February 9, 2024 19:00
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.

2 participants