From d7c39ea00f03210c023c03dcd9af8664a13ba078 Mon Sep 17 00:00:00 2001 From: Sagar Gupta Date: Wed, 15 Apr 2026 08:34:52 +0530 Subject: [PATCH 1/2] fix(deploy-on-aws): check file extension before defusedxml dependency Move the defusedxml dependency check after the file extension filter so non-drawio files exit early and silently. Previously, every Edit/Write hook invocation showed a "Missing required dependency" warning even for unrelated files like markdown, JSON, etc. Fixes #129 --- plugins/deploy-on-aws/scripts/validate-drawio.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/deploy-on-aws/scripts/validate-drawio.sh b/plugins/deploy-on-aws/scripts/validate-drawio.sh index 26307f0..d5d4fe6 100755 --- a/plugins/deploy-on-aws/scripts/validate-drawio.sh +++ b/plugins/deploy-on-aws/scripts/validate-drawio.sh @@ -8,13 +8,6 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -# Ensure defusedxml is available (required for safe XML parsing) -# See scripts/requirements.txt or plugin README for installation instructions -python3 -c "import defusedxml" 2>/dev/null || { - echo '{"systemMessage": "Missing required dependency: defusedxml. Install it with: pip3 install defusedxml>=0.7.1"}' - exit 0 -} - # Read stdin (hook input JSON) INPUT=$(cat) @@ -29,7 +22,7 @@ except (json.JSONDecodeError, KeyError, TypeError, ValueError): print('') " 2>/dev/null || echo "") -# Only validate .drawio or .drawio.xml files +# Only validate .drawio or .drawio.xml files -- exit early for all other files if [[ -z "$FILE_PATH" ]]; then exit 0 fi @@ -42,6 +35,13 @@ if [[ ! -f "$FILE_PATH" ]]; then exit 0 fi +# Ensure defusedxml is available (required for safe XML parsing) +# See scripts/requirements.txt or plugin README for installation instructions +python3 -c "import defusedxml" 2>/dev/null || { + echo '{"systemMessage": "Missing required dependency: defusedxml. Install it with: pip3 install defusedxml>=0.7.1"}' + exit 0 +} + # Step 0: Run post-processing fixers BEFORE validation # This fixes badge overlaps, external actor placement, and legend sizing # timeout prevents runaway processes from blocking the hook indefinitely From 6422b0aced4c16df77167b294e53547e0521dee0 Mon Sep 17 00:00:00 2001 From: Sagar Gupta Date: Wed, 15 Apr 2026 09:20:40 +0530 Subject: [PATCH 2/2] chore: trigger CI re-run for contributor statement check