Improve issue mine's no-team error and suggest linear config in repos#255
Merged
Conversation
When no team can be determined, issue mine (and its list alias) now uses the same message as issue query — 'No default team configured and no team scope provided' — instead of the inaccurate 'Could not determine team key from directory name or team flag' (the team only ever comes from the --team flag, LINEAR_TEAM_ID, or team_id config; directory names are not consulted). The error now carries a suggestion: always offer --team <key>, and when run inside a git work tree, also point at linear config, which links the repository to a team by generating .linear.toml. Repo detection is a new best-effort isInsideGitRepo() helper: any git failure (not a repo, dubious ownership) counts as false so the optional hint can never turn the team error into a git crash. The same stale message remains in cycle-list, cycle-view, team-states, and team-members; those are deferred so they can adopt the helper in a follow-up.
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.
Follow-up to #253 / #254, addressing the other rough edge in the out-of-the-box experience:
What changed
issue mine(and itslist/laliases) now reports the same error asissue querywhen no team can be determined, with an actionable suggestion — and when run inside a git work tree, it additionally points atlinear config, which links the repository to a team by generating.linear.toml:The old message was also inaccurate: the team never comes from the directory name — only from
--team,LINEAR_TEAM_ID, orteam_idconfig.Repo detection is a new
isInsideGitRepo()helper insrc/utils/git.tsthat is deliberately best-effort: any failure (git missing, not a repo, dubious ownership, spawn error) yieldsfalse, so the optional hint can never replace the actionable team error with a git crash. It checksgit rev-parse --is-inside-work-tree's stdout, not just its exit code (which is 0-with-"false" inside.gitdirs and bare repos), and covers colocated jj repos via their.git.Tests
isInsideGitRepo(non-repo, repo, nested dir)..linear.tomlsetsteam_id, so the error path is unreachable in-process from the repo root.Deferred
The same stale message exists in
cycle list,cycle view,team states, andteam members; they can adoptisInsideGitRepo()and this error shape in a follow-up.issue start's "Could not determine team ID" and adding thelinear confighint toissue queryare likewise out of scope here.