Skip to content

Commit

Permalink
get version in outputs, make stacktraces Unknown Errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Shalucik committed Jun 19, 2024
1 parent f47df6b commit 3f7e793
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/build-and-publish-dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ jobs:
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- name: Autobump version
shell: bash
# language=bash
run: |
set -e
# https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
VERSION=$(echo $GITHUB_REF | grep -oP '(?<=/)(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$')
PLACEHOLDER='__version__ = "0.0.0-dev"'
VERSION_FILE='geopackage_validator/__init__.py'
grep "$PLACEHOLDER" "$VERSION_FILE" || { echo 'version placeholder not found'; exit 1; }
sed -i "s/$PLACEHOLDER/__version__ = \"${VERSION}\"/g" "$VERSION_FILE"
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v3
Expand Down
12 changes: 6 additions & 6 deletions geopackage_validator/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ def gdal_error_handler(err_class, err_num, error):
for t in traceback.format_exception(exc_type, exc_value, exc_traceback)
]
output = format_result(
validation_code=validator.validation_code,
validation_description=f"No unexpected errors must occur for: {validator.__doc__}",
level=validator.level,
validation_code="UNKNOWN_WARNINGS",
validation_description=f"No unexpected errors must occur for: {validator.code}: {validator.__doc__}",
level=ValidationLevel.UNKNOWN_WARNING,
trace=trace,
)
validation_results.append(output)
Expand All @@ -171,9 +171,9 @@ def gdal_error_handler(err_class, err_num, error):
validation_results[-1]["locations"].extend(current_gdal_error_traces)
else:
output = format_result(
validation_code=validator.validation_code,
validation_description=f"No unexpected errors must occur for: {validator.__doc__}",
level=validator.level,
validation_code="UNKNOWN_WARNINGS",
validation_description=f"No unexpected errors must occur for: {validator.code}: {validator.__doc__}",
level=ValidationLevel.UNKNOWN_WARNING,
trace=current_gdal_error_traces,
)
validation_results.append(output)
Expand Down

0 comments on commit 3f7e793

Please sign in to comment.