Skip to content

Suppress default team note when the team is project configuration - #263

Merged
schpetbot merged 1 commit into
mainfrom
suppress-default-team-note
Aug 12, 2026
Merged

Suppress default team note when the team is project configuration#263
schpetbot merged 1 commit into
mainfrom
suppress-default-team-note

Conversation

@schpetbot

Copy link
Copy Markdown
Collaborator

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, i.e. explicit, directory-scoped configuration where the reminder is just noise on every query.

What changed

  • src/config.ts keeps global and project config separate (instead of spread-merging) and records which env keys were actually applied from a project .env, exposing a typed getOptionWithSource() that reports where each option was resolved from: cli, env, project-env, project-config, or global-config. getOption() keeps its interface and delegates — this also removed its two as casts.
  • src/utils/linear.ts adds getTeamKeyWithSource(); getTeamKey() delegates so all other call sites are untouched.
  • issue query gates the note through an exhaustive shouldShowDefaultTeamNote(source) switch: suppressed for project-scoped sources, kept for ambient ones.
Effective team_id source Note?
--team / --all-teams n/a (bypasses the default branch)
project linear.toml / .linear.toml (cwd or git root) suppressed
project .env suppressed
global config (XDG / ~/.config / APPDATA) shown
shell-exported LINEAR_TEAM_ID shown

Tests

  • Subprocess provenance tests for every source category, run with clearEnv so a runner-supplied LINEAR_TEAM_ID can't leak into module-init config loading.
  • A regression test that a present-but-invalid project value still shadows a valid global value (preserving the old spread-merge behavior).
  • In-process integration tests for both note outcomes, plus a full policy-matrix table test of the exported helper.

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.
@schpetbot
schpetbot merged commit 5af8286 into main Aug 12, 2026
15 checks passed
@schpetbot
schpetbot deleted the suppress-default-team-note branch August 12, 2026 21:25
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