Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions .github/scripts/validate-bridge-naming.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,26 @@
#
# Validates bridge naming conventions for Symfony AI components.
#
# Usage: validate-bridge-naming.sh <bridge_type> <bridge_path> [options_file]
# Usage: validate-bridge-naming.sh <bridge_type> [component] [options_file]
#
# Arguments:
# bridge_type Type of bridge (e.g., "store", "tool") - used in output messages and package suffix
# bridge_path Path pattern to bridge directories (e.g., "src/store/src/Bridge/*")
# component Name of the parent component (e.g., agent, platform, store)
# If not provided, defaults to bridge_type
# options_file Optional: Path to options.php file for config key validation (only needed for stores)
#
# Example:
# validate-bridge-naming.sh store "src/store/src/Bridge/*" src/ai-bundle/config/options.php
# validate-bridge-naming.sh tool "src/agent/src/Bridge/*"
# validate-bridge-naming.sh store
# validate-bridge-naming.sh store store src/ai-bundle/config/options.php
# validate-bridge-naming.sh tool agent
#
# The script builds the bridge path internally as: src/${component}/src/Bridge/*

set -e

BRIDGE_TYPE="${1:?Bridge type is required (e.g., store, tool)}"
BRIDGE_PATH="${2:?Bridge path pattern is required (e.g., src/store/src/Bridge/*)}"
COMPONENT="${2:-$BRIDGE_TYPE}"
BRIDGE_PATH="src/${COMPONENT}/src/Bridge/*"
OPTIONS_FILE="${3:-}"

ERRORS=0
Expand Down
14 changes: 9 additions & 5 deletions .github/scripts/validate-bridge-splitsh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,24 @@
#
# Validates that all bridge directories are configured in splitsh.json.
#
# Usage: validate-bridge-splitsh.sh <bridge_type> <bridge_path>
# Usage: validate-bridge-splitsh.sh <bridge_type> [component]
#
# Arguments:
# bridge_type Type of bridge (e.g., "store", "tool") - used in output messages
# bridge_path Path pattern to bridge directories (e.g., "src/store/src/Bridge/*")
# component Name of the parent component (e.g., agent, platform, store)
# If not provided, defaults to bridge_type
#
# Example:
# validate-bridge-splitsh.sh store "src/store/src/Bridge/*"
# validate-bridge-splitsh.sh tool "src/agent/src/Bridge/*"
# validate-bridge-splitsh.sh store
# validate-bridge-splitsh.sh tool agent
#
# The script builds the bridge path internally as: src/${component}/src/Bridge/*

set -e

BRIDGE_TYPE="${1:?Bridge type is required (e.g., store, tool)}"
BRIDGE_PATH="${2:?Bridge path pattern is required (e.g., src/store/src/Bridge/*)}"
COMPONENT="${2:-$BRIDGE_TYPE}"
BRIDGE_PATH="src/${COMPONENT}/src/Bridge/*"

SPLITSH_FILE="splitsh.json"

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/validation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ jobs:
uses: actions/checkout@v6

- name: Validate store bridge naming conventions
run: .github/scripts/validate-bridge-naming.sh store "src/store/src/Bridge/*" src/ai-bundle/config/options.php
run: .github/scripts/validate-bridge-naming.sh store store src/ai-bundle/config/options.php

- name: Validate store bridges are in splitsh.json
run: .github/scripts/validate-bridge-splitsh.sh store "src/store/src/Bridge/*"
run: .github/scripts/validate-bridge-splitsh.sh store

validate_tools:
name: Tool Bridges
Expand All @@ -44,7 +44,7 @@ jobs:
uses: actions/checkout@v6

- name: Validate tool bridge naming conventions
run: .github/scripts/validate-bridge-naming.sh tool "src/agent/src/Bridge/*"
run: .github/scripts/validate-bridge-naming.sh tool agent

- name: Validate tool bridges are in splitsh.json
run: .github/scripts/validate-bridge-splitsh.sh tool "src/agent/src/Bridge/*"
run: .github/scripts/validate-bridge-splitsh.sh tool agent