Bugtracker needs your help for better bug triage (req: PHP knowledge)

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
User avatar
Kunda1
Posts: 5460
Joined: Thu Jan 05, 2017 9:03 pm

Bugtracker needs your help for better bug triage (req: PHP knowledge)

Postby Kunda1 » Mon Jan 16, 2017 7:47 pm

Hey FC community,
I've been spending time cleaning up the bugtracker, apologies for all the mantis emails some of you may be receiving... it's for a good cause! ;)

The reason for this post is to find out if someone can help us enhance MantisBT (as you know, the FC bugtacker) in a way where bug triage is hopefully less repetitive. For example, even though the Bug tracker has a link in its dropdown stated not very subtly: READ THIS BEFORE REPORTING

READ-THIS-BEFORE-REPORTING.png
READ-THIS-BEFORE-REPORTING.png (22.67 KiB) Viewed 1737 times

alas...many many people ignore it! I constantly am encountering tickets where @wmayer @yorik @normandc etc... are requesting from bug reporters to follow the guidelines. Obviously this is inevitable, since you can't fool-proof anything 100% (i know, since I've been the fool many times in my life :oops:)


So i concocted a proposal to enhance the MantisBT software itself in issue #2846. The gist is that when someone opens a bug report they encounter pre-populated placeholder text in each field that they are asked to type in. Once they start typing in said field that placeholder text disappears.

FC-Mantis-Bug-Reporting-Template.png
FC-Mantis-Bug-Reporting-Template.png (91.05 KiB) Viewed 1737 times



One of the issues with this is that making any customizations to the bugtracker would potentially be a headache to integrate in to following upgraded versions. A headache yorik didn't need. So I opened a ticket on MantisBT http://mantisbt.org/bugs/view.php?id=22187 to request the functionality. Of course the gist of the MantisBT dev response was: Feel free to send us a PR (which we may or may not accept).


mantisbt-dev-response.png
mantisbt-dev-response.png (117.25 KiB) Viewed 1737 times


Obviously, not the response I was hoping for. since I'm no PHP-head and it was such a non-commital answer who knows if we do submit a PR that why will accept it?! But it occurred to me nevertheless, that I could tap the FreeCAD community to see if we can make this happen because from what I've seen you guys have overcome some pretty big obstacles. Very inspiring.
  • So if you're still reading and interested here are some details I think would be useful to get started:
  • MantisBT repo on github is https://github.com/mantisbt/mantisbt
  • Talk directly to the MantisBT devs via their gitter (https://gitter.im/mantisbt/mantisbt) which is preferable for them instead of IRC.
  • According to the MantisBT dev

    Code: Select all

    The way to achieve this [feature] is to have configuration opens that can be set in config_inc.php or the database (per project) that end up in the HTML place holder text, which provides the desired behavior automatically.
    [**] a sample config_inc.php can be seen at: https://github.com/mantisbt/mantisbt/bl ... php.sample
    [**] not sure what he means by 'or the database'
  • We can also try to make a plugin that auto-injects our customized code in to mantis freeing us from either banking that their devs will merge our patch or that we'll need to hand diff our customized code in to each MantisBT update ( :roll: )
So any help would be super appreciated! Thank you!
Last edited by Kunda1 on Tue Jan 17, 2017 1:12 am, edited 5 times in total.
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
triplus
Posts: 8667
Joined: Mon Dec 12, 2011 4:45 pm

Re: Bugtracker needs your help for better bug triage (req: PHP knowledge)

Postby triplus » Mon Jan 16, 2017 7:54 pm

The main problem with web apps is security. You really want to know what you are doing when tackling with web apps. Therefore achieving a working solution isn't always enough. You need to be sure you don't compromise security on the long run as maintaining custom solution also isn't easy.
User avatar
Kunda1
Posts: 5460
Joined: Thu Jan 05, 2017 9:03 pm

Re: Bugtracker needs your help for better bug triage (req: PHP knowledge)

Postby Kunda1 » Mon Jan 16, 2017 8:02 pm

triplus wrote:The main problem with web apps is security. You really want to know what you are doing when tackling with web apps. Therefore achieving a working solution isn't always enough. You need to be sure you don't compromise security on the long run as maintaining custom solution also isn't easy.
Agreed. Hopefully this is a pretty straightforward patch that won't undermine security in any way. The MantisBT may be able to vet it for us as well.
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
cox
Posts: 963
Joined: Wed Nov 26, 2014 11:37 pm

Re: Bugtracker needs your help for better bug triage (req: PHP knowledge)

Postby cox » Mon Jan 16, 2017 8:12 pm

Would it be a good idea to ad a "Expected behaviour field"?
Need help? Feel free to ask, but please read the guidelines first
User avatar
Kunda1
Posts: 5460
Joined: Thu Jan 05, 2017 9:03 pm

Re: Bugtracker needs your help for better bug triage (req: PHP knowledge)

Postby Kunda1 » Tue Jan 17, 2017 1:03 am

Was playing with the HTML Inspector by adding a placeholder="Some foo text" in <textinput placeholder="">
mantisbt-proof-of-concept.png
mantisbt-proof-of-concept.png (109.24 KiB) Viewed 1683 times
I realize that placeholder doesn't respect newlines. Doing more research i found this stackoverflow link: http://stackoverflow.com/questions/7312 ... a-textarea
Last edited by Kunda1 on Tue Jan 17, 2017 1:13 am, edited 1 time in total.
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
Kunda1
Posts: 5460
Joined: Thu Jan 05, 2017 9:03 pm

Re: Bugtracker needs your help for better bug triage (req: PHP knowledge)

Postby Kunda1 » Tue Jan 17, 2017 1:05 am

In mantisbt source code this would be the place for us to put the php variable: https://github.com/mantisbt/mantisbt/bl ... #L539-L576
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
kkremitzki
Posts: 1708
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

Re: Bugtracker needs your help for better bug triage (req: PHP knowledge)

Postby kkremitzki » Tue Jan 17, 2017 8:33 am

This seems like something that could also be solved with a few lines of Javascript if there's some way to include custom JS in Mantis.

For example, it looks like jQuery is already available on the page, so if you open up the console you can see the effect of the following:

Code: Select all

$('textarea[name*="steps_to_reproduce"]').attr('placeholder', 'Please produce a step-by-step...')
Also the new Mantis, from looking at the upstream bug, looks great :D should be interesting once that gets set up.

If FreeCAD infrastructure was maintained programmatically, e.g. with Docker, this custom jQuery, once set up, would require no maintenance, it'd just be a copy line in the setup script. devops stuff :twisted:
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
User avatar
yorik
Site Admin
Posts: 11497
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Bugtracker needs your help for better bug triage (req: PHP knowledge)

Postby yorik » Tue Jan 17, 2017 1:12 pm

kkremitzki wrote:This seems like something that could also be solved with a few lines of Javascript if there's some way to include custom JS in Mantis.
That might be much easier to turn into a plugin
User avatar
Kunda1
Posts: 5460
Joined: Thu Jan 05, 2017 9:03 pm

Re: Bugtracker needs your help for better bug triage (req: PHP knowledge)

Postby Kunda1 » Tue Jan 17, 2017 1:36 pm

yorik wrote:
kkremitzki wrote:This seems like something that could also be solved with a few lines of Javascript if there's some way to include custom JS in Mantis.
That might be much easier to turn into a plugin
I asked dregad on the mantisbt gitter page for a skeleton plug-in for us to use to implement this as a plug-in and he said to look at:
https://github.com/mantisbt-plugins/jQuery-UI/
Damien Regad @dregad Check the Developer's Guide for a minimalist, sample plugin; you can hook the EVENT_LAYOUT_RESOURCES event in the plugin's register method and do something like register_js( plugin_file( 'custom.js' ) );
Carlos @cproensa
See jqueryui plugin
Its purpose is to include jqueryui js lib
As a compkete
Complete example of your case
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
kkremitzki
Posts: 1708
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

Re: Bugtracker needs your help for better bug triage (req: PHP knowledge)

Postby kkremitzki » Tue Jan 17, 2017 2:27 pm

I'm setting up an installation of MantisBT 2.0 for further testing now. I'm assuming the switch will come before too long, and I should target the next version, right?
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.