Cover untested Resolver branches in pkg/intent/resolver_test.go - #52941
Merged
pelikhan merged 2 commits intoAug 15, 2026
Conversation
6 tasks
Contributor
PR Triage
|
…atchLabels Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Improve test quality for resolver_test.go
Cover untested Resolver branches in pkg/intent/resolver_test.go
Aug 15, 2026
pelikhan
marked this pull request as ready for review
August 15, 2026 19:06
Contributor
There was a problem hiding this comment.
Pull request overview
Adds direct coverage for previously untested resolver branches and strengthens assertions.
Changes:
- Tests explicit-intent version handling and immutability.
- Covers
ResolveIssue, nil matchers, and label cloning. - Uses full-record assertions for unlinked and ambiguous results.
Show a summary per file
| File | Description |
|---|---|
pkg/intent/resolver_test.go |
Expands resolver branch coverage and tightens expected results. |
Review details
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Balanced
Collaborator
|
@copilot Maintainers will want another pass here before investigating. Please refresh the branch, fix the failing check, and then run the Failed checks:
|
Contributor
|
🎉 This pull request is included in a new release. Release: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
resolver_test.goexercised only theResolvePullRequestclosing-issue/artifact/ambiguous paths. The explicit-intent branch, most ofResolveIssue, andstatusForLabels'sMatchLabels == nilcase had no direct coverage, and the unlinked/ambiguous tests asserted only non-zero fields.Test-only change;
resolver.gois untouched.New tests
ResolvePullRequestreturns the record as-is whenResolverVersionis set, and fills it from the resolver when blank. Also asserts the caller's record is not mutated (relies on the value copy inresolver.go:74).ResolveIssue— no labels → unlinked, unmapped labels, andcloneStringsisolation (mutating the caller's slice after the call does not affectintent.Labels).statusForLabelswith nilMatchLabels— covered from both entry points (PR artifact-label fallback andResolveIssue), which previously fell through untested toAttributionUnmapped.Tightened existing assertions
TestResolverResolvePullRequestNoSourcesUnlinkedand...MultipleClosingIssuesAmbiguousnow compare the whole struct, so zero-value fields are asserted and unexpected fields are caught:Both resolvers now set an explicit
ResolverVersionso that field participates in the comparison rather than matching the zero value by accident.The optional table-driven refactor and
t.Runregrouping from the issue were skipped to keep the diff additive; the existing one-function-per-branch layout stays consistent with the rest of the package.