Skip to content

Fixes pytorch autorevert issue with Lint workflow name #7009

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from typing import Dict, Set

from .clickhouse_client_helper import CHCliFactory
from .github_client_helper import GHClientFactory


class WorkflowRestartChecker:
Expand Down Expand Up @@ -124,22 +125,6 @@ def restart_workflow(self, workflow_name: str, commit_sha: str) -> bool:
)
return False

# Get GitHub client
try:
from .github_client_helper import GHClientFactory

if not (
GHClientFactory().token_auth_provided
or GHClientFactory().key_auth_provided
):
logging.error("GitHub authentication not configured")
return False

client = GHClientFactory().client
except Exception as e:
logging.error(f"Failed to get GitHub client: {e}")
return False

try:
# Use trunk/{sha} tag format
tag_ref = f"trunk/{commit_sha}"
Expand All @@ -148,7 +133,7 @@ def restart_workflow(self, workflow_name: str, commit_sha: str) -> bool:
workflow_file_name = f"{normalized_workflow_name}.yml"

# Get repo and workflow objects
repo = client.get_repo(f"{self.repo_owner}/{self.repo_name}")
repo = GHClientFactory().client.get_repo(f"{self.repo_owner}/{self.repo_name}")
workflow = repo.get_workflow(workflow_file_name)

# Dispatch the workflow
Expand All @@ -173,4 +158,6 @@ def restart_workflow(self, workflow_name: str, commit_sha: str) -> bool:

except Exception as e:
logging.error(f"Error dispatching workflow {normalized_workflow_name}: {e}")
import traceback
traceback.print_exc()
return False
Loading