Skip to content

[Bug]: AutoDeploy import checker silently passes unreadable source files #17753

Open

Description

@sylvesterkaczmarek

System Info

Platform-independent source inspection.

Reproduction

scripts/check_auto_deploy_imports.py::_check_file() currently does:

try:
    source = path.read_text()
except (OSError, UnicodeDecodeError):
    return []

If an AutoDeploy Python file cannot be read or decoded, the checker reports zero violations. The caller therefore treats that file as passing the import-discipline check.

Expected behavior

A checker that cannot inspect an in-scope source file should fail closed and report the read/decode failure as a violation.

Actual behavior

Read and decode failures are silently accepted.

Proposed fix

Return a diagnostic violation for read/decode failures and add a regression test that simulates an OSError.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    AutoDeploy<NV> AutoDeploy Backend

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions