Platform for Machine Learning projects on Software Engineering
Перейти к файлу
Bastien Abadie 0ee0cd60bf Split models download and check scripts (#279) 2019-04-12 15:26:06 +02:00
bugbug Add number of previous commits touching the same files as a feature (#249) 2019-04-11 16:41:39 +02:00
http_service Split models download and check scripts (#279) 2019-04-12 15:26:06 +02:00
infra Add missing Dockerfiles for the training steps (#276) 2019-04-12 12:31:13 +02:00
scripts Import Trainer class from release-services repository (#254) 2019-04-09 17:49:56 +02:00
tests Pre commit setup (#252) 2019-04-09 15:57:29 +02:00
.dockerignore Update root dockerignore (#266) 2019-04-12 12:31:52 +02:00
.flake8 Pre commit setup (#252) 2019-04-09 15:57:29 +02:00
.gitignore Add some Python packaging artifacts to .gitignore 2019-03-11 15:30:29 +01:00
.isort.cfg Add basic HTTP service (#262) 2019-04-10 17:57:07 +02:00
.pre-commit-config.yaml Add Flake8 to the pre-commit, so we ensure commits are Flake8 happy (#255) 2019-04-09 18:02:36 +02:00
.taskcluster.yml Add Docker build task for the base image (#270) 2019-04-11 14:00:18 +02:00
CODE_OF_CONDUCT.md Add Mozilla Code of Conduct (#237) 2019-03-30 16:01:34 +01:00
LICENSE First commit 2018-03-11 20:12:35 +00:00
MANIFEST.in Include labels in package 2018-11-24 00:32:41 +01:00
README.md Pre commit setup (#252) 2019-04-09 15:57:29 +02:00
VERSION Version 0.0.13 2019-04-05 17:13:40 +02:00
comment_level_labeler.py Pre commit setup (#252) 2019-04-09 15:57:29 +02:00
docker-compose.yml Add basic HTTP service (#262) 2019-04-10 17:57:07 +02:00
requirements.txt Update gensim from 3.7.1 to 3.7.2 (#267) 2019-04-11 01:21:15 +02:00
run.py Pre commit setup (#252) 2019-04-09 15:57:29 +02:00
setup.cfg Enable several flake8 checkers 2018-09-21 16:45:04 +02:00
setup.py Import Trainer class from release-services repository (#254) 2019-04-09 17:49:56 +02:00
test-requirements.txt Pre commit setup (#252) 2019-04-09 15:57:29 +02:00

README.md

bugbug

Contributing

Discussions happen in #bugbug on irc.mozilla.org.

  1. Issues marked as good first issue are self-contained enough that a contributor should be able to work on them.
  2. Issues marked as reserved-for-beginners are reserved for people who have never contributed to the project before.
  3. Issues are to be considered as not assigned, until there is a PR linked to them.

Classifiers

  • bug vs feature - Bugs on Bugzilla aren't always bugs. Sometimes they are feature requests, refactorings, and so on. The aim of this classifier is to distinguish between bugs that are actually bugs and bugs that aren't. The dataset currently contains 2110 bugs, the accuracy of the current classifier is ~93% (precision ~95%, recall ~94%).

  • defect vs feature vs task - Extension of the previous classifier to detect differences also between feature requests and development tasks.

  • component - The aim of this classifier is to assign product/component to (untriaged) bugs.

  • regression vs non-regression - Bugzilla has a regression keyword to identify bugs that are regressions. Unfortunately it isn't used consistently. The aim of this classifier is to detect bugs that are regressions.

  • tracking - The aim of this classifier is to detect bugs to track.

  • uplift - The aim of this classifier is to detect bugs for which uplift should be approved and bugs for which uplift should not be approved.

  • devdocneeded - The aim of this classifier is to detect bugs which should be documented for developers.

  • qaneeded - The aim of this classifier is to detect bugs that would need QA verification.

Setup

Run pip install -r requirements.txt and pip install -r test-requirements.txt

If you update the bugs database, run xz -v9 -k data/bugs.json. If you update the commits database, run xz -v9 -k data/commits.json.

Usage

Run the run.py script to perform training / classification. The first time run.py is executed, the --train argument should be used to automatically download databases containing bugs and commits data.

Running the repository mining script

  1. Clone https://hg.mozilla.org/mozilla-central/.
  2. Run ./mach vcs-setup in the directory where you have cloned mozilla-central.
  3. Enable the pushlog, hgmo and mozext extensions. For example, if you are on Linux, add the following to the extensions section of the ~/.hgrc file:
    pushlog = ~/.mozbuild/version-control-tools/hgext/pushlog
    hgmo = ~/.mozbuild/version-control-tools/hgext/hgmo
    mozext = ~/.mozbuild/version-control-tools/hgext/mozext
    firefoxtree = ~/.mozbuild/version-control-tools/hgext/firefoxtree
    
  4. Run the repository.py script, with the only argument being the path to the mozilla-central repository.

Note: the script will take a long time to run (on my laptop more than 7 hours). If you want to test a simple change and you don't intend to actually mine the data, you can modify the repository.py script to limit the number of analyzed commits. Simply add limit=1024 to the call to the log command.

Structure of the project

  • bugbug/labels contains manually collected labels;
  • bugbug/db.py is an implementation of a really simple JSON database;
  • bugbug/bugzilla.py contains the functions to retrieve bugs from the Bugzilla tracking system;
  • bugbug/repository.py contains the functions to mine data from the mozilla-central (Firefox) repository;
  • bugbug/bug_features.py contains functions to extract features from bug/commit data;
  • bugbug/model.py contains the base class that all models derive from;
  • bugbug/models contains implementations of specific models;
  • bugbug/nn.py contains utility functions to include Keras models into a scikit-learn pipeline;
  • bugbug/utils.py contains misc utility functions;
  • bugbug/nlp contains utility functions for NLP;
  • bugbug/labels.py contains utility functions for handling labels;
  • bugbug/bug_snapshot.py contains a module to play back the history of a bug.

Auto-formatting setup

This project is using pre-commit. Please run pre-commit install to install the git pre-commit hooks on your clone.

Then every time you will try to commit, it will check that the files are correctly formatted before letting you commit.