#4449 Subscribe another user to an artifact (global admin only)

v1.0.0
closed
nobody
General
2015-08-20
2012-06-26
No

At /nf/admin (only accessible by global admins) create a new left-menu item called 'Add Subscribers' which goes to a new page. On this page, there should be a form to enter a URL and a username. Take the URL and run it through URL dispatch to determine what artifact it goes with (e.g. ticket, wiki page). Note: if the URL dispatch is hard to do at all, we can use a different approach, like separate input boxes for neighborhood, project, tool mount point, ticket number.

Then add the specified username as a subscriber to the artifact, if they aren't already. This should work just like when you subscribe yourself to a ticket, but for a different user.

Related

Tickets: #4449
Tickets: #4567

Discussion

  • Yaroslav Luzin - 2012-06-27

    created #94: [#4449] Subscribe another user to an artifact (2cp)

     

    Related

    Tickets: #4449

  • Yaroslav Luzin - 2012-06-27
    • status: open --> in-progress
     
  • Anonymous - 2012-07-05

    Originally by: *anonymous

    closed #94, changes are in 42cc_4449

    finding an artifact by a URL is a bit tricky, but it works.

     
  • Yaroslav Luzin - 2012-07-05
    • status: in-progress --> code-review
     
  • Dave Brondsema

    Dave Brondsema - 2012-07-05
    • status: code-review --> in-progress
    • qa: Dave Brondsema
     
  • Dave Brondsema

    Dave Brondsema - 2012-07-05
    • There is no success message after adding a subscriber. There is also no error message if an artifact is not found. This is basic behavior that is necessary. How else do you know if it worked or not?
    • A user can generate errors from within subscribe_artifact if an incomplete URL is given. Or if neighborhood, project, appconf is not found. Since this is only for admins, its not too big of a deal, but I'd still like avoid fatal errors from a form submission. A simple try/catch with log.warn(..., exc_info=True) would be fine.
    • there are 2 loops over __subclasses__() which finds Artifact of a depth of exactly 2. This should be changed to a recursive function to gather all subclasses (depth 1, 2 and beyond). Add them to a set so that duplicates are not present (Post is checked twice in the current implementation). Actually, I think you can call some functions from show_models.py to get this list: for depth, cls in dfs(M.Artifact, build_model_inheritance_graph())
    • On line 113, you shouldn't need all() in your for loop. all() pulls them all into memory, but you're doing a loop, so looping over the find() cursor is better.
    • I wish there were a more efficient way to find the right Artifact, but I can't think of a better way. If this isn't fast enough with production-sized data, we may have to revisit.
     
  • Yaroslav Luzin - 2012-07-06

    I wish there were a more efficient way to find the right Artifact, but I can't think of a better way. If this isn't fast enough with production-sized data, we may have to revisit.

    If this isn't fast enough we could add separate input boxes for each kind of artifact

     
  • Yaroslav Luzin - 2012-07-06

    created #104: [#4449] Add error messages and make code better (1cp)

     

    Related

    Tickets: #4449

  • Yaroslav Luzin - 2012-07-10

    closed #104, pushed changes into 42cc_4449

     
  • Yaroslav Luzin - 2012-07-10
    • status: in-progress --> code-review
     
  • Dave Brondsema

    Dave Brondsema - 2012-07-16
    • status: code-review --> closed
    • milestone: forge-backlog --> forge-jul-27
     

Log in to post a comment.