• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mozilla / relman-auto-nag / #4841

05 Dec 2023 04:04PM CUT coverage: 21.936% (+0.05%) from 21.889%
#4841

push

coveralls-python

web-flow
Bump recurring-ical-events from 2.0.2 to 2.1.1 (#2280)

Bumps [recurring-ical-events](https://github.com/niccokunzmann/python-recurring-ical-events) from 2.0.2 to 2.1.1.
- [Commits](https://github.com/niccokunzmann/python-recurring-ical-events/compare/v2.0.2...v2.1.1)

---
updated-dependencies:
- dependency-name: recurring-ical-events
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

716 of 3588 branches covered (0.0%)

1924 of 8771 relevant lines covered (21.94%)

0.22 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/bugbot/log.py
1
# This Source Code Form is subject to the terms of the Mozilla Public
2
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
3
# You can obtain one at http://mozilla.org/MPL/2.0/.
4

5
import argparse
×
6
import os
×
7

8
from libmozdata import utils as lmdutils
×
9

10
from . import mail, utils
×
11

12

13
def clean():
×
14
    path = utils.get_config("common", "log")
×
15
    os.remove(path)
×
16

17

18
def get_msg(path):
×
19
    with open(path, "r") as In:
×
20
        data = In.read()
×
21
    errors = 0
×
22
    for line in data.split("\n"):
×
23
        if "ERROR" in line or "CRITICAL" in line:
×
24
            errors += 1
×
25

26
    if errors == 1:
×
27
        return data, []
×
28

29
    return "There are {} errors: see the log in attachment.".format(errors), [path]
×
30

31

32
def send():
×
33
    path = utils.get_config("common", "log")
×
34
    try:
×
35
        n = os.path.getsize(path)
×
36
        if n != 0:
×
37
            login_info = utils.get_login_info()
×
38
            date = lmdutils.get_date("today")
×
39
            msg, files = get_msg(path)
×
40
            mail.send(
×
41
                login_info["ldap_username"],
42
                utils.get_config("common", "on-errors"),
43
                "[bugbot] Something bad happened when running BugBot the {}".format(
44
                    date
45
                ),
46
                msg,
47
                html=False,
48
                login=login_info,
49
                dryrun=False,
50
                files=files,
51
            )
52
    except Exception:
×
53
        pass
×
54

55

56
if __name__ == "__main__":
×
57
    parser = argparse.ArgumentParser(description="Manage logs")
×
58
    parser.add_argument(
×
59
        "-c", "--clean", dest="clean", action="store_true", help="Remove the log files"
60
    )
61
    parser.add_argument(
×
62
        "-s",
63
        "--send",
64
        dest="send",
65
        action="store_true",
66
        help="Send the log if not empty",
67
    )
68
    args = parser.parse_args()
×
69
    if args.clean:
×
70
        clean()
×
71
    if args.send:
×
72
        send()
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc