Skip to content

Conversation

@nik9000
Copy link
Member

@nik9000 nik9000 commented Jul 23, 2025

Adds a new behavior to the esql build we enable in CI that, instead of generating the docs, asserts that they are already up to date.

Adds a new behavior to the esql build we enable in CI that, instead of
generating the docs, asserts that they are already up to date.
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Jul 23, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@github-actions
Copy link
Contributor

github-actions bot commented Jul 23, 2025

🔍 Preview links for changed docs

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.

Looks good, thanks!
I would consider the git comment, but I have no problem going with this if you feel it's better in some way

Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice if we could just do a git diff after generation, to avoid propagating that logic to the code. Easier to maintain also, IMO.
I see only the build-tools module depends on git though, but I would expect git to be available in both CI and machines running test

Copy link
Member Author

Choose a reason for hiding this comment

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

I was trying to keep as much stuff as I could out of the build.gradle so we can maintain it ourselves. And there's some trickiness with the replacements.... But I did think about it.

}
if (renderedLines.size() < found.size()) {
if (renderedLines.size() + 1 == found.size() && found.get(renderedLines.size()).isEmpty()) {
// trailing newline, whatever
Copy link
Contributor

Choose a reason for hiding this comment

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

This means somebody else will have the change in their PRs anyway right? I would probably start with a hard equals, unless you found some edge case like that already

Copy link
Member Author

Choose a reason for hiding this comment

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

I had seen newlines at first. Let me double check.


@Override
public boolean supportsRendering() {
// CI doesn't always support rendering the svgs. And we hack them anyway so they don't match.
Copy link
Contributor

Choose a reason for hiding this comment

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

What is specifically unsupported of SVGs in CI? Isn't the library "just" crafting the XML? Or is it doing something else?

Copy link
Member Author

Choose a reason for hiding this comment

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

It has to render the font to get some pixel values. I know, it shouldn't have to do that, but it does! I can expand the comment.

Copy link
Member Author

Choose a reason for hiding this comment

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

And most CI machines are fine with it. But some are missing the components to make the render fonts at all. The build provides the font too.

public static class AssertCallbacks implements Callbacks {
@Override
public void write(Path dir, String name, String extension, String str, boolean kibana) throws IOException {
Path file = dir.resolve(name + "." + extension);
Copy link
Contributor

Choose a reason for hiding this comment

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

What about adding a message like "Run the changes function tests to regenerate the docs, and push them"? As to guide devs for their first contributions, and avoid the sense of flakyness in tests.
Maybe just try-catching the code of this method and wrapping the exception

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah. I think that's a good choice.

@nik9000 nik9000 merged commit f3d74f3 into elastic:main Jul 23, 2025
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL >non-issue Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants