-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ES|QL] add docs step to sync pipeline (#186011)
## 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]>
- Loading branch information
1 parent
1c8fc1f
commit ca98a8b
Showing
5 changed files
with
30 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
VALIDATION_PACKAGE_DIR="packages/kbn-esql-validation-autocomplete" | ||
EDITOR_PACKAGE_DIR="packages/kbn-text-based-editor" | ||
GIT_SCOPE="$VALIDATION_PACKAGE_DIR/**/* $EDITOR_PACKAGE_DIR/**/*" | ||
|
||
report_main_step () { | ||
echo "--- $1" | ||
} | ||
|
@@ -19,7 +23,7 @@ main () { | |
|
||
.buildkite/scripts/bootstrap.sh | ||
|
||
cd "$KIBANA_DIR/packages/kbn-esql-validation-autocomplete" | ||
cd "$KIBANA_DIR/$VALIDATION_PACKAGE_DIR" | ||
|
||
report_main_step "Generate function definitions" | ||
|
||
|
@@ -29,9 +33,21 @@ main () { | |
|
||
yarn make:tests | ||
|
||
report_main_step "Generate inline function docs" | ||
|
||
cd "$KIBANA_DIR/$EDITOR_PACKAGE_DIR" | ||
|
||
yarn make:docs $PARENT_DIR/elasticsearch | ||
|
||
report_main_step "Run i18n check" | ||
|
||
cd "$KIBANA_DIR" | ||
|
||
node scripts/i18n_check.js --fix | ||
|
||
# Check for differences | ||
set +e | ||
git diff --exit-code --quiet . | ||
git diff --exit-code --quiet $GIT_SCOPE | ||
if [ $? -eq 0 ]; then | ||
echo "No differences found. Our work is done here." | ||
exit | ||
|
@@ -44,8 +60,8 @@ main () { | |
git config --global user.name "$KIBANA_MACHINE_USERNAME" | ||
git config --global user.email '[email protected]' | ||
|
||
PR_TITLE='[ES|QL] Update function definitions' | ||
PR_BODY='This PR updates the function definitions based on the latest metadata from Elasticsearch.' | ||
PR_TITLE='[ES|QL] Update function metadata' | ||
PR_BODY='This PR updates the function definitions and inline docs based on the latest metadata from Elasticsearch.' | ||
|
||
# Check if a PR already exists | ||
pr_search_result=$(gh pr list --search "$PR_TITLE" --state open --author "$KIBANA_MACHINE_USERNAME" --limit 1 --json title -q ".[].title") | ||
|
@@ -58,12 +74,12 @@ main () { | |
echo "No existing PR found. Committing changes." | ||
|
||
# Make a commit | ||
BRANCH_NAME="esql_generate_function_definitions_$(date +%s)" | ||
BRANCH_NAME="esql_generate_function_metadata_$(date +%s)" | ||
|
||
git checkout -b "$BRANCH_NAME" | ||
|
||
git add ./**/* | ||
git commit -m "Update function definitions" | ||
git add $GIT_SCOPE | ||
git commit -m "Update function metadata" | ||
|
||
report_main_step "Changes committed. Creating pull request." | ||
|
||
|
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters