Skip to content

Commit 65d8de8

Browse files
authored
[autorevert] Remove legacy entry point and fix bugs on ci entry (#7178)
Main entry point had some strange references to past autorevert code that could not be reached. And there is no point of using the old version of the code, so, to start the cleanup I am fixing bugs on entrypoint and removing the references to it.
1 parent 03bf20c commit 65d8de8

File tree

1 file changed

+5
-33
lines changed
  • aws/lambda/pytorch-auto-revert/pytorch_auto_revert

1 file changed

+5
-33
lines changed

aws/lambda/pytorch-auto-revert/pytorch_auto_revert/__main__.py

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
from .clickhouse_client_helper import CHCliFactory
1111
from .github_client_helper import GHClientFactory
12-
from .testers.autorevert import autorevert_checker
1312
from .testers.autorevert_v2 import autorevert_v2
1413
from .testers.hud import run_hud
1514
from .testers.restart_checker import workflow_restart_checker
@@ -112,11 +111,6 @@ def get_opts() -> argparse.Namespace:
112111
action="store_true",
113112
help="Ignore common errors in autorevert patterns (e.g., 'No tests found')",
114113
)
115-
workflow_parser.add_argument(
116-
"--legacy-autorevert",
117-
action="store_true",
118-
help="Run the legacy autorevert behavior instead of the new Signals-based flow",
119-
)
120114

121115
# workflow-restart-checker subcommand
122116
workflow_restart_parser = subparsers.add_parser(
@@ -211,36 +205,14 @@ def main(*args, **kwargs) -> None:
211205
do_revert=True,
212206
)
213207
elif opts.subcommand == "autorevert-checker":
214-
if getattr(opts, "legacy_autorevert", False):
215-
# Legacy behavior behind flag
216-
autorevert_checker(
217-
opts.workflows,
218-
do_restart=opts.do_restart,
219-
do_revert=opts.do_revert,
220-
hours=opts.hours,
221-
verbose=opts.verbose,
222-
dry_run=opts.dry_run,
223-
ignore_common_errors=opts.ignore_common_errors,
224-
)
225-
else:
226-
# New default behavior under the same subcommand
227-
autorevert_v2(
228-
opts.workflows,
229-
hours=opts.hours,
230-
repo_full_name=opts.repo_full_name,
231-
dry_run=opts.dry_run,
232-
do_restart=opts.do_restart,
233-
do_revert=opts.do_revert,
234-
)
235-
elif opts.subcommand == "autorevert-checker":
236-
autorevert_checker(
208+
# New default behavior under the same subcommand
209+
autorevert_v2(
237210
opts.workflows,
238-
do_restart=opts.do_restart,
239-
do_revert=opts.do_revert,
240211
hours=opts.hours,
241-
verbose=opts.verbose,
212+
repo_full_name=opts.repo_full_name,
242213
dry_run=opts.dry_run,
243-
ignore_common_errors=opts.ignore_common_errors,
214+
do_restart=opts.do_restart,
215+
do_revert=opts.do_revert,
244216
)
245217
elif opts.subcommand == "workflow-restart-checker":
246218
workflow_restart_checker(opts.workflow, commit=opts.commit, days=opts.days)

0 commit comments

Comments
 (0)