Skip to content

Conversation

@GravendeelJochem
Copy link
Contributor

INT-1269

@GravendeelJochem GravendeelJochem requested a review from a team as a code owner January 19, 2026 10:53
Copilot AI review requested due to automatic review settings January 19, 2026 10:53
@GravendeelJochem GravendeelJochem changed the title Feat/add capabilities proxy feat: add capabilities proxy Jan 19, 2026
@codecov
Copy link

codecov bot commented Jan 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.95%. Comparing base (616c759) to head (cbb3df6).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #408      +/-   ##
============================================
+ Coverage     94.91%   94.95%   +0.03%     
- Complexity     2032     2048      +16     
============================================
  Files           359      363       +4     
  Lines          6642     6694      +52     
============================================
+ Hits           6304     6356      +52     
  Misses          338      338              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds a capabilities proxy endpoint to enable communication with the Capabilities API service. The implementation follows the same pattern as the existing addresses microservice proxy.

Changes:

  • Added new CapabilitiesApiService to handle API communication with the capabilities service
  • Created CapabilitiesAction with CORS support for handling frontend requests
  • Registered the new proxy endpoint in the frontend context configuration

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Api/Service/CapabilitiesApiService.php New API service for communicating with the Capabilities API, handles authentication and base URL configuration
src/App/Action/Capabilities/CapabilitiesAction.php New action handler with CORS support for proxying requests to the capabilities service
src/App/Request/Capabilities/CapabilitiesEndpointRequest.php Request class defining the 'capabilities' property for the endpoint
src/Api/Response/CapabilitiesResponse.php Response wrapper for capabilities API responses
src/Api/PdkCapabilitiesActions.php Constants class defining the PROXY_CAPABILITIES action
config/pdk-services.php Registers the CapabilitiesApiService in the DI container
config/pdk-default.php Adds capabilitiesServiceUrl configuration with default value
config/actions.php Registers the proxyCapabilities action in the frontend context and adjusts formatting for alignment
tests/Unit/App/Action/Capabilities/CapabilitiesActionTest.php Comprehensive test coverage including request building, CORS handling, and OPTIONS preflight
tests/snapshots/ContextServiceTest__it_gets_context_data_with_data_set_delivery_options_config__1.json Updated snapshot to include the new proxyCapabilities endpoint configuration
tests/snapshots/FrontendRenderServiceTest__it_renders_component_with_data_set_delivery_options__1.json Updated snapshot to include the new proxyCapabilities endpoint configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@myparcel-bot myparcel-bot bot force-pushed the feat/add-capabilities-proxy branch from 61d2a3f to dd7dbfa Compare January 19, 2026 12:40
}

/** @var \MyParcelNL\Pdk\Api\Response\CapabilitiesResponse $response */
$response = $this->apiService->doRequest($this->buildRequest($request), CapabilitiesResponse::class);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here the SDK capabilities client needs to be used rather than internal PDK API logic (see acceptance criteria)

*/
public function buildRequest(Request $incomingRequest): ApiRequest
{
$query = $incomingRequest->query->all();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the correct way to call capabilities - but using the SDK for this should make it redundant

@myparcel-bot myparcel-bot bot added the changes requested (Auto) label Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

3 participants