Skip to content

Commit

Permalink
Rename auto_nag to bugbot
Browse files Browse the repository at this point in the history
  • Loading branch information
suhaibmujahid committed Apr 29, 2023
1 parent 2fd6c00 commit 8a3de62
Show file tree
Hide file tree
Showing 169 changed files with 418 additions and 422 deletions.
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
*~
.DS_Store
scripts/configs/config.json
auto_nag/scripts/configs/*
!auto_nag/scripts/configs/tools.json
!auto_nag/scripts/configs/*round_robin.json
!auto_nag/scripts/configs/rm.json
!auto_nag/scripts/configs/team_managers.json
bugbot/scripts/configs/*
!bugbot/scripts/configs/tools.json
!bugbot/scripts/configs/*round_robin.json
!bugbot/scripts/configs/rm.json
!bugbot/scripts/configs/team_managers.json
models/
venv/
venv2/
Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ Before running:
}
Do a dryrun::
python -m auto_nag.scripts.stalled -d
python -m bugbot.scripts.stalled -d

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

Setting up 'Round Robin' triage rotations
-----------------------------------------
Expand Down Expand Up @@ -103,7 +103,7 @@ The person requesting the round robin schedule must provide the URL of the calen

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.
And then you just have to add an entry in `bugbot/scripts/config/tools.json <https://github.com/mozilla/relman-auto-nag/blob/333ec164ba5c3ceebf3c39cf84196fa35c667b1b/bugbot/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

Expand Down
6 changes: 3 additions & 3 deletions alembic.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[alembic]
# path to migration scripts
script_location = auto_nag/db_migrations
script_location = bugbot/db_migrations

# template used to generate migration files
# file_template = %%(rev)s_%%(slug)s
Expand All @@ -27,9 +27,9 @@ script_location = auto_nag/db_migrations
# sourceless = false

# version location specification; this defaults
# to auto_nag/db_migrations/versions. When using multiple version
# to bugbot/db_migrations/versions. When using multiple version
# directories, initial revisions must be specified with --version-path
# version_locations = %(here)s/bar %(here)s/bat auto_nag/db_migrations/versions
# version_locations = %(here)s/bar %(here)s/bat bugbot/db_migrations/versions

# the output encoding used when revision files
# are written from script.py.mako
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion auto_nag/auto_mock.py → bugbot/auto_mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import responses

from auto_nag import logger
from bugbot import logger

MOCKS_DIR = os.path.join(os.path.dirname(__file__), "tests/mocks")

Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions auto_nag/bzcleaner.py → bugbot/bzcleaner.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
from libmozdata import utils as lmdutils
from libmozdata.bugzilla import Bugzilla

from auto_nag import db, logger, mail, utils
from auto_nag.cache import Cache
from auto_nag.nag_me import Nag
from bugbot import db, logger, mail, utils
from bugbot.cache import Cache
from bugbot.nag_me import Nag


class TooManyChangesError(Exception):
Expand Down Expand Up @@ -490,7 +490,7 @@ def get_list_bugs(self, bugs):
return [x["id"] for x in bugs.values()]

def get_documentation(self):
return "For more information, please visit [auto_nag documentation](https://wiki.mozilla.org/Release_Management/autonag#{}).".format(
return "For more information, please visit [BugBot documentation](https://wiki.mozilla.org/Release_Management/autonag#{}).".format(
self.get_tool_path().replace("/", ".2F")
)

Expand Down
2 changes: 1 addition & 1 deletion auto_nag/cache.py → bugbot/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

from libmozdata import utils as lmdutils

from auto_nag import utils
from bugbot import utils


class Cache(object):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

from libmozdata.bugzilla import BugzillaProduct

from auto_nag.components import ComponentName
from auto_nag.round_robin import RoundRobin
from bugbot.components import ComponentName
from bugbot.round_robin import RoundRobin


@dataclass
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion auto_nag/config.py → bugbot/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class MyConfig(config.Config):

PATH = "auto_nag/scripts/configs/config.json"
PATH = "bugbot/scripts/configs/config.json"

def __init__(self):
super(MyConfig, self).__init__()
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions auto_nag/db.py → bugbot/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
from sqlalchemy.orm import relationship, sessionmaker
from sqlalchemy.orm.exc import NoResultFound

from auto_nag import logger, utils
from auto_nag.history import History
from bugbot import logger, utils
from bugbot.history import History

Base: Any = declarative_base()
lock_path = utils.get_config("common", "lock")
Expand All @@ -38,7 +38,7 @@ def init():
def check(table_name):
if not engine.dialect.has_table(engine, table_name):
raise Exception(
"No database here: you can create it in using 'alembic upgrade head' and you can fill it with Bugzilla data in calling auto_nag.db.init()"
"No database here: you can create it in using 'alembic upgrade head' and you can fill it with Bugzilla data in calling bugbot.db.init()"
)


Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
sys.path.append(os.getcwd())

try:
from auto_nag.db import Base, db_url
from bugbot.db import Base, db_url
except ModuleNotFoundError:
raise

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion auto_nag/escalation.py → bugbot/escalation.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import re

from auto_nag import logger, utils
from bugbot import logger, utils

RANGE_PAT = re.compile(r"\[([0-9]+)[ \t]*;[ \t]*([0-9]*|\+∞)\[", re.UNICODE)
NPLUS_PAT = re.compile(r"n\+([0-9]+)")
Expand Down
2 changes: 1 addition & 1 deletion auto_nag/history.py → bugbot/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from libmozdata.bugzilla import Bugzilla

from auto_nag import logger
from bugbot import logger


class History(object):
Expand Down
2 changes: 1 addition & 1 deletion auto_nag/iam.py → bugbot/iam.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def get_phonebook_dump(output_dir=""):
update_bugzilla_emails(new_data)
new_data = list(new_data.values())

with open("./auto_nag/scripts/configs/people.json", "w") as Out:
with open("./bugbot/scripts/configs/people.json", "w") as Out:
json.dump(new_data, Out, sort_keys=True, indent=4, separators=(",", ": "))


Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions auto_nag/multi_autofixers.py → bugbot/multi_autofixers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from collections import ChainMap, defaultdict
from typing import Any, Callable, Counter, Dict, Iterable, Type

from auto_nag import logger, utils
from auto_nag.bzcleaner import BzCleaner
from auto_nag.nag_me import Nag
from bugbot import logger, utils
from bugbot.bzcleaner import BzCleaner
from bugbot.nag_me import Nag

ToolsChanges = Dict[Type[BzCleaner], Any]

Expand Down
8 changes: 4 additions & 4 deletions auto_nag/multinaggers.py → bugbot/multinaggers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
from jinja2 import Environment, FileSystemLoader
from libmozdata import utils as lmdutils

from auto_nag import mail, utils
from auto_nag.bzcleaner import BzCleaner
from auto_nag.nag_me import Nag
from bugbot import mail, utils
from bugbot.bzcleaner import BzCleaner
from bugbot.nag_me import Nag


class MultiNaggers(object):
Expand Down Expand Up @@ -63,7 +63,7 @@ def gather(self):
common = env.get_template("common.html")
login_info = utils.get_login_info()
From = Nag.get_from()
Default_Cc = set(utils.get_config("auto_nag", "cc", []))
Default_Cc = set(utils.get_config("bugbot", "cc", []))

all_mails = {}
for nagger in self.naggers:
Expand Down
10 changes: 5 additions & 5 deletions auto_nag/nag_me.py → bugbot/nag_me.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

from jinja2 import Environment, FileSystemLoader

from auto_nag import db, logger, mail, utils
from auto_nag.escalation import Escalation
from auto_nag.people import People
from bugbot import db, logger, mail, utils
from bugbot.escalation import Escalation
from bugbot.people import People


class Nag(object):
Expand All @@ -28,12 +28,12 @@ def __init__(self):

@staticmethod
def get_from():
return utils.get_config("auto_nag", "from", "[email protected]")
return utils.get_config("bugbot", "from", "[email protected]")

def get_cc(self):
cc = self.get_config("cc", None)
if cc is None:
cc = utils.get_config("auto_nag", "cc", [])
cc = utils.get_config("bugbot", "cc", [])

return set(cc)

Expand Down
4 changes: 2 additions & 2 deletions auto_nag/people.py → bugbot/people.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class People:

def __init__(self, p=None):
if p is None:
with open("./auto_nag/scripts/configs/people.json", "r") as In:
with open("./bugbot/scripts/configs/people.json", "r") as In:
self.data = json.load(In)
else:
self.data = p
Expand Down Expand Up @@ -192,7 +192,7 @@ def get_info_by_nick(self, nick):
def get_rm(self):
"""Get the release managers as defined in configs/rm.json"""
if not self.release_managers:
with open("./auto_nag/scripts/configs/rm.json", "r") as In:
with open("./bugbot/scripts/configs/rm.json", "r") as In:
self.release_managers = set(json.load(In))
return self.release_managers

Expand Down
8 changes: 4 additions & 4 deletions auto_nag/round_robin.py → bugbot/round_robin.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
from libmozdata import utils as lmdutils
from libmozdata.bugzilla import BugzillaUser

from auto_nag import logger, utils
from auto_nag.components import Components
from auto_nag.people import People
from auto_nag.round_robin_calendar import BadFallback, Calendar, InvalidCalendar
from bugbot import logger, utils
from bugbot.components import Components
from bugbot.people import People
from bugbot.round_robin_calendar import BadFallback, Calendar, InvalidCalendar


class RoundRobin(object):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
from icalendar import Calendar as iCalendar
from libmozdata import utils as lmdutils

from auto_nag import utils
from auto_nag.people import People
from bugbot import utils
from bugbot.people import People


class InvalidCalendar(Exception):
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.

from auto_nag import utils
from auto_nag.bzcleaner import BzCleaner
from bugbot import utils
from bugbot.bzcleaner import BzCleaner


class AffectedFlagConfirm(BzCleaner):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

from libmozdata import utils as lmdutils

from auto_nag import people, utils
from auto_nag.bzcleaner import BzCleaner
from auto_nag.constants import HIGH_PRIORITY, HIGH_SEVERITY
from auto_nag.user_activity import UserActivity
from bugbot import people, utils
from bugbot.bzcleaner import BzCleaner
from bugbot.constants import HIGH_PRIORITY, HIGH_SEVERITY
from bugbot.user_activity import UserActivity


class AssigneeNoLogin(BzCleaner):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
from libmozdata import utils as lmdutils
from libmozdata.bugzilla import Bugzilla

from auto_nag import logger, utils
from auto_nag.bzcleaner import BzCleaner
from auto_nag.people import People
from auto_nag.user_activity import UserActivity, UserStatus
from bugbot import logger, utils
from bugbot.bzcleaner import BzCleaner
from bugbot.people import People
from bugbot.user_activity import UserActivity, UserStatus

PUSHLOG_PAT = re.compile(
r"https:\/\/hg\.mozilla\.org\/[a-z0-9-/]*\/pushloghtml\?[a-z0-9=&]*[a-z0-9]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.

from auto_nag.bzcleaner import BzCleaner
from auto_nag.components import ComponentName, fetch_component_teams
from bugbot.bzcleaner import BzCleaner
from bugbot.components import ComponentName, fetch_component_teams


class Intermittents(BzCleaner):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.

from auto_nag.bzcleaner import BzCleaner
from bugbot.bzcleaner import BzCleaner


class DupeMe(BzCleaner):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
from libmozdata.connection import Query
from libmozdata.fx_trains import FirefoxTrains

from auto_nag import utils
from auto_nag.bzcleaner import BzCleaner
from auto_nag.people import People
from bugbot import utils
from bugbot.bzcleaner import BzCleaner
from bugbot.people import People

NIGHTLY_PAT = Bugzilla.get_landing_patterns(channels=["nightly"])
BUG_PAT = re.compile("[\t ]*bug[s]?[\t ]*([0-9]+)", re.I)
Expand Down
8 changes: 4 additions & 4 deletions auto_nag/scripts/component.py → bugbot/scripts/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

from libmozdata.bugzilla import Bugzilla

from auto_nag import logger
from auto_nag.bugbug_utils import get_bug_ids_classification
from auto_nag.bzcleaner import BzCleaner
from auto_nag.utils import get_config, nice_round
from bugbot import logger
from bugbot.bugbug_utils import get_bug_ids_classification
from bugbot.bzcleaner import BzCleaner
from bugbot.utils import get_config, nice_round


class Component(BzCleaner):
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"Web Compatibility",
"WebExtensions"
],
"log": "/tmp/auto_nag_errors.txt",
"log": "/tmp/bugbot_errors.txt",
"receiver_list": {
"rm": ["[email protected]", "[email protected]"]
},
Expand Down Expand Up @@ -110,7 +110,7 @@
"MailNews Core"
]
},
"auto_nag": {
"bugbot": {
"no_mail_for_manager": [],
"cc": ["[email protected]"],
"from": "[email protected]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

from libmozdata.bugzilla import Bugzilla

from auto_nag import utils
from auto_nag.bzcleaner import BzCleaner
from bugbot import utils
from bugbot.bzcleaner import BzCleaner


class CopyDuplicateInfo(BzCleaner):
Expand Down
Loading

0 comments on commit 8a3de62

Please sign in to comment.