Repository navigation
feat(agent-evals): abstract the repository host - #4467
Conversation
Agent evals❌ 4 failed · ✅ 15 passed ❌ Failed (4)
✅ Passed (15)
Audited a9b4346. This check only reports. |
Agent evals
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
6d450a8 to
a9b4346
Compare
Description
First step towards Azure DevOps support in
@rnx-kit/agent-evals. The provider calledghdirectly and the public API assumed GitHub. Two things in particular only worked on GitHub:modified: number[], which relies on issues and pull requests sharing one number sequence, andnotModifiedOnGitHub. Azure DevOps numbers work items (#123) and pull requests (!123) separately, so numbers alone are ambiguous there.This PR puts the provider behind an internal
Hostinterface and makes the GitHub code the only implementation. Behaviour is unchanged, apart from the renamed API and new shapes below.Breaking changes (the package is experimental, 0.x, so this is a minor bump):
AgentRun.githubis nowAgentRun.hostand has a new requiredname: HostName("github" | "azure-devops").host.modifiedandHostItem.refare now references such as"#123"instead of numbers.notModifiedOnGitHubis nownotModified, with the sametitleandownOnlyconfig.notModifiedrejectshost.modifiedentries that are not references such as#123or!123.GitHubItemandGitHubMatcherare nowHostItemandHostMatcher.Alternative considered: adding a separate
azureDevOpsfield and anotModifiedOnAzureDevOpscheck. That would avoid breaking anything, but the logic would be duplicated for every host.Follow-up PR: an Azure DevOps host based on
az repos pr show, plus detecting the host from the git remote, with aconfig.hostoverride. Detection is deferred so that Azure DevOps remotes don't start failing before that host exists; local session audits on them mostly work today.Test plan
yarn build --dependenciesinincubator/agent-evals(includes lint): passedyarn testinincubator/agent-evals: passed, 140/140yarn buildandyarn testinevals: passed, 37/37yarn knipandnode scripts/lint-tsconfig.ts: passed@rnx-kit/agent-evals/provider:copilotSession(the current local session) returnedhost: { name: "github", actor: "tido64", modified: [] }.pullRequest: 4460resolved the base and head refs, diffed 6 files, and reported that the missing cloud session log was skipped.Line coverage:
github.tswent from 98.43% to 92.26%, because the pull request lookup moved there fromprovider.tsand is untested in both places.provider.tswent from 40.05% to 40.65%, and the total from 78.12% to 78.02%.