Both 'tags' and 'reason' should be optional when adding a log entry

RESOLVED FIXED

Status

Release Engineering
TreeStatus
RESOLVED FIXED
5 years ago
2 years ago

People

(Reporter: emorley, Assigned: emorley)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Ryan was trying to set the MOTD on b2g18_v1_1_0 and got an ISE.

Reproducing locally gave:

{
Traceback (most recent call last):
  File "c:\src\treestatus\vendor\lib\python\flask\app.py", line 1701, in __call__
    return self.wsgi_app(environ, start_response)
  File "c:\src\treestatus\vendor\lib\python\repoze\who\middleware.py", line 87, in __call__
    app_iter = app(environ, wrapper.wrap_start_response)
  File "c:\src\treestatus\vendor\lib\python\flask\app.py", line 1689, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "c:\src\treestatus\vendor\lib\python\flask\app.py", line 1687, in wsgi_app
    response = self.full_dispatch_request()
  File "c:\src\treestatus\vendor\lib\python\flask\app.py", line 1360, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "c:\src\treestatus\vendor\lib\python\flask\app.py", line 1358, in full_dispatch_request
    rv = self.dispatch_request()
  File "c:\src\treestatus\vendor\lib\python\flask\app.py", line 1344, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "c:\src\treestatus\treestatus\app.py", line 656, in update_tree
    status.set_motd(request.environ['REMOTE_USER'], tree, request.form['message'])
  File "c:\src\treestatus\treestatus\app.py", line 272, in set_motd
    self.log(tree, who, 'motd', message)
TypeError: log() takes exactly 6 arguments (5 given)
}

We need to set defaults when logging, given that we can't guarantee that both tags and reason will always be set depending on the action performed.
(Assignee)

Comment 1

5 years ago
Created attachment 761403 [details] [diff] [review]
Patch v1
Attachment #761403 - Flags: review?(catlee)

Updated

5 years ago
Attachment #761403 - Flags: review?(catlee) → review+
(Assignee)

Comment 2

5 years ago
Ta :-)

https://github.com/mozilla/treestatus/commit/9d5bedb357c52d2581ed9981333d59efca9a3389
(Assignee)

Updated

5 years ago
Depends on: 883891
(Assignee)

Comment 3

5 years ago
In production :-)
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Product: Webtools → Tree Management
Product: Tree Management → Release Engineering
You need to log in before you can comment on or make changes to this bug.