Skip to content

Context improvements explorations#2049

Draft
jponge wants to merge 8 commits intosmallrye:mainfrom
jponge:scratchpad/context-improvements
Draft

Context improvements explorations#2049
jponge wants to merge 8 commits intosmallrye:mainfrom
jponge:scratchpad/context-improvements

Conversation

@jponge
Copy link
Member

@jponge jponge commented Jan 11, 2026

This is a draft of improvements to the Context API in a bid to improve framework integrations, and especially support context scoping rules that seems coherent.

For instance we want to make sure that merging ensures that each upstream branch has its own context rather than a single one:

Uni a
Uni b

a (ctx_1)
 \-join(a, b) -> (root_ctx)
 /
b (ctx_2)

where ctx_1 and ctx_2 are forked from root_ctx at the pipeline subscription time

@jponge
Copy link
Member Author

jponge commented Jan 11, 2026

(this is a work-in-progress, for instance all operators that should fork a context are not doing it as I'm writing this)

@codecov
Copy link

codecov bot commented Jan 11, 2026

Codecov Report

❌ Patch coverage is 88.23529% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.05%. Comparing base (baef9fb) to head (fa74305).
⚠️ Report is 23 commits behind head on main.

Files with missing lines Patch % Lines
...y/operators/multi/MultiContextForkingOperator.java 83.33% 1 Missing and 1 partial ⚠️
...llrye/mutiny/operators/multi/MultiRetryWhenOp.java 71.42% 1 Missing and 1 partial ⚠️
...tation/src/main/java/io/smallrye/mutiny/Multi.java 66.66% 1 Missing ⚠️
...entation/src/main/java/io/smallrye/mutiny/Uni.java 66.66% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #2049      +/-   ##
============================================
- Coverage     89.16%   89.05%   -0.11%     
- Complexity     3121     3128       +7     
============================================
  Files           412      414       +2     
  Lines         13294    13331      +37     
  Branches       1688     1689       +1     
============================================
+ Hits          11853    11872      +19     
- Misses          813      823      +10     
- Partials        628      636       +8     
Files with missing lines Coverage Δ
...tion/src/main/java/io/smallrye/mutiny/Context.java 91.80% <100.00%> (+0.57%) ⬆️
...va/io/smallrye/mutiny/operators/AbstractMulti.java 100.00% <100.00%> (ø)
...java/io/smallrye/mutiny/operators/AbstractUni.java 90.32% <100.00%> (+0.32%) ⬆️
...allrye/mutiny/operators/uni/UniAndCombination.java 90.65% <100.00%> (ø)
...utiny/operators/uni/UniContextForkingOperator.java 100.00% <100.00%> (ø)
...mallrye/mutiny/operators/uni/UniOrCombination.java 91.17% <100.00%> (ø)
...lrye/mutiny/operators/uni/builders/UniJoinAll.java 95.83% <100.00%> (ø)
...ye/mutiny/operators/uni/builders/UniJoinFirst.java 89.39% <100.00%> (ø)
...tation/src/main/java/io/smallrye/mutiny/Multi.java 86.36% <66.66%> (-3.12%) ⬇️
...entation/src/main/java/io/smallrye/mutiny/Uni.java 88.88% <66.66%> (-2.03%) ⬇️
... and 2 more

... and 13 files with indirect coverage changes

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

@FroMage
Copy link
Contributor

FroMage commented Jan 12, 2026

I'd probably be able to give better feedback if this proposal had docs and sample usage, but perhaps we should first establish better base for docs as discussed at #2037 ?

@jponge
Copy link
Member Author

jponge commented Jan 12, 2026

This one is not even ready for review 😉

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.

2 participants