Skip to content

Initial import of go-envloader - #1

Merged
waltercacau merged 3 commits into
mainfrom
initial-import
Nov 12, 2026
Merged

waltercacau merged 3 commits into
mainfrom
initial-import

Conversation

@waltercacau

@waltercacau waltercacau commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Initial import of go-envloader.

  • Adds the envloader package.
  • Uses github.com/instacart/go-testhooks v0.1.0.
  • Includes the standard GitHub Actions CI workflow that runs make test on pushes and pull requests.

@waltercacau
waltercacau requested a review from a team as a code owner November 12, 2026 02:03
@pr-inbox-app

pr-inbox-app Bot commented Nov 12, 2026

Copy link
Copy Markdown

🚀 Ready for Review? 🚀

Mark your PR as ready and automatically assign the right reviewers.

Mark Ready Button
Let reviewers know this PR is ready for review

@olive-agent

olive-agent Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Olive Review: ✅ Approved

Posted by: GitHub @olive-agent[bot]
Reviewed commit: 5ea18ed90fd01a0f22189ced05b002f5eba37063
Base ref: origin/main
Merge base: ad4c12080f0aed6d948cf393fcc839d6b1156837

Review Summary

Adds a shared Go environment loader for local runner workflows, with documentation, CI, and a dependency release update. Callers choose files and load order; relative paths use BUILD_WORKING_DIRECTORY or the process working directory, and missing files are optional unless RequireAll() is enabled. Integration or performance evidence could not be verified from the PR description. Unique current findings: 0. Selected preexisting concerns: 0.

📣 Human Attention

  • 📣 MustLoadEnv uses godotenv.Overload, allowing later files to override earlier files and inherited environment variables. Relative paths use BUILD_WORKING_DIRECTORY when set, otherwise the process working directory; confirm these precedence and path rules suit callers’ startup configuration.
  • 📣 MustLoadEnv skips loading and missing-file checks whenever ENV_LOADER_LOADED_ENVS="true", including with RequireAll(). Restarted or child processes that inherit this marker also skip loading, so confirm the guard should apply across different file lists and processes.
  • 📣 MustLoadEnv changes the current environment without restarting the process. Services whose package initializers need the loaded values must adopt the documented restart wrapper, because loading in main cannot update values those initializers already captured.

Component Walkthrough

  • MustLoadEnv — envloader/envloader.go:42 (new) — The new public entry point accepts an ordered file list, applies caller options, and delegates loading, returning whether any files were loaded.
  • Environment file loading — envloader/envloader.go:50 (new) — The new loader skips previously marked environments, resolves relative paths against BUILD_WORKING_DIRECTORY when set, skips missing files unless required, overloads process environment values, and sets ENV_LOADER_LOADED
  • Changed handoff: MustLoadEnv → Environment file loading — envloader/envloader.go:47 — The new delegation passes the requested files and configured options to loadEnv and propagates its boolean result.
Loop Summary

The supplied history contains one prior review thread and an explicit deferral. The current description records follow-up changes.

PR Inbox Meta
{
  "changeComplexity": "complex",
  "hasHumanAttention": true
}

Comment thread go.mod Resolved
@waltercacau

Copy link
Copy Markdown
Contributor Author

olive review

@waltercacau
waltercacau merged commit 70bb432 into main Nov 12, 2026
5 checks passed
@waltercacau
waltercacau deleted the initial-import branch November 12, 2026 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants