def postComment(id: str, vti: VulnTestInfo, internal=False, addStopMessage=False) -> Mapping:
""" Post a comment to the report with the given ID using the information in the given VulnTestInfo
- Set internal=True in order to post an internal comment
- Set addStopMessage=True in order to add the stop message """
if config.DEBUG:
print("Posting comment: internal=%s, reproduced=%s, id=%s" % (str(internal), str(vti.reproduced), id))
if addStopMessage:
message = vti.message + '\n\n' + constants.disableMessage
else:
message = vti.message
postMessage("Posting Message: \n\n%s" % message) # TODO: Delete this
resp = requests.post('http://api:8080/v1/sendMessage',
json={'message': message, 'internal': internal, 'id': id},
auth=HTTPBasicAuth('AutoTriageBot', secrets.apiBoxToken))
if config.triageOnReproduce and vti.reproduced:
changeStatus(id, 'triaged')
return resp.json()
评论列表
文章目录