Skip to content

deploy-on-aws: validate-drawio hook fires dependency warning on every file write, not just .drawio files #129

@mackenzieclark

Description

@mackenzieclark

Problem

The deploy-on-aws plugin registers a PostToolUse hook on Edit|Write that runs validate-drawio.sh. This script checks for the defusedxml Python dependency before checking whether the file being written is actually a .drawio file.

As a result, every single file write (HTML, markdown, JSON, memory files, etc.) produces:

Missing required dependency: defusedxml. Install it with: pip3 install defusedxml>=0.7.1

...even though the hook has nothing to do with the file being written.

Location

scripts/validate-drawio.sh, lines 13-16:

python3 -c "import defusedxml" 2>/dev/null || {
  echo '{"systemMessage": "Missing required dependency: defusedxml. Install it with: pip3 install defusedxml>=0.7.1"}'
  exit 0
}

The file extension check comes later in the script. The dependency check should either:

  1. Come after the file type check (so non-drawio files exit early and silently), or
  2. The hook matcher in hooks.json should be scoped to .drawio files rather than matching all Edit|Write events

Impact

Anyone with the plugin enabled who hasn't installed defusedxml sees this warning on every file write across every project and file type. Produces noise that undermines trust in the hook system.

Version

deploy-on-aws v1.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions