Closed (fixed)
Project:
Scheduler
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
15 Feb 2016 at 17:45 UTC
Updated:
15 Sep 2016 at 08:00 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
legovaerThis patch replaces
_scheduler_scheduler_api()with Symfony's dispatcher.Comment #4
legovaerFixed issues that caused the CI tests to fail
Comment #5
jonathan1055 commentedThanks for working on this. I will do some manual testing too.
Comment #6
legovaer@Jonathan any progress on the manual testing?
Comment #7
jonathan1055 commentedNot yet, as I have spent most of time on #2651338: Create a service for the Scheduler API. I don't know anything about event dispatch and event subscribing, so I am having to learn it all before I can understand what the changes mean :-)
I will requeue the patch in #4 as that was when we only had 32 classes. Now that #2655666: API Testing module - conversion to 8.x has been expanded and completed, the result might be different.
Comment #10
jonathan1055 commentedThe reasons for the failed tests in #4 would not be very clear to someone who had not written the tests. Also, the unpublishing assertions gave mis-leading passes when they should have failed, which was caused by earlier failed operations. Hence I have made the tests stronger, and given clearer assertion messages, in the commit in #9. I have re-queued the patch to show the improved failure messages.
The reason for patch failure is that the testing module also needs to be updated. It currently implements the existing
hook_scheduler_api. But if this function is being replaced by events then our use of it in scheduler_api_test module also needs to updated.That's the beauty of automated testing!
@legovaer - what are the instructions for converting an implementation of hook_scheduler_api to use the new event?
Comment #12
legovaerHere's another patch that should fix (some) tests. Changes:
scheduler_api_testtoscheduler_events_testsetNode()to the EventDispatcher so that the updated node can be used._scheduler_publish()and_scheduler_unpublish()so that we use the node which has been dispatched.TODO
While applying this patch, I get this test result:
for
Drupal\scheduler\Tests\SchedulerEventsTestA list of errors:
Comment #14
legovaerFor some reason my patch was missing a lot of code, here's the update patch for #12.
Comment #16
jonathan1055 commentedThanks for working on this.
Please can I suggest that we do not rename the test module until after the bulk of the actual work is complete. I tried to read your patch and interdiff, but because the module name was changed it was just a complete list of deleted files and new files, making it impossible to read what you have actually done. I understand that we should change the test module name in due course, but for other people to understand what coding you have done and what changes have actually been made, please can you revert the name change, for now. Trying to review a patch of 880 lines and an interdiff of 930, and understand what changes have actually been done is a big task, and it would be much easier if the module name was kept the same in the first instance.
By the way, patch 14 is smaller than 12, did you mean that?
I'm looking forward to seeing what is actually needed to convert the test module, as we will have to document this to allow our users to upgrade their own scheduler hooks to 8.x. Making the changes in stages will assist in this task.
Thanks again for your work on this. Hope you are not too annoyed with my request.
Comment #17
legovaerFair enough! Here's another patch. The interdiff is now only 180 lines, so it should be easier to review.
Comment #18
legovaerAnd this (final?) patch should have a 100% pass on the testing.
Comment #20
legovaerAnother attempt to fix the CI tests. Fixed the namespace in both sheduler_api_test.services.yml and EventSubscriber.php
Comment #22
legovaerDid a diff against my local branch instead of 8.x-1.x.
Comment #23
legovaerComment #24
legovaerUpdated the patch according to the changes in #2651338: Create a service for the Scheduler API. The interdiff looks a bit weird, but the only thing I've done in this patch is replacing the
_scheduler_scheduler_api()functions with the Event dispatcher.Comment #25
legovaerBecause of the committed changes of the namespace of the Exceptions, the patch no longer applied. Here's the one that does apply.
Changes:
Changed line # 246:
To
Change line # 213
To
Comment #26
jonathan1055 commentedGreat work, thanks. I've taken your patch and made a few changes:
scheduler_api_test_scheduler_api()from tests/modules/scheduler_api_test.modulehook_scheduler_api()from scheduler.api.phpPatch has the full changes, interdiff shows just my changes between 25 and 26.
Comment #27
jonathan1055 commentedHi legovaer,
Have you had a chance to review the latest changes in #26? As explained, there is nothing major that I have changed from your patch, it is mainly the naming of functions and a bit of tidying up. It all works, and passes the full set of tests, but I know that that's only half the story. These events replace all the calls to hook_scheduler_api(), but I think that hook_scheduler_nid_list() and hook_scheduler_allow() will remain unchanged.
You asked a question about the possible clash of events that I had started in #2651348: Port Rules integration for Scheduler to Drupal 8. Does this need to be looked at now?
This is the last blocker issue that we've identified before we can make an alpha1 release, and it would be really good if I could do that soon. I will also ask pfrenssen to review this, as I definitely want his agreement that we are doing the right thing before going ahead with the alpha release.
Jonathan
Comment #28
legovaerJonathan,
Sorry to keep you waiting. I was quite busy.
I had a final review of your changes and it all looks good to me so I'd say RTBC.
About the discussion on #2651348 -- Your comment in that issue makes a lot of sense. I haven't done research on how Rules is working in D8. But it makes a lot of sense to keep the events separate. I'll add the same comment in that issue.
Let's get Alpha1 released! ;-)
Comment #29
jonathan1055 commentedThanks for the review. Good that you are OK with my changes.
I did contact Pieter and he said just over a week ago that he would like to review this final alpha1 blocker. I would appreciate his input, and I am not sure of the limitations we would be creating if we make alpha1 now, then Pieter wants to change the structure. I guess anyone using the dev release or upcoming alpha1 would just have to re-install Scheduler if we did make major changes, and possibly re-write any implementations of the new event subscriber.
I am unsure of the implications of #2651348: Port Rules integration for Scheduler to Drupal 8 and how that may clash with this issue. That's also what I would like Pieter's view on.
... or maybe we go ahead, and try to fix things if we find we need to do major changes later? You are right, it would be good to get a proper non-dev release on the project page.
Comment #30
legovaerFair enough. I think it'd be good to have an extra pair of eyes on the code changes. We don't want to go re-factoring.
Pieter seems to be quite busy, so we could alternatively launch a "beta" version which is designed for testing purposes. Then people can start using the beta version in order to detect bugs we didn't see. We should clearly mention that it's only a beta version and that code changes are most likely.
In the meantime Pieter can take his time to do a full review.
Comment #31
jonathan1055 commentedI think that making a separate version would add more confusion. And doesn't a 'beta' release follow a few 'alpha' releases, when the structure and API are stable. We certainly must be confident that nothing major will change before we name anything 'beta'.
Thanks for the idea, but I am now considering waiting until after this weekend, and if Pieter has not reviewed, I will commit this change and release alpha1 anyway. I'm sure we can fix things afterwards, and for a first alpha release other users should accept that an update might require a re-install of the module, and that some restructuring might be needed if they have started coding to react to the new event subscribers.
Comment #32
jonathan1055 commentedRe-rolled the patch to cater for my change to the API test module in #2655666-36: API Testing module - conversion to 8.x.
Comment #34
jonathan1055 commentedGreat work, Levi. Thank you for all this work. I decided to go ahead and commit - Pieter can review later and I am happy to make changes as required. Now for alpha1!
Comment #36
jonathan1055 commentedThis is fixed so setting to Unassigned