Skip to content

Tidy the bundle's structure and constraints - #53

Merged
loevgaard merged 1 commit into
masterfrom
fix/30-bundle-structure
Sep 14, 2026
Merged

loevgaard merged 1 commit into
masterfrom
fix/30-bundle-structure

Conversation

@loevgaard

Copy link
Copy Markdown
Member

Fixes #30

Stacked on #52.

What is in

One source of truth for the tag bag check. Configuration::isTagBagBundleInstalled() and the four Assert calls in the extension both decided what counts as an installed tag bag bundle, with the package name and ^3.0 written twice. Both now call InstalledBundles::hasTagBagBundle(), and the constraint is a constant.

Symfony's exception types. The extension used Webmozart\Assert\Assert::true() and ::keyExists(), which throw \InvalidArgumentException. Symfony's convention for "bundle X requires bundle Y" is \LogicException, so that is what it throws now, with a message that also names the way out (client_side.enabled: false). The integration test asserting on the old type is updated.

Dependency constraints. symfony/event-dispatcher-contracts drops the ^2.5 branch: 2.x pairs with Symfony 5.4, which this bundle no longer supports, and Symfony 6.4's event dispatcher accepts ^3. Added a suggest section for nyholm/psr7, symfony/http-client, setono/tag-bag-bundle and setono/consent-bundle, which the README already told people to install.

What is deliberately out

AbstractBundle and PHP service configuration. The XML DI format is deprecated in Symfony 7.4 and removed in 8.0, so this migration is needed for Symfony 8 support, which is blocked on dependencies rather than on this bundle: setono/bot-detection-bundle allows ^5.4 || ^6.4 || ^7.0, and the consent and tag bag bundles have no Symfony 8 constraints either. Doing the migration now would be churn with no user-visible effect, so the extension keeps its comment marking the spot, and this stays with the Symfony 8 work.

Moving symfony/messenger to suggest. Server side tracking is on by default, so messenger is required for the default configuration. Making it optional would mean guarding the message and handler classes, which costs more than it saves.

@codecov

codecov Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.93%. Comparing base (3cf8998) to head (7b3e810).

Files with missing lines Patch % Lines
src/DependencyInjection/InstalledBundles.php 75.00% 1 Missing ⚠️
...ncyInjection/SetonoMetaConversionsApiExtension.php 92.30% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master      #53      +/-   ##
============================================
- Coverage     82.08%   81.93%   -0.16%     
- Complexity      142      148       +6     
============================================
  Files            30       31       +1     
  Lines           480      487       +7     
============================================
+ Hits            394      399       +5     
- Misses           86       88       +2     

☔ View full report in Codecov by Harness.
📢 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.

@loevgaard
loevgaard force-pushed the fix/30-bundle-structure branch from c17b1a2 to df6dd77 Compare September 7, 2026 12:03
@loevgaard
loevgaard force-pushed the fix/30-bundle-structure branch from df6dd77 to 00aed2f Compare September 7, 2026 12:18
@loevgaard
loevgaard force-pushed the fix/30-bundle-structure branch from 00aed2f to 964b4b5 Compare September 7, 2026 12:47
@loevgaard
loevgaard force-pushed the fix/30-bundle-structure branch from 964b4b5 to 6064e42 Compare September 7, 2026 12:51
@loevgaard
loevgaard force-pushed the fix/30-bundle-structure branch from 6064e42 to 064cf2d Compare September 7, 2026 12:57
@loevgaard
loevgaard force-pushed the fix/30-bundle-structure branch from 064cf2d to 14071bb Compare September 14, 2026 07:29
@loevgaard
loevgaard force-pushed the fix/30-bundle-structure branch from 14071bb to caf2c06 Compare September 14, 2026 07:39
@loevgaard
loevgaard force-pushed the fix/30-bundle-structure branch from caf2c06 to 3ab6fc1 Compare September 14, 2026 07:52
Base automatically changed from fix/27-public-api to fix/29-cookie-domain September 14, 2026 07:52
Move the duplicated tag bag detection into InstalledBundles, replace the
Webmozart assertions in the extension with LogicException, which is what
Symfony uses for a missing bundle, drop the dead
event-dispatcher-contracts ^2.5 branch and list the optional packages
under suggest.

The AbstractBundle and PHP config migration stays out: it is only needed
for Symfony 8, which is blocked on dependencies.

Fixes #30
@loevgaard
loevgaard force-pushed the fix/30-bundle-structure branch from 3ab6fc1 to 7b3e810 Compare September 14, 2026 08:00
@loevgaard
loevgaard changed the base branch from fix/29-cookie-domain to master September 14, 2026 08:00
@loevgaard
loevgaard merged commit df977e6 into master Sep 14, 2026
91 of 92 checks passed
@loevgaard
loevgaard deleted the fix/30-bundle-structure branch September 14, 2026 08:05
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.

Modernize bundle structure: AbstractBundle, PHP config, exception types, dependency constraints

1 participant