From f337c0155d3c7a1ef28854ce7e67914d53024e91 Mon Sep 17 00:00:00 2001 From: beckermr Date: Fri, 20 Dec 2024 05:17:33 -0600 Subject: [PATCH] feat: try PRs only 10 times --- README.md | 2 +- conda_forge_tick/auto_tick.py | 6 +++--- conda_forge_tick/make_migrators.py | 12 +++++++----- conda_forge_tick/migrators/migration_yaml.py | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 4645fc566..7d2f7f8f1 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,7 @@ __migrator: # The bot will forcibly make PRs for feedstocks that have failed the solver attempts after # this many tries. - force_pr_after_solver_attempts: 100 + force_pr_after_solver_attempts: 10 # If `override_cbc_keys` is set to a list, the bot will use this list of packages to # determine which feedstocks to migrate as opposed to the changed pins listed below. diff --git a/conda_forge_tick/auto_tick.py b/conda_forge_tick/auto_tick.py index fbe173b32..02cabb0ac 100644 --- a/conda_forge_tick/auto_tick.py +++ b/conda_forge_tick/auto_tick.py @@ -46,7 +46,7 @@ sync_lazy_json_object, ) from conda_forge_tick.make_migrators import ( - MAX_SOLVER_ATTEMPTS, + FORCE_PR_AFTER_SOLVER_ATTEMPTS, PR_LIMIT, load_migrators, ) @@ -312,7 +312,7 @@ def _is_solvability_check_needed( is_version=isinstance(migrator, Version), ) max_pr_attempts = getattr( - migrator, "force_pr_after_solver_attempts", MAX_SOLVER_ATTEMPTS * 2 + migrator, "force_pr_after_solver_attempts", FORCE_PR_AFTER_SOLVER_ATTEMPTS ) logger.info( @@ -343,7 +343,7 @@ def _is_solvability_check_needed( and context.attrs["name"] not in getattr(migrator, "top_level", set()) # either the migrator or the feedstock has to request solver checks and (migrator_check_solvable or context.check_solvable) - # we try up to MAX_SOLVER_ATTEMPTS times, and then we just skip + # we try up to max_pr_attempts times, and then we just skip # the solver check and issue the PR if automerge is off and (_should_automerge(migrator, context) or (pr_attempts < max_pr_attempts)) ) diff --git a/conda_forge_tick/make_migrators.py b/conda_forge_tick/make_migrators.py index d0c97ad6d..75d3a2c8d 100644 --- a/conda_forge_tick/make_migrators.py +++ b/conda_forge_tick/make_migrators.py @@ -98,7 +98,8 @@ PR_LIMIT = 5 MAX_PR_LIMIT = 20 -MAX_SOLVER_ATTEMPTS = 50 +MAX_SOLVER_ATTEMPTS = 3 +FORCE_PR_AFTER_SOLVER_ATTEMPTS = 10 CHECK_SOLVABLE_TIMEOUT = 90 # 90 days DEFAULT_MINI_MIGRATORS = [ CondaForgeYAMLCleanup, @@ -307,7 +308,7 @@ def add_rebuild_migration_yaml( migration_name: str, nominal_pr_limit: int = PR_LIMIT, max_solver_attempts: int = 3, - force_pr_after_solver_attempts: int = MAX_SOLVER_ATTEMPTS * 2, + force_pr_after_solver_attempts: int = FORCE_PR_AFTER_SOLVER_ATTEMPTS, paused: bool = False, ) -> None: """Adds rebuild migrator. @@ -478,14 +479,15 @@ def migration_factory( excluded_feedstocks = set(migrator_config.get("exclude", [])) _pr_limit = min(migrator_config.pop("pr_limit", pr_limit), MAX_PR_LIMIT) max_solver_attempts = min( - migrator_config.pop("max_solver_attempts", 3), + migrator_config.pop("max_solver_attempts", MAX_SOLVER_ATTEMPTS), MAX_SOLVER_ATTEMPTS, ) force_pr_after_solver_attempts = min( migrator_config.pop( - "force_pr_after_solver_attempts", MAX_SOLVER_ATTEMPTS * 2 + "force_pr_after_solver_attempts", + FORCE_PR_AFTER_SOLVER_ATTEMPTS, ), - MAX_SOLVER_ATTEMPTS * 2, + FORCE_PR_AFTER_SOLVER_ATTEMPTS, ) if "override_cbc_keys" in migrator_config: diff --git a/conda_forge_tick/migrators/migration_yaml.py b/conda_forge_tick/migrators/migration_yaml.py index ce72ac3ab..8600e2316 100644 --- a/conda_forge_tick/migrators/migration_yaml.py +++ b/conda_forge_tick/migrators/migration_yaml.py @@ -141,7 +141,7 @@ def __init__( ignored_deps_per_node=None, max_solver_attempts=3, effective_graph: nx.DiGraph = None, - force_pr_after_solver_attempts=100, + force_pr_after_solver_attempts=10, longterm=False, paused=False, **kwargs: Any,