Skip to content

refactor: make TaskEnvs::resolve accept env iterator parameter#28

Merged
Brooooooklyn merged 2 commits into
mainfrom
11-12-refactor_make_taskenvs_resolve_accept_env_iterator_parameter
Nov 12, 2025
Merged

refactor: make TaskEnvs::resolve accept env iterator parameter#28
Brooooooklyn merged 2 commits into
mainfrom
11-12-refactor_make_taskenvs_resolve_accept_env_iterator_parameter

Conversation

@wan9chi

@wan9chi wan9chi commented Nov 12, 2025

Copy link
Copy Markdown
Member

refactor: make TaskEnvs::resolve accept env iterator parameter

Change TaskEnvs::resolve to accept environment variables as an iterator
parameter instead of reading from std::env::vars_os() directly. This makes
tests cleaner and more isolated.

Changes:

  • Update resolve_envs_with_patterns to accept env_vars iterator
  • Update TaskEnvs::resolve to accept current_envs iterator parameter
  • Update production call sites to pass std::env::vars_os()
  • Refactor all tests to use clean mock environment vectors
  • Remove all unsafe std::env::set_var/remove_var calls from tests

Benefits:

  • Tests are isolated and don't modify global process environment
  • No unsafe code needed in tests
  • Tests can run safely in parallel
  • More functional and easier to test

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

remove unnecessary code

wan9chi and others added 2 commits November 12, 2025 19:29
Change TaskEnvs::resolve to accept environment variables as an iterator
parameter instead of reading from std::env::vars_os() directly. This makes
tests cleaner and more isolated.

Changes:
- Update resolve_envs_with_patterns to accept env_vars iterator
- Update TaskEnvs::resolve to accept current_envs iterator parameter
- Add OsString import from std::ffi
- Update production call sites to pass std::env::vars_os().collect()
- Refactor all tests to use clean mock environment vectors
- Remove all unsafe std::env::set_var/remove_var calls from tests

Benefits:
- Tests are isolated and don't modify global process environment
- No unsafe code needed in tests
- Tests can run safely in parallel
- More functional and easier to test

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

wan9chi commented Nov 12, 2025

Copy link
Copy Markdown
Member Author

@wan9chi
wan9chi marked this pull request as ready for review November 12, 2025 11:33
@Brooooooklyn
Brooooooklyn merged commit 33381fc into main Nov 12, 2025
6 checks passed
@Brooooooklyn
Brooooooklyn deleted the 11-12-refactor_make_taskenvs_resolve_accept_env_iterator_parameter branch December 11, 2025 06:39
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.

3 participants