We need to port all the native support in project_issue that integrates with flag.module to provide the ability to follow issues without commenting on them.
My primary concern is that getting this working in a performant way on Drupal.org required patches to tracker2. See #404084: Add support for tracking flagged nodes for more. However, tracker2 is now part of D7 core, so we're obviously not going to be able to do the same things. :/ So, we need to figure out how to make this work given D7 core only and no help from tracker2. Or *maybe* we could get a fix into the core tracker for this, but I *HIGHLY* doubt it. :( Perhaps we'll have to try to do what tracker2 is doing in D6 directly from inside project_issue?
----
This issue resulted in the creation of the flag_tracker module in contrib. However, there are a few remaining pieces to actually getting this working on the upgraded D7 d.o site:
#1828620: Enable and properly configure flag_tracker during D7 update/migration
#1828634: drupalorg_update_7006() ignores issue following and flag_tracker
#1706520: Add a "Follow" button to the issue metadata block
#1828652: Theme the "Follow" button in the issue metadata block
There's a major bug in flag_tracker:
#1828658: Nodes are not auto-flagged when added to the tracker
And we've got a pretty major bug in the issue views:
#1828756: D7 views don't honor tracker and issue following
Finally, there are also some minor cleanup issues in the flag_tracker queue:
#1828562: Flag tracker settings on a given node type should only allow flags that can touch that node type
#1828568: Minor code style bugs in flag_tracker.module
| Comment | File | Size | Author |
|---|---|---|---|
| #27 | project-issue-use-flag-tracker-1560010-27.patch | 6.51 KB | mirzu |
| #26 | project-issue-use-flag-tracker-1560010-26.patch | 6.5 KB | mirzu |
| #23 | project-issue-use-flag-tracker-1560010-23.patch | 6.39 KB | mirzu |
Comments
Comment #1
mirzu commentedI started looking at this and I think there are a couple of approaches that we could use to solve this issue.
Option 1 Update the tracker module like tracker2 was updated. Advantage: Simple, the diff is ready, just needs to be applied to the d7 module. Disadvantage: need to change a core module.
Option 2 is simpler to accomplish, but could be a little harder to code cleanly. Mainly because it would require the use of "internal" functions from tracker. that could be solved by a) ignoring that they are internal functions and just use them. b) create wrappers that are not internal.
The integration with the issue module would be nearly identical for both options 1 and 2.
Option 3 Create a "flag interface" that allows users to subscribe and unsubscribe from nodes using flag and subscriptions. The module seams like it would handle the mechanics of subscription, but would require an additional module for custom emails, and would likely bring with it a number of new options and workflow decisions. I don't know enough about this module to assess it's feasibility.
Integration would likely need to be rethought.
Comment #2
dwwThanks for looking into this!
While we're exploring options, there's also:
4) The whole notifications/messaging framework.
5) Trying to replicate this stuff with just flag and rules.
My primary criteria for making a decision on which approach to pursue would be:
A) Can we replicate the current functionality without many (if any) end-user-visible changes in behavior?
B) What are the longer-term maintenance implications?
C) How feasible is a timely implementation?
D) How well does it fit into the overall strategy of keeping project_issue itself as small as can be with as little hard-coded custom stuff as possible?
I think that's the priority order I'd have to put those criteria in. I'm not sure how to rank each of the options with these criteria -- I don't have enough data without doing more research myself.
From the d.o-side, generally, I think keeping this flag-based will be easiest from the infra team's perspective, but I could be wrong. I'm just hesitant to introduce a new dependency on a large external project if we're not already using it for other things. Flag is already being used by things outside of Project*. And I suspect doing some custom (if slightly generalized) email notification stuff to keep all the existing functionality working the same way will be the quickest path. But, again, without more data about each of the options, it's hard to commit to a specific approach just yet. Also, there's no telling what we'd end up using rules for on d.o if we made it a requirement for Project*. ;) So, it's definitely worth investigating that approach, too.
Thanks,
-Derek
Comment #3
mirzu commented4) I've had bad experiences with this framework on the D6 side, and it wasn't entirely positive, and I've recieved similar feedback from others. It was difficult to work with and buggy. The drupal 7 version is in Alpha so I'm skeptical that it's mature enough either.
5) I'll poke at rules today, and get back to you. I'm curious about performance, but it might not be an issue.
I'm with you 100% on the priorities.
I'd like to see a generic flag_tracker solution for d7. I think it's a no brainer useful module, unless you don't "need" a module and can do this with flag + rules (in a performant fashion). More after I've discovered more with this solution.
Comment #4
dwwIf we end up sticking with our own custom email sending code, see #1571404: Make the 'Reply-to address on e-mail notifications' setting (project_issue_reply_to) per-node-type.
However, here's another issue that might be solved via rules: #1571400: Port auto-closing functionality to D7
Comment #5
dwwAlso, yeah, I don't think messaging/notifications is actually a good idea, but I wanted to mention it for completeness. ;)
Otherwise, sounds like you're on the right track, so just keep at it...
Thanks!
-Derek
Comment #6
senpai commentedTagging.
Comment #7
dwwWe had a discussion about Rules + Project* in IRC today with Itangalo, mikey_p, davereid, jhodgdon, and myself. Turns out that implementing our existing email notification logic with Rules would require quite a lot of custom actions in project_issue. So, in terms of removing custom code, this wouldn't help. And the resulting rules would be so specific that they'd probably break if you changed anything -- which invalidates one of the other reasons to use Rules.
Itangalo suggested that maybe project_issue should still do all the fancy logic it does now to figure out who should be emailed, and just expose that to rules, and then use rules to actually send the emails. Except, there's no good support for rules to deal with queues (which we want for the notification emails). Basically, that would amount to doing all the "hard" stuff in project_issue, and then the trivial part in Rules. A 164Kb (compressed) external dependency and lots of complication in the call stack hardly seems worth it for this.
Sure, we could perhaps expose some of this to Rules for other sites that optionally want to make use of Rules for more fancy things, but this isn't a viable reason for a hard dependency.
So, we can safely take option 5 out of the list of considerations. At this point, I'm leaning towards keeping the email notification stuff itself native to project_issue (since it's pretty specific). In terms of the tracker2 stuff, I'll let mirzu continue to investigate if we should do that via a very thin "tracker2" D7 port, or if we should just do what we need directly in project_issue using hooks. I don't think it's going to work to get flag-specific functionality committed to the core tracker, even in D8, much less D7. At best, we could get some new hooks invoked if we need them, but I really don't think we do -- we only care when a node is created, edited, or commented on, and there are already hooks for all of those events.
p.s. Since we're probably going to keep doing the email notifications ourselves, we might want to look at something like http://drupal.org/project/queue_mail (although sadly there are no official releases and no sign of a D7 port of that).
Comment #8
webchickAwesome, thanks for researching that angle, anyway. It's good to be able to rule it out and have sound reasoning as to why.
The only thing I'd question is if those custom actions we'd have to write for Project Issue would be useful at all in other contexts; for example, in Views Bulk Operations for mass issue queue changing.
Comment #9
dwwYeah, we even talked about VBO in our conversation. ;) #1093650: Provide VBO support for issue management is definitely still on my radar. If anything, the kind of stuff to support that would be coming from #1571400: Port auto-closing functionality to D7 not here. The main point is that we don't need all of rules to make that work. And if Rules isn't really the silver bullet I thought it might be, it's not worth the (3Mb uncompressed!) external dependency. If there were like 3 or 4 obvious win use cases, I'd be singing a very different tune. As it is, there's really only 1 case that's a reasonably good fit, and even that will require more work than I hoped...
Comment #10
mirzu commentedSorry to be offline for a bit, one project ends another begins, and meetings meetings meetings. I'm in agreement with all the comments about rules, and email notifications. There isn't a good generic solution, so porting the old working stuff to d7 sounds like the most reasonable path.
For the follow functionality I'm thinking that a generic flag_tracker module is the way to go. Project issue can then use it, or we simply configure it to allow following of issues.
Comment #11
dwwI'm not entirely sure what "or we simply configure it to allow following of issues." means. Can you elaborate what you have in mind? Have you looked closely at how the following stuff works in project_issue already?
Thanks,
-Derek
Comment #12
dwwNote: just in terms of keeping patches/issues focused/smaller, *this* issue should be about the following itself (UI on issue nodes, tracker integration, etc) and then the email notification stuff itself should happen over at #1560012: Port per-user issue notification email functionality to D7...
Comment #13
senpai commentedTagging for Sprint 3.
Comment #14
mitchell commentedRules Link should be a 6th option on the list. It meets the mentioned requirements of views integration, similar to vbo without bulk op, but is more lightweight than flag.
I originally advocated for flag, #34496-26: [meta] Add Flag module to allow users to subscribe/unsubscribe without posting a comment, well before the Rules Link module was developed, but it has since become a powerful alternative for all things flag can do minus the data storage.
The user subscription manifest would then need to be put in a manually created table because Rules Link does not provide a storage mechanism, ie user_followings=nids.
There are a few examples of it in Johnan's screencasts, http://dev.nodeone.se/node/1067 http://dev.nodeone.se/node/1068 and Rules Workflow project. Obviously, a subscription/following feature would be a little more impactful example...
Comment #15
dwwmitchell: Again, thanks for the input, but we already decided we can't add a dependency on Rules, therefore, rules_link is also off the table.
Comment #16
senpai commentedTagging for Sprint 4.
Comment #17
mirzu commentedYay progress. http://drupal.org/sandbox/mirzu/1649546
This is the work in progress for moving the flag tracker code out of the issues and into it's own module. The meat of it works (it's a direct port of how it worked in 6). Today I hope to have it cleaned up and have added forms that allow users to select a flag per content type and globally. After that I'll create a patch that moves the code out of issues tracker that is made redundant.
Comment #18
mirzu commentedThe Flag tracker module: http://drupal.org/sandbox/mirzu/1649546 is now ready for testing.
Try it out:
Next is removing the bits of this that are duplicated in the project_issue module.
Comment #19
iamcarrico commentedFew quick things:
1) Line 11 of the .module file, there is an extra indent.
2) I do not get the content to show up on user/{UID}/track.
3) On the flag that is pre-created you also have to choose to show it on the node and node teaser. Not sure if there is a way to fix that (or if we should).
#2 is the only one I am worried about, IRC mayhaps to chat about it?
Comment #20
iamcarrico commentedI just tested the most recent update, the new module code works great. Now just need the code to remove said functionality from the project_issue module.
Comment #21
mitchell commentedSince this issue and #1571400: Port auto-closing functionality to D7 are a bit commingled, I'm mentioning here that I added some info Re: 7 in the later parts of my comment in that issue. It's not at all meant to disrupt efforts on the existing porting. It's a parallel contribution, on my part, so that good options aren't forgone, especially from the above evaluation which needed some corrections.
Comment #22
mitchell commentedThere's a base set of functionality for tracking available in Track N Notify. It's a proof of concept (in the sense that it uses features and a track node-type instead of an entity), however despite its incompleteness, it's functional and extensible.
Other elements like email queuing, a view for # of followers, and a view for whose subscribing will be simple enough additions. User digests and per-project subscription management are probably higher priority features, so that's what I'll focus on next. That's all for now.
Comment #23
mirzu commentedAttached is a patch that sets up project issue to use the flag_tracker module. There is likely some work still to be done, and I have a number of questions about a couple of things, but I figure it's better to post something at this point than to keep this under wraps.
Questions:
I'm not sure where this is called project_issue_flag_issue() greping for it only comes up with the one instance, so I'm not sure how to change it.
Where are the variables for the project-issue-summary.tpl.php generated? I couldn't find it.
Comment #24
mirzu commentedTalked about this in Project Project Scrum. I'm going to investigate how the project_issue_flag_issue() is used in the d6 version.
Comment #25
dwwI'm assuming the status here is still accurate and there's nothing for me to review at this time. Is that right? Please change this to "needs review" when that's appropriate. ;)
Thanks!
-Derek
Comment #26
mirzu commentedI've updated the patch to use new settings included in the flag_tracker module. Should work correctly now and include the number of followers. Once the layout of a project issue page is finished should be an easy task to output the flag in the template. Shouldn't need to do anythine more than place the flag using the recomended method from the flag module. http://drupal.org/node/295383
Comment #27
mirzu commentedFixed a couple of spelling errors found by Rob.
Comment #28
rgristroph commentedI read through the code for both this patch and the flag_tracker module that mirzu has in sandbox right now. We made a few small changes (typo type things). I tested on my own dev environment and we walked through setting it up, I followed and unfollowed an issue as admin and a test user, and checked the "Track" tab on the user account page. We fixed one error message that was popping up when you were the last person to unfollow something.
Also we ran a coder review.
This looks good to me !
Comment #29
webchickAwesome!! Marking rtbc :)
Comment #30
bdragon commentedReviewed and committed, thanks. http://drupalcode.org/project/project_issue.git/commit/ace2c5e
I made a slight change in includes/notification.inc to avoid crashing in _project_issue_notification_levels on the user/%/project-issue form. (Note that this form does crash again later, but that's #1560012: Port per-user issue notification email functionality to D7's problem. ;)
http://drupalcode.org/project/project_issue.git/commit/746df4a
Mirzu, you're planning to promote your sandbox soon, right?
Comment #31
senpai commentedTagging for Sprint 6.
Comment #32
mirzu commentedpromoting tomorrow.
Comment #34
dwwAs per today's scrum call, I need to figure out what's actually happening with this code, make sure it's getting deployed/enabled/configured on the D7 staging site, make sure the follow button is actually showing up on issue nodes, etc, etc.
Comment #34.0
dwwupdated summary to show remaining tasks for getting this stuff actually working again on the D7 site.
Comment #34.1
dwwadded #1828652
Comment #34.2
dwwadded #1828658
Comment #34.3
dwwadded #1828756
Comment #35
dwwThere's a ton of progress in here, see the updated summary. Turning this into META.
Comment #36
dwwThe last remaining task here, #1828756: D7 views don't honor tracker and issue following, is blocked on #949372: Port issue views to Search API so we can have a performant backend.
Comment #37
drumm#1828756: D7 views don't honor tracker and issue following is now done.
Comment #38.0
(not verified) commented#1828560 is no longer relevant
Comment #39
klonos...restoring tags eaten by the tag monster.