Skip to content

Commit a026761

Browse files
committed
minor #1113 Simplify validate-bridge-*.sh arguments (OskarStark)
This PR was squashed before being merged into the main branch. Discussion ---------- Simplify `validate-bridge-*.sh` arguments | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | Docs? | no | Issues | -- | License | MIT Build bridge path internally from component name instead of requiring full path pattern as argument. Commits ------- 05c56bc Simplify `validate-bridge-*.sh` arguments
2 parents 92134c3 + 05c56bc commit a026761

File tree

3 files changed

+23
-14
lines changed

3 files changed

+23
-14
lines changed

.github/scripts/validate-bridge-naming.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,26 @@
22
#
33
# Validates bridge naming conventions for Symfony AI components.
44
#
5-
# Usage: validate-bridge-naming.sh <bridge_type> <bridge_path> [options_file]
5+
# Usage: validate-bridge-naming.sh <bridge_type> [component] [options_file]
66
#
77
# Arguments:
88
# bridge_type Type of bridge (e.g., "store", "tool") - used in output messages and package suffix
9-
# bridge_path Path pattern to bridge directories (e.g., "src/store/src/Bridge/*")
9+
# component Name of the parent component (e.g., agent, platform, store)
10+
# If not provided, defaults to bridge_type
1011
# options_file Optional: Path to options.php file for config key validation (only needed for stores)
1112
#
1213
# Example:
13-
# validate-bridge-naming.sh store "src/store/src/Bridge/*" src/ai-bundle/config/options.php
14-
# validate-bridge-naming.sh tool "src/agent/src/Bridge/*"
14+
# validate-bridge-naming.sh store
15+
# validate-bridge-naming.sh store store src/ai-bundle/config/options.php
16+
# validate-bridge-naming.sh tool agent
17+
#
18+
# The script builds the bridge path internally as: src/${component}/src/Bridge/*
1519

1620
set -e
1721

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

2227
ERRORS=0

.github/scripts/validate-bridge-splitsh.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,24 @@
22
#
33
# Validates that all bridge directories are configured in splitsh.json.
44
#
5-
# Usage: validate-bridge-splitsh.sh <bridge_type> <bridge_path>
5+
# Usage: validate-bridge-splitsh.sh <bridge_type> [component]
66
#
77
# Arguments:
88
# bridge_type Type of bridge (e.g., "store", "tool") - used in output messages
9-
# bridge_path Path pattern to bridge directories (e.g., "src/store/src/Bridge/*")
9+
# component Name of the parent component (e.g., agent, platform, store)
10+
# If not provided, defaults to bridge_type
1011
#
1112
# Example:
12-
# validate-bridge-splitsh.sh store "src/store/src/Bridge/*"
13-
# validate-bridge-splitsh.sh tool "src/agent/src/Bridge/*"
13+
# validate-bridge-splitsh.sh store
14+
# validate-bridge-splitsh.sh tool agent
15+
#
16+
# The script builds the bridge path internally as: src/${component}/src/Bridge/*
1417

1518
set -e
1619

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

2024
SPLITSH_FILE="splitsh.json"
2125

.github/workflows/validation.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ jobs:
3131
uses: actions/checkout@v6
3232

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

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

3939
validate_tools:
4040
name: Tool Bridges
@@ -44,7 +44,7 @@ jobs:
4444
uses: actions/checkout@v6
4545

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

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

0 commit comments

Comments
 (0)