Skip to content

Register --in/--project flags on comments commands#249

Merged
jeremy merged 3 commits intomainfrom
fix/comments-project-flags
Mar 11, 2026
Merged

Register --in/--project flags on comments commands#249
jeremy merged 3 commits intomainfrom
fix/comments-project-flags

Conversation

@jeremy
Copy link
Copy Markdown
Member

@jeremy jeremy commented Mar 11, 2026

Summary

  • The comments group and comment shortcut were the only command groups missing --in/--project flags
  • Add persistent flags on NewCommentsCmd (inherited by subcommands)
  • Add local flags on NewCommentCmd (top-level shortcut that doesn't inherit from the group)
  • Surface snapshot updated

Stacked on #248

Test plan

  • TestCommentShortcutAcceptsInFlagcomment --in accepted
  • TestCommentShortcutAcceptsProjectFlagcomment -p accepted
  • TestCommentsGroupAcceptsInFlagcomments list --in accepted
  • make check green

Summary by cubic

Add --in/--project support to the comments group and comment shortcut for project scoping. Improve person resolution by falling back to pingable users and deduplicating suggestions.

  • Bug Fixes
    • Register --in/--project (-p) on NewCommentsCmd (persistent) and NewCommentCmd (local); update .surface and add tests.
    • Update ResolvePerson to query /people/pingable.json on miss, prefer primary people, deduplicate suggestions, clear pingable cache on account changes, degrade gracefully if pingable fetch fails, and add tests.

Written for commit 3ae5aec. Summary will update on new commits.

@jeremy jeremy requested a review from a team as a code owner March 11, 2026 03:31
Copilot AI review requested due to automatic review settings March 11, 2026 03:31
@github-actions github-actions bot added commands CLI command implementations tests Tests (unit and e2e) labels Mar 11, 2026
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 3 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/commands/comment.go">

<violation number="1" location="internal/commands/comment.go:22">
P1: Dead code: The `project` variable is declared but never used in `NewCommentCmd`. The flags `--in`/`--project` are registered but have no effect since the underlying `newCommentsCreateCmd()` function doesn't access them.</violation>
</file>

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

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 --in / --project flag registration to the comments command group and the top-level comment shortcut to match other command groups, and updates the CLI surface snapshot accordingly.

Changes:

  • Register persistent --in/--project flags on NewCommentsCmd (inherited by subcommands).
  • Register local --in/--project flags on NewCommentCmd (shortcut command).
  • Add tests to ensure the new flags are accepted; update .surface snapshot.

Reviewed changes

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

File Description
internal/commands/comment.go Adds --in/--project flags to comments and comment.
internal/commands/comment_test.go Adds tests asserting the new flags are accepted.
.surface Records newly surfaced --in flags for comment/comments commands.

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

@jeremy jeremy force-pushed the fix/flag-alias-required branch from f691522 to f08648a 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 enhancement New feature or request label Mar 11, 2026
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 3 out of 3 changed files in this pull request and generated no new comments.


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

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 (changes from recent commits).

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:213">
P2: A `getPingable` failure turns a "not found" with helpful suggestions into a raw API error. Since this is a fallback path, consider degrading gracefully (e.g., treat the error as an empty pingable list) so the suggestions from the already-fetched `people` list are still shown.</violation>
</file>

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

Base automatically changed from fix/flag-alias-required to main March 11, 2026 05:08
Copilot AI review requested due to automatic review settings March 11, 2026 06:57
@github-actions github-actions bot added bug Something isn't working and removed enhancement New feature or request labels 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

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.


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

jeremy added 3 commits March 11, 2026 00:07
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).
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.
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.
@jeremy jeremy force-pushed the fix/comments-project-flags branch from eef066d to 3ae5aec Compare March 11, 2026 07:14
@jeremy jeremy merged commit 475f37d into main Mar 11, 2026
25 checks passed
@jeremy jeremy deleted the fix/comments-project-flags branch March 11, 2026 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working commands CLI command implementations tests Tests (unit and e2e)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants