Suppress default team note when the team is project configuration - #263
Merged
Conversation
issue query prints "Note: using default team ..." whenever the team scope falls back to the configured default. The note exists to flag ambient defaults (a global config file or a shell-exported LINEAR_TEAM_ID) silently narrowing a query, but it also fired when the team came from the project's own linear.toml or .env — explicit, directory-scoped configuration where the reminder is just noise on every query. Track where each option was resolved from (cli, env, project-env, project-config, global-config) by keeping global and project config separate and recording which env keys were applied from a project .env. issue query now consults the source and only prints the note for ambient sources. getOption keeps its interface, delegating to the new getOptionWithSource, which also removes its type casts.
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.
issue queryprintsNote: using default team ...whenever the team scope falls back to the configured default. The note exists to flag ambient defaults (a global config file or a shell-exportedLINEAR_TEAM_ID) silently narrowing a query — but it also fired when the team came from the project's ownlinear.tomlor.env, i.e. explicit, directory-scoped configuration where the reminder is just noise on every query.What changed
src/config.tskeeps global and project config separate (instead of spread-merging) and records which env keys were actually applied from a project.env, exposing a typedgetOptionWithSource()that reports where each option was resolved from:cli,env,project-env,project-config, orglobal-config.getOption()keeps its interface and delegates — this also removed its twoascasts.src/utils/linear.tsaddsgetTeamKeyWithSource();getTeamKey()delegates so all other call sites are untouched.issue querygates the note through an exhaustiveshouldShowDefaultTeamNote(source)switch: suppressed for project-scoped sources, kept for ambient ones.team_idsource--team/--all-teamslinear.toml/.linear.toml(cwd or git root).env~/.config/ APPDATA)LINEAR_TEAM_IDTests
clearEnvso a runner-suppliedLINEAR_TEAM_IDcan't leak into module-init config loading.