Andrushika commented on code in PR #74654:
URL: https://github.com/apache/airflow/pull/74654#discussion_r4266135565
##########
scripts/ci/prek/extract_permissions.py:
##########
@@ -276,8 +279,11 @@ def extract_from_file(path: pathlib.Path) ->
list[PermissionEntry]:
source = path.read_text(encoding="utf-8")
tree = ast.parse(source)
except (OSError, SyntaxError) as exc:
- print(f"[WARN] Could not parse {path.name}: {exc}", file=sys.stderr)
- return []
+ # Returning no entries here would quietly shrink a security reference
that readers
+ # trust to be complete, and the caller has no way to tell that apart
from a file
+ # that genuinely declares no routes. Stop the run instead.
+ print(f"[FAIL] Could not parse {path}: {exc}", file=sys.stderr)
+ raise SystemExit(1)
Review Comment:
Nit: raise the exception here and handling the exit at `main()` would be
cleaner.
##########
scripts/ci/prek/extract_permissions.py:
##########
Review Comment:
Could be fixed here or in another follow-up PR: our docs still ask users to
regenerate with plain Python, but it could bypass the version lock. We could
tell users to use nv instead.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]