Success

User tests: Successful: Unsuccessful:

avatar elkuku
elkuku
18 Apr 2014

The intention here is to

  • Create an "edit bot" account that has at least "push rights" (e.g. a GitHub "collaborator") to the given project to perform a specific action on the behalf of an, otherwise non authenticated, user.

I think it requires an account with "admin" permissions to get a list of authenticated users for a given project, so I decided to take a more "hackier" approach:

  1. Try to perform the action on behalf of the current logged in user and if this "fails"

    1a. Try to perform the action on behalf of a configured "edit bot"

When the status changes (open <=> closed) a comment will be generated that includes the username of the user that performed the action.

This should be carefully reviewed and tested (how?) before merging into master. ?

avatar elkuku elkuku - open - 18 Apr 2014
avatar b2z
b2z - comment - 21 Apr 2014

Looking on the code I could say it should work (will test it tomorrow):) I have only one question - why you update status only on GitHub?

avatar elkuku
elkuku - comment - 21 Apr 2014

why you update status only on GitHub?

Not sure what you mean... Since GitHub has only 2 statuses (open and closed), the JTracker status value gets translated to either "open" or "closed" to match those on GitHub.
Then it will be saved to the database ;)

avatar b2z
b2z - comment - 22 Apr 2014

Hmm I do not see any status saving. Only updating it on the GitHub. But what about non-GitHub project?

avatar elkuku
elkuku - comment - 22 Apr 2014

The status get's sucked in and filtered in the models save() method and then saved to the issues table (@todo filter and validate somewhere else...) - I hope thats what you meant.

That would be the same for non GitHub projects..

The only issue that pops up for me here is that you can not open <=> close issues with editown permissions, but that's another topic (I hope).. ((that would require some lines of code around here))

avatar b2z
b2z - comment - 22 Apr 2014

The status get's sucked in and filtered in the models save() method and then saved to the issues table (@todo filter and validate somewhere else...) - I hope thats what you meant.

Nope. I mean that in the controller's save method status does not come in from the input.

avatar elkuku
elkuku - comment - 22 Apr 2014

Nope. I mean that in the controller's save method status does not come in from the input.

That code only gets executed when editown permissions are used. If you have full edit permissions all values are taken from the input here... seems like the comments should be more explicit ;)

avatar b2z
b2z - comment - 22 Apr 2014

Oh blind me...

avatar elkuku
elkuku - comment - 22 Apr 2014

OK, so i switched that strange try/catch to an if/else and moved the GitHub update code to a proper method.
Does that make things more clear ? (or less...)

avatar b2z
b2z - comment - 22 Apr 2014

Now it is more clear :)

What I do not like (in general) that our controllers become responsible for things that models should do. Just IMHO :)

avatar b2z b2z - change - 24 Jul 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-07-24 18:53:27
avatar b2z b2z - close - 24 Jul 2014
avatar b2z b2z - merge - 24 Jul 2014
avatar b2z b2z - close - 24 Jul 2014
avatar b2z b2z - reference | - 24 Jul 14
avatar elkuku elkuku - head_ref_deleted - 24 Jul 2014

Add a Comment

Login with GitHub to post a comment