Docs: Deprecating packages_api and removing it from our pipelines (#54473)

This commit is contained in:
Timur Olzhabayev
2022-09-01 18:15:44 +02:00
committed by GitHub
parent 927ddf9376
commit b5b41988cf
31 changed files with 33 additions and 429 deletions

View File

@@ -1,23 +0,0 @@
#!/bin/bash
# abort if we get any error
set -eo pipefail
BUILD_MODE="${1-local}"
if [ "local" == "$BUILD_MODE" ]
then
# building grafana packages
echo "building grafana packages..."
yarn packages:build
else
echo "skip building grafana packages since it already built in previous steps..."
fi
# extract packages api documentation json
echo "extracting packages documentation data..."
yarn packages:docsExtract
# generating api documentation markdown
echo "generating markdown from documentation data..."
yarn packages:docsToMarkdown

View File

@@ -1,44 +0,0 @@
#!/bin/bash
# abort if we get any error
set -eo pipefail
pretty_print_result_of_report() {
# $1 = result of current report
echo -e "\n\n"
echo -e "-----------------------------------------------------\n"
echo -e "$1\n"
echo "-----------------------------------------------------"
}
BUILD_MODE="${1-local}"
BUILD_SCRIPT_PATH="$(realpath "$(dirname "$0")/ci-reference-docs-build.sh")"
if [ ! -d "$(realpath "$(dirname "$0")/../reports/docs/")" ]; then
echo "reports/docs directory doesn't exist. creating..."
# this script needs to be run after the packages have been built and the api-extractor has completed.
# shellcheck source=/scripts/ci-reference-docs-build.sh
if ! . "$BUILD_SCRIPT_PATH" "$BUILD_MODE";
then
echo "Failed to build packages and extract docs" >&2
exit 1
else
echo "Successfully built packages and extracted docs"
fi
fi
REPORT_PATH="$(realpath "$(dirname "$0")/../reports/docs/")"
WARNINGS_COUNT="$(find "$REPORT_PATH" -type f -name \*.log -print0 | xargs -0 grep -o "Warning:.*(ae-\|Warning:.*(tsdoc-" | wc -l | xargs)"
WARNINGS_COUNT_LIMIT=1212
if [ "$WARNINGS_COUNT" -gt $WARNINGS_COUNT_LIMIT ]; then
echo -e "API Extractor warnings/errors $WARNINGS_COUNT exceeded $WARNINGS_COUNT_LIMIT so failing build.\n"
echo "Please go to: https://github.com/grafana/grafana/blob/main/contribute/style-guides/code-comments.md for more information on how to add code comments."
fi
if [ "$WARNINGS_COUNT" -lt $WARNINGS_COUNT_LIMIT ]; then
pretty_print_result_of_report "Wohoo! Fewer warnings compared to last build 🎉🎈🍾✨\n\nYou can lower the threshold from $WARNINGS_COUNT_LIMIT to $WARNINGS_COUNT in the:\nscripts/ci-reference-docs-metrics.sh"
fi
pretty_print_result_of_report "API Extractor total warnings: $WARNINGS_COUNT"

View File

@@ -8,7 +8,6 @@ load(
'codespell_step',
'test_frontend_step',
'build_storybook_step',
'build_frontend_docs_step',
'build_frontend_package_step',
'build_docs_website_step',
'compile_build_cmd',
@@ -42,7 +41,6 @@ def docs_pipelines(edition, ver_mode, trigger):
codespell_step(),
lint_docs(),
build_frontend_package_step(edition=edition, ver_mode=ver_mode),
build_frontend_docs_step(edition=edition),
build_docs_website_step(),
compile_build_cmd(),
]

View File

@@ -437,19 +437,6 @@ def build_frontend_package_step(edition, ver_mode):
}
def build_frontend_docs_step(edition):
return {
'name': 'build-frontend-docs',
'image': build_image,
'depends_on': [
'build-frontend-packages'
],
'commands': [
'./scripts/ci-reference-docs-lint.sh ci',
]
}
def build_plugins_step(edition, ver_mode):
if ver_mode!='pr':
env = {
@@ -751,9 +738,6 @@ def build_docs_website_step():
'name': 'build-docs-website',
# Use latest revision here, since we want to catch if it breaks
'image': 'grafana/docs-base:latest',
'depends_on': [
'build-frontend-docs',
],
'commands': [
'mkdir -p /hugo/content/docs/grafana',
'cp -r docs/sources/* /hugo/content/docs/grafana/latest/',