Skip to content
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
22 changes: 15 additions & 7 deletions scripts/repo_review_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,9 @@ def collect_gitnexus_map(workspace_root: Path, repo_path: Path, repo: RepoConfig
}


def run_gitnexus_analyze(repo_path: Path, gitnexus_bin: str, timeout: int = 180) -> tuple[bool, str]:
def run_gitnexus_analyze(
repo_path: Path, gitnexus_bin: str, timeout: int = 180
) -> tuple[bool, str]:
try:
result = subprocess.run(
[gitnexus_bin, "analyze", str(repo_path), "--skip-agents-md"],
Expand Down Expand Up @@ -905,18 +907,20 @@ def gitnexus_preflight(
)
else:
refresh_status = "failed"
refresh_error = refresh_output.splitlines()[-1] if refresh_output else "unknown error"
warnings.append(
f"{repo.repo} GitNexus refresh failed: {refresh_error}"
refresh_error = (
refresh_output.splitlines()[-1] if refresh_output else "unknown error"
)
warnings.append(f"{repo.repo} GitNexus refresh failed: {refresh_error}")
records[repo.repo] = {
"before": before,
"after": after,
"refresh_status": refresh_status,
"refresh_error": refresh_error,
}
stale_after = [
repo for repo, record in records.items() if record["after"]["status"] in GITNEXUS_REFRESH_STATUSES
repo
for repo, record in records.items()
if record["after"]["status"] in GITNEXUS_REFRESH_STATUSES
]
return {
"enabled": True,
Expand Down Expand Up @@ -1612,7 +1616,9 @@ def dropped_candidate_indexes(
except (TypeError, ValueError):
continue
if candidates is not None:
indexes.update(candidate_title_pattern_indexes(decision, "dropped_title_patterns", candidates))
indexes.update(
candidate_title_pattern_indexes(decision, "dropped_title_patterns", candidates)
)
return indexes


Expand Down Expand Up @@ -1770,7 +1776,9 @@ def build_approved_issue_queue(
if "approve" not in parts:
continue

selected_indexes = approved_candidate_indexes(decision, len(candidates), defaults, candidates)
selected_indexes = approved_candidate_indexes(
decision, len(candidates), defaults, candidates
)
missing_indexes = sorted(index for index in selected_indexes if index > len(candidates))
if missing_indexes:
warnings.append(
Expand Down
6 changes: 5 additions & 1 deletion scripts/upload_repo_review_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ def ensure_labels(repo: str, labels: list[str], prefix: list[str]) -> None:


def add_missing_labels(
repo: str, issue_number: int, labels: list[str], existing_labels: list[dict[str, Any]], prefix: list[str]
repo: str,
issue_number: int,
labels: list[str],
existing_labels: list[dict[str, Any]],
prefix: list[str],
) -> None:
existing = {label.get("name") for label in existing_labels}
missing = [label for label in labels if label not in existing]
Expand Down
4 changes: 3 additions & 1 deletion tests/scripts/test_repo_review_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,9 @@ def test_gitnexus_preflight_reports_stale_without_refresh(tmp_path: Path) -> Non
(repo_dir / "README.md").write_text("# Demo\n", encoding="utf-8")
subprocess = evaluator.subprocess
subprocess.run(["git", "-C", str(repo_dir), "init"], check=True, capture_output=True)
subprocess.run(["git", "-C", str(repo_dir), "config", "user.email", "test@example.com"], check=True)
subprocess.run(
["git", "-C", str(repo_dir), "config", "user.email", "test@example.com"], check=True
)
subprocess.run(["git", "-C", str(repo_dir), "config", "user.name", "Test User"], check=True)
subprocess.run(["git", "-C", str(repo_dir), "add", "README.md"], check=True)
subprocess.run(
Expand Down
Loading