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

[ES|QL] gather inline function documentation from Elasticsearch #184689

Merged
merged 19 commits into from
Jun 10, 2024

Conversation

drewdaemon
Copy link
Contributor

@drewdaemon drewdaemon commented Jun 3, 2024

Summary

Adds a script to gather inline function documentation sections from Elasticsearch.

Screenshot 2024-06-03 at 12 03 06 PM

To run the script:

cd packages/kbn-text-based-editor && yarn make:docs path/to/elasticsearch

This script will be operationalized in a follow-up PR.

@drewdaemon
Copy link
Contributor Author

/ci

@drewdaemon drewdaemon added Feature:ES|QL ES|QL related features in Kibana Team:ESQL ES|QL related features in Kibana release_note:skip Skip the PR/issue when compiling release notes v8.15.0 labels Jun 3, 2024
@drewdaemon
Copy link
Contributor Author

/ci

@drewdaemon
Copy link
Contributor Author

/ci

@drewdaemon
Copy link
Contributor Author

/ci

@drewdaemon drewdaemon marked this pull request as ready for review June 4, 2024 17:23
@drewdaemon drewdaemon requested a review from a team as a code owner June 4, 2024 17:23
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-esql (Team:ESQL)

Comment on lines 98 to 119
recast.visit(ast, {
visitVariableDeclarator(astPath) {
if (
n.Identifier.check(astPath.node.id) &&
astPath.node.id.name === functionsArrayIdentifier
) {
this.traverse(astPath);
}
return false;
},
visitProperty(astPath) {
if (
n.Identifier.check(astPath.node.key) &&
astPath.node.key.name === 'items' &&
n.ArrayExpression.check(astPath.node.value)
) {
foundArray = astPath.node.value;
this.abort();
}
return false;
},
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vadimkibana more AST fun :)

@stratoula
Copy link
Contributor

Not sure if the obs-ai-assistant could benefit from this script too. I know that you have already your implementation @dgieselaar but maybe you are interested in this.

@drewdaemon
Copy link
Contributor Author

drewdaemon commented Jun 4, 2024

Guess my celebration was a bit premature.

Need to deal with

  • weird line breaks
Screenshot 2024-06-04 at 4 55 26 PM
  • AsciiDoc cross references
Screenshot 2024-06-04 at 4 57 20 PM Screenshot 2024-06-04 at 4 55 54 PM

Potential improvement for the future: syntax highlighting?

@nik9000
Copy link
Member

nik9000 commented Jun 6, 2024

MOAR generated docs.

@nik9000
Copy link
Member

nik9000 commented Jun 6, 2024

Less hand maintained docs. MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM

@nik9000
Copy link
Member

nik9000 commented Jun 6, 2024

Excellent.

@drewdaemon
Copy link
Contributor Author

@stratoula this is ready for your review. Thanks!

@stratoula
Copy link
Contributor

/ci

@stratoula
Copy link
Contributor

I can't describe of how excited I am about this PR. ❤️ Just something goes wrong with:

I think all the other examples look great, the problem is with the ones with the escape characters.

@drewdaemon
Copy link
Contributor Author

Just something goes wrong with...

Actually, @stratoula you're talking about commands, no? The script only generates the docs for functions

@drewdaemon drewdaemon changed the title [ES|QL] gather inline documentation from Elasticsearch [ES|QL] gather inline function documentation from Elasticsearch Jun 10, 2024
@stratoula
Copy link
Contributor

Aaah shoot @drewdaemon, you are right. So apparently the above was a bug in main that got fixed from my PR. Sorry man, I am approving.

@drewdaemon drewdaemon enabled auto-merge (squash) June 10, 2024 19:31
@drewdaemon
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
textBasedLanguages 167.4KB 173.3KB +6.0KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@drewdaemon drewdaemon merged commit 940cee5 into elastic:main Jun 10, 2024
16 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Jun 10, 2024
drewdaemon added a commit that referenced this pull request Jun 13, 2024
## Summary

#184689 added a script to gather
ES|QL function docs from Elasticsearch.

This PR adds it to our CI pipeline!

Close #173492
Close #173817

---------

Co-authored-by: Kibana Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:ES|QL ES|QL related features in Kibana release_note:skip Skip the PR/issue when compiling release notes Team:ESQL ES|QL related features in Kibana v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants