Skip to content

Commit f66a283

Browse files
Handle missing data
Signed-off-by: Lukasz Gryglicki <[email protected]> Assisted by [OpenAI](https://platform.openai.com/) Assisted by [GitHub Copilot](https://github.com/features/copilot)
1 parent 8e3de6e commit f66a283

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cla-backend/cla/models/github_models.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,16 @@ def process_enqueued_pull_request(self, data):
470470
github_repository_id = data.get("repository", {}).get("id")
471471
installation_id = data.get("installation", {}).get("id")
472472
pull_request_id = data.get("pull_request", {}).get("number")
473+
if None in (installation_id, github_repository_id, merge_group_sha, pull_request_id):
474+
cla.log.warning(
475+
"process_enqueued_pull_request: Missing required field(s): "
476+
f"installation_id={installation_id}, "
477+
f"github_repository_id={github_repository_id}, "
478+
f"merge_group_sha={merge_group_sha}, "
479+
f"pull_request_id={pull_request_id}. "
480+
"Aborting update_merge_group."
481+
)
482+
return
473483

474484
self.update_merge_group(installation_id, github_repository_id, merge_group_sha, pull_request_id)
475485

0 commit comments

Comments
 (0)