Add context-aware git provider retrieval and refactor related functions

This commit is contained in:
mrT23
2024-06-19 11:20:00 +03:00
parent bdf1be921d
commit 833bb29808

View File

@ -200,10 +200,6 @@ async def handle_push_trigger_for_new_commits(body: Dict[str, Any],
get_logger().info(f"Finished waiting to process push trigger for {api_url=} - continue with flow")
try:
if get_settings().github_app.push_trigger_wait_for_initial_review and not get_git_provider()(api_url,
incremental=IncrementalPR(True)).previous_review:
get_logger().info(f"Skipping incremental review because there was no initial review for {api_url=} yet")
return {}
if get_identity_provider().verify_eligibility("github", sender_id, api_url) is not Eligibility.NOT_ELIGIBLE:
get_logger().info(f"Performing incremental review for {api_url=} because of {event=} and {action=}")
await _perform_auto_commands_github("push_commands", agent, body, api_url, log_context)