Skip to content

Conversation

salaboy
Copy link
Collaborator

@salaboy salaboy commented Mar 20, 2025

Description

Add support for configuring AppHTTPMiddleware pipelines for testcontainers.

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #1270

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

@salaboy salaboy requested review from a team as code owners March 20, 2025 14:30
@salaboy salaboy force-pushed the 1270-app-middleware branch 2 times, most recently from b0abc03 to d608392 Compare March 20, 2025 14:31
@salaboy salaboy self-assigned this Mar 20, 2025
@salaboy salaboy added this to the v1.15 milestone Mar 20, 2025
@salaboy salaboy marked this pull request as draft March 20, 2025 14:31
@salaboy salaboy force-pushed the 1270-app-middleware branch from 4992bb9 to 2300d66 Compare March 20, 2025 14:47
@salaboy salaboy marked this pull request as ready for review March 20, 2025 14:47
@salaboy salaboy changed the title [WIP] Support App HTTP middleware Pipelines Support App HTTP middleware Pipelines Mar 20, 2025
@salaboy
Copy link
Collaborator Author

salaboy commented Mar 20, 2025

@artur-ciocanu @mcruzdev1 @cicoyle please review. This add the support the AppHttpMiddlewarePipeline to support microcks contract tests paths.

@salaboy salaboy force-pushed the 1270-app-middleware branch from 82b5d81 to 8172780 Compare March 20, 2025 14:55
@mcruzdev
Copy link
Contributor

Hi @salaboy, could you add a simple context about this solution to me?

@salaboy
Copy link
Collaborator Author

salaboy commented Mar 21, 2025

Ok, a bit of context:

  • AppHttpPipelines middleware allows us to change the behaviour of incoming and outgoing requests from the Dapr sidecar. This PR adds support for configuring these middleware pipelines.
  • This is needed to support service-to-service contract testing using microcks.io, something that we need if we want to simplify how to test multiple Dapr-enabled applications.

The main requirement here is to have a consistent story to test Spring Boot Dapr-enabled applications that use Service to Service communication (which requires two sidecars to communicate) in test scenarios, where instead of starting a second service we can use contract testing.

@salaboy salaboy force-pushed the 1270-app-middleware branch 2 times, most recently from 114129f to 65b53e5 Compare March 27, 2025 16:02
salaboy and others added 10 commits March 27, 2025 16:27
Signed-off-by: salaboy <[email protected]>
* Clean up pom

Signed-off-by: sirivarma <[email protected]>

* downgrade dependency

Signed-off-by: sirivarma <[email protected]>

* Fix

Signed-off-by: sirivarma <[email protected]>

* Fix thigns

Signed-off-by: sirivarma <[email protected]>

* Fix class not found

Signed-off-by: sirivarma <[email protected]>

* Remove import

Signed-off-by: sirivarma <[email protected]>

* Address comments

Signed-off-by: Siri Varma Vegiraju <[email protected]>

* cleanup

Signed-off-by: Siri Varma Vegiraju <[email protected]>

* Fix deps

Signed-off-by: siri-varma <[email protected]>

* cleanup

Signed-off-by: Siri Varma Vegiraju <[email protected]>
Signed-off-by: siri-varma <[email protected]>

* Fix deps

Signed-off-by: siri-varma <[email protected]>

* Fix things

Signed-off-by: siri-varma <[email protected]>

* Fix finals

Signed-off-by: siri-varma <[email protected]>

* Fix finals

Signed-off-by: siri-varma <[email protected]>

* upgrade test containers to .5

Signed-off-by: sirivarma <[email protected]>

* This is it

Signed-off-by: sirivarma <[email protected]>

* Fix feedback

Signed-off-by: sirivarma <[email protected]>

* Add comment

Signed-off-by: sirivarma <[email protected]>

* Add comment

Signed-off-by: sirivarma <[email protected]>

* Change to properties

Signed-off-by: sirivarma <[email protected]>

---------

Signed-off-by: sirivarma <[email protected]>
Signed-off-by: Siri Varma Vegiraju <[email protected]>
Signed-off-by: siri-varma <[email protected]>
Co-authored-by: Siri Varma Vegiraju <[email protected]>
Co-authored-by: salaboy <[email protected]>
Co-authored-by: artur-ciocanu <[email protected]>
Co-authored-by: Cassie Coyle <[email protected]>
Signed-off-by: salaboy <[email protected]>
* update docker version for ci

Signed-off-by: salaboy <[email protected]>

* adding DOCKER_HOST to all tests

Signed-off-by: salaboy <[email protected]>

* Move dependency management and plugin management to parent pom (#1260)

* Clean up pom

Signed-off-by: sirivarma <[email protected]>

* downgrade dependency

Signed-off-by: sirivarma <[email protected]>

* Fix

Signed-off-by: sirivarma <[email protected]>

* Fix thigns

Signed-off-by: sirivarma <[email protected]>

* Fix class not found

Signed-off-by: sirivarma <[email protected]>

* Remove import

Signed-off-by: sirivarma <[email protected]>

* Address comments

Signed-off-by: Siri Varma Vegiraju <[email protected]>

* cleanup

Signed-off-by: Siri Varma Vegiraju <[email protected]>

* Fix deps

Signed-off-by: siri-varma <[email protected]>

* cleanup

Signed-off-by: Siri Varma Vegiraju <[email protected]>
Signed-off-by: siri-varma <[email protected]>

* Fix deps

Signed-off-by: siri-varma <[email protected]>

* Fix things

Signed-off-by: siri-varma <[email protected]>

* Fix finals

Signed-off-by: siri-varma <[email protected]>

* Fix finals

Signed-off-by: siri-varma <[email protected]>

* upgrade test containers to .5

Signed-off-by: sirivarma <[email protected]>

* This is it

Signed-off-by: sirivarma <[email protected]>

* Fix feedback

Signed-off-by: sirivarma <[email protected]>

* Add comment

Signed-off-by: sirivarma <[email protected]>

* Add comment

Signed-off-by: sirivarma <[email protected]>

* Change to properties

Signed-off-by: sirivarma <[email protected]>

---------

Signed-off-by: sirivarma <[email protected]>
Signed-off-by: Siri Varma Vegiraju <[email protected]>
Signed-off-by: siri-varma <[email protected]>
Co-authored-by: Siri Varma Vegiraju <[email protected]>
Co-authored-by: salaboy <[email protected]>
Co-authored-by: artur-ciocanu <[email protected]>
Co-authored-by: Cassie Coyle <[email protected]>
Signed-off-by: salaboy <[email protected]>

* fixing flaky docker network

Signed-off-by: salaboy <[email protected]>

---------

Signed-off-by: salaboy <[email protected]>
Signed-off-by: sirivarma <[email protected]>
Signed-off-by: Siri Varma Vegiraju <[email protected]>
Signed-off-by: siri-varma <[email protected]>
Co-authored-by: Siri Varma Vegiraju <[email protected]>
Co-authored-by: Siri Varma Vegiraju <[email protected]>
Co-authored-by: artur-ciocanu <[email protected]>
Co-authored-by: Cassie Coyle <[email protected]>
Signed-off-by: salaboy <[email protected]>
Signed-off-by: Matheus Cruz <[email protected]>
Co-authored-by: Cassie Coyle <[email protected]>
Signed-off-by: salaboy <[email protected]>
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.4.1 to 5.4.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](codecov/codecov-action@v4.4.1...v5.4.0)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cassie Coyle <[email protected]>
Signed-off-by: salaboy <[email protected]>
Bumps [fossas/fossa-action](https://github.com/fossas/fossa-action) from 1.3.3 to 1.6.0.
- [Release notes](https://github.com/fossas/fossa-action/releases)
- [Commits](fossas/fossa-action@v1.3.3...v1.6.0)

---
updated-dependencies:
- dependency-name: fossas/fossa-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cassie Coyle <[email protected]>
Signed-off-by: salaboy <[email protected]>
Signed-off-by: salaboy <[email protected]>
Co-authored-by: artur-ciocanu <[email protected]>
Co-authored-by: Cassie Coyle <[email protected]>
Signed-off-by: salaboy <[email protected]>
Signed-off-by: salaboy <[email protected]>
@salaboy salaboy force-pushed the 1270-app-middleware branch from 78c8683 to ca97f7b Compare March 27, 2025 16:27
@cicoyle cicoyle merged commit de82451 into dapr:master Mar 27, 2025
7 of 9 checks passed
Copy link

codecov bot commented Mar 27, 2025

Codecov Report

Attention: Patch coverage is 76.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 75.50%. Comparing base (d759c53) to head (b9f5457).
Report is 120 commits behind head on master.

Files with missing lines Patch % Lines
...rc/main/java/io/dapr/testcontainers/ListEntry.java 60.00% 4 Missing ⚠️
...n/java/io/dapr/testcontainers/AppHttpPipeline.java 80.00% 0 Missing and 1 partial ⚠️
...ntainers/converter/ConfigurationYamlConverter.java 83.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1271      +/-   ##
============================================
- Coverage     76.91%   75.50%   -1.42%     
- Complexity     1592     1615      +23     
============================================
  Files           145      193      +48     
  Lines          4843     5099     +256     
  Branches        562      553       -9     
============================================
+ Hits           3725     3850     +125     
- Misses          821      934     +113     
- Partials        297      315      +18     

☔ 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.

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.

Support App Middleware configuration for Testcontainers
4 participants