Add interactive Ray.Di bindings documentation#101
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughAdds a ChangesBindings documentation output
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant ApiDoc
participant Config
participant BindingsHtml
participant Browser
ApiDoc->>Config: load context, bindings markdown, and DOT graph
ApiDoc->>BindingsHtml: render bindings.html
ApiDoc->>BindingsHtml: inject graph payload and assets
Browser->>ApiDoc: load generated HTML
Browser->>Browser: render DOT as SVG and filter graph nodes
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/ApiDocTest.php (1)
195-203: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert actual binding data, not only the page shell.
This can pass if
bindingsMarkdownfalls back to the zero-bindings page while DOT generation still succeeds. Assert a known binding/module/provenance row or expected count from the Fake application.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/ApiDocTest.php` around lines 195 - 203, Strengthen the binding documentation assertions in the test around the bindings.html checks so they verify actual Fake application binding data, not just shell elements and DOT output. Assert a known binding/module or provenance row, or the expected binding count, using the symbols and expected values established by the Fake application fixtures.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/ApiDocTest.php`:
- Around line 195-203: Strengthen the binding documentation assertions in the
test around the bindings.html checks so they verify actual Fake application
binding data, not just shell elements and DOT output. Assert a known
binding/module or provenance row, or the expected binding count, using the
symbols and expected values established by the Fake application fixtures.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 57693d76-e491-46fe-9589-09979235d5d5
📒 Files selected for processing (10)
.gitignoreCLAUDE.mdapidoc.xsdcomposer.jsondocs/assets/bindings-object-graph.cssdocs/assets/bindings-object-graph.jssrc/ApiDoc.phpsrc/Config.phptests/ApiDocTest.phptests/apidoc.bindings.xml
Raise bear/sunday to ^1.8, ray/di to ^2.22, and bear/package to ^1.20 so that --prefer-lowest resolves bear/query-repository to >=1.13 (doctrine-free Symfony Cache) instead of 1.6.0, whose QueryRepositoryModule binds Doctrine\Common\Cache\Cache and fails with Ray\Di NotFound since doctrine/cache is no longer a dependency.
|
Closing in favor of #102. #102 contains all of this PR's commits plus the ray/di 2.22 explicit-bindings-snapshots adaptation, and is now fully green (cs, static analysis, and PHPUnit across PHP 8.2/8.3/8.5 × highest/lowest). This PR cannot pass CI on its own: keeping the old deps (ray/di ^2.21) breaks static analysis (Ray\Bindings undefined), while bumping to ray/di ^2.22 breaks testBindingsOutput without the explicit-collection migration that lives in #102. |
Problem
Ray.Di bindings and provenance are difficult to inspect as a large Markdown report, and the relationships between selected bindings are not visible in context.
Approach
bindingsoutput format and optional application DI context.bindings.htmlfrom Ray.Di diagnostics and export the object graph as DOT.ray/object-visual-grapheras a runtime dependency and avoid graph work for non-bindings formats.Dependency
Validation
composer cs-fixcomposer test— 139 tests, 583 assertions; one existing deprecationcomposer sa— PHPStan, Psalm, and PHPMD passednode --check docs/assets/bindings-object-graph.jscomposer validate --strict --no-check-publishFull
composer cswith the locally updated toolchain additionally reports four fixable issues in unchangedsrc-alps/ProfileDictionary.php; that file is intentionally excluded from this PR.