Dashboard › cli › Distillation
c8bcb481-b7e1-48d3-9f1f-46150e8a8734["lore_tm_v1_uIEiV2Hlu7SGKowU_eFnA3lbMqVwgqQWjjiAyo0MlKQ","lore_tm_v1_fTDml21_dbilIgKs75u2wE_dKX5F4MEHQtKIjuGNpRw"]
getsentry/pr-risk-action repository tree at commit f5126d7a979415ac5124b7c14919482b149382aa was returned with truncated: false; top-level contents include .github/workflows/test.yml, .gitignore, README.md, action.yml, profiles/, pyproject.toml, src/risk_pr_agent/, and tests/.profiles/getsentry__cli, profiles/getsentry__dotagents, profiles/getsentry__junior, profiles/getsentry__sentry-dotnet, profiles/getsentry__sentry-mcp, profiles/getsentry__sentry, and profiles/getsentry__snuba; each contains README.md, model.json, and pr-history.jsonl.gz.model.json files are identical at blob SHA e05fb89b4c86e6710051280d7ed2448eb0fded8e and size 20565 bytes.profiles/getsentry__cli/pr-history.jsonl.gz — 887889 bytes; profiles/getsentry__dotagents/pr-history.jsonl.gz — 629415; profiles/getsentry__junior/pr-history.jsonl.gz — 9800014; profiles/getsentry__sentry-dotnet/pr-history.jsonl.gz — 12923919; profiles/getsentry__sentry-mcp/pr-history.jsonl.gz — 447933; profiles/getsentry__sentry/pr-history.jsonl.gz — 10813719; and profiles/getsentry__snuba/pr-history.jsonl.gz — 9531718.src/risk_pr_agent/ contains __init__.py (104 bytes), cli.py (40978), features.py (47613), git_history.py (9655), github.py (12743), modeling.py (32477), and scoring.py (24979).tests/test_cli.py (26372 bytes), tests/test_features.py (14853), tests/test_git_history.py (2055), and tests/test_scoring.py (5645).src/risk_pr_agent/github.py is described as a “Small GitHub REST client for PR backfills”; it defines GITHUB_API = "https://api.github.com", GitHubError(RuntimeError), immutable dataclass RepoRef, and GitHubClient.RepoRef.parse() requires the exact owner/name format and raises ValueError(f"repo must look like owner/name, got {value!r}") otherwise; RepoRef.slug returns owner/name, while RepoRef.path_slug returns owner__name.GitHubClient.__init__() accepts token: Optional[str] = None, api_url: str = GITHUB_API, sleep_seconds: float = 0.0, and max_retries: int = 3; token resolution order is the explicit argument, then GITHUB_TOKEN, then GH_TOKEN, and trailing / characters are removed from api_url.GitHubClient.request_json() JSON-encodes request payloads as UTF-8, tracks whether it has already waited for rate limiting, and uses exponential retry sleeping via time.sleep(2**attempt) for retryable failures._is_rate_limited() only considers HTTP 403 and 429; it returns true when X-RateLimit-Remaining == "0" or when the response body contains “rate limit” case-insensitively.GitHubClient.get_pull_request(repo, number) requests /repos/{repo.owner}/{repo.name}/pulls/{number}; search_issues_count(query) requests /search/issues with {"q": query, "per_page": 1} and returns integer total_count, defaulting to 0.GitHubClient.remove_issue_label(repo, number, label) URL-encodes the entire label with urllib.parse.quote(label, safe=""), sends DELETE to /repos/{repo.owner}/{repo.name}/issues/{number}/labels/{encoded_label}, ignores GitHubError responses containing GitHub API 404, and re-raises other errors.normalize_label(label) retains name, color, and description; normalize_file(file_info) retains filename, status, additions, deletions, changes, previous_filename, and patch, defaulting missing/falsy numeric counts to 0.