1
0
mirror of synced 2025-12-19 18:14:56 -05:00

chore: refactor metadata validation step (#64492)

This commit is contained in:
Edward Gao
2025-08-04 15:26:46 -07:00
committed by GitHub
parent b47a6ef969
commit afd7d138f1
3 changed files with 14 additions and 13 deletions

View File

@@ -4,6 +4,7 @@
CONNECTORS_DIR="airbyte-integrations/connectors"
DOCS_BASE_DIR="docs/integrations"
METADATA_SERVICE_PATH='airbyte-ci/connectors/metadata_service/lib'
# Usage: connector_docs_path "source-foo"
# Returns a string "docs/integrations/sources/foo.md"

View File

@@ -5,9 +5,6 @@ source "${BASH_SOURCE%/*}/lib/util.sh"
source "${BASH_SOURCE%/*}/lib/parse_args.sh"
metadata_service_path='airbyte-ci/connectors/metadata_service/lib'
poetry install --directory $metadata_service_path
exit_code=0
while read -r connector; do
echo "---- PROCESSING METADATA FOR $connector ----"
@@ -15,7 +12,7 @@ while read -r connector; do
doc="$(connector_docs_path $connector)"
# Don't exit immediately. We should run against all connectors.
set +e
if ! poetry run --directory $metadata_service_path metadata_service validate "$meta" "$doc"; then
if ! poetry run --directory $METADATA_SERVICE_PATH metadata_service validate "$meta" "$doc"; then
exit_code=1
fi
# Reenable the "exit on error" option.
@@ -24,6 +21,6 @@ done < <(get_connectors)
if test $exit_code -ne 0; then
echo '------------'
echo 'One or more connectors failed to validate/upload metadata. See previous logs for more information.'
echo 'One or more connectors had invalid metadata.yaml. See previous logs for more information.'
exit $exit_code
fi