GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [1.0-beta] Merge main (15884210ff) into 1.0-beta by dagger-codex[bot] · Pull Request #13327 · dagger/dagger

[1.0-beta] Merge main (15884210ff) into 1.0-beta #13327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
tiborvass merged 20 commits into 1.0-beta from codex/merge-main-into-1.0-beta
Jun 4, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

[1.0-beta] Merge main (15884210ff) into 1.0-beta #13327

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
f7ea195
fix: handle 1Password secrets with spaces (#13297)
matipan Jun 1, 2026
24b06e7
fix: allow empty setSecret name (#13304)
sipsma Jun 2, 2026
2452472
fix(core/dotenv): accept `export`-prefixed lines in .env files (#13293)
marcosnils Jun 2, 2026
6a7b3a7
fix incorrect artifact caching issue when releasing (#13285)
sipsma Jun 2, 2026
b2d43ba
fix(core): attach never-cached module function results (#13298)
sipsma Jun 2, 2026
41a7910
fix(engine): lease parent layer content for tarball export (#13307)
sipsma Jun 2, 2026
b720144
bump dang (#13306)
vito Jun 2, 2026
fae340c
fix(layercopy): materialize resolved parent dirs when writing through…
marcosnils Jun 2, 2026
219b696
Volatile vars (#13223)
alexcb Jun 2, 2026
0fd148e
Show root usage when dagger has no args
shykes May 27, 2026
81bb907
chore: prep for v0.21.4 (#13314)
matipan Jun 3, 2026
de85595
ci: bump default engine version to v0.21.3 (#13315)
matipan Jun 3, 2026
54f9811
chore: post-release during v0.21.4 (#13316)
matipan Jun 3, 2026
16e85ca
Container exists expand option (#13310)
alexcb Jun 3, 2026
6cfdcb4
fix(layercopy): follow source symlinks when copying directory content…
marcosnils Jun 4, 2026
316ca15
Fix snapshot owner lease attach/remove race (#13321)
sipsma Jun 4, 2026
20b2554
Simplify function call return handling (#13319)
sipsma Jun 4, 2026
1588421
chore: update daggerverse from 0.21.0 to 0.21.4 (#13328)
tiborvass Jun 4, 2026
a01677a
Merge main into 1.0-beta
tiborvass Jun 4, 2026
e45e7e4
Run dagger generate
tiborvass Jun 4, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Prev Previous commit
Next Next commit
fix(core/dotenv): accept export-prefixed lines in .env files (#13293)
Signed-off-by: Marcos Nils <[email protected]>
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@marcosnils
marcosnils authored Jun 2, 2026
commit 2452472d0083b1f14ce2e6c38344686e557105eb

There are no files selected for viewing

19 changes: 19 additions & 0 deletions 19 core/dotenv/dotenv.go
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ func NewGraphEvaluator(environ []string, systemLookup func(string) string, noUns

// parseEntry parses a line into a parsedEntry without expanding variables
func (g *GraphEvaluator) parseEntry(line string) (*parsedEntry, error) {
// Strip an optional leading `export` keyword. This is a widely supported
// dotenv convention (direnv, `set -a; . ./.env`, shell `source`, and most
// .env loaders), so we treat `export KEY=value` the same as `KEY=value`.
line = StripExportPrefix(line)

// Try fast path first for simple assignments
if idx := strings.Index(line, "="); idx != -1 {
key := line[:idx]
Expand Down Expand Up @@ -245,6 +250,7 @@ func AllRaw(environ []string) map[string]string {
if kv == "" {
continue // skip empty lines
}
kv = StripExportPrefix(kv)
name, value, _ := strings.Cut(kv, "=")
vars[name] = value
}
Expand Down Expand Up @@ -275,6 +281,7 @@ func Exists(environ []string, name string) bool {
if kv == "" {
continue // skip empty lines
}
kv = StripExportPrefix(kv)
k, _, _ := strings.Cut(kv, "=")
if k == name {
return true
Expand All @@ -286,6 +293,18 @@ func Exists(environ []string, name string) bool {
// simpleKeyRegexp checks if a key is a valid environment variable name
var simpleKeyRegexp = regexp.MustCompile(`^[A-Za-z_][A-Za-z0-9_]*$`)

// exportPrefixRegexp matches a leading `export` keyword (with trailing
// whitespace), as commonly used in .env files.
var exportPrefixRegexp = regexp.MustCompile(`^export\s+`)

// StripExportPrefix removes an optional leading `export` keyword from a dotenv
// line. This is a widely supported convention (direnv, `set -a; . ./.env`,
// shell `source`, and most .env loaders), so `export KEY=value` is treated the
// same as `KEY=value`.
func StripExportPrefix(line string) string {
return exportPrefixRegexp.ReplaceAllString(line, "")
}

// containsShellFeatures checks if a value contains shell features that require parsing
func containsShellFeatures(value string) bool {
for i, ch := range value {
Expand Down
47 changes: 47 additions & 0 deletions 47 core/dotenv/dotenv_test.go
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,53 @@ func TestAllExpansion(t *testing.T) {
"FOO": "a b c",
},
},
{
name: "export prefix",
environ: []string{
"export FOO=bar",
},
want: map[string]string{
"FOO": "bar",
},
},
{
name: "export prefix with quoted value",
environ: []string{
`export FOO="bar baz"`,
},
want: map[string]string{
"FOO": "bar baz",
},
},
{
name: "export prefix with expansion",
environ: []string{
"export FOO=bar",
"export BAZ=$FOO-baz",
},
want: map[string]string{
"FOO": "bar",
"BAZ": "bar-baz",
},
},
{
name: "export prefix with extra whitespace",
environ: []string{
"export FOO=bar",
},
want: map[string]string{
"FOO": "bar",
},
},
{
name: "key named export-like is not stripped",
environ: []string{
"exportable=yes",
},
want: map[string]string{
"exportable": "yes",
},
},
{
name: "empty line",
environ: []string{
Expand Down
3 changes: 3 additions & 0 deletions 3 core/envfile.go
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ func (ef *EnvFile) WithContents(contents string) (*EnvFile, error) {
if strings.TrimSpace(line) == "" {
continue
}
// Tolerate the common `export KEY=value` convention by stripping the
// leading `export` keyword before parsing.
line = dotenv.StripExportPrefix(strings.TrimSpace(line))
kv := strings.SplitN(line, "=", 2)
k := kv[0]
var v string
Expand Down
28 changes: 28 additions & 0 deletions 28 core/integration/envfile_test.go
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,34 @@ func (m *Dep) Bar(
require.Equal(t, "doodoo", string(decodeOutput), string(callOutput))
}

// Regression test for https://github.com/dagger/dagger/issues/13291: a `.env`
// file using the common `export KEY=value` convention must not break env file
// loading.
func (EnvFileSuite) TestExportPrefix(ctx context.Context, t *testctx.T) {
c := connect(ctx, t)
ef := c.File(".env", `export FOO=bar
export BAZ="qux quux"
export REF=$FOO-suffix
PLAIN=plain
`).AsEnvFile()

foo, err := ef.Get(ctx, "FOO")
require.NoError(t, err)
require.Equal(t, "bar", foo)

baz, err := ef.Get(ctx, "BAZ")
require.NoError(t, err)
require.Equal(t, "qux quux", baz)

ref, err := ef.Get(ctx, "REF")
require.NoError(t, err)
require.Equal(t, "bar-suffix", ref)

plain, err := ef.Get(ctx, "PLAIN")
require.NoError(t, err)
require.Equal(t, "plain", plain)
}

func (EnvFileSuite) TestUpdateVariableWithTheSameValue(ctx context.Context, t *testctx.T) {
c := connect(ctx, t)
ef := c.File(".env", "FOO=bar").AsEnvFile().
Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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.
You are visitor 01402809 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.