From 7a6f04c653defc9b01e65ad1c554d620c6b35245 Mon Sep 17 00:00:00 2001 From: Stanislav Zhuk Date: Thu, 4 Jun 2026 14:36:38 +0300 Subject: [PATCH] feat(update-checker): validate add-on dependencies --- .github/scripts/update-checker.sh | 39 +++++++++++++++++++++++++++++++ install.yaml | 1 + 2 files changed, 40 insertions(+) diff --git a/.github/scripts/update-checker.sh b/.github/scripts/update-checker.sh index 89bf6a6..aedae31 100755 --- a/.github/scripts/update-checker.sh +++ b/.github/scripts/update-checker.sh @@ -365,6 +365,42 @@ check_ddev_generated() { done } +# Check that dependencies in install.yaml use org/repo format +check_dependencies() { + local install_yaml="install.yaml" + + local line entry in_section + local list_item_re='^[[:space:]]*-[[:space:]]+(.*)' + + in_section=false + while IFS= read -r line; do + if [[ "$line" == "dependencies:" ]]; then + in_section=true + continue + fi + + [[ "$in_section" != "true" ]] && continue + + # A top-level YAML key (starts with a letter) ends the section + [[ "$line" =~ ^[a-zA-Z] ]] && break + + [[ "$line" =~ $list_item_re ]] || continue + entry="${BASH_REMATCH[1]}" + + [[ -z "$entry" ]] && continue + + if [[ "$entry" != */* ]]; then + local example_repo + if [[ "$entry" == ddev-* ]]; then + example_repo="ddev/$entry" + else + example_repo="ddev/ddev-$entry" + fi + actions+=("install.yaml dependency '$entry' should use org/repo format (e.g. '$example_repo'), see upstream file $UPSTREAM/$install_yaml") + fi + done < "$install_yaml" +} + # Check .gitattributes check_gitattributes() { local gitattributes=".gitattributes" @@ -467,6 +503,9 @@ run_checks() { # Check #ddev-generated in files listed in install.yaml check_ddev_generated + # Check dependencies use org/repo format + check_dependencies + # Check docker-compose.*.yaml for conditions check_docker_compose_yaml diff --git a/install.yaml b/install.yaml index fa1e29a..06ed62f 100644 --- a/install.yaml +++ b/install.yaml @@ -85,6 +85,7 @@ global_files: ddev_version_constraint: '>= v1.24.10' # List of add-on names that this add-on depends on +# Dependencies must use org/repo format (e.g. ddev/ddev-redis), otherwise DDEV cannot resolve them dependencies: # - ddev/ddev-redis