Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: try PRs only 10 times #3456

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions conda_forge_tick/auto_tick.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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))
)
Expand Down
12 changes: 7 additions & 5 deletions conda_forge_tick/make_migrators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion conda_forge_tick/migrators/migration_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading