in libmozdata/lando.py [0:0]
def add_warning(self, warning, revision_id, diff_id):
"""
Adds a warning to Lando
"""
response = requests.post(
self.api_url,
json={
"revision_id": revision_id,
"diff_id": diff_id,
"group": "LINT",
"data": {"message": warning},
},
headers={
"X-Phabricator-API-Key": self.api_key,
"User-Agent": self.USER_AGENT,
},
)
if response.status_code != 201:
raise Exception(
f"Failed to add warnings for revision_id {revision_id} and diff_id {diff_id} with error {response.status_code}:\n{response.text}"
)