Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
b234a5d
Fix typo causing attachment flag changes to not get filtered properly
staktrace Apr 4, 2012
b51bc86
Add bugtags support for dependency tree views
staktrace Apr 7, 2012
2daff3c
Add bug titles as link titles during linkification
staktrace Apr 8, 2012
e9e7a70
Add linkification for bugnumbers in the depends/blocks fields
staktrace May 7, 2012
57fc735
Guard against passing an empty needle to strpos
staktrace May 24, 2012
821d2c5
Update saveDependencyChanges to deal with multiple change tables in a…
Jun 5, 2012
6a6574b
Deal with roc's multi-line author info
staktrace Jun 7, 2012
d2ab0db
Revert "Deal with roc's multi-line author info"
staktrace Jun 9, 2012
2827f4b
Add some more known issueS
staktrace Jun 13, 2012
ed22b2e
Deal with some weird emails which have a changed-fields header but ju…
staktrace Jun 22, 2012
1f4f59d
Update scraper to deal with changes in X-Bugzilla-Changed-Fields head…
staktrace Aug 23, 2012
a7e66c6
Revert "Update scraper to deal with changes in X-Bugzilla-Changed-Fie…
staktrace Aug 24, 2012
1b5079b
Update to deal with minor bugmail format changes
staktrace Aug 24, 2012
3fae6f5
Deal with some more minor format updates
staktrace Aug 24, 2012
89ae820
Update whiteboard field name
staktrace Aug 24, 2012
fa68a8a
The headers don't contain the attachment number any more; update to a…
staktrace Aug 25, 2012
d7049a2
Allow missing change table for new bug notifications, since now we're…
staktrace Aug 30, 2012
e106776
Deal with flags and attachment flags having the same header
staktrace Sep 3, 2012
7e0242e
Deal with attachment flags better
staktrace Sep 4, 2012
8d32103
Really fix the attachment flags thing this time
staktrace Sep 5, 2012
378d90b
Update _ME to be an array
staktrace Sep 5, 2012
0b444ff
Update filter to deal with KDE bugmail as well (field headers are low…
staktrace Sep 5, 2012
b5553e0
Deal with mozilla bug 789278
staktrace Sep 7, 2012
071329b
Deal with other attachment fields like mime and plain
staktrace Sep 10, 2012
250c047
Add a X at the bottom of the bug block too
Sep 23, 2012
0cb1791
Deal with missing email addresses in unconfirmed bugmails
staktrace Oct 29, 2012
b904421
Fuzzify the TBPL robot check
staktrace Jan 3, 2013
c9adf31
Deal with needinfo requests as well
staktrace Feb 6, 2013
ae188c8
Fix longstanding bug that all requests show up as r? instead of with …
staktrace Feb 6, 2013
5961a0d
Handle needinfo cancellations
staktrace Feb 7, 2013
fe06f5a
Add an extra space next to the X for mac os lion scrollbars
staktrace May 28, 2013
8318379
Add support for dep_changed emails
staktrace Aug 1, 2013
d95c92c
Update robot name change
staktrace Aug 22, 2013
c71846f
Update attachment flags parsing bit to deal with the attachment numbe…
staktrace Nov 18, 2013
dd66e4d
Deal with linebreaks when people with long names respond to review re…
staktrace Jan 10, 2014
45aac82
Add User Story as a field
staktrace Mar 6, 2014
30df22a
Add QA Whiteboard field
staktrace Apr 30, 2014
37c66ef
Scroll to the top of a bug block on x-axis too
staktrace May 13, 2014
6c72b2a
Deal with new 'comment created' useless field
staktrace Jul 8, 2014
429372e
Slight edit to user script while debugging GM_xhr failures
staktrace Jul 8, 2014
d3a04f8
Update filter script
staktrace Dec 10, 2014
8b144ec
Deal with new secure mail format
staktrace Dec 10, 2014
0ca0f09
Deal with attachment titles that fall into the next line because of l…
staktrace Dec 27, 2014
52ad6ae
Add treeherder robot
staktrace Mar 23, 2015
3898702
Suppress warning on amazon AMIs
staktrace Apr 17, 2015
884759b
Remove spurious variable
staktrace Apr 17, 2015
5c2a9ae
Make sender checking optional
staktrace Apr 17, 2015
0ad5b89
Fix scrollTo onclick code
May 2, 2015
febc9a2
Create README.md
retornam May 5, 2015
c9b2c22
Merge pull request #1 from retornam/readme.md
staktrace May 5, 2015
a51f6ff
Don't scroll down/right when wiping a bug block from the bottom.
staktrace May 6, 2015
4b95bec
Update user script to work in greasemonkey again
staktrace Jul 22, 2015
575dc28
Add regression range as a keyword
staktrace Sep 28, 2015
2597a48
Add Has STR as a keyword
staktrace Nov 2, 2015
38069c5
Stop assuming attachments are splinter reviews
staktrace Feb 19, 2016
f7a1c89
Update filter to catch 'Restrict Comments'
staktrace Apr 18, 2016
11ea0c2
Add support for Mozilla theme
staktrace Jan 9, 2017
4af0280
Drop nag mails
staktrace Feb 3, 2017
48ea1b0
Move the user script into bugtags/
staktrace Sep 26, 2017
c047d50
Turn bugtags into a webextension
staktrace Sep 26, 2017
92ae62d
Fix migration from GM to standalone content script
staktrace Sep 26, 2017
0429161
Drop unnecessary application id
staktrace Sep 26, 2017
60e821b
Add user-finding for new bugzilla layout
staktrace Dec 21, 2017
2decf5b
Add amazonses as a valid sender
staktrace Mar 26, 2018
b893e06
amazonses was the wrong thing to check
staktrace Mar 26, 2018
1bbc32a
Fix checks
staktrace Mar 29, 2018
272cade
Fix stupid PHP warnings about undefined indices
staktrace May 24, 2018
37bbc30
More PHP warning fixes
staktrace May 24, 2018
8d30ec9
More warning fix
staktrace May 24, 2018
384e052
Fix typo
staktrace May 24, 2018
2760067
Remove unused variable
staktrace Jun 6, 2018
dec066e
Reorganize files into folders
staktrace Jul 24, 2018
9b7315c
Add gitignore
staktrace Jul 24, 2018
cf0df7a
Add Due Date field
staktrace Jul 24, 2018
1e48145
Add nginx config
staktrace Jul 26, 2018
1d9c2a4
Fix filename
staktrace Jul 26, 2018
f0c2da3
Add more scraper tools
staktrace Jul 29, 2018
6bf2bfd
Fail on metadata errors
staktrace Aug 2, 2018
c978c93
Provide a note field
staktrace Aug 2, 2018
7c3b834
Reduce PHP warnings
staktrace Aug 2, 2018
7606751
Avoid PHP warning
staktrace Sep 1, 2018
83cf0a2
Add a table for GH issue comments
staktrace Sep 13, 2018
adc94f3
Initial GH email scraper
staktrace Sep 14, 2018
3c0e3b4
Add sample for scraper mysql config
staktrace Sep 14, 2018
c392e94
Fix for rust 1.27 compat
staktrace Sep 14, 2018
3b72446
Remove test output and fix insertion
staktrace Sep 14, 2018
6abcc50
Add review_requested category
staktrace Sep 17, 2018
ca35352
Fix more PHP warnings
staktrace Sep 26, 2018
09f322d
Fix note updating
staktrace Sep 26, 2018
ea4decb
Start displaying gh_issues table contents; notes aren't hooked up yet
staktrace Oct 9, 2018
a3403b5
Add new GH issues linking
staktrace Oct 9, 2018
f1fb863
Linkify things in GH
staktrace Oct 9, 2018
78236e9
Expand commentnum to hash since apparently github can send #event- ha…
staktrace Oct 9, 2018
ac589d5
Robustify the scraper against early failure by saving the file and th…
staktrace Oct 9, 2018
a0e5786
Do a better job with newlines
staktrace Oct 15, 2018
59ab00d
Deal with URLs that have no hash but /files/<rev>..<rev> instead
staktrace Oct 16, 2018
1c1e59f
Alter schema to support non-BMP unicode
staktrace Oct 16, 2018
d2c072b
Map thread authoring to reporter
staktrace Oct 16, 2018
424d7f6
Make some columns wider
staktrace Oct 18, 2018
66de671
Switch metadata bug to varchar to allow GH issues as well
staktrace Oct 18, 2018
b54aec5
Remove stray \r characters that might be just before end_ix
staktrace Oct 18, 2018
3b97730
Add title support for GH issues
staktrace Oct 18, 2018
3706b13
Linkify markdown
staktrace Oct 18, 2018
f4d52aa
Fix typo
staktrace Oct 18, 2018
40c9ffd
Fix note/tag stuff for GH issues
staktrace Oct 18, 2018
48bf537
Increase newbugs.title to 1024 len
staktrace Oct 19, 2018
6945af3
Factor out some bugzilla vs github code
staktrace Nov 2, 2018
0808eb1
Fix search results for GH issues
staktrace Nov 2, 2018
cb15315
Add new robot name
staktrace Nov 19, 2018
6c38a8f
Handle emails generated from replies to other emails
staktrace Nov 20, 2018
b9ebdd0
Support commit notifications
staktrace Jan 14, 2019
e979a73
Fix scraping of attachment props change
staktrace Jan 22, 2019
efb5905
Add Fission Milestone field
staktrace Feb 14, 2019
7eac6be
Link bugs in regressions field
staktrace Apr 8, 2019
1a8deb6
Add Regressed by field
staktrace Apr 8, 2019
8b4a9db
Regressed by needs linking too
staktrace Apr 8, 2019
0d452f3
Add webcompat priority field
staktrace May 17, 2019
62db13d
Update field mappings
staktrace Jun 9, 2019
fff9d63
Update deprecated ssl syntax
staktrace Aug 15, 2019
fa18d0e
Update use of deprecated code
staktrace Jan 26, 2020
216648f
Make scraping bugmail work, except for request type emails
staktrace Feb 6, 2020
776501b
Add support for needinfo request emails
staktrace Feb 15, 2020
c622093
Look in a different dir for error emails
staktrace Feb 15, 2020
78a25c1
Add handling for needinfo cancellation
staktrace Feb 21, 2020
ba88843
Secure request emails don't have a reason
staktrace Feb 27, 2020
8139f01
Add support for granted requests
staktrace Mar 22, 2020
0b7fbd6
Add support for denied requests
staktrace Apr 6, 2020
53a4517
Add support for failed CI runs
staktrace Oct 16, 2020
eee9005
Set up initial phabricator scraping
staktrace Oct 23, 2020
5e5b923
Add table for phab diffs
staktrace Oct 29, 2020
ab79163
Add support for phab_diff table to dashboard
staktrace Oct 29, 2020
bd744f7
Implement phabricator mail scraping (untested)
staktrace Oct 29, 2020
99b20a8
Linkify all links for phabmail
staktrace Oct 30, 2020
20e58bc
Trim stuff after revision detail
staktrace Oct 30, 2020
db15192
Use a unique letter for phab_diffs
staktrace Oct 30, 2020
1564dcd
Add support for diffusion things too
staktrace Nov 6, 2020
50fd762
Add some support for diffusion revert emails
staktrace Nov 22, 2020
c305a00
Deal with slight change to github email that caused slashes to appear…
staktrace Feb 7, 2022
8f794cf
Explicit row format for easier migration across mysql versions
staktrace Mar 2, 2024
da596d0
php 8 fixes
staktrace Mar 2, 2024
aa4d115
Add http support for certbot
staktrace Apr 15, 2024
3aaca22
Drop spurious slash in URL causing 404s
staktrace May 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
scraper/config.php
scraper/scraper.mysql.cnf
scraper/target
4 changes: 3 additions & 1 deletion README.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ <h2 id="dsetup">Detailed Setup</h2>

<code>"| /home/myusername/path/to/decrypt_mail.awk | /home/myusername/path/to/filter.php"</code>

<p>The second component is a MySQL database. This is where all the bug data is actually stored after being extracted from the emails. You will need to set up a database with the necessary tables (schemas are in tables.sql). You will also need to rename the example.config.php file to bugmash.config.php and put your database access information into it. While you're at it, also fill in $_ME in the config file with the email address on your Bugzilla account (i.e. what shows up when you go to Bugzilla preferences).</p>
<p>The second component is a MySQL database. This is where all the bug data is actually stored after being extracted from the emails. You will need to set up a database with the necessary tables (schemas are in tables.sql). You will also need to rename the example.config.php file to bugmash.config.php and put your database access information into it. While you're at it, also fill in $_ME in the config file with the email address on your Bugzilla account (i.e. what shows up when you go to Bugzilla preferences). If you have multiple Bugzilla accounts you can put them all in.</p>

<p><b>IMPORTANT!</b> Make sure that the bugmash.config.php file is not in your web server's document root (generally $HOME/www), otherwise your database credentials may be at risk of being snarfed by evil crackers!!</p>

Expand Down Expand Up @@ -81,6 +81,8 @@ <h2 id="kissues">Known issues</h2>
<ul>
<li>The code to strikethrough obsoleted review requests doesn't seem to be taking effect. Not sure where in the code this bug is, haven't really looked at it.</li>
<li>When concurrently editing tags via both the user script and the dashboard, it is easy to accidentally clobber tag changes. This should be detected and handled better.</li>
<li>Bugzilla comments which contain "--" on a single line will be prematurely terminated, since that is taken as the end-of-comment marker.</li>
<li>Review authors whose name/email wraps onto a second line in the email are not handled properly.</li>
</ul>

<h2 id="improve">Areas for improvement</h2>
Expand Down
89 changes: 89 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# Bugmash v0.1

A dashboard for quickly viewing and processing high volumes of bugmail. Also comes with the ability to add private notes and tags to bugs, and have those tags show up on Bugzilla itself (via a Scriptish user script).

* Source code available at: [https://github.com/staktrace/bugmash](https://github.com/staktrace/bugmash)
* Original author: Kartikaya Gupta
* Contributors: maybe you!

Jump to section: [Quick Setup](#qsetup) | [Detailed Setup](#dsetup) | [Usage](#usage) | [Known Issues](#kissues) | [Areas for improvement](#improve)

## Quick Setup

Bugmash is NOT trivial to install. At least, not yet. It also requires that you have some infrastructure set up on your part (database, PHP, etc.) to be able to run the different pieces. Therefore, use of bugmash is not for the faint of heart, and is really only recommended if the volume of bugmail you receive (or want to receive) is stupendous. A good qualification factor might be that you have declared bugmail bankruptcy at least once. Therefore, there is no quick setup. Work your way through the detailed setup instructions if you're still interested.

## Detailed Setup

Bugmash has a number of components that work together. The way you set up these components can vary somewhat, but you may need to twiddle a few things here and there to get things to work if you deviate too far from how I've set it up. Ideally as more people try to use it, they will contribute patches to make this easier. As it is, you should probably read through these instructions first before even attempting to set it up.

First, there is an email scraper. This is contained in the filter.php file. You will need to set up your Bugzilla email such that you can feed the bugmail into this php script. The way I have it set up is I have my Bugzilla email account redirect to a mailbox on my webhost account (of the form myusername+bugmash@myaccountserver.dreamhost.com), and then I have a .forward file in my webhost account with a line like the one below:

`"| /home/myusername/path/to/filter.php"`

This takes all incoming email and pipes it to the filter.php script. Make sure you mark filter.php as executable, and update the hashbang line at the top to point to your php interpreter. The scraper extracts useful information from Bugzilla emails, and stuffs it into a MySQL database (which is the second component, detailed below). If you want to be able to process PGP/GPG-encrypted bugmail as well, you can additionally pipe the mail through decrypt_mail.awk before piping it to filter.php. This assumes you have no passphrase on your gpg key, such that "gpg --decrypt" will successfully decrypt stdin to stdout. In this case, your .forward file might look like this:

`"| /home/myusername/path/to/decrypt_mail.awk | /home/myusername/path/to/filter.php"`

The second component is a MySQL database. This is where all the bug data is actually stored after being extracted from the emails. You will need to set up a database with the necessary tables (schemas are in tables.sql). You will also need to rename the example.config.php file to bugmash.config.php and put your database access information into it. While you're at it, also fill in $_ME in the config file with the email address on your Bugzilla account (i.e. what shows up when you go to Bugzilla preferences). If you have multiple Bugzilla accounts you can put them all in.

**IMPORTANT!** Make sure that the bugmash.config.php file is not in your web server's document root (generally $HOME/www), otherwise your database credentials may be at risk of being snarfed by evil crackers!!

So, with these two components, bugmail you receive should be getting parsed and inserted correctly. If you are piping emails to the script that are not bugmail, they will be saved to the folder you specify in the config file. If, for whatever reason, the email scraper is unable to parse an actual bugmail, it will save the bugmail, along with a corresponding .err file, to the same directory that filter.php is in. This is so that you don't lose any bugmail, and can improve the scraper to handle the failures. (The most frequent reason this happens is when an unknown bug field changes value.)

The third component is the front-end, which consists of the common.php, dashboard.php, wipe.php, and search.php files. These should be installed into a directory and served via a normal PHP-supporting webserver (e.g. Apache with mod_php). You will need to modify the $BUGMASH_DIR variable in common.php so that it can find the bugmash.config.php file with the database credentials. Once you have this set up, you can access the dashboard by going to the dashboard.php in your favourite web browser (i.e. Firefox).

**IMPORTANT!** You should probably lock down access to the dashboard (and the other web-facing .php files) by using .htaccess or some other kind of authentication. Failure to do so could allow evil crackers to walk right in and mark all your bugmail as read!!

Now, if you have set all of that up, there is one final (optional) component you can install. This consists of the tags.php file, which should be placed in the same web-facing directory as common.php, and the bugtags.user.js user script. This user script can be installed into Scriptish (a Firefox add-on) and modifies Bugzilla bug listing pages (such as the "My Bugs" page, or any search results page) to display and edit your personal bug tags. Before installing the user script into Scriptish, make sure you modify the TAGS_SERVER variable as appropriate so that it points to your web-facing tags.php file.

## Usage

As with most power tools, there are many intricacies to using Bugmash. These are documented here in favour of keeping the actual interface minimal and fast.

### Bug blocks

The primary mode of interaction with Bugmash is through the dashboard.php front-end. This will show all of the data from your bugmail that you have not marked as "viewed" at the time that the page is loaded. Note that the page does not auto-update or auto-refresh; you have to reload manually when you want to view the latest bug information. This is by design because I hate pages that move content around under my cursor. Here is a screenshot of what the dashboard looks like:

<center>![Screenshot of the dashboard](bugmash-dashboard-screenshot.png)</center>

All of the data for a given bug is contained inside a "bug block" (the thing with the blue header and footer). Note that if a bug is marked "secure" (so that the bugmail is PGP/GPG-encrypted), the header and border of the bug block is red instead. The header contains the bug number, the bug title, and two links in the top-right corner. The first link will be either "N" (for Note) or "U" (for Update). Clicking on this link will take you to the bottom of the dashboard, to the bug notes section, and allow you to add or edit the corresponding note and tag information for that bug. The "N" link will be displayed when there is no pre-existing note/tag, and the "U" link will be displayed when there is already a pre-existing note/tag for the bug. You can also hover your mouse over the "U" link to get the note/tag information in a tooltip.

The second link is an "X" that marks the bug block as viewed. Clicking on the X makes the bug block disappear and shifts the column up so that you can click on the X for the next bug block without moving your mouse. Note that when you mark a bug block as viewed, the block is hidden and an XMLHttpRequest is sent to the server; if that XMLHttpRequest fails, the bug block will be made visible again, and the "X" will be replaced with "[E]" (for Error). If this happens, you can click on the "[E]" to try again (it does the same thing as the X).

The data inside the bug block should be largely self-explanatory; it is basically a compressed version of the data you should be accustomed to seeing in normal bugmail. Note that URLs and bug numbers should be clickable even though they are not blue-and-underlined. This is to reduce visual noise for when you have a lot of them. The footer on the bug block has a link to take you back to the top of the bug block; this is useful for when the bug block is taller than a screen, or if you're on a mobile device with a small screen. The other noteworthy thing about bug block data is that comments made by TinderboxPushlog Robot will be greyed out. This allows you to quickly scan a bug block for a randomorange bug and see if there were any "real" comments made. Also something to note is that for better layout of bug data, whitespace in comments is often munged and/or thrown away (this also happens because of the way emails are parsed).

The bug blocks are arranged into four columns by default (on narrow screens the four columns get stacked into one column such that the leftmost column is on top and the rightmost is at the bottom). The four columns are generally arranged in decreasing order of importance from left to right. The leftmost column contains bugs that have a review requested of you, or contain a response to a review that you requested. The second column is for bugs that are assigned to you, or which you filed. The third column is for bugs you are CC'd on, or have voted on. The final column is for pretty much anything else (usually component-watching). If you would like to change this sorting behaviour, the column() function in dashboard.php is the place to look.

### Bug notes and tags

Below all the bug blocks is the bug notes section. Each bug note has a bug number, a note field, a tag field, and the bug title (if available). You can add notes/tags either by using the N/U link on the bug block, or the "Add note" button at the bottom of the section. Use the "Save notes" link to save changes (this will reload the whole page, rather than using XMLHttpRequest). Saving an empty note and tag for a bug removes that row from the notes section.

The primary difference between notes and tags is that, if you have the bugtags.user.js script installed, the tags will show up in Bugzilla next to the title of the bug on any bug listing page, such as shown in the screenshot below. If you do not have the userscript, then the tags field is redundant. Tags that start with a bang (!) will be displayed by the userscript in red, or blue otherwise. You can click on the tag to edit it; bugs with no tags will have a "+" that you can click to add tags. As tag updates from Bugzilla pages are done via XMLHttpRequest, they are shown in yellow while the update request is pending, and might revert to their old value if the update fails.

<center>![Screenshot of bugtags on Bugzilla](bugmash-bugtags-screenshot.png)</center>

**WARNING!** Be careful when editing tags from both the Bugzilla userscript interface and the dashboard interface, as you may inadvertently clobber changes you made. In particular this may happen if you make a change from Bugzilla, and then make a change (possibly to a different bug's tag) from the dashboard without reloading it, and then saving the dashboard bug notes.

### Search

Below the bug notes section is the search field. This is a very bare-bones search that searches through your saved bug data. Search queries are split into tokens on whitespace, and only bugs that match all of the tokens are shown. The results are limited to bugs modified in the last 15 days, and are sorted by time (most recent first). Try not to search for really common substrings because there is no limiting on the number of hits other than recency, and the search implementation isn't particularly efficient - it may bring your server to its knees.

### Handling errors

Errors may occur if a bugmail cannot be parsed by the scraper. When this happens, the email and a corresponding .err file is saved into the folder where filter.php resides. The number of .err files is shown in browser window title bar when you are viewing the dashboard. This allows you to quickly check if there have been any errors. When an error occurs, you'll need to look at the .err file and the email to see why the email could not be parsed, and patch up the filter.php to handle it. Or you could file a bug against the github repo and get me to do it.

## Known issues

* The code to strikethrough obsoleted review requests doesn't seem to be taking effect. Not sure where in the code this bug is, haven't really looked at it.
* When concurrently editing tags via both the user script and the dashboard, it is easy to accidentally clobber tag changes. This should be detected and handled better.
* Bugzilla comments which contain "--" on a single line will be prematurely terminated, since that is taken as the end-of-comment marker.
* Review authors whose name/email wraps onto a second line in the email are not handled properly.

## Areas for improvement

* Add a quick-reply form to comment on bugs
* Beef up the search feature
* Hook into the Bugzilla API for more awesome
* Prune data from the database periodically
* A way to undo marking bugs as viewed, in case of accidentally marking a bug as viewed
* A way to specify a list of terms to highlight in bug blocks
140 changes: 0 additions & 140 deletions bugtags.user.js

This file was deleted.

Loading