31
31
from conda_forge_tick .feedstock_parser import BOOTSTRAP_MAPPINGS
32
32
from conda_forge_tick .git_utils import (
33
33
DryRunBackend ,
34
- DuplicatePullRequestError ,
35
34
GitCli ,
36
35
GitCliError ,
37
36
GitPlatformBackend ,
38
37
RepositoryNotFoundError ,
39
38
github_backend ,
40
- is_github_api_limit_reached ,
39
+ is_github_api_limit_reached , DuplicatePullRequestError ,
41
40
)
42
41
from conda_forge_tick .lazy_json_backends import (
43
42
LazyJson ,
51
50
PR_LIMIT ,
52
51
load_migrators ,
53
52
)
54
- from conda_forge_tick .migration_runner import run_migration
55
- from conda_forge_tick .migrators import MigrationYaml , Migrator , Version
53
+ from conda_forge_tick .migrators import Migrator , Version , MigrationYaml
56
54
from conda_forge_tick .migrators .version import VersionMigrationError
57
55
from conda_forge_tick .os_utils import eval_cmd
58
56
from conda_forge_tick .rerender_feedstock import rerender_feedstock
69
67
load_existing_graph ,
70
68
sanitize_string ,
71
69
)
70
+ from .migration_runner import run_migration
72
71
73
72
from .migrators_types import MigrationUidTypedDict
74
73
from .models .pr_json import PullRequestData , PullRequestInfoSpecial , PullRequestState
@@ -849,10 +848,11 @@ def _run_migrator_on_feedstock_branch(
849
848
return good_prs , break_loop
850
849
851
850
852
- def _is_migrator_done (_mg_start , good_prs , time_per , pr_limit ):
851
+ def _is_migrator_done (
852
+ _mg_start , good_prs , time_per , pr_limit , git_backend : GitPlatformBackend
853
+ ):
853
854
curr_time = time .time ()
854
- backend = github_backend ()
855
- api_req = backend .get_api_requests_left ()
855
+ api_req = git_backend .get_api_requests_left ()
856
856
857
857
if curr_time - START_TIME > TIMEOUT :
858
858
logger .info (
@@ -930,7 +930,7 @@ def _run_migrator(
930
930
931
931
if package :
932
932
if package not in possible_nodes :
933
- logger .warning (
933
+ logger .info (
934
934
f"Package { package } is not a candidate for migration of { migrator_name } "
935
935
)
936
936
return 0
@@ -968,7 +968,9 @@ def _run_migrator(
968
968
flush = True ,
969
969
)
970
970
971
- if _is_migrator_done (_mg_start , good_prs , time_per , migrator .pr_limit ):
971
+ if _is_migrator_done (
972
+ _mg_start , good_prs , time_per , migrator .pr_limit , git_backend
973
+ ):
972
974
return 0
973
975
974
976
for node_name in possible_nodes :
@@ -985,7 +987,9 @@ def _run_migrator(
985
987
):
986
988
# Don't let CI timeout, break ahead of the timeout so we make certain
987
989
# to write to the repo
988
- if _is_migrator_done (_mg_start , good_prs , time_per , migrator .pr_limit ):
990
+ if _is_migrator_done (
991
+ _mg_start , good_prs , time_per , migrator .pr_limit , git_backend
992
+ ):
989
993
break
990
994
991
995
base_branches = migrator .get_possible_feedstock_branches (attrs )
@@ -1334,7 +1338,7 @@ def main(ctx: CliContext, package: str | None = None) -> None:
1334
1338
1335
1339
for mg_ind , migrator in enumerate (migrators ):
1336
1340
good_prs = _run_migrator (
1337
- migrator , mctx , temp , time_per_migrator [mg_ind ], git_backend
1341
+ migrator , mctx , temp , time_per_migrator [mg_ind ], git_backend , package
1338
1342
)
1339
1343
if good_prs > 0 :
1340
1344
pass
@@ -1349,5 +1353,5 @@ def main(ctx: CliContext, package: str | None = None) -> None:
1349
1353
# ],
1350
1354
# )
1351
1355
1352
- logger .info ("API Calls Remaining: %d" , github_backend () .get_api_requests_left ())
1356
+ logger .info (f "API Calls Remaining: { git_backend .get_api_requests_left ()} " )
1353
1357
logger .info ("Done" )
0 commit comments