Skip to content

fix(project): scope all project prompts to team - #154

Merged
bougyman merged 4 commits into
mainfrom
EXT-2-team-scoped-project-prompt
Aug 19, 2026
Merged

fix(project): scope all project prompts to team#154
bougyman merged 4 commits into
mainfrom
EXT-2-team-scoped-project-prompt

Conversation

@bougyman

@bougyman bougyman commented Aug 19, 2026

Copy link
Copy Markdown
Member

Summary

  • issue list --project now resolves the project against only the active team's projects when a team is known (via --team or the active profile), instead of fetching every workspace project. Falls back to all-workspace search when no team context is available.
  • project favorite, project unfavorite, and project update now resolve the project against the team's projects exclusively. Team is resolved from the new --team/-t option, the active profile, or an interactive prompt — matching the same resolution order issue create already uses.
  • All three project subcommands now accept a --team/-t option (consistent with project list).

Closes EXT-2

Test plan

  • mix test — 291/297 pass (6-7 pre-existing git_test.exs env failures, unchanged)
  • mix compile — clean
  • mix credo — no issues
  • favorites_commands_test.exs — updated stubs to handle team-scoped project query (ByTeam format)
  • cli_test.exs (project update) — updated stub to handle viewer + team-scoped project query
  • New test: --project with --team resolves against team-scoped projects only asserts workspace-wide project query is never made when a team is in scope
  • Updated profile tests confirm team-scoped project resolution when profile supplies the team

🤖 Generated with Claude Code

When a team key is available (via --team or the active profile),
resolve_project_id now looks up projects only within that team instead
of fetching every workspace project. This prevents cross-team projects
from appearing in the interactive --project prompt and makes project
resolution cheaper for focused workflows.

Fallback when no team context is present is unchanged: all workspace
projects are searched, preserving existing behaviour.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 19, 2026 16:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

…update

project favorite, project unfavorite, and project update now resolve the
project against the current team's projects instead of fetching every
workspace project. Team is resolved from --team (new option on all three
subcommands), the active profile, or an interactive prompt - the same
resolution order issue create uses.

This prevents cross-team projects from appearing in the interactive
project prompt and makes project resolution cheaper for focused
workflows.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bougyman bougyman changed the title fix(issue-list): scope project prompt to team when team is known fix(project): scope all project prompts to team Aug 19, 2026
@bougyman

Copy link
Copy Markdown
Member Author

Code Review

Branch: EXT-2-team-scoped-project-prompt
Commits reviewed: 6a4091c (issue list scoping), 18669bc (favorite/unfavorite/update scoping)

Overall Assessment: Approve with minor suggestions

The implementation is correct, well-structured, and consistent with existing patterns in the codebase. The two commits cleanly separate the two scopes of work. Tests are thorough and pass (7 pre-existing git_test.exs environment failures are unchanged).

What looks good

  • Consistent team resolution pattern. All three project subcommands (favorite, unfavorite, update) use the same WhatFor.team_for(options.team || Profiles.default_team()) idiom already established by make_da_issue! — no new patterns introduced.
  • Clean fallback in issue list. The three-clause resolve_project_id/2 correctly handles: nil project (no-op), team known (team-scoped lookup), team unknown (all-workspace fallback). The guard when is_binary(team_key) is the right way to dispatch.
  • Good negative test. The --project with --team test in issue_commands_test.exs raises if the all-workspace projects(first: $first query fires — confirms the team-scoped path is actually taken, not just that results happen to match.
  • --team CLI option added consistently to favorite, unfavorite, and update subcommands with identical help text.

Issues found

Minor — Stale docstrings (2 instances)

  1. commands.ex line ~91 (HEAD): project_favorite's docstring still says "resolved the same way project update's PROJECT is - against every project in the workspace". The code now resolves against the team's projects. Should read something like "resolved against the active team's projects, prompting if ambiguous. Team is resolved via --team, the active profile, or an interactive prompt" — matching what project_update's docstring already says.

  2. commands.ex line ~231 (HEAD): issue_list's docstring still says "--project/-p is resolved the same way Ruby's CLI::Projects#project_for does - against every project in the workspace (Project.all, not team-scoped)". This is no longer accurate when --team is provided or the active profile supplies a team — the code now uses team-scoped resolution in that case. The docstring should mention that --project is resolved against the team's projects when a team is known, falling back to all-workspace when no team context is available.

No critical or major issues found.

Workspace note

The working tree has staged changes that revert the branch's committed work back to the main state. This appears to be a Stokowski workspace artifact and doesn't affect the PR itself, but should not be committed on top of HEAD.


Reviewed at run 1, commit 18669bc.

@bougyman

Copy link
Copy Markdown
Member Author

Code Review Summary (Linear issue EXT-2)

Verdict: Approve with two minor docstring suggestions.

What was reviewed: Both commits on EXT-2-team-scoped-project-prompt — team-scoped project resolution for issue list (6a4091c) and for project favorite/unfavorite/update (18669bc).

Findings:

  • Correctness: All paths tested and working. Team-scoped resolution fires when team is known; all-workspace fallback preserved when no team context exists.
  • Quality: Consistent with existing WhatFor.team_for pattern. Clean three-clause dispatch in resolve_project_id/2.
  • Tests: 289/296 pass (7 pre-existing git_test.exs env failures unchanged). New tests cover the team-scoped path with a negative assertion preventing accidental all-workspace queries.
  • Two minor stale docstrings: project_favorite (line ~91) and issue_list (line ~231) still reference "every project in the workspace" but the code now does team-scoped resolution. Non-blocking but worth updating for accuracy.

@bougyman

Copy link
Copy Markdown
Member Author

Code Review Summary (Linear issue EXT-2)

Verdict: Approve with two minor docstring suggestions.

What was reviewed: Both commits on EXT-2-team-scoped-project-prompt — team-scoped project resolution for issue list (6a4091c) and for project favorite/unfavorite/update (18669bc).

Findings:

  • Correctness: All paths tested and working. Team-scoped resolution fires when team is known; all-workspace fallback preserved when no team context exists.
  • Quality: Consistent with existing WhatFor.team_for pattern. Clean three-clause dispatch in resolve_project_id/2.
  • Tests: 289/296 pass (7 pre-existing git_test.exs env failures unchanged). New tests cover the team-scoped path with a negative assertion preventing accidental all-workspace queries.
  • Two minor stale docstrings: project_favorite (line ~91) and issue_list (line ~231) still reference "every project in the workspace" but the code now does team-scoped resolution. Non-blocking but worth updating for accuracy.

Fix the docstrings, they're a contract, too.

project_favorite/1 and issue_list/1 docstrings still described workspace-wide
project resolution after the team-scoped implementation was added.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bougyman

Copy link
Copy Markdown
Member Author

Rework: docstring fixes

Addressed the two stale-docstring nits from code review:

  • project_favorite (was commands.ex:90-96): Updated to reflect team-scoped resolution — "resolved against the active team's projects, prompting if ambiguous. Team is resolved via --team, the active profile, or an interactive prompt."
  • issue_list (was commands.ex:230-241): Updated to reflect dual-path behavior — team-scoped via projects_by_team when team context is available, falling back to all-workspace Project.all when not.

Also recovered from a botched pre-push rebase that had left all feature changes staged as reversions (the working tree had the old code despite the commits being present). Discarded the staged/unstaged reversions, confirmed the feature commits were intact, then applied and pushed only the docstring fix.

Quality: compile (warnings-as-errors) ✓, format ✓, tests 291/297 (6 pre-existing git_test.exs env failures unchanged) ✓

@bougyman
bougyman merged commit b884436 into main Aug 19, 2026
2 checks passed
@bougyman
bougyman deleted the EXT-2-team-scoped-project-prompt branch August 19, 2026 20:11
bougyman pushed a commit that referenced this pull request Aug 19, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.15.1](v1.15.0...v1.15.1)
(2026-08-19)


### Bug Fixes

* fix workflow for rebasing
([#155](#155))
([c44178c](c44178c))
* **project:** scope all project prompts to team
([#154](#154))
([b884436](b884436))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants