chore: refactor metadata validation step (#64492)
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user