Discussion:
[mantisbt-dev] EVENT_MANAGE_PROJECT_DELETE
Louis BAYLE
2014-10-16 08:27:09 UTC
Permalink
Hi,
I have not found any EVENT_MANAGE_PROJECT_DELETE in core/events_inc.php.
Do you know if someone has already worked on this ?

If not, I'll try to do it. Is there any chance that this would be
integrated in future mantis 1.2.x releases or are you not interested in
this event ?

Is there any documentation on adding events in mantis ?

Best regards,

Louis BAYLE
http://CodevTT.org
***@gmail.com
Damien Regad
2014-10-16 08:43:50 UTC
Permalink
Louis BAYLE <***@...> writes:

Hi Louis,
Post by Louis BAYLE
I have not found any EVENT_MANAGE_PROJECT_DELETE in core/events_inc.php.
Do you know if someone has already worked on this ?
If there is, I'm not aware of it.
Post by Louis BAYLE
If not, I'll try to do it.
Your contribution would be welcome !
Post by Louis BAYLE
Is there any chance that this would be integrated in future mantis 1.2.x
releases or are you not interested in this event ?
Please note that it is unlikely we would add any new features to the 1.2.x
branch, as we're focusing our efforts on releasing 1.3 now.

Therefore, I suggest you submit your work as a pull request against our
master branch.
Post by Louis BAYLE
Is there any documentation on adding events in mantis ?
All information there is would be in the developer's guide (see
http://mantisbt.org/documentation.php); When adding new events, they should
be documented there.

Hope this helps
Louis BAYLE
2014-10-16 08:58:04 UTC
Permalink
Hi, thanks for your quick answer, I'll see what I can do.

So there will be no more 1.2.x release ?

My application (CodevTT.org) is closely linked to the mantis database, is
there a description of the changes in the DB that you plan to do from 1.2.x
to 1.3 ?

thank you,


Louis BAYLE
http://CodevTT.org
Post by Damien Regad
Hi Louis,
Post by Louis BAYLE
I have not found any EVENT_MANAGE_PROJECT_DELETE in core/events_inc.php.
Do you know if someone has already worked on this ?
If there is, I'm not aware of it.
Post by Louis BAYLE
If not, I'll try to do it.
Your contribution would be welcome !
Post by Louis BAYLE
Is there any chance that this would be integrated in future mantis 1.2.x
releases or are you not interested in this event ?
Please note that it is unlikely we would add any new features to the 1.2.x
branch, as we're focusing our efforts on releasing 1.3 now.
Therefore, I suggest you submit your work as a pull request against our
master branch.
Post by Louis BAYLE
Is there any documentation on adding events in mantis ?
All information there is would be in the developer's guide (see
http://mantisbt.org/documentation.php); When adding new events, they should
be documented there.
Hope this helps
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
mantisbt-dev mailing list
https://lists.sourceforge.net/lists/listinfo/mantisbt-dev
Damien Regad
2014-10-16 09:25:30 UTC
Permalink
Post by Louis BAYLE
So there will be no more 1.2.x release ?
We would only be releasing security and important bug fixes, but definitely
no new features.
Post by Louis BAYLE
My application (CodevTT.org) is closely linked to the mantis database, is
there a description of the changes in the DB that you plan to do from
1.2.x to 1.3 ?
There are no major changes to the database; you can find full details about
these by reviewing the the schema definition:

https://github.com/mantisbt/mantisbt/blob/master/admin/schema.php#L729

Helper functions source code is in http://git.io/KxbWXw
Paul Richards
2014-10-16 09:08:25 UTC
Permalink
Hi Louis,

I'd been reviewing some of the EVENT's in mantis recently for correct
placement.

Hooks on deleting project is one of the areas where we are missing events.

I'll generate a PR either during a spare moment today or this evening for
this. We actually miss being able to hook on a number of deletion
activities across the code base - adding additional hooks to cover this is
something that has been on my list to backport from the previous scrapped
2.x branches.

In addition, when reviewing the events before in that branch, there were a
number of events that I believe we mis-placed within the code base ( some
of which are currently in as PR's and as those get reviewed and merged,
i'll be continuing to submit the remaining ones)

Paul
Post by Louis BAYLE
Hi,
I have not found any EVENT_MANAGE_PROJECT_DELETE in core/events_inc.php.
Do you know if someone has already worked on this ?
If not, I'll try to do it. Is there any chance that this would be
integrated in future mantis 1.2.x releases or are you not interested in
this event ?
Is there any documentation on adding events in mantis ?
Best regards,
Louis BAYLE
http://CodevTT.org
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
mantisbt-dev mailing list
https://lists.sourceforge.net/lists/listinfo/mantisbt-dev
Paul Richards
2014-10-16 19:16:56 UTC
Permalink
Louis,



As promised, I’ve generated the patch I had for PROJECT event deletion, and also VERSION event deletion.



Whilst I managed to generate the patch at lunchtime today from previous experimental branches, we block SSH from our work network to “unknown” hosts so could only generate the PR now.



I’ve created two bugs in Mantis to track these new events:



http://www.mantisbt.org/bugs/view.php?id=17782 - 0017782: New Event: EVENT_MANAGE_VERSION_DELETE

http://www.mantisbt.org/bugs/view.php?id=17783 - 0017783: New Event: EVENT_MANAGE_PROJECT_DELETE



Can you see if the PR for this at https://github.com/mantisbt/mantisbt/pull/384 would achieve what you were after?



I’ve got some similar patches still to generate PR’s for, so if there’s anything else you are missing say – it might be I already have a patch, or it might be something new that it would be helpful for you to work on implementing.



Thanks

Paul



From: Paul Richards [mailto:***@mantisforge.org]
Sent: 16 October 2014 10:08
To: developer discussions
Subject: Re: [mantisbt-dev] EVENT_MANAGE_PROJECT_DELETE



Hi Louis,



I'd been reviewing some of the EVENT's in mantis recently for correct placement.



Hooks on deleting project is one of the areas where we are missing events.



I'll generate a PR either during a spare moment today or this evening for this. We actually miss being able to hook on a number of deletion activities across the code base - adding additional hooks to cover this is something that has been on my list to backport from the previous scrapped 2.x branches.



In addition, when reviewing the events before in that branch, there were a number of events that I believe we mis-placed within the code base ( some of which are currently in as PR's and as those get reviewed and merged, i'll be continuing to submit the remaining ones)



Paul







On Thu, Oct 16, 2014 at 9:27 AM, Louis BAYLE <***@gmail.com <mailto:***@gmail.com> > wrote:

Hi,

I have not found any EVENT_MANAGE_PROJECT_DELETE in core/events_inc.php.

Do you know if someone has already worked on this ?

If not, I'll try to do it. Is there any chance that this would be integrated in future mantis 1.2.x releases or are you not interested in this event ?



Is there any documentation on adding events in mantis ?

Best regards,




Louis BAYLE
http://CodevTT.org
***@gmail.com <mailto:***@gmail.com>
Robert Munteanu
2014-10-16 19:19:19 UTC
Permalink
On Thu, Oct 16, 2014 at 10:16 PM, Paul Richards
Post by Paul Richards
Whilst I managed to generate the patch at lunchtime today from previous
experimental branches, we block SSH from our work network to “unknown” hosts
so could only generate the PR now.
You can use https for github access ; that's very likely to be allowed
through firewalls.

Robert
--
http://robert.muntea.nu/
Paul Richards
2014-10-16 19:27:25 UTC
Permalink
I thought you could only push back on ssh though, or do you have to modify the command in some way?

I cloned with git clone https://github.com/mantisbt/mantisbt.git and that didn't allow pushing back

And ssh to ***@github.com:mantisbt/mantisbt.git hit the regional firewall block - I should probably put in a CR to get a rule to allow ssh to github added at some point.

Paul




-----Original Message-----
From: Robert Munteanu [mailto:***@gmail.com]
Sent: 16 October 2014 20:19
To: developer discussions
Subject: Re: [mantisbt-dev] EVENT_MANAGE_PROJECT_DELETE
Post by Paul Richards
Whilst I managed to generate the patch at lunchtime today from
previous experimental branches, we block SSH from our work network to
“unknown” hosts so could only generate the PR now.
You can use https for github access ; that's very likely to be allowed through firewalls.

Robert

--
http://robert.muntea.nu/
Louis BAYLE
2014-10-16 20:26:02 UTC
Permalink
Hi Paul,
I too, created a pull request on EVENT_MANAGE_PROJECT_DELETED:
https://github.com/mantisbt/mantisbt/pull/383

So now we've got two :-)

Note: i called it "..._DELETED" (instead of "..._DELETE", to be similar to
the 'EVENT_BUG_DELETED' event. But it's exactly the same code.

I tested in on my plugin, so it should be ok.

Thank you,
Louis

Louis BAYLE
Tel: +33 (0)4.42.604.734
Post by Damien Regad
Louis,
As promised, I’ve generated the patch I had for PROJECT event deletion,
and also VERSION event deletion.
Whilst I managed to generate the patch at lunchtime today from previous
experimental branches, we block SSH from our work network to “unknown”
hosts so could only generate the PR now.
EVENT_MANAGE_VERSION_DELETE
EVENT_MANAGE_PROJECT_DELETE
Can you see if the PR for this at
https://github.com/mantisbt/mantisbt/pull/384 would achieve what you
were after?
I’ve got some similar patches still to generate PR’s for, so if there’s
anything else you are missing say – it might be I already have a patch, or
it might be something new that it would be helpful for you to work on
implementing.
Thanks
Paul
*Sent:* 16 October 2014 10:08
*To:* developer discussions
*Subject:* Re: [mantisbt-dev] EVENT_MANAGE_PROJECT_DELETE
Hi Louis,
I'd been reviewing some of the EVENT's in mantis recently for correct placement.
Hooks on deleting project is one of the areas where we are missing events.
I'll generate a PR either during a spare moment today or this evening for
this. We actually miss being able to hook on a number of deletion
activities across the code base - adding additional hooks to cover this is
something that has been on my list to backport from the previous scrapped
2.x branches.
In addition, when reviewing the events before in that branch, there were a
number of events that I believe we mis-placed within the code base ( some
of which are currently in as PR's and as those get reviewed and merged,
i'll be continuing to submit the remaining ones)
Paul
Hi,
I have not found any EVENT_MANAGE_PROJECT_DELETE in core/events_inc.php.
Do you know if someone has already worked on this ?
If not, I'll try to do it. Is there any chance that this would be
integrated in future mantis 1.2.x releases or are you not interested in
this event ?
Is there any documentation on adding events in mantis ?
Best regards,
Louis BAYLE
http://CodevTT.org
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
mantisbt-dev mailing list
https://lists.sourceforge.net/lists/listinfo/mantisbt-dev
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
mantisbt-dev mailing list
https://lists.sourceforge.net/lists/listinfo/mantisbt-dev
P Richards
2014-10-16 21:13:24 UTC
Permalink
Hi,



Actually, the pull request I generated also handles VERSION deletions



In terms of the code for the manage project deletion event, there’s a couple of subtle differences:



Firstly – you currently place the code within manage_proj_delete.php – this is a problem in as much as – it’s possible to delete projects via the SOAP api. Equally other plugins may provide routes to delete projects.



Making the assumption that the most likely reason for adding a plugin on a hook to handle project deletions is to allow either:

a) Synchronisation of project information with a 3rd party source (I suspect in your case this the reason you are after this event is so you can handle project deletions within your time tracking software

b) “Event log” monitoring of project deletions



In both of these cases the correct placement of this hook is within project_delete – one of the issues in the current code IMO is that for some of the hooks I’ve slowly been submitting PR’s to relocate/fix there are cases where the event does not fire – for example, a bugnote added event that only fires if a bugnote is added via a particular route.



In some cases I’d deem this to be the correct behaviour i.e. if we expect the plugin author to modify a particular page.



In the case of deletion of project or version events, I think that it’s unlikely that we’d want to modify the page output – and that instead, the expectation would be to achieve either a or b above.



If indeed, the expectation is to allow something specify to the manage page, then I’d argue we’d need to add a 2 new events – one to fire on A+B above, the other to fire on the manage project page.



In terms of the naming of the hook, (and again, I think some of our existing hooks may have been thrown in in the wrong place in this regard) – we may like to add 2 events at some stage:



EVENT_MANAGE_PROJECT_DELETE (Y)

Delete from project_table

EVENT_MANAGE_PROJECT_DELETED (Z)



Consider 3 plugins:

a) Plugin 1 checks project has been removed from a wiki before allowing deletion

b) Plugin 2 checks project has been removed from a forum before allowing deletion from mantis

c) Plugin 3 logs that a project has been deleted



In the base above, we’d want to hook plugins 1+2 to event Y – this would allow a user to “block” the deletion of the project if the tidy up steps (delete from wiki, delete from forum) had not been completed.



We’d then potentially want to hook plugin 3 to event Z – i.e. to perform the logging after the actual deletion – note, we’d need to be careful what arguments would be picked for this hook as it wouldn’t be possible to look up the information at this point.



In any case, my point here is more that we need to make a good choice of naming for future use – calling an event “deleted” (past tense) before the actual deletion I’d argue is more confusing for long-term use. We describe the hook as a “pre-“ hook and then use past tense which doesn’t make that much sense – and I’m pretty sure we do that in a number of places already.



Paul



From: Louis BAYLE [mailto:***@gmail.com]
Sent: 16 October 2014 21:26
To: developer discussions
Subject: Re: [mantisbt-dev] EVENT_MANAGE_PROJECT_DELETE



Hi Paul,

I too, created a pull request on EVENT_MANAGE_PROJECT_DELETED:
https://github.com/mantisbt/mantisbt/pull/383

So now we've got two :-)

Note: i called it "..._DELETED" (instead of "..._DELETE", to be similar to the 'EVENT_BUG_DELETED' event. But it's exactly the same code.

I tested in on my plugin, so it should be ok.

Thank you,

Louis




Louis BAYLE
Tel: +33 (0)4.42.604.734
***@gmail.com <mailto:***@gmail.com>



On Thu, Oct 16, 2014 at 9:16 PM, Paul Richards <***@blueyonder.co.uk <mailto:***@blueyonder.co.uk> > wrote:

Louis,



As promised, I’ve generated the patch I had for PROJECT event deletion, and also VERSION event deletion.



Whilst I managed to generate the patch at lunchtime today from previous experimental branches, we block SSH from our work network to “unknown” hosts so could only generate the PR now.



I’ve created two bugs in Mantis to track these new events:



http://www.mantisbt.org/bugs/view.php?id=17782 - 0017782: New Event: EVENT_MANAGE_VERSION_DELETE

http://www.mantisbt.org/bugs/view.php?id=17783 - 0017783: New Event: EVENT_MANAGE_PROJECT_DELETE



Can you see if the PR for this at https://github.com/mantisbt/mantisbt/pull/384 would achieve what you were after?



I’ve got some similar patches still to generate PR’s for, so if there’s anything else you are missing say – it might be I already have a patch, or it might be something new that it would be helpful for you to work on implementing.



Thanks

Paul



From: Paul Richards [mailto:***@mantisforge.org <mailto:***@mantisforge.org> ]
Sent: 16 October 2014 10:08
To: developer discussions
Subject: Re: [mantisbt-dev] EVENT_MANAGE_PROJECT_DELETE



Hi Louis,



I'd been reviewing some of the EVENT's in mantis recently for correct placement.



Hooks on deleting project is one of the areas where we are missing events.



I'll generate a PR either during a spare moment today or this evening for this. We actually miss being able to hook on a number of deletion activities across the code base - adding additional hooks to cover this is something that has been on my list to backport from the previous scrapped 2.x branches.



In addition, when reviewing the events before in that branch, there were a number of events that I believe we mis-placed within the code base ( some of which are currently in as PR's and as those get reviewed and merged, i'll be continuing to submit the remaining ones)



Paul







On Thu, Oct 16, 2014 at 9:27 AM, Louis BAYLE <***@gmail.com <mailto:***@gmail.com> > wrote:

Hi,

I have not found any EVENT_MANAGE_PROJECT_DELETE in core/events_inc.php.

Do you know if someone has already worked on this ?

If not, I'll try to do it. Is there any chance that this would be integrated in future mantis 1.2.x releases or are you not interested in this event ?



Is there any documentation on adding events in mantis ?

Best regards,




Louis BAYLE
http://CodevTT.org
***@gmail.com <mailto:***@gmail.com>


------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
mantisbt-dev mailing list
mantisbt-***@lists.sourceforge.net <mailto:mantisbt-***@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/mantisbt-dev

Continue reading on narkive:
Loading...