Repository navigation
fix: preserve dotenv declaration order - #3078
Open
satya-sudo wants to merge 1 commit into
Open
satya-sudo wants to merge 1 commit into
satya-sudo wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #1847
Preserve dotenv declaration order when loading global and task-level environment
files. MIT liscense is added , The existing loaders copy godotenv's plain Go map into Task's ordered
variable store, losing declaration order. This makes nested global dotenv
{{.VAR}}references resolve inconsistently between runs.Adapt the godotenv v1.5.1 parser into an internal package backed by the existing
ordered-map dependency, Both loaders use
this reader. Dollar expansion, quotes, parse errors, optional missing files and
first-file-wins precedence remain unchanged. No new dependency is added and no
public API is introduced.
Validation:
go test ./...golangci-lint runusing the pinned v2.14.0go build -o bin/task ./cmd/taskand run the nested-path fixture50 times; parser tests cover syntax, quoting, multiline values, CRLF,
duplicate keys, dollar expansion and error compatibility.
AI assistance was used to prepare tests and validation.
Checklist