Skip to content

Commit

Permalink
Merge pull request #3127 from regro/revert-3125-minor-fixes
Browse files Browse the repository at this point in the history
Revert "minor fixes"
  • Loading branch information
beckermr authored Nov 11, 2024
2 parents eedaf0f + c61b753 commit b2f2cea
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
13 changes: 9 additions & 4 deletions conda_forge_tick/auto_tick.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ def run(
return migration_run_data["migrate_return_value"], pr_lazy_json


def _compute_time_per_migrator(migrators):
def _compute_time_per_migrator(mctx, migrators):
# we weight each migrator by the number of available nodes to migrate
num_nodes = []
for migrator in tqdm.tqdm(migrators, ncols=80, desc="computing time per migrator"):
Expand Down Expand Up @@ -885,7 +885,9 @@ def _is_migrator_done(_mg_start, good_prs, time_per, pr_limit):
return False


def _run_migrator(migrator, mctx, temp, time_per, git_backend: GitPlatformBackend):
def _run_migrator(
migrator, mctx, temp, time_per, dry_run, git_backend: GitPlatformBackend
):
_mg_start = time.time()

migrator_name = get_migrator_name(migrator)
Expand Down Expand Up @@ -1026,7 +1028,8 @@ def _run_migrator(migrator, mctx, temp, time_per, git_backend: GitPlatformBacken
os.chdir(BOT_HOME_DIR)

# Write graph partially through
dump_graph(mctx.graph)
if not dry_run:
dump_graph(mctx.graph)

with filter_reprinted_lines("rm-tmp"):
for f in glob.glob("/tmp/*"):
Expand Down Expand Up @@ -1226,6 +1229,7 @@ def main(ctx: CliContext) -> None:
graph=gx,
smithy_version=smithy_version,
pinning_version=pinning_version,
dry_run=ctx.dry_run,
)
migrators = load_migrators()

Expand All @@ -1237,6 +1241,7 @@ def main(ctx: CliContext) -> None:
time_per_migrator,
tot_time_per_migrator,
) = _compute_time_per_migrator(
mctx,
migrators,
)
for i, migrator in enumerate(migrators):
Expand All @@ -1260,7 +1265,7 @@ def main(ctx: CliContext) -> None:

for mg_ind, migrator in enumerate(migrators):
good_prs = _run_migrator(
migrator, mctx, temp, time_per_migrator[mg_ind], git_backend
migrator, mctx, temp, time_per_migrator[mg_ind], ctx.dry_run, git_backend
)
if good_prs > 0:
pass
Expand Down
1 change: 1 addition & 0 deletions conda_forge_tick/contexts.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class MigratorSessionContext:
graph: DiGraph = None
smithy_version: str = ""
pinning_version: str = ""
dry_run: bool = True


@dataclass(frozen=True)
Expand Down
1 change: 1 addition & 0 deletions conda_forge_tick/status_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ def main() -> None:
graph=gx,
smithy_version=smithy_version,
pinning_version=pinning_version,
dry_run=False,
)
migrators = load_migrators(skip_paused=False)

Expand Down

0 comments on commit b2f2cea

Please sign in to comment.