-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add AutomateWoo course actions #6849
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## trunk #6849 +/- ##
============================================
- Coverage 51.21% 51.20% -0.01%
- Complexity 11188 11189 +1
============================================
Files 614 614
Lines 47228 47230 +2
Branches 405 405
============================================
Hits 24186 24186
- Misses 22715 22717 +2
Partials 327 327 see 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
a9d9f2b
to
2c630c1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gabrielcaires Oh, you may have to run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have had success running after the composer install!
I found the following points.
- I saw the fields Groups and Courses are not required, but I tried to use them without fill the values, and I couldn't see results. Should we mark the fields are required?
I also tried to have the Groups field empty and select a course. I was expecting the action to be triggered when I remove a student from any group, but I couldn't see actions.
- I succeeded in seeing the Add to Course action working ( setting the group and the course), but I couldn't see the Remove from Course action working, I set a group and a course but the student was not removed.
Hey @m1r0 👋 Just pinging you here as it looks like this PR awaits your reaction :) |
I couldn't get this to work, even after running |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@m1r0 Looks like Gabriel's comment and mine are still outstanding.
Thanks for the reminder, Donna. This one slipped under the radar. I'm adding it to my todo. ✔️ |
Makes sense for the Course field. I've updated the code 31604ff. As for the groups, I think this is out of scope. This PR only adds the course actions. Also, note that the groups logic actually lives in the AutomateWoo plugin.
Hm, it seems to be working for me. Could you double-check/record a video? 2bawtj.mov
Donna, are the actions not triggering or you can't see the course actions at all? Note that the actions are at the bottom of the list. cFsiX6.mp4
The name is "Student Removed from the Group", it was wrong just in the testing instructions. 🙂 FYI, that code is part of the AutomateWoo plugin. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's working for me now. Apparently the secret is to wait 6 months and try again! 😅
After testing it out, I'm not clear on why we feel this change is necessary, since it looks like this functionality is already part of Groups. What I mean is that you can already add courses to a group, and when a student is added to the group it also adds them to those courses. And same thing when you remove a student from a group:
Unless I'm missing some context, this seems like 2 different ways of doing the same thing. Is there some additional value that this integration offers that Groups doesn't?
In case the value is outside of the Group trigger, I think we may need to map this out as it doesn't make sense, for example, to have the Course Completed trigger add or remove a student to / from a course. That just seems like a recipe for disaster. 😳 Which leads me back to wanting to understand the overall goal of this change. 🙂
In case I am missing some important context, I wanted to add some other thoughts before I forget them.
Makes sense for the Course field. I've updated the code 31604ff.
This doesn't seem to work as I can save without adding a course.
As for the groups, I think this is out of scope. This PR only adds the course actions. Also, note that the groups logic actually lives in the AutomateWoo plugin.
It does? So this is something that AutomateWoo added to support Sensei? If so, although it may be considered out of scope for this PR, I do think we need to address it as it's misleading. At a minimum we could open an issue in the AutomateWoo repo; at best we would fix it too, although I think it would enable maximum flexibility to make it work with the Groups field empty.
No problem, adding the course actions was an idea that Ronnie brought up, so I can see why there's a knowledge gap. The main idea was to give users more flexibility and help with automation in general. For example, with AutomateWoo, a site owner can gift a course when a user's total orders reach a threshold, or enroll a user in multiple courses when a product is purchased. The testing instructions use the group triggers just because it's a known territory. The feature is not strictly related to that, you can use any other trigger.
This is an AutomateWoo thing. It allows saving even if you don't fill the required fields. You can observe the same when omitting to select the trigger. The workflow will do nothing if no course or trigger is selected.
Could you be more specific about this? I'm not sure what the end goal is. Is it to make selecting a group a required action? |
These use cases make sense, though I'm concerned about introducing potential issues if the user selects an undesirable combination (e.g. Signed Up to a Course + Remove from Course). Is it possible to filter the actions based on which trigger is selected? If so, I think we should map which triggers make sense for the "remove from / add to course" actions and which don't. If not, do you think the benefits outweigh the risks of users selecting problematic combinations of trigger & action? |
Makes sense, it would be best to avoid that if we can.
I'm not sure to be honest. The only thing that I can see that can limit the action is the Taking the above into consideration, and knowing that AutomateWoo already has some Sensei triggers, I think it would be best to integrate this into AutomateWoo directly. That way we would have the expertise of the AutomateWoo team and be able to add proper tests. I'm closing this PR. |
This PR adds 2 new AutomateWoo course actions.
Proposed Changes
Testing Instructions
composer install
to update the autoloader.I was not able to add tests for the AutomateWoo actions because they are extending an abstraction class provided by the AutomateWoo plugin.
Pre-Merge Checklist