Problem/Motivation

Looking at the code I'm wondering if any of the feed writer services are ever used.

Since #2976335: Use Zend-Feed's standalone extension managers to prevent sites breaking this is now only about feed.bridge.writer.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review
FileSize
2.19 KB

Let's see...

If this passes we have zero test coverage and zero use case for this :)

dawehner’s picture

I once had the honour to use zend writer in a project. I don't remember the exact details, nor do I have the source code, but it turned out the bridge in Drupal was broken, can't say how anymore though :(

Regarding usage in contrib:

$ ag "feed.bridge"
feeds/src/Feeds/Parser/SyndicationParser.php
32:    Reader::setExtensionManager(\Drupal::service('feed.bridge.reader'));

feeds/src/Utility/Feed.php
47:    Reader::setExtensionManager(\Drupal::service('feed.bridge.reader'));

feeds/tests/src/Unit/Feeds/Parser/SyndicationParserTest.php
48:    $container->set('feed.bridge.reader', $manager);

feeds_brighttalk/copy-to-feeds/BrightTALKParser.php
32:    Reader::setExtensionManager(\Drupal::service('feed.bridge.reader'));

feeds_brighttalk/src/Feeds/Parser/BrightTALKParser.php
32:    Reader::setExtensionManager(\Drupal::service('feed.bridge.reader'));

ide_helper/src-dev/expected/Unish/PhpStormMeta/drupal.core.php
185:      'feed.bridge.reader' => \Zend\Feed\Reader\ExtensionManagerInterface::class,
186:      'feed.bridge.writer' => \Zend\Feed\Reader\ExtensionManagerInterface::class,
574:      'feed.bridge.reader' => \Zend\Feed\Reader\ExtensionManagerInterface::class,
575:      'feed.bridge.writer' => \Zend\Feed\Reader\ExtensionManagerInterface::class,
alexpott’s picture

@dawehner so it looks like no one is using the writer in contrib. Makes sense if you found it buggy :)

dawehner’s picture

Something we could certainly talk about is to mark it as deprecated. On the longrun we could tell people to use internal services + composer dependencies if they really want to.

borisson_’s picture

Status: Needs review » Needs work

I agree with #5, marking it as deprecated sounds like a good idea. I don't think we can just remove it.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

alexpott’s picture

#2976335: Use Zend-Feed's standalone extension managers to prevent sites breaking deprecates all of feed.writer.* and feed.reader.* services - so once that lands this becomes only about feed.bridge.writer

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

quietone’s picture

Issue summary: View changes

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

alexpott’s picture

Title: Test if Zend feed writer services are ever used » Deprecate feed.bridge.writer and feed.bridge.reader and move feed.bridge.reader to aggregator

Re-purposing this issue to do things with deprecations.

alexpott’s picture

Title: Deprecate feed.bridge.writer and feed.bridge.reader and move feed.bridge.reader to aggregator » Deprecate feed.bridge.writer

The feeds module uses feed.bridge.reader and does not depend on aggregator so let's just do the feed.bridge.writer - one less thing to worry about.

alexpott’s picture

Status: Needs work » Needs review
FileSize
1.71 KB
alexpott’s picture

Thinking about the feed.bridge.reader and #18. Maybe we could still do the move but tell people that either they depend on aggregator or the use the standalone or they create a new service. And we could deprecate \Drupal\Component\Bridge\ZfExtensionManagerSfContainer too and move it to aggregator.

longwave’s picture

+++ b/core/tests/Drupal/KernelTests/Core/LegacyServiceTest.php
@@ -41,6 +41,14 @@ public function testLaminasFeedServices($type, $service, $class) {
+    $this->expectDeprecation("The \"feed.bridge.writer\" service is deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. Use \Laminas\Feed\Writer\StandaloneExtensionManager or create your own service. See https://www.drupal.org/node/3258440");

We better update the deprecation that we just added that points to this service :)

    deprecated: The "%service_id%" service is deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. You should use \Drupal::service('feed.bridge.writer')->get('Atom\Renderer\Feed') instead. See https://www.drupal.org/node/2979042
longwave’s picture

Now we have deprecated all the feed.(reader|writer).* services what is the point of feed.bridge.reader and ZfExtensionManagerSfContainer?

Would we be better off wrapping Laminas\Feed\Reader\StandaloneExtensionManager in a service, perhaps with a service collector that allows users to add new feed types?

catch’s picture

I think it'd be worth going ahead with what we have here, then opening follow-ups for #20-22 - just to make sure we get this deprecation in now, and not in another four years.

In general, once #3188549: [Meta] Tasks to deprecate both Aggregator and our dependency on Laminas Feed is done, we can remove Laminas/Feed entirely from core. #2003108: Switch Views RSS to use Serializer/Zend never happened so it is only used by aggregator. We need to deprecate all of the services in order to remove them, but not really worth expending effort trying to clean up an integration we're going to nuke entirely.

longwave’s picture

Status: Needs review » Reviewed & tested by the community

OK, let's just get this small part done and defer the rest to followups if needed. Not even sure #21 is relevant if nobody is using this in contrib and earlier reports suggest the writer service doesn't work anyway.

alexpott’s picture

Status: Reviewed & tested by the community » Needs review

@longwave @catch - how about #20 - deprecating feed.bridger.reader in core and moving it to Aggregator - imo that woud make it easier to remove Laminas/Feed when and if we remove aggregator.

longwave’s picture

Status: Needs review » Reviewed & tested by the community

Sure but let's do that in a followup, deprecating the writer is easy because nobody uses it, restructuring the reader means moving ZfExtensionManagerSfContainer and deprecating the entire Bridge component I think, which seems much more complicated.

  • catch committed a0e1956 on 10.0.x
    Issue #2919215 by alexpott, longwave, dawehner: Deprecate feed.bridge....

  • catch committed 1198809 on 9.4.x
    Issue #2919215 by alexpott, longwave, dawehner: Deprecate feed.bridge....
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 10.0.x and cherry-picked to 9.4.x, thanks!

alexpott’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

quietone’s picture

Published the change record.