-
Notifications
You must be signed in to change notification settings - Fork 183
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
feat: reintroduce docusaurus caching to CI #4436
Conversation
…same cache as preview-env-deploy?
…for internal branches.
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.
LGTM!
Indeed, but only once a day, so cache will be very helpful for consecutive push in a relatively short (one day) timeframe 🚀 . |
Oh, nice! I was wondering how frequently this happened, because every time I look at that "caches" page it seems like we're over the cache limit 😅 |
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.
Sorry! I had this opened in a tab yesterday for review, but didn't actually hit the button.
🧹 Preview environment for this PR has been torn down. |
Description
Resolves #4418, by adding a local GitHub action that basically does what we ripped out in #4417 due to the target action being removed from the internet.
For reference, the original caching was introduced in #4025.
This PR adds the caching step to these workflows:
It does not add it to publish-prod....yet. I'd like to see it merged and running against staging first, to make sure it doesn't mess up prod builds.
Some details about how the caching works
This PR also modifies
build-docs
workflow to trigger only onpull_request
.This is done to allow sharing of the cache between the
build-docs
andpreview-env-deploy
. A build triggered bypush
does not run in the samegithub_workspace
as a build triggered onpull_request
-- see this screenshot of caches:Those are the same PR. The top one is from
preview-env-deploy
running on apull_request
trigger; the bottom one is frombuild-docs
running on apush
trigger. (Yes, the issue/PR numbers are different in the two caches, but that's because the top one shows the PR number, and the bottom one shows the branch name, which includes the issue number.)Removing the
push
trigger frombuild-docs
, and forcing it to run onpull_request
in all cases, results in the workspace/cache being shared across the workflows. This has two positive effects: (1) a better chance that a build will benefit from a cache, and (2) fewer caches, thus longer duration of each cache before it gets evicted due to lack of space.Can we remove the
push
trigger?I tracked down two conversations in Slack where I've asked publicly if people are using the
push
trigger to watch CI before they open a PR: https://camunda.slack.com/archives/C01H4NG9XDY/p1654292859796899?thread_ts=1654292843.207019&cid=C01H4NG9XDY and https://camunda.slack.com/archives/C026U8GBNSW/p1675695601973339.In neither case did a single person say "I rely on the
push
trigger, by pushing up a branch before opening a PR."This trigger was skipping
main
, so direct-commits tomain
(which shouldn't be done) weren't relying on this workflow to tell us when the build broke in that occasion, either.Thus, I think we can remove this trigger, and if anyone complains, nudge them to open PRs if they want to run builds.
Experiments
You can see the workflow executions from my experimentation here and here. Note the build times decrease by 4-10 minutes on executions that are able to take advantage of the cache.
When should this change go live?
hold
label or convert to draft PR)PR Checklist
/versioned_docs
directory./docs
directory (aka/next/
).My changes require an Engineering review, and I've assigned the Engineering DRI or delegate.
My changes require a technical writer review, and I've assigned @camunda/tech-writers as a reviewer.
My changes require a docs infrastructure review.