A Mozilla release management tool to send reminders to Firefox developers and improve Bugzilla metadata
Перейти к файлу
dependabot[bot] 49b2896245
Bump sqlalchemy from 1.3.23 to 1.3.24 (#1441)
Bumps [sqlalchemy](https://github.com/sqlalchemy/sqlalchemy) from 1.3.23 to 1.3.24.
- [Release notes](https://github.com/sqlalchemy/sqlalchemy/releases)
- [Changelog](https://github.com/sqlalchemy/sqlalchemy/blob/main/CHANGES.rst)
- [Commits](https://github.com/sqlalchemy/sqlalchemy/commits)

---
updated-dependencies:
- dependency-name: sqlalchemy
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-24 16:05:52 +02:00
.github Create a pull request template (#1420) 2022-05-11 11:38:29 -04:00
auto_nag CC people in the management chain when escalating nag emails (#1445) 2022-05-20 10:50:12 -04:00
db Add a db to store the different actions the bot made (#542) 2019-04-16 11:08:33 +02:00
extra Prettify json files 2022-03-16 11:52:07 +01:00
templates Suggest increasing the severity for bugs with P1 WebCompat priority (#1431) 2022-05-11 16:46:43 -04:00
.coveragerc Better automation of the tests in travis + add code coverage 2015-10-22 10:01:52 +02:00
.flake8 Exclude some directories from flake8 checks, and disable line length rule (#720) 2019-06-11 18:30:15 +02:00
.gitignore Nag managers for components that need triage owner to be assigned (#1342) 2022-03-31 18:00:57 +02:00
.isort.cfg not_landed: Ni reviewer (#1064) 2021-02-08 14:54:01 +01:00
.pre-commit-config.yaml Fix black by updating to the lates version (#1360) 2022-03-30 09:47:09 +02:00
.taskcluster.yml Prettify yaml files 2022-03-16 11:50:31 +01:00
CODE_OF_CONDUCT.md Prettify markdown files 2022-03-16 11:50:48 +01:00
LICENSE Update of the license file (#700) 2019-06-03 10:23:52 +02:00
README.rst Improve documentation of IAM requirements (#1071) 2021-02-09 09:34:26 +01:00
alembic.ini Add a db to store the different actions the bot made (#542) 2019-04-16 11:08:33 +02:00
requirements-dev.txt Remove dependency on `nose` (#1392) 2022-04-06 22:03:35 +02:00
requirements-test.txt Bump pre-commit from 2.18.1 to 2.19.0 (#1426) 2022-05-10 20:50:16 +02:00
requirements.txt Bump sqlalchemy from 1.3.23 to 1.3.24 (#1441) 2022-05-24 16:05:52 +02:00
run_close_intermittents.sh Make dryrun the default (#1334) 2022-03-18 18:10:22 +01:00
run_code_freeze_week.sh Make dryrun the default (#1334) 2022-03-18 18:10:22 +01:00
run_survey_sec_bugs.sh Disable the sec survey for now (#1386) 2022-04-06 18:55:33 +02:00
runauto_nag_common.sh Keep running scripts when one fails (#895) 2020-02-18 09:41:45 +01:00
runauto_nag_daily.sh Suggest increasing the severity for bugs with P1 WebCompat priority (#1431) 2022-05-11 16:46:43 -04:00
runauto_nag_hourly.sh Drop the `tracked_bad_severity` in favour of `severity_tracked` (#1433) 2022-05-11 16:39:35 -04:00
tox.ini Remove dependency on `nose` (#1392) 2022-04-06 22:03:35 +02:00
update_people.sh Generate phonebook data using IAM api (#820) 2019-09-09 12:02:28 +02:00

README.rst

.. image:: https://community-tc.services.mozilla.com/api/github/v1/repository/mozilla/relman-auto-nag/master/badge.svg
    :target: https://community-tc.services.mozilla.com/api/github/v1/repository/mozilla/relman-auto-nag/master/latest
.. image:: https://coveralls.io/repos/github/mozilla/relman-auto-nag/badge.svg
    :target: https://coveralls.io/github/mozilla/relman-auto-nag


This tool is used by Mozilla release management to send emails to the Firefox developers. It will query the bugzilla.mozilla.org database and send emails to Mozilla developers and their managers (if Mozilla staff).

The tool will also notify release managers about potential issues in bugzilla and autofix some categories of issues.

The list of checkers is documented on the Mozilla wiki:
https://wiki.mozilla.org/Release_Management/autonag


This package currently uses Mozilla's `Bugzilla REST API <https://wiki.mozilla.org/Bugzilla:REST_API>`_, and optionally the Mozilla IAM `phonebook <https://github.com/mozilla-iam/cis/blob/master/docs/PersonAPI.md>`_ (to access bug assignees' managers & Mozilla email addresses).


Installation
------------

#. Check out the code::

    git clone git://github.com/mozilla/relman-auto-nag.git

#. (optional) Create your virtualenv using virtualenvwrapper::

    virtualenv -p python3 venv
    source venv/bin/activate

#. Install pip::

    easy_install pip

#. Install the dependencies for Python 3 too::

    pip3 install -r requirements.txt


To run it into production, you will need the full list of employees + managers.

Automated Nagging Script
------------------------

Before running:

1. The LDAP + SMTP infos are used to send emails
2. Need to generate an API key from bugzilla admin ( https://bugzilla.mozilla.org/userprefs.cgi?tab=apikey )
3. Should generate an API key from Phabricator ( https://phabricator.services.mozilla.com/settings/user )
4. The IAM secrets are used to generate a dump of phonebook, which is required for some scripts (employees can request them by `filing a bug in the SSO: Requests component <https://bugzilla.mozilla.org/enter_bug.cgi?product=Infrastructure%20%26%20Operations&component=SSO%3A%20Requests>`_ )
5. The private entry contains URLs for private calendar in ICS format:

.. code-block:: json

    # in scripts/configs/config.json
    {
      "ldap_username": "xxx@xxxx.xxx",
      "ldap_password": "xxxxxxxxxxxxxx",
      "smtp_server": "smtp.xxx.xxx",
      "smtp_port": 314,
      "smtp_ssl": true,
      "bz_api_key": "xxxxxxxxxxxxxx",
      "phab_api_key": "xxxxxxxxxxxxxx",
      "iam_client_secret": "xxxxxxxxxxxxxx",
      "iam_client_id": "xxxxxxxxxxxxxx",
      "private":
      {
        "Core::General": "https://..."
      }
    }

Do a dryrun::
    python -m auto_nag.scripts.stalled -d

There is a ton of scripts in auto_nag/scripts/ so you should be able to find some good examples.

Setting up 'Round Robin' triage rotations
-----------------------------------------

One use case for this tool is managing triage of multiple components across a team of multiple people.

To set up a new Round Robin rotation, a manager or team lead should create a Google Calendar with the rotation of triagers.

Then the administrators will need to create a configuration file:

.. code-block:: json

    # in scripts/configs/<name of rotation>_round_robin.json
    {
        "fallback": "<Name of manager or lead>",
        "components":
        {
            "Product::Component": "default",
            "Product::Component": "default",
            …
        },
        "default":
        {
            "calendar": "private://<Name of calendar>"
        }
    }

The person requesting the round robin schedule must provide the URL of the calendar's `.ics` file.

In the calendar, the summary of the events must be the full name (eventually prefixed with text between square brackets) of triage owner as it appears in Phonebook, e.g. `[Gfx Triage] Foo Bar` or just `Foo Bar`.

And then you just have to add an entry in `auto_nag/scripts/config/tools.json <https://github.com/mozilla/relman-auto-nag/blob/333ec164ba5c3ceebf3c39cf84196fa35c667b1b/auto_nag/scripts/configs/tools.json#L2>`_ in the round-robin section.

Once everything is set-up you can make a PR similar too https://github.com/mozilla/relman-auto-nag/pull/858/files

Running on a server
-------------------

This needs to run on a private server because it will have login for smtp and bugzilla key so it can't currently be shared access.

Cronjob::

  00 14 * * 1-5 $HOME/run_autonags_daily.sh &> /tmp/autonag.log
  15 */1 * * * $HOME/runauto_nag_hourly.sh &> /tmp/autonag-hour.log