Skip to content

IBX-11826: Cleaned up http-cache ResponseTagger deprecations - #82

Merged
konradoboza merged 4 commits into
6.0from
IBX-11826-Clean-up-http-cache-ResponseTagger-deprecations
Jul 28, 2026
Merged

IBX-11826: Cleaned up http-cache ResponseTagger deprecations#82
konradoboza merged 4 commits into
6.0from
IBX-11826-Clean-up-http-cache-ResponseTagger-deprecations

Conversation

@wiewiurdp

@wiewiurdp wiewiurdp commented Jun 5, 2026

Copy link
Copy Markdown
Contributor
🎫 Issue IBX-11826

Related PRs:

#78

Description:

This PR finalizes the ResponseTagger cleanup introduced in ibexa/http-cache#78.

It adds supports(mixed $value): bool to the ResponseTagger interface, removes AbstractValueTagger, and simplifies DispatcherTagger by dropping the BC fallback for implementations without supports().

Additionally, DispatcherTagger now signals when no tagger supports the given value — throwing an InvalidArgumentException in debug mode and logging a warning otherwise — instead of silently doing nothing.

###Regressions:
ibexa/commerce#1841

###QA
Need some sanities.

@wiewiurdp
wiewiurdp marked this pull request as ready for review June 5, 2026 13:02
@wiewiurdp
wiewiurdp requested a review from a team June 5, 2026 13:02
@ibexa-workflow-automation-1
ibexa-workflow-automation-1 Bot requested review from Steveb-p, ViniTou, alongosz, barw4, bnowak, ciastektk, konradoboza, mikadamczyk and tbialcz and removed request for a team June 5, 2026 13:02
Comment thread src/lib/ResponseTagger/Value/ContentInfoTagger.php Outdated
Comment thread src/lib/ResponseTagger/Value/LocationTagger.php Outdated
…ated tests to mock `ResponseTagger` instead of specific tagger classes.
@wiewiurdp
wiewiurdp force-pushed the IBX-11826-Clean-up-http-cache-ResponseTagger-deprecations branch from 14d267e to 21f8d30 Compare June 5, 2026 15:11
@wiewiurdp
wiewiurdp requested a review from barw4 June 5, 2026 15:25
Comment thread src/contracts/ResponseTagger/ResponseTagger.php Outdated
Comment thread src/lib/ResponseTagger/Delegator/ContentValueViewTagger.php Outdated
Comment thread src/lib/ResponseTagger/Delegator/LocationValueViewTagger.php Outdated
Comment thread src/lib/ResponseTagger/Value/ContentInfoTagger.php Outdated
Comment thread src/lib/ResponseTagger/Value/LocationTagger.php Outdated

@konradoboza konradoboza left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As long as both CI here and the regression build agree.

'%s does not implement supports(). This will be required in 6.0, supports() will be a part of ResponseTagger interface',
get_debug_type($tagger),
);
if ($tagger->supports($value)) {

@mnocon mnocon Jun 18, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Going back the initial idea that pushed us towards these changes - maybe we throw an exception* if there's no tagger supporting given value? As this must be a mistake.

The origial report said that if you pass a Content object (instead of ContentInfo) to be tagged, nothing happens and you get no information that something is wrong.

*or log a warning, or log a warning in dev mode, or something else

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I went with your "log a warning" idea, but split it by environment:

debug mode (dev/test) → throw an InvalidArgumentException, so the mistake surfaces immediately, including in the test suite
prod → log a warning instead

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me at least.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks great to me, thank you! 🙇

@sonarqubecloud

sonarqubecloud Bot commented Jul 3, 2026

Copy link
Copy Markdown

@wiewiurdp
wiewiurdp requested review from barw4, konradoboza and mnocon July 3, 2026 12:25
@konradoboza
konradoboza merged commit 5ab061c into 6.0 Jul 28, 2026
32 checks passed
@konradoboza
konradoboza deleted the IBX-11826-Clean-up-http-cache-ResponseTagger-deprecations branch July 28, 2026 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants