Skip to content

Commit aef76e4

Browse files
committed
Add PHP SDK coverage for Apache Iggy
The PHP extension client needs to build independently from the root Rust workspace while still testing against the in-tree Rust SDK. This adds the PHP binding package, Dockerized integration test path, and CI detection so PHP-only changes exercise the right checks. Constraint: Foreign SDK crates are kept outside the root workspace like the existing Python and C++ SDKs Constraint: PHP extension builds require php-config, cargo-php, and libclang in containerized CI Rejected: Leave PHP tests manual only | PHP-only PRs would not run SDK-specific validation Confidence: medium Scope-risk: moderate Directive: Keep foreign/php excluded from the root Cargo workspace unless the extension build is intentionally made workspace-compatible Tested: cargo fmt --manifest-path foreign/php/Cargo.toml --check; composer validate --working-dir foreign/php --strict; PHP syntax lint for tests; cargo metadata --manifest-path foreign/php/Cargo.toml; docker compose config; docker compose build php-tests; PHP integration smoke against apache/iggy:latest with 23 passed, 3 skipped, 0 failed Not-tested: Full docker compose test with source-built Iggy server after php-tests image build
1 parent 239d7ee commit aef76e4

33 files changed

Lines changed: 8958 additions & 3 deletions

.github/config/components.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,15 @@ components:
200200
- "foreign/python/**"
201201
tasks: ["lint", "test", "build"]
202202

203+
sdk-php:
204+
depends_on:
205+
- "rust-sdk" # PHP SDK wraps the Rust SDK
206+
- "rust-server" # For integration tests
207+
- "ci-infrastructure" # CI changes trigger full regression
208+
paths:
209+
- "foreign/php/**"
210+
tasks: ["build", "test"]
211+
203212
sdk-node:
204213
depends_on:
205214
- "rust-sdk" # Node SDK depends on core SDK

.github/workflows/_detect.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ on:
2626
python_matrix:
2727
description: "Matrix for Python SDK"
2828
value: ${{ jobs.detect.outputs.python_matrix }}
29+
php_matrix:
30+
description: "Matrix for PHP SDK"
31+
value: ${{ jobs.detect.outputs.php_matrix }}
2932
node_matrix:
3033
description: "Matrix for Node SDK"
3134
value: ${{ jobs.detect.outputs.node_matrix }}
@@ -57,6 +60,7 @@ jobs:
5760
outputs:
5861
rust_matrix: ${{ steps.mk.outputs.rust_matrix }}
5962
python_matrix: ${{ steps.mk.outputs.python_matrix }}
63+
php_matrix: ${{ steps.mk.outputs.php_matrix }}
6064
node_matrix: ${{ steps.mk.outputs.node_matrix }}
6165
go_matrix: ${{ steps.mk.outputs.go_matrix }}
6266
java_matrix: ${{ steps.mk.outputs.java_matrix }}
@@ -227,7 +231,7 @@ jobs:
227231
console.log(`Total files changed: ${files.length}`);
228232
}
229233
230-
const groups = { rust:[], python:[], node:[], go:[], java:[], csharp:[], cpp:[], bdd:[], examples:[], other:[] };
234+
const groups = { rust:[], python:[], php:[], node:[], go:[], java:[], csharp:[], cpp:[], bdd:[], examples:[], other:[] };
231235
232236
// Process affected components and generate tasks
233237
console.log('');
@@ -250,6 +254,7 @@ jobs:
250254
251255
if (name === 'rust') groups.rust.push(...entries);
252256
else if (name === 'sdk-python') groups.python.push(...entries);
257+
else if (name === 'sdk-php') groups.php.push(...entries);
253258
else if (name === 'sdk-node') groups.node.push(...entries);
254259
else if (name === 'sdk-go') groups.go.push(...entries);
255260
else if (name === 'sdk-java') groups.java.push(...entries);
@@ -296,6 +301,7 @@ jobs:
296301
// Clear existing groups to avoid duplicates - we'll run everything anyway
297302
groups.rust = [];
298303
groups.python = [];
304+
groups.php = [];
299305
groups.node = [];
300306
groups.go = [];
301307
groups.java = [];
@@ -310,6 +316,7 @@ jobs:
310316
const entries = cfg.tasks.map(task => ({ component: name, task }));
311317
if (name === 'rust') groups.rust.push(...entries);
312318
else if (name === 'sdk-python') groups.python.push(...entries);
319+
else if (name === 'sdk-php') groups.php.push(...entries);
313320
else if (name === 'sdk-node') groups.node.push(...entries);
314321
else if (name === 'sdk-go') groups.go.push(...entries);
315322
else if (name === 'sdk-java') groups.java.push(...entries);
@@ -346,6 +353,7 @@ jobs:
346353
const jobSummary = [
347354
{ name: 'Rust', tasks: groups.rust },
348355
{ name: 'Python SDK', tasks: groups.python },
356+
{ name: 'PHP SDK', tasks: groups.php },
349357
{ name: 'Node SDK', tasks: groups.node },
350358
{ name: 'Go SDK', tasks: groups.go },
351359
{ name: 'Java SDK', tasks: groups.java },
@@ -378,6 +386,7 @@ jobs:
378386
379387
setOutput('rust_matrix', JSON.stringify(matrix(groups.rust)));
380388
setOutput('python_matrix', JSON.stringify(matrix(groups.python)));
389+
setOutput('php_matrix', JSON.stringify(matrix(groups.php)));
381390
setOutput('node_matrix', JSON.stringify(matrix(groups.node)));
382391
setOutput('go_matrix', JSON.stringify(matrix(groups.go)));
383392
setOutput('java_matrix', JSON.stringify(matrix(groups.java)));

.github/workflows/_test.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,23 @@ jobs:
9797
verbose: true
9898
override_pr: ${{ github.event.pull_request.number }}
9999

100+
# PHP SDK
101+
- name: Set up Docker Buildx for PHP
102+
if: inputs.component == 'sdk-php'
103+
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
104+
105+
- name: Run PHP SDK task
106+
if: inputs.component == 'sdk-php'
107+
run: |
108+
if [ "${{ inputs.task }}" = "build" ]; then
109+
docker compose -f foreign/php/docker-compose.test.yml build php-tests
110+
elif [ "${{ inputs.task }}" = "test" ]; then
111+
docker compose -f foreign/php/docker-compose.test.yml up --build --abort-on-container-exit --exit-code-from php-tests
112+
else
113+
echo "Unknown PHP SDK task: ${{ inputs.task }}"
114+
exit 1
115+
fi
116+
100117
# Node SDK
101118
- name: Run Node SDK task
102119
if: inputs.component == 'sdk-node'

.github/workflows/pre-merge.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,19 @@ jobs:
7878
secrets:
7979
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
8080

81+
# PHP SDK
82+
test-php:
83+
name: PHP • ${{ matrix.task }}
84+
needs: detect
85+
if: ${{ fromJson(needs.detect.outputs.php_matrix).include[0].component != 'noop' }}
86+
strategy:
87+
fail-fast: false
88+
matrix: ${{ fromJson(needs.detect.outputs.php_matrix) }}
89+
uses: ./.github/workflows/_test.yml
90+
with:
91+
component: ${{ matrix.component }}
92+
task: ${{ matrix.task }}
93+
8194
# Node SDK
8295
test-node:
8396
name: Node • ${{ matrix.task }}
@@ -194,7 +207,7 @@ jobs:
194207
status:
195208
name: CI Status
196209
runs-on: ubuntu-latest
197-
needs: [common, detect, test-rust, test-python, test-node, test-go, test-java, test-csharp, test-cpp, test-bdd, test-examples, test-other]
210+
needs: [common, detect, test-rust, test-python, test-php, test-node, test-go, test-java, test-csharp, test-cpp, test-bdd, test-examples, test-other]
198211
if: always()
199212
steps:
200213
- name: Get job execution times

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ members = [
6161
"core/tools",
6262
"examples/rust",
6363
]
64-
exclude = ["foreign/cpp", "foreign/python"]
64+
exclude = ["foreign/cpp", "foreign/php", "foreign/python"]
6565
resolver = "2"
6666

6767
[workspace.dependencies]

foreign/php/.cargo/config.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[target.aarch64-apple-darwin]
2+
rustflags = ["-C", "link-arg=-Wl,-undefined,dynamic_lookup"]
3+
4+
[target.x86_64-apple-darwin]
5+
rustflags = ["-C", "link-arg=-Wl,-undefined,dynamic_lookup"]

foreign/php/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/target
2+
.omx/
3+
/vendor
4+
/test-results

0 commit comments

Comments
 (0)