Skip to content

Add pingable fallback to ResolvePerson#250

Merged
jeremy merged 1 commit intofix/comments-project-flagsfrom
fix/resolver-pingable-fallback
Mar 11, 2026
Merged

Add pingable fallback to ResolvePerson#250
jeremy merged 1 commit intofix/comments-project-flagsfrom
fix/resolver-pingable-fallback

Conversation

@jeremy
Copy link
Copy Markdown
Member

@jeremy jeremy commented Mar 11, 2026

Summary

  • ResolvePerson only searched /people.json, missing people findable via /people/pingable.json (clients, external collaborators)
  • After the primary people list fails to match, fall back to the pingable endpoint for both email and name resolution
  • Cache the pingable list per session, clear on account switch
  • Suggestions on not-found draw from both lists

Stacked on #249

Test plan

  • TestResolverResolvePerson_PingableFallback_ByName — name match via pingable
  • TestResolverResolvePerson_PingableFallback_ByEmail — email match via pingable
  • TestResolverResolvePerson_PeoplePreferredOverPingable — people list takes priority
  • TestResolverResolvePerson_PingableFallback_NotFound — not-found in both lists
  • make check green

Summary by cubic

Fixes person resolution by falling back to /people/pingable.json when /people.json has no match, so clients and external collaborators resolve correctly. Adds per-session caching, deduped suggestions, and proper error propagation.

  • Bug Fixes
    • Fall back to /people/pingable.json for email and name when /people.json has no match; prefer the main people list if both match.
    • Cache the pingable list per session; clear on account switch and ClearCache().
    • Build suggestions from both lists and dedupe by ID.
    • Propagate pingable fetch errors instead of masking as not-found.

Written for commit f181cfc. Summary will update on new commits.

Copilot AI review requested due to automatic review settings March 11, 2026 03:31
@jeremy jeremy requested a review from a team as a code owner March 11, 2026 03:31
@github-actions github-actions bot added the tests Tests (unit and e2e) label Mar 11, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a secondary “pingable people” lookup path to names.Resolver.ResolvePerson so the CLI can resolve people who aren’t returned by /people.json (e.g., clients/external collaborators), while caching the pingable list per session and clearing it on account switch.

Changes:

  • Add Resolver.pingable cache and clear it via SetAccountID and ClearCache.
  • Extend ResolvePerson to fall back to /people/pingable.json for email/name resolution and include both lists in suggestions.
  • Add unit tests covering pingable fallback behavior and precedence of /people.json.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
internal/names/resolver.go Adds pingable cache + fetcher and uses it as a fallback resolution source for people.
internal/names/resolver_test.go Adds mock support for pingable cache and tests for pingable fallback scenarios.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/names/resolver_test.go Outdated
Comment thread internal/names/resolver.go
Comment thread internal/names/resolver.go Outdated
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="internal/names/resolver.go">

<violation number="1" location="internal/names/resolver.go:239">
P2: `allPeople` can contain duplicates when a person appears in both `/people.json` and `/people/pingable.json` (which is common — pingable is a superset). Since `suggest` doesn't deduplicate, the "Did you mean" hint can show the same name twice.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread internal/names/resolver.go Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9dfb150813

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/names/resolver.go Outdated
@jeremy jeremy force-pushed the fix/resolver-pingable-fallback branch from 9dfb150 to 30d1e2b Compare March 11, 2026 03:43
@jeremy jeremy force-pushed the fix/comments-project-flags branch from 8c0b7f2 to 65a2954 Compare March 11, 2026 03:43
@github-actions github-actions bot added the bug Something isn't working label Mar 11, 2026
@jeremy jeremy force-pushed the fix/resolver-pingable-fallback branch from 30d1e2b to 82eb829 Compare March 11, 2026 04:27
Copilot AI review requested due to automatic review settings March 11, 2026 04:27
@jeremy jeremy force-pushed the fix/comments-project-flags branch from 65a2954 to 8251716 Compare March 11, 2026 04:27
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/names/resolver.go
ResolvePerson only searched /people.json, missing people findable via
/people/pingable.json (clients, external collaborators). After the
primary people list fails to match, fall back to the pingable endpoint
for both email and name resolution before returning not-found.

Propagate getPingable errors so transient API failures aren't masked as
not-found. Deduplicate suggestions by ID to avoid showing the same name
twice when a person appears in both lists.
@jeremy jeremy force-pushed the fix/resolver-pingable-fallback branch from 82eb829 to f181cfc Compare March 11, 2026 04:41
@jeremy jeremy merged commit 2d91244 into fix/comments-project-flags Mar 11, 2026
7 checks passed
@jeremy jeremy deleted the fix/resolver-pingable-fallback branch March 11, 2026 04:42
jeremy added a commit that referenced this pull request Mar 11, 2026
ResolvePerson only searched /people.json, missing people findable via
/people/pingable.json (clients, external collaborators). After the
primary people list fails to match, fall back to the pingable endpoint
for both email and name resolution before returning not-found.

Propagate getPingable errors so transient API failures aren't masked as
not-found. Deduplicate suggestions by ID to avoid showing the same name
twice when a person appears in both lists.
jeremy added a commit that referenced this pull request Mar 11, 2026
* Register --in/--project flags on comments and comment commands

The comments group and comment shortcut were the only command groups
missing --in/--project flags, breaking consistency with every other
command group. Add persistent flags on NewCommentsCmd and local flags
on NewCommentCmd (which is a top-level shortcut that doesn't inherit
from the group's persistent flags).

* Add pingable fallback to ResolvePerson (#250)

ResolvePerson only searched /people.json, missing people findable via
/people/pingable.json (clients, external collaborators). After the
primary people list fails to match, fall back to the pingable endpoint
for both email and name resolution before returning not-found.

Propagate getPingable errors so transient API failures aren't masked as
not-found. Deduplicate suggestions by ID to avoid showing the same name
twice when a person appears in both lists.

* Degrade gracefully when pingable fallback fails

If getPingable errors, the people list was already fetched
successfully and can still provide suggestions. Swallow the
error instead of replacing the "not found" with a raw API error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working tests Tests (unit and e2e)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants