fix: fail on ambiguous entity names instead of taking the first - #307
Open
nikosavola wants to merge 2 commits into
Open
nikosavola wants to merge 2 commits into
nikosavola wants to merge 2 commits into
Conversation
- a name matching several projects or tasks silently resolved to whichever the api listed first, so writes could hit the wrong entity Co-Authored-By: DeepSeek V4.1 <noreply@deepseek.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #307 +/- ##
==========================================
+ Coverage 32.46% 32.78% +0.32%
==========================================
Files 141 141
Lines 9016 9067 +51
==========================================
+ Hits 2927 2973 +46
- Misses 5974 5979 +5
Partials 115 115
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
lucassabreu
reviewed
Sep 17, 2026
Comment on lines
+68
to
+74
| if len(cs) > maxCandidatesInError { | ||
| return prefix + strings.Join(cs[:maxCandidatesInError], ", ") + | ||
| fmt.Sprintf(", and %d more", | ||
| len(e.Candidates)-maxCandidatesInError) | ||
| } | ||
|
|
||
| return prefix + strhlp.ListForHumans(cs) |
Owner
There was a problem hiding this comment.
i think this logic should be moved to a new func at strhlp
Suggested change
| if len(cs) > maxCandidatesInError { | |
| return prefix + strings.Join(cs[:maxCandidatesInError], ", ") + | |
| fmt.Sprintf(", and %d more", | |
| len(e.Candidates)-maxCandidatesInError) | |
| } | |
| return prefix + strhlp.ListForHumans(cs) | |
| return prefix + strhlp.LimitedListForHumans(cs, maxCandidatesInError) |
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.
A name matching several projects or tasks silently resolved to whichever the API listed first, so writes could hit the wrong entity.