Skip to content

feat(php): add SDK examples component#3368

Merged
hubcio merged 5 commits into
apache:masterfrom
countradooku:feat/php-sdk-examples
May 29, 2026
Merged

feat(php): add SDK examples component#3368
hubcio merged 5 commits into
apache:masterfrom
countradooku:feat/php-sdk-examples

Conversation

@countradooku
Copy link
Copy Markdown
Contributor

@countradooku countradooku commented May 29, 2026

Summary

  • add PHP SDK examples under examples/php for getting-started and basic producer/consumer flows
  • add an examples-php component entry with PHP SDK, Rust SDK, Rust server, and CI infrastructure dependencies
  • wire PHP examples into _test_examples.yml and scripts/run-examples-from-readme.sh

Closes #3311.

Validation

  • php -l for all PHP example files
  • bash -n scripts/run-examples-from-readme.sh
  • git diff --check
  • ./scripts/ci/markdownlint.sh examples/php/README.md
  • ./scripts/ci/license-headers.sh --check
  • cargo build --locked --bin iggy-server
  • cargo build in foreign/php
  • pre-push hook: cargo clippy passed; Go lint suites passed; Java/C# skipped as no relevant files changed

PHP examples were missing from the repository example runner and component detection graph, so PHP SDK changes did not get the same examples coverage as the other SDKs. Add producer and consumer examples, teach the README runner about PHP, and wire examples-php into CI.

Constraint: examples-php must depend on the PHP SDK, Rust SDK, Rust server, and CI infrastructure components.

Rejected: Fold PHP examples into sdk-php tasks | existing repository pattern keeps examples as separate components.

Confidence: high

Scope-risk: narrow

Directive: Keep PHP example commands parseable by scripts/run-examples-from-readme.sh when adding new examples.

Tested: php -l examples/php/**/*.php

Tested: bash -n scripts/run-examples-from-readme.sh

Tested: git diff --check

Tested: ./scripts/ci/markdownlint.sh examples/php/README.md

Tested: ./scripts/ci/license-headers.sh --check

Tested: cargo build --locked --bin iggy-server

Tested: cargo build in foreign/php

Not-tested: Full PHP example runner on macOS; local iggy-server did not emit readiness and logged memory binding failures.
@countradooku countradooku changed the title Add PHP SDK examples component feat(php): add SDK examples component May 29, 2026
@countradooku countradooku marked this pull request as ready for review May 29, 2026 07:59
@github-actions github-actions Bot added the S-waiting-on-review PR is waiting on a reviewer label May 29, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.62%. Comparing base (f139f0e) to head (c096b62).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3368      +/-   ##
============================================
- Coverage     73.66%   73.62%   -0.04%     
  Complexity      943      943              
============================================
  Files          1223     1223              
  Lines        115710   115710              
  Branches      92447    92475      +28     
============================================
- Hits          85234    85195      -39     
- Misses        27607    27610       +3     
- Partials       2869     2905      +36     
Components Coverage Δ
Rust Core 74.64% <ø> (-0.02%) ⬇️
Java SDK 58.44% <ø> (ø)
C# SDK 69.41% <ø> (-0.52%) ⬇️
Python SDK 81.06% <ø> (ø)
Node SDK 91.53% <ø> (+0.01%) ⬆️
Go SDK 40.20% <ø> (ø)
see 27 files with indirect coverage changes
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread scripts/run-examples-from-readme.sh Outdated
Comment thread examples/php/src/common.php Outdated
Comment thread examples/php/src/common.php Outdated
Comment thread scripts/run-examples-from-readme.sh
Comment thread examples/php/README.md Outdated
Comment thread examples/php/basic/producer.php Outdated
@github-actions github-actions Bot added S-waiting-on-author PR is waiting on author response and removed S-waiting-on-review PR is waiting on a reviewer labels May 29, 2026
The PHP examples runner discovered local extension artifacts with repo-root-relative paths, which broke once the shared README runner changed into examples/php. Normalize discovered extension paths to absolute paths and apply the PHP example cleanups requested in review.

Constraint: CI already exports an absolute PHP_IGGY_EXTENSION, but local runs need the same property after cd examples/php.

Rejected: Keep Windows DLL candidates | examples CI does not run PHP on Windows and the local fallback only needs Linux/macOS artifacts.

Confidence: high

Scope-risk: narrow

Directive: Keep PHP_IGGY_EXTENSION absolute before run_language_examples changes directories.

Tested: php -l examples/php/**/*.php

Tested: bash -n scripts/run-examples-from-readme.sh

Tested: git diff --check

Tested: ./scripts/ci/markdownlint.sh examples/php/README.md

Tested: ./scripts/ci/license-headers.sh --check

Not-tested: Full PHP example runner on macOS; local iggy-server readiness issue persists independently of this path fix.
@countradooku
Copy link
Copy Markdown
Contributor Author

/ready

@github-actions github-actions Bot added S-waiting-on-review PR is waiting on a reviewer and removed S-waiting-on-author PR is waiting on author response labels May 29, 2026
@hubcio hubcio merged commit 2c28667 into apache:master May 29, 2026
88 checks passed
@github-actions github-actions Bot removed the S-waiting-on-review PR is waiting on a reviewer label May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PHP SDK: add examples and examples-php component

3 participants