elastic / docs

25 stars 335 forks source link

feat: reduce clone/fetch size when building docs PRs #3094

Closed kruskall closed 1 month ago

kruskall commented 1 month ago

do not fetch tags (they are unused)

use a treeless clone of the target branch instead of cloning the default branch: the initial clone of the default branch is unused, we are only interested in the target branch to compare the diff with the PR.

github-actions[bot] commented 1 month ago

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](https://buildkite.com/elastic/docs-build).
bmorelli25 commented 1 month ago

I might have to revert this. A number of PRs are failing with:


2024-10-30 09:42:30 PDT | INFO:build_docs:---------
-- | --
  | 2024-10-30 09:42:30 PDT | INFO:build_docs: -                             Kibana Guide: Merging the subbed dir for [kibana][main][:(glob)src/**/*.asciidoc] into the last successful build.
  | 2024-10-30 09:42:34 PDT | INFO:build_docs: -                             Kibana Guide: Failed to merge the subbed dir for [kibana][main][:(glob)src/**/*.asciidoc] into the last successful build:
  | 2024-10-30 09:42:34 PDT | INFO:build_docs:Error executing: git merge -m merge dbe7f54dd7beaf10f7e059c06d98970a8eae8b4a
  | 2024-10-30 09:42:34 PDT | INFO:build_docs:---out---
  | 2024-10-30 09:42:34 PDT | INFO:build_docs:Auto-merging yarn.lock
  | 2024-10-30 09:42:34 PDT | INFO:build_docs:CONFLICT (content): Merge conflict in yarn.lock
  | 2024-10-30 09:42:34 PDT | INFO:build_docs:Auto-merging src/dev/license_checker/config.ts
  | 2024-10-30 09:42:34 PDT | INFO:build_docs:CONFLICT (content): Merge conflict in src/dev/license_checker/config.ts
  | 2024-10-30 09:42:34 PDT | INFO:build_docs:Auto-merging package.json
  | 2024-10-30 09:42:34 PDT | INFO:build_docs:CONFLICT (content): Merge conflict in package.json
  | 2024-10-30 09:42:34 PDT | INFO:build_docs:Automatic merge failed; fix conflicts and then commit the result.
  | 2024-10-30 09:42:34 PDT | INFO:build_docs:
  | 2024-10-30 09:42:34 PDT | INFO:build_docs:---err---

edit: link to one of these failures

bmorelli25 commented 1 month ago

Hmm. Seems to only be Kibana PRs that are failing.

kruskall commented 1 month ago

:sob:

bmorelli25 commented 1 month ago

Not sure why only Kibana PRs are failing, but they all are failing with the same error. I reverted in https://github.com/elastic/docs/pull/3098.

kruskall commented 1 month ago

Not sure why only Kibana PRs are failing

kibana is excluded from the switch case which means the script will only fetch the latest commit in the PR without fetching the whole history (because it doesn't need to do the diff). I'm not sure why building the docs fail (probably using some git command that requires the whole history which imo is bad) but I guess this is an opportunity to improve the build process :D