Skip to content

Comments

Add environment variable abstraction and harden build service tests#2585

Open
Mpdreamz wants to merge 8 commits intomainfrom
fix/build-test
Open

Add environment variable abstraction and harden build service tests#2585
Mpdreamz wants to merge 8 commits intomainfrom
fix/build-test

Conversation

@Mpdreamz
Copy link
Member

@Mpdreamz Mpdreamz commented Jan 29, 2026

  • Add IEnvironmentVariables interface and SystemEnvironmentVariables implementation
    for testable environment variable access

  • Update IsolatedBuildService and AssemblerBuildService to use IEnvironmentVariables

  • Add validation that --assume-build flag throws error on CI to prevent stale builds

  • Create comprehensive unit tests with truth tables documenting:

    • CI behavior (always forces full rebuild, always clears output)
    • Force parameter behavior and CI override logic
    • assumeBuild validation on CI

- Add IEnvironmentVariables interface and SystemEnvironmentVariables implementation
  for testable environment variable access
- Add SymlinkValidator to prevent path traversal attacks via symlinked control files
  (docset.yml, toc.yml, redirects.yml)
- Update IsolatedBuildService and AssemblerBuildService to use IEnvironmentVariables
- Add validation that --assume-build flag throws error on CI to prevent stale builds
- Create comprehensive unit tests with truth tables documenting:
  - CI behavior (always forces full rebuild, always clears output)
  - Force parameter behavior and CI override logic
  - assumeBuild validation on CI
The --assume-build flag is blocked on CI by the new environment variable
validation, but the integration test fixture always passed it. On CI there
is no cached build output so the flag was effectively a no-op anyway.
Conditionally exclude it when GITHUB_ACTIONS is set so the integration
tests do a fresh build on CI while preserving fast local reruns.
New Codex command files from main were missing the IEnvironmentVariables
parameter added to IsolatedBuildService's constructor in this branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant