ticket: use base32 project record ids
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
---
|
||||
title: "Tests: eliminate test-only environment variables"
|
||||
state: "closed"
|
||||
created_at: "2026-05-31T08:59:59Z"
|
||||
updated_at: "2026-05-31T10:04:28Z"
|
||||
---
|
||||
|
||||
## Background
|
||||
|
||||
The environment-variable policy now treats process environment as an undesirable ambient input. Tests currently still use several test-only or test-generated env names, such as `INSOMNIA_TEST_*`, and many tests mutate process environment directly with local guards.
|
||||
|
||||
The user decision is to eliminate test-only environment-variable surfaces rather than documenting them as supported configuration. A shared test utility crate may be added if it helps remove duplicated unsafe env mutation and replace test-only env channels with typed fixtures.
|
||||
|
||||
## Requirements
|
||||
|
||||
- Remove test-only environment variables from active code/tests, including `INSOMNIA_TEST_*` patterns.
|
||||
- Do not add new test-only user-facing env vars.
|
||||
- Where tests need to exercise real supported env behavior, keep those mutations isolated behind a shared guard rather than ad-hoc per-test `set_var`/`remove_var` code.
|
||||
- Prefer typed fixtures, temporary files, explicit config structs, or dependency injection over process-global env channels.
|
||||
- It is acceptable to introduce a small `test-support` crate if it reduces duplication and keeps env mutation serialized/restored.
|
||||
- Update docs so test-only env vars are not listed as a supported surface.
|
||||
|
||||
## Non-goals
|
||||
|
||||
- Removing tests that intentionally verify public path/env fallback behavior such as `INSOMNIA_HOME`, `XDG_CONFIG_HOME`, or `INSOMNIA_RUNTIME_DIR`.
|
||||
- Removing credential env vars in this ticket; those belong with `manifest-profile-encrypted-secrets`.
|
||||
- Removing `INSOMNIA_POD_COMMAND`; that is tracked by `remove-insomnia-pod-command-env`.
|
||||
|
||||
## Acceptance criteria
|
||||
|
||||
- No active code/tests generate or depend on `INSOMNIA_TEST_*` env names.
|
||||
- Test-only env vars are absent from `docs/environment.md`.
|
||||
- Any remaining test env mutation is for documented public env behavior or unavoidable external compatibility and is guarded/serialized/restored.
|
||||
- If a `test-support` crate is added, it is test-only/dev-only and does not become runtime dependency surface.
|
||||
- Relevant test suites pass, including tools/provider/manifest/pod tests that previously mutated env.
|
||||
- `cargo fmt --check`, relevant `cargo test`/`cargo check`, `./tickets.sh doctor`, and `git diff --check` pass.
|
||||
@@ -0,0 +1,18 @@
|
||||
Removed test-only environment-variable usage from active code.
|
||||
|
||||
Implementation:
|
||||
- Removed `INSOMNIA_TEST_*` Brave WebSearch test key generation/dependency.
|
||||
- Split Brave search request execution so tests can inject an API key directly into a private helper.
|
||||
- Preserved production behavior: WebSearch still reads configured `web.search.api_key_env` and fails closed for missing/empty values.
|
||||
- Updated `docs/environment.md` so test-only env vars are not listed as supported surface.
|
||||
|
||||
Review:
|
||||
- External reviewer `eliminate-test-env-vars-reviewer-20260531` approved implementation commit `e64a5595956c970b090cdce851cc962e92723a97`.
|
||||
|
||||
Validation after merge:
|
||||
- `cargo fmt --check`
|
||||
- `cargo test -p tools`
|
||||
- `cargo check -p tools` (passed with unrelated existing `llm-worker` dead_code warning)
|
||||
- `./tickets.sh doctor`
|
||||
- `git diff --check`
|
||||
- `git grep -n "INSOMNIA_TEST" -- ':!work-items' || true` produced no active references.
|
||||
@@ -0,0 +1,64 @@
|
||||
<!-- event: create author: tickets.sh at: 2026-05-31T08:59:59Z -->
|
||||
|
||||
## Created
|
||||
|
||||
Created by tickets.sh create.
|
||||
|
||||
---
|
||||
|
||||
<!-- event: review author: hare at: 2026-05-31T10:03:55Z status: approve -->
|
||||
|
||||
## Review: approve
|
||||
|
||||
External reviewer: `eliminate-test-env-vars-reviewer-20260531`
|
||||
Reviewed implementation commit: `e64a5595956c970b090cdce851cc962e92723a97` (`test: remove test-only env vars`)
|
||||
Verdict: approve
|
||||
|
||||
Summary:
|
||||
- WebSearch tests no longer generate or depend on `INSOMNIA_TEST_*` API-key env names.
|
||||
- The request/search implementation was split so tests can inject an API key directly into a private helper while production still reads the configured `web.search.api_key_env` and fails closed for missing/empty values.
|
||||
- `docs/environment.md` no longer presents test-only env vars as a supported surface.
|
||||
|
||||
Requirements mapping:
|
||||
- No active non-work-item `INSOMNIA_TEST` references remain.
|
||||
- No replacement test-only env var was introduced.
|
||||
- Credential env vars and `INSOMNIA_POD_COMMAND` were not removed by this ticket.
|
||||
- WebSearch production behavior and network safety boundaries are preserved.
|
||||
|
||||
Blockers: none.
|
||||
|
||||
Non-blocking follow-up:
|
||||
- A future public-path fail-closed test could guard missing/empty `api_key_env`, but this is not required for this ticket.
|
||||
|
||||
Validation adequacy:
|
||||
- Coder validation covered fmt, tools tests/check, ticket doctor, diff check, and residual `INSOMNIA_TEST` grep.
|
||||
- Reviewer performed read-only diff/source/docs/grep review and did not rerun tests.
|
||||
|
||||
|
||||
---
|
||||
|
||||
<!-- event: close author: hare at: 2026-05-31T10:04:28Z status: closed -->
|
||||
|
||||
## Closed
|
||||
|
||||
Removed test-only environment-variable usage from active code.
|
||||
|
||||
Implementation:
|
||||
- Removed `INSOMNIA_TEST_*` Brave WebSearch test key generation/dependency.
|
||||
- Split Brave search request execution so tests can inject an API key directly into a private helper.
|
||||
- Preserved production behavior: WebSearch still reads configured `web.search.api_key_env` and fails closed for missing/empty values.
|
||||
- Updated `docs/environment.md` so test-only env vars are not listed as supported surface.
|
||||
|
||||
Review:
|
||||
- External reviewer `eliminate-test-env-vars-reviewer-20260531` approved implementation commit `e64a5595956c970b090cdce851cc962e92723a97`.
|
||||
|
||||
Validation after merge:
|
||||
- `cargo fmt --check`
|
||||
- `cargo test -p tools`
|
||||
- `cargo check -p tools` (passed with unrelated existing `llm-worker` dead_code warning)
|
||||
- `./tickets.sh doctor`
|
||||
- `git diff --check`
|
||||
- `git grep -n "INSOMNIA_TEST" -- ':!work-items' || true` produced no active references.
|
||||
|
||||
|
||||
---
|
||||
Reference in New Issue
Block a user