Skip to content

Conversation

@craigtaverner
Copy link
Contributor

Earlier work on the ES|QL port of docs to V3 introduced an issue in the build.gradle file making it fail with --configuration-cache. This fixes that, as well as one other broken link and removes some unused files.

In addition we bring back partial support for deleting unused files. It is tricky to have full support for this due to the mix of static and generated content, particularly in the operators snippets.

@craigtaverner craigtaverner added >docs General docs changes Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) :Analytics/ES|QL AKA ESQL labels Mar 18, 2025
@elasticsearchmachine elasticsearchmachine added v9.1.0 Team:Docs Meta label for docs team labels Mar 18, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-docs (Team:Docs)

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@craigtaverner craigtaverner requested a review from ivancea March 18, 2025 14:16
def imagesDocFolder = file("${rootDir}/docs/reference/query-languages/esql/images")
def snippetsDocFolder = file("${rootDir}/docs/reference/query-languages/esql/_snippets")
def kibanaDocFolder = file("${rootDir}/docs/reference/query-languages/esql/kibana")
def snippetsTree = fileTree(snippetsFolder).matching {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The fix for --configuration-cache is essentially to move these calls to fileTree out of the doLast while still making sure they run after the tests are finished.

preserve {
// The snippets directory contains generated and static content, so we must preserve all MD files.
include '**/*.md'
if (countSnippets <= 100) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We used to delete all files if we ran more than 1 test, which is extreme. This way we only delete all files if we probably run the entire suite.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am not following this. Both branches start with If we do not run the full test of tests comment.
How does it know what files could be preserved when running individual tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree the comment is ambiguous. The second half of the comment is better. Anyway, the way it works is if we run only a subset of the tests (usually just one, hence the old rule), then it uses include '**/*.md' to keep all old files. If, instead, we run all the tests, it will try to delete unused files. We used to delete all unused files (too many), but now we delete only the ones we feel more confident are actually generated. The more complex line to handle this is:

include '*.md', '**/operators/*.md', '**/operators/**/*.md', '**/lists/*.md'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I verified this line by running all tests and seeing what got deleted, and verifying that it was nothing we didn't already want to delete.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I deleted the not in the second comment below, since it was the source of the confusion.

// <<match-field-params,match query parameters>>
return switch (parts[0]) {
case "match-field-params" -> makeLink(key, "", "/reference/query-languages/query-dsl-match-query.md");
case "match-field-params" -> makeLink(key, "", "/reference/query-languages/query-dsl/query-dsl-match-query.md");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a loose end from the docs restructuring PR that merged yesterday. It should have been in that PR.

Copy link
Contributor

@ivancea ivancea left a comment

Choose a reason for hiding this comment

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

LGTM! Minor thing around some comments Ievgen commented, which may probably be rewritten

@craigtaverner craigtaverner merged commit 50a7eb0 into elastic:main Mar 18, 2025
16 checks passed
smalyshev pushed a commit to smalyshev/elasticsearch that referenced this pull request Mar 21, 2025
Earlier work on the ES|QL port of docs to V3 introduced an issue in the build.gradle file making it fail with --configuration-cache. This fixes that, as well as one other broken link and removes some unused files.

In addition we bring back partial support for deleting unused files. It is tricky to have full support for this due to the mix of static and generated content, particularly in the operators snippets.
omricohenn pushed a commit to omricohenn/elasticsearch that referenced this pull request Mar 28, 2025
Earlier work on the ES|QL port of docs to V3 introduced an issue in the build.gradle file making it fail with --configuration-cache. This fixes that, as well as one other broken link and removes some unused files.

In addition we bring back partial support for deleting unused files. It is tricky to have full support for this due to the mix of static and generated content, particularly in the operators snippets.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL >docs General docs changes Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) Team:Docs Meta label for docs team v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants