Repository navigation
Refactor envloader for base directories and restart - #3
Conversation
Olive Review: ✅ ApprovedPosted by: GitHub @olive-agent[bot] Review SummaryThe pre-release refactor adds explicit WithBaseDir path resolution and makes process restart the default after loading env files so package initialization can see the loaded values. Callers may need to update Bazel path handling or pass NoRestart(). End-to-end or performance testing evidence could not be verified from the PR description. Unique current findings: 0. Selected preexisting concerns: 0. 📣 Human Attention
Component WalkthroughLegend: green = new; blue = changed; gray = existing context; blue arrows = changed handoffs.
flowchart TD
N_entry["MustLoadEnv entry"]:::existing
N_load["Environment loading"]:::changed
N_reexec["Unix process restart"]:::new
N_entry --> N_load
N_load --> N_reexec
classDef new fill:#1a7f37,stroke:#04300f,color:#fff,stroke-width:2,fill-opacity:.8
classDef changed fill:#0b62c4,stroke:#032a5c,color:#fff,stroke-width:2,fill-opacity:.8
classDef existing fill:#4a5563,stroke:#10151a,color:#fff,stroke-width:2,fill-opacity:.8
linkStyle 1 stroke:#38bdf8,stroke-width:3
Loop SummaryTwo prior review rounds yielded four concerns with explicit disposition replies: three claim fixes and one accepts the current behavior. The latest fix claim references reviewed commit 696966d; these human claims require independent verification. PR Inbox Meta{
"changeComplexity": "complex",
"hasHumanAttention": true
} |
|
olive review |
| t.Run("EmptyFileListDoesNotNeedWorkingDirectory", func(t *testing.T) { | ||
| dir := t.TempDir() | ||
| t.Chdir(dir) | ||
| require.NoError(t, os.Remove(dir)) |
There was a problem hiding this comment.
[P2]
Skip the deleted-working-directory cases on Windows. Windows prevents deletion of the process's current directory, so this assertion and the equivalent assertion in AbsolutePathDoesNotNeedWorkingDirectory fail before exercising the loader. These tests are unconditional even though Windows remains supported with NoRestart().
There was a problem hiding this comment.
We are not currently running the test suite on Windows, only cross-compiling, so skipping the deleted-working-directory cases is not necessary right now. Leaving the tests unchanged.
|
olive review |
Summary
Refactors
envloaderbefore the first release:BUILD_WORKING_DIRECTORYhandling withWithBaseDir(dir). Empty/unset base directories fall back to the process working directory; absolute paths ignore the base.init()functions already ran see the new environment.NoRestart()for debuggers, tests, and Windows.ENV_LOADER_LOADED_ENVSguard,RequireAll(), missing-file behavior, load order, andgodotenv.Overloadsemantics.Validation
make testgofmt -l .is emptyGOOS=windows go test -c)