Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Fetchers got converted on #1497366: Introduce Plugin System to Core lets do the same for processors and parsers
Followups
#1925048: Convert aggregator's system_config_form() to SystemConfigFormBase
#1957312: Use the entity storage controller in aggregator module
#1957330: Make possible for parsers and fetchers to expose configuration through plugins
After #15266: Replace aggregator category system with taxonomy is in check admin settings form for usability issues
Comment | File | Size | Author |
---|---|---|---|
#54 | drupal-aggregator_plugins-1930274-55.patch | 85.25 KB | ParisLiakos |
#54 | interdiff.txt | 741 bytes | ParisLiakos |
#36 | drupal-aggregator_plugins-1930274-36.patch | 85.7 KB | ParisLiakos |
#36 | interdiff.txt | 1.85 KB | ParisLiakos |
#35 | drupal-aggregator_plugins-1930274-35.patch | 85.7 KB | ParisLiakos |
Comments
Comment #1
ParisLiakos CreditAttribution: ParisLiakos commentedI am gonna use this as my chance to get familiar with plugin system within the weekend
Comment #2
ParisLiakos CreditAttribution: ParisLiakos commented4 files hit @ /dev/null two of them are .inc..i love this..
this patch needs some love more, eg those globals in DefaultParser are ugly, but i am gonna turn them to properties..just want to see what tests say, functionality should be the same, i did some manual testing
Edit: do not review this patch, just want to see the tests..there wont be an interdiff with the next patch
Comment #3
ParisLiakos CreditAttribution: ParisLiakos commentedok, it is almost ready now, i just have some todos in tests, i am trying to figure out how to properly test them.
lets check with bot
Comment #4
BerdirOnly skimmed over it but looks nice.
Why are we removing the api documentation?
Comment #5
ParisLiakos CreditAttribution: ParisLiakos commentedNo hook_*_info() anymore..i transferred the documentation to the plugin interfaces
Comment #6
ParisLiakos CreditAttribution: ParisLiakos commenteduh, noticed some stuff that accidentally slipped in the patch
Comment #7
BerdirNice patch, didn't read everything but awesome clean-up, just a few notes...
Off topic, but it's amazing that you can just switch a db_select() (well, in this case it's db_update but the result is the same) with entity_query() and. it. just. works. Even if it's a simple one as in this case.
Wondering if we want to kill this function and access the config directly where it's used? No need for this hack anymore...
Is this still checked somewhere or do we no longer care? It could still happen that a module that provides a processor is disabled... but we don't do this for other plugins either I guess. And if the plugin no longer exits then I guess we can fall back to the default in the manager? (haven't actually checked if we do that)
Nitpick, can we have a space between the Implements and @todo lines? ;)
Comment #8
ParisLiakos CreditAttribution: ParisLiakos commentedYou are right,
_aggregator_get_variables()
was only used in one place after the previous cleanup:) one more down!About
aggregator_sanitize_configuration
I know it might not be the issue to have this conversation, so i can just put it back in, i am fine with, i made so much more progress with the cleanup here, so i dont care
Comment #9
BerdirRemoving it sounds fine to me, as long as we don't crash if something is missing. Views is also simply displaying a "plugin missing" message, no need to do something different here I think.
Comment #10
ParisLiakos CreditAttribution: ParisLiakos commentedOops..added try/catch and tests for that..also tests for plugins:)
here we go
Comment #12
ParisLiakos CreditAttribution: ParisLiakos commentedactually no need for try catch in aggregator_remove..hmmm and somehow i messed all the tests up with the patch above..lets see
Comment #13
ParisLiakos CreditAttribution: ParisLiakos commentedoh, got it..forgot to remove an innocent line from the test plugin:)
Comment #15
ParisLiakos CreditAttribution: ParisLiakos commentedseems my ideas were bad:) lets see now..go. bot. green.
Comment #17
ParisLiakos CreditAttribution: ParisLiakos commentedright..sorry for the noise
there we go, this should be green
Comment #18
Berdir#17: drupal-aggregator_plugins-1930274-17.patch queued for re-testing.
Comment #20
ParisLiakos CreditAttribution: ParisLiakos commentedAnnotation\Plugin moved to Component..
manually edited patches++
Comment #21
BerdirNit-pick mode...
This should probably use the fully qualified namespace so that api.drupal.org (and a manual reader) can resolve it. Starting with a \
Yep, I'd suggest to add a watchdog_exception('aggregator', $e) here. Is almost easier than adding a @todo, so we can IMHO just do it here.
The @count was already ther but that looks a bit ugly. Why do we need it? Can't we just add a !empty($feed->items) or something instead? Doesn't need to be in this issue.
When changing this anyway, let's change it to "Contains \Drupal\..."
Should be @return bool then.
"stage." is a tiny bit over 80 characters. On the other side, there is some more space behind ".. parse()". Generally, docblocks should get as close to 80 characters as possible without getting above. Also, the parse() reference should have a leading \
Should probably say service and not class.
Needs a space above @var I think. Same for those below.
Removed or moved to wherever it's called, but not something to fix for this issue I guess.
Another space here.
Most of it is moved code, but while we're moving it, probably doesn't hurt to add some types to @param and @return where it's missing.
What does this have to do with that issue? The namespace/plugin issues should be fixed...
setUp() currently doesn't need a docblock.
Comment #22
ParisLiakos CreditAttribution: ParisLiakos commentedFixed all above
This tests fails because the plugin manager discovers plugin classes provided by aggregator_test, even though it is in the line above disabled..when i try it manually it works as should but not in the simpletest enviroment..This also made me spend quite some time to write some tests that are unaffected by this anomaly:(
so i tend to think that the issue is not fixed
Comment #23
ParisLiakos CreditAttribution: ParisLiakos commentedActually, nvm, i missed clearing the cache..fixed that as well:)
Comment #24
twistor CreditAttribution: twistor commentedAren't we supposed to be putting things in $form_state instead?
entity_query()?
Review was interrupted, more to come.
Comment #25
ParisLiakos CreditAttribution: ParisLiakos commentedI cant see how to convert this query to entity_query..this part
AND checked + refresh < :time AND
i dont think entity query supports itComment #26
ParisLiakos CreditAttribution: ParisLiakos commented#25: drupal-aggregator_plugins-1930274-25.patch queued for re-testing.
Comment #27
BerdirLooks great to me. Some final nitpicks and then I'll RTBC, looks like nobody else in interested in reviewing this :(
Maybe we can try to get some of the Feeds guys (looks like there's not much activity, but maybe @twistor?) interested in our aggregator.module improvements, so that they can actually rely on parts of it instead of doing their own thing in 8.x?
Processing is done*,* call ...
Uses *the* http_default_client service, I think
@return bool.
Can we add some @param's to those. And maybe state that those are callbacks for the XML parser.
Just want to make sure that the patch isn't going to come back from RTBC because of something like this :)
string for @param and int|false for @return I think.
Can we use a different string for this? Maybe "Do not fetch" or "Return FALSE" or something other that's more self-speaking :)
Comment #28
ParisLiakos CreditAttribution: ParisLiakos commentedthanks for the review:)
I fixed all the above..one thing i am not sure..
+ * @param resource $parser
i guess we dont use resource? i wasnt sure what it is and my d8 installation is really messed up, so i checked php.net and it documents it as resource:/
Comment #29
Berdirsuper-minor thing, false should be lowercase, see http://drupal.org/node/1354#types.
This can be fixed while commiting or when this will need a re-roll.
This looks great to me and is a very nice example of plugin conversions. Cleaner, interface-based and documented API's, unification with other systems, has better tests and improved inline documentation. Nothing left to complain about :)
Comment #30
ParisLiakos CreditAttribution: ParisLiakos commentedfixed too:)
Comment #32
Berdir#30: drupal-aggregator_plugins-1930274-30.patch queued for re-testing.
Yeah sure testbot, as if *that* change could have broken anything.
Comment #33
BerdirComment #34
Lars Toomre CreditAttribution: Lars Toomre commentedI am not changing status, but think drupal_container() notes should be addressed before this goes in. The rest are nitpicks from reading through the patch for first time.
I am pretty sure drupal_container() has been deprecated in favor of Drupal::service(). Can this be implemented here?
This comment can be wrapped better. Ibid re: drupal_container().
Ibid re: drupal_container()
I am pretty sure code comments are supposed to wrap at 80 characters as well.
drupal_container() again.
My understanding is that coding standards call for blank line before closing brace of a class. Same with other classes below (some are already correct).
Processes? (third person verb tense)
Refreshes?
Can be better wrapped for 80 characters.
Removes?
Are we ever testing this settings page in a language other than English? If not, t() calls can be removed to speed up tests.
This needs a type hint. 'int|null' correct? Also description should start with '(optional)'. Finally, I might suggest 'If omitted or set to NULL,'. (note comma)
Comment #35
ParisLiakos CreditAttribution: ParisLiakos commentedah, yeah drupal_container is a very good point..and sorry for double interdiff but i found a couple more drupal_container calls right before posting the patch
Comment #36
ParisLiakos CreditAttribution: ParisLiakos commented...that should be prefixed with
\
while in class contextComment #37
podarok#36 +1RTBC
Comment #38
jibran#1925048: Convert aggregator's system_config_form() to SystemConfigFormBase is postponed on this.
Comment #39
xjm#36: drupal-aggregator_plugins-1930274-36.patch queued for re-testing.
Comment #41
ParisLiakos CreditAttribution: ParisLiakos commented#36: drupal-aggregator_plugins-1930274-36.patch queued for re-testing.
Comment #42
ParisLiakos CreditAttribution: ParisLiakos commentedDrupal\Core\Config\StorageException: Failed to write configuration file: sites/default/files/simpletest/571115/config_active/update_test.settings.yml in Drupal\Core\Config\FileStorage->write() (line 102 of /var/lib/drupaltestbot/sites/default/files/checkout/core/lib/Drupal/Core/Config/FileStorage.php).
obviously a bot thingie, back to rtbc...
Comment #43
podarokwow
looking at #36 and it looks like Feeds contrib into core )))
Code looks good for me +1 RTBC
Comment #44
podarokmarked #1827164: Integrate Feeds into core #1136482: [policy] Deprecate aggregator.module in D9 core and remove it in D10 as duplicates
and bumping this one as major due to covering a lot of possible issues with Feeds and possible help from Feeds contrib team
Comment #45
andypostNice patch, +1 to commit. Also there's some small suggestions
diffstat
23 files changed, 1201 insertions(+), 893 deletions(-)
This looks ugly, please change to format_string()
actually admin_form() needs follow-up for usability
needs follow-up to convert to entity_query() to use entity storage controller
Suppose better off with "mysqkism" and have clean entity api for all aggregator
Comment #46
twistor CreditAttribution: twistor commentedThis will throw parse errors on a 304, 403, 404, etc, . I guess it's not actually related to this patch, and more-so to do with the Guzzle conversion. But, we need to handle status codes. Maybe turn off dead feeds. While we're at it, we should handle cache-control and expires headers.
Comment #47
twistor CreditAttribution: twistor commentedExcuse me for a second, while I take a brain dump.
To elaborate more on my very brief statement in #1827164: Integrate Feeds into core, this doesn't get us too much farther with regard to Feeds depending on Aggregator, or some such thing. I'm not sure how much room is left for architectural improvements, but off the top of my head:
I'm sure there's more, but that's what stuck in my brain after reviewing the current state of Aggregator. I keep forgetting it exists.
This reminds me of Actions/Triggers vs. Rules.
Comment #48
ParisLiakos CreditAttribution: ParisLiakos commentedNo, actually only the enabled processors process a feed..All of them run only on remove()..i only exposed remove() for all processors cause i replaced hook_aggregator_remove() with that..but maybe it makes sense to run remove() only for enabled processors as well
When #15266: Replace aggregator category system with taxonomy is in, i will make them configurable per feed type, so you can set different processors per feed type..right now configuration is global, which kinda defeats the point of enabling/disabling processors
We are gonna introduce one (zend feed probably) for both aggregator and views #1839468: [Followup] Replace aggregator rss parsing with Zend Feed
Maybe you can post your feedback there, eg why you think zend feed is bad idea
Maybe we should convert the update items callback to batch
Comment #49
ParisLiakos CreditAttribution: ParisLiakos commentedAnd fetchers are already plugins
Comment #50
ParisLiakos CreditAttribution: ParisLiakos commentedAlso, feel free open to open follow up issues for your bullet points above, i would be happy to work on them
Thanks for the feedback!
Comment #51
Berdir@twistor: Thanks for joining in :)
The comment caused a bit of confusing, the goal of this issue is not to replace feeds. All it does is convert custom aggregator plugin stuff to the standard plugin architecture. How these plugins work together is AFAIK more or less unchanged. It will be the job of other issues to improve it.
Small improvements can still make it into 8.x (given that we will get below thresholds and we're currently a fair bit away from that) but moving feeds in core obviously not. The best thing might be to create separate issues for your feedback, point out how feeds does and why that's better.
Also, I suggest we stop commenting on this issue because every comment moves it back to the end of the RTBC queue, this has been waiting for quite a while already.
Comment #52
effulgentsia CreditAttribution: effulgentsia commented#36: drupal-aggregator_plugins-1930274-36.patch queued for re-testing.
Comment #53
neclimdulI like everything about this _except_ some of the entity changes in hook_cron(). They seem unrelated to this patch(as far as I can tell) and I wonder if splitting a db_update into "load a bunch of entities and the call save on them" has some serious performance concerns for large collections of feeds.
Rather than mire this issue in "can we get a benchmarking and discuss", can we remove it from this issue and follow up or is it actually connected? If its is actually necessary, lets just move forward and discuss elsewhere if anyone cares.
Comment #54
ParisLiakos CreditAttribution: ParisLiakos commentedAgreed, i reverted changes on the second db_update on aggregator_cron()
The first one has no performance impact since feed object is already loaded, i merely replace db_update with ->save()
Comment #55
neclimdulAgreed. Back to RTBC!
Comment #56
webchickWow, this is a fantastic patch! It essentially represents almost a complete re-write of aggregator.module, but definitely for the better. Things that used to be pseudo-hooks are now part of an actual interface, and it's a lot clearer now of what's required in order to implement a processer, fetcher, or parser.
I'm sure I could probably find some nits if I looked hard enough, but I think whatever there is we can deal with in follow-ups. Great work!
Committed and pushed to 8.x. Thanks!
rootatwc: Want to be added to MAINTAINERS.txt for aggregator module? :)
Marking for change notice.
Comment #57
ParisLiakos CreditAttribution: ParisLiakos commentedChange notice here:
http://drupal.org/node/1957310
Re #45
I sneaked it in #1925048: Convert aggregator's system_config_form() to SystemConfigFormBase
I actually think we should leave this after #15266: Replace aggregator category system with taxonomy is in, since certain stuff will change there
Opened #1957312: Use the entity storage controller in aggregator module
Re #56
Sure, opened #1957314: Add rootatwc as aggregator maintainer in MAINTAINERS.txt, thanks!
Comment #58
BerdirHm, maybe shorten the change notice a bit by removing the code within the functions/methods and instead simply link to the new class on a.d.o as soon as it's there? That and link to the plugin API documentation on d.o. Looks good to me otherwise.
Comment #59
ParisLiakos CreditAttribution: ParisLiakos commentedSure, i updated the change notice, looks better/shorter now:)
Comment #60
andypostPlease add some lines about fetchers
Comment #61
BerdirFetchers were converted and documented in the initial change record: http://drupal.org/node/1704454
Maybe just reference that?
Comment #62
andypost@Berdir yep, please reference both to have the overall picture,
Also this one requires updates in summary based on #47 feedback and follow-ups
Comment #63
ParisLiakos CreditAttribution: ParisLiakos commentedfetchers have nothing to do with this issue, they were already plugins..
i added a link in the change notice any way though
Comment #63.0
ParisLiakos CreditAttribution: ParisLiakos commentedUpdated issue summary
Comment #63.1
ParisLiakos CreditAttribution: ParisLiakos commentedAdd followups
Comment #64
ParisLiakos CreditAttribution: ParisLiakos commentedi added the follow ups in summary, please if new ones are opened add them too
Comment #65.0
(not verified) CreditAttribution: commentedadmin form usability