I know about #1442434: Do not port Elysia Cron, recommend Ultimate Cron for Drupal 8 and there is a new pretty old 8.x-1.x branch in the repository, so I wanted to check if there are goals/plans from the maintainers?

I haven't used Ultimate Cron before but it seems to be in a much better state than Elysia cron is based on a quick look.

Based on how much 8.x moved in the last 13 month and this module has an apparently quite different 7.x-2.x branch ( I think, did not even look at the old one), it might be better to just do a fresh start with an 8.x-2.x branch, based on 7.x-2.x?

We have some resources that we can put into a port, although I can't say yet how soon/how much exactly yet. We're already working on other ports, like redirect and pathauto and we usually do that by creating a github repo or a sandbox to hack around as 8.x is still a moving target. Happy to give everyone who is interested in helping commit access.

Comments

gielfeldt’s picture

I haven't touched the 8.x-1.x in quite some time, and after making 7.x-2.x, I've been thinking of abandoning the 8.x-1.x and doing a port of the 2.x instead.

The 2.x is mainly based on ctools-plugins, which probably makes it a better fit for D8 (I'm just guessing here, I don't really know for sure).

Any help in porting 2.x to D8 is appreciated, since I'm not sure when I will commence the port to D8. I was planning at least to make a proper release of 7.x-2.x first.

berdir’s picture

Ok, thanks for the quick feedback.

We have our monthly Drupal 8 Contrib Port sprints today (http://www.md-systems.ch/node/816), so maybe I'll start something today and if not, possibly next month.

Yes, ctools plugins/exportables should make for a pretty good starting point to convert it to plugins/config entities for 8.x.

gielfeldt’s picture

so maybe I'll start something today and if not, possibly next month.

Cool :-)

berdir’s picture

Did found some time, so started the port: https://github.com/md-systems/ultimate_cron

Obviously far from complete, but I did move a lot of code around, converted the ctools plugins and started converting the ctools exportable to a config entity.

gielfeldt’s picture

Nice. I think we should remove the background_process stuff from the module to make it more lean. The background_process_legacy launcher is for use with Background Process 1.x, and I'm thinking of abandoning the 8.x-1.x in favor of 2.x, as this is also be based on ctools plugins.

miro_dietiker’s picture

In the next few weeks we will push completeness of our port. No idea yet what will be remaining exactly, but i do think our code will be ready for a first d.o merge.

gielfeldt’s picture

Awesome. Looking forward to it. Gonna peek at the code this weekend if I get the chance. Is it the repo Berdir mentioned? Or are you using another one?

berdir’s picture

Miro making promises again that I'll have to keep? ;)

Yeah, it's that repository, but there wasn't too much activity since I started, had lots of other modules to port :)

miro_dietiker’s picture

Haha, nah Berdir, we discussed (and if i remember correctly, you've been part of that discussion ;-P) that one of our Drupal 8 interns will take care of it.
Hopefully not everything directly depending on Berdir writing the code. :-) (Except you want to complete it over the weekend ;-) )

Ah and, did i mention? Github is awesome for quick collaboration with pull requests... So we're open for everyone to help pushing things forward with us. :-)

cbr’s picture

Starting from tomorrow I'll continue on porting Ultimate Cron to Drupal 8.
All changes will be done on the MD Systems Github repository (https://github.com/md-systems/ultimate_cron).

Will keep you updated by posting my progress on this issue.

gielfeldt’s picture

Ok. There's been a few commits to 7.x-2.x since the initial fork to github, just fyi.

cbr’s picture

Ultimate Cron has been updated, port is not done yet, but main functionality and tests are working on Drupal 8 now.
For now the Ultimate Cron port will be on hold on my part, will keep re-rolling Ultimate Cron for new core releases.

https://github.com/md-systems/ultimate_cron

miro_dietiker’s picture

We are still updating our codebase (by cbr, Berdir) above with ongoing core changes...

Looking forward to some merge into this d.o project. Preferrably with access for us so we can continue to maintain it here.

gielfeldt’s picture

Sure. Who wants/needs access?

miro_dietiker
Berdir
cbr

?

miro_dietiker’s picture

OK, MD Systems is interested in co-maintaining this long term. (Berdir, miro_dietiker)
cbr was working on this task during his internship with us - which is almost over.

Should we squash the whole history or merge it in?
There is still a lot untouched and the port is considered (only) minimum functional. So it needs quite some extra work to complete.
Will you review it first?

gielfeldt’s picture

I totally forgot about this :-o.

I've just granted Berdir and miro_dietiker VCS write access. There is already a 8.x-1.x branch, but it's no good. Just nuke it/overwrite it with what you've got.

I feel no need to review it as such, so just go ahead.

miro_dietiker’s picture

Thx for access. We will push the project soon.

Will you update the project page with a D8 statement afterwards? We don't have access (yet).
In case you keep it locked: Please also mention MD Systems for the (hard) D8 port work. ;-)

BTW i also updated the issue at Elysia cron about our port status and encouraged again for collaboration.
#1442434: Do not port Elysia Cron, recommend Ultimate Cron for Drupal 8

gielfeldt’s picture

You now have full access :-)

kalpaitch’s picture

Hi folks, really keen to help getting a D8 port, however, I notice despite discussing it that it hasn't yet made it's way across to d.o

While I also much prefer github, it would be great to continue work on d.o. Love to know your thoughts. Thanks.

miro_dietiker’s picture

Yeah we have some checklist and wanted to complete the establishing of D8 patterns to a pretty stable state before merging to d.o.
Our repo is perfectly open for your pull requests if you have any proposal.

We are near... and as soon as we merge it in to d.o then we will switch to a strict per-issue review process with strict test coverage requirement.

damienmckenna’s picture

Title: Drupal 8 » Port Ultimate Cron to Drupal 8

Standardized the title.

berdir’s picture

We're still working on this. There are some major things in the port that I'm currently not yet happy about and wanted to ask @gielfeldt for some feedback or at least inform about the current plans:

* In 7.x, cron job discovery was very dynamic and could change any time depending on what hook_cronapi() returns. Cron jobs are config entities in 8.x and config doesn't really support that kind of dynamic change. So, we're dropping that, instead, modules can provide config entities for default configuration. We still look automaticallly for cron hooks in new (and soon also existing modules again) and create config entities for them if they don't exist yet. Not sure yet about automatically deleting, currently going for marking them as broken/missing in the UI and just allow to delete.

* I'm not sure about logging and launcher both being plugins that are configured per-job. Are there really use cases for that? Making them globally configured services would IMHO allow us simplify certain parts a lot.

* We've also started the currently not yet ported (global) settings, and the plan there is also to drop that plugin that and just implement them directly. Also related to the next point.

* Things are often nested in many method calls and many of hose also invokes multiple hooks and callbacks on plugins. To give you an example, this is the call chain until we actually invoke a cron callback:
1. UltimateCron::run() (replacement for the core service)
2. SerialLauncher::launchJobs()
3. SearialLauncher::runThread()
4. CronJob::launch() (the cronjob config entity)
5. SerialLauncher::launch()
6. CronJob::run()
7. LauncherBase::run()
8. CronJob::invoke()

And multiple of those methods trigger hooks and callbacks. That's very hard to follow and understand if you're trying to debug something. For example that we go back between the cron job and the launcher multiple times. I think one of the reasons for all those plugin callbacks are the settings plugins, haven't seen any other implementation of those. I'd like to try and simplify that a bit.

Any thoughts/opinions on those points? Thanks

berdir’s picture

Ah, another thing are all those background job, shutdown and other attempts at improving automatic cron. We've only touched what we had to of that. I honestly think that if you use a module like ultimate cron, then you probably need to have a reliable cron invocation and shouldn't rely on users visiting your site to trigger it.

Drupal 8 even moved that feature into a separate, completely optional module now. So it can be disabled or a better implementation can be provided by a contrib module that doesn't have to mess with replacing what's in core. One thing that is really nice in 8.x is that all cron invocations go through the cron service, and we just replace that and then every single way to call cron (drush, ui, callback) goes through that.

Given that, I think it would make a lot of sense to move all those things into either an optional submodule (that would likely look completely different to what is in 7.x) or even a different project. And remove it from this module.

berdir’s picture

Status: Active » Needs review

Ok!

I'm finally happy enough to push this to D8, which is what I just did. I've also created an 8.x-2.x release and will hide 8.x-1.x from the overview. Hope that's OK with you, but since it's obviously not working at all, I guess that's not very controversial ;)

Some notes on the things above for what we've done for now:

* Implemented as suggested above, removed the add form but added a discover local action if a manual update is necessary (e.g. code changes). It's automatically discovered for newly installed modules. Currently only hook_cron() is supported, those additional hooks for automatic configuration to e.g. run every 1h are not yet supported, not sure if all that complexity is worth it?

* Logger and laucher are still per-job plugins for now

* The global setting Ui has been ported but it's not dynamic yet and not actually used yet. So that definitely needs more work.

* Nothing done yet to simplify the amount of nested calls going on. There are also some hidden bugs there, currently job runs are always considered to be manually started.

miro_dietiker’s picture

Version: 8.x-1.x-dev » 8.x-2.x-dev

Yippie! Switching to the right branch then.

esolitos’s picture

Hello, I see that the development is very active, I was wondering how stable is the current `-dev`, because in the issue queue for 8.x I can only see normal and minor reports, so no major or critical issues? Or is it that the issues are not in the d.o system?

Would be nice to have a "development status update" to have an idea since the last message is from 4 months ago. :)

PS: Thanks for bringing to us this great module!

berdir’s picture

Status: Needs review » Fixed

There's a bunch of cleanup and porting of missing pieces going on, but the parts that are ported are working fairly well. Nobody reported any major or critical issues so far.

I'll start working on the current issues more actively in the next days and weeks, with the goals of releasing at least a beta release. I'm not the original maintainer, so I'll move ahead the way I see fit, unless we get any feedback otherwise from @gielfeldt.

Marking this as fixed.

esolitos’s picture

Could you create an alpha release so we can start having some "reference point" if reporting issues?

berdir’s picture

I will do that after going through the current issues.

Keep in mind that issues should always be reported and tested against the latest dev snapshot anyway.

Status: Fixed » Closed (fixed)

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