fix(issue-list): add --no-profile flag to bypass active profile defaults - #119
Conversation
Adds a `--no-profile` boolean flag to `issue list`. When set, the `team_key` and `project_id` fields no longer fall back to `Profiles.default_team()` / `Profiles.default_project()`, so the command behaves as if no profile is active. Explicit `--team` / `--project` still take effect even when `--no-profile` is set. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Code ReviewReviewer: Autonomous code review agent (CRY-45, Run 1) SummaryThe change adds a Issues FoundMinor: Duplicate test
|
bougyman
left a comment
There was a problem hiding this comment.
Code Review
Branch: CRY-45-no-profile-flag
Commit: aa4657f fix(issue-list): add --no-profile flag to bypass active profile defaults
Issue: CRY-45
Critical Issues
None.
Major Issues
1. Formatting failure — commands.ex fails mix format --check-formatted (will break CI)
app/lib/linear_cli/cli/commands.ex:230,233 — The unless expressions have unnecessary parentheses that the Elixir formatter wants removed:
- team_key = options.team || (unless no_profile, do: Profiles.default_team())
+ team_key = options.team || unless no_profile, do: Profiles.default_team()
- options.project || (unless no_profile, do: Profiles.default_project())
+ options.project || unless no_profile, do: Profiles.default_project()Fix: run mix format on the file.
2. Duplicate test blocks in profile_defaults_test.exs
Two describe blocks test the exact same --no-profile scenarios:
- Lines 219–285: inside
"Commands.issue_list/1 falls back to the active profile"— tests bypass-defaults and bypass+explicit-team - Lines 321–390: standalone
"Commands.issue_list/1 with --no-profile bypasses active profile defaults"— tests the same two scenarios again
The only meaningful difference is the standalone block's first test also guards against project queries being made (the raise on projects(first: $first). These should be consolidated into one set of tests. Suggest keeping the standalone describe block (which has the stronger assertions) and removing the duplicates from the "falls back" block.
Minor Issues
3. Missing test: --no-profile combined with explicit --project
Tests cover --no-profile alone and --no-profile + explicit --team, but not --no-profile + explicit --project. For symmetry and to confirm project resolution still works when the user explicitly passes --project while bypassing profile defaults, this case should be tested.
4. expand_issue_id not affected by --no-profile
IssueHelpers.expand_issue_id/1 (issue_helpers.ex:403) still calls Profiles.default_team() for bare numeric IDs regardless of the --no-profile flag. Example: lc issue list --no-profile 42 would still expand 42 → CRY-42 using the profile's team. The investigation acknowledged this as acceptable behavior (the flag is about filtering, not ID expansion), so this is a documentation/awareness note, not a change request.
What Looks Good
- Core logic is minimal and clean — the 4-line change in
commands.exdoes exactly what the ticket asks Map.get(flags, :no_profile, false)correctly handles backward compatibility with existing test fixtures that don't include the new flag (matching theMap.get(flags, :all, false)pattern)- Optimus spec placement and help text follow existing conventions (
--no-minepattern) - Smoke test via
LinearCli.CLI.main/1dispatch path provides good integration coverage - Test stubs properly verify no project queries are fired when
--no-profileomits both defaults
Overall Assessment
Request changes. The formatting failure (#1) must be fixed — it will fail CI. The duplicate tests (#2) should be consolidated. The missing --project test case (#3) is nice-to-have. All are straightforward fixes.
- Remove unnecessary parentheses from `unless` expressions in `Commands.issue_list/1` to pass `mix format --check-formatted` - Consolidate duplicate `--no-profile` describe block in `profile_defaults_test.exs` into the existing "falls back to the active profile" describe; strengthen the bypass test with a project- query guard and output assertion - Add missing test: `--no-profile` with explicit `--project` still applies the explicit project filter while ignoring profile defaults
Rework Summary (CRY-45, Run 2)Addressed all three review comments from the code review stage. What was fixed1. Formatting failure ( 2. Duplicate test blocks (
3. Missing test ( Quality
|
Code Review (Run 2)Branch: CRY-45-no-profile-flag Prior Review Issues — Status1. Formatting failure ( 2. Duplicate test blocks ( 3. Missing New Issues Introduced by ReworkNone found. The rework commit ( Quality Suite
Implementation SummaryThe final implementation is clean and well-structured:
Overall AssessmentApprove. All three prior review issues have been addressed cleanly. No new issues found. The implementation is correct, follows project conventions, and has thorough test coverage. |
WorkpadCode Review (Run 2, 2026-08-16)Status: Approved. Prior review issues (all 3 addressed):
New issues found: None. Quality: 239/243 tests pass (4 pre-existing Decision: Approve — ready to merge. |
Code Review (Run 2)Reviewer: Autonomous code review agent (CRY-45, Run 2) Prior Review Issues — VerificationAll 3 issues from the Run 1 review have been properly addressed: 1. Formatting failure ( 2. Duplicate test blocks ( 3. Missing New Issues FoundNone. Quality Suite
Notes
Overall AssessmentApprove. All 3 prior review issues have been cleanly resolved. The implementation is correct, well-tested (3 unit tests + 1 smoke test), follows project conventions ( |
🤖 I have created a release *beep* *boop* --- ## [1.9.1](v1.9.0...v1.9.1) (2026-08-16) ### Bug Fixes * **issue-list:** add --no-profile flag to bypass active profile defaults ([#119](#119)) ([f19409c](f19409c)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Summary
--no-profileboolean flag toissue list(follows the--no-minenaming convention)Commands.issue_list/1skipsProfiles.default_team()andProfiles.default_project()fallbacks entirely — the command runs as if no profile is active--team/--projectstill win even when--no-profileis setTest plan
profile_defaults_test.exs: two new unit tests —--no-profileomits team/project filters;--no-profile+ explicit--teamstill applies the explicit teamissue_commands_test.exs: smoke test via full CLI dispatch path confirming no project query is issued and no team/project filter appears in the GQL variablesLinearCli.GitTest)Closes: https://linear.app/cryptokairos/issue/CRY-45
🤖 Generated with Claude Code