Skip to content

[backport-0.21] core: resolve GitRepository and GitRef user defaults - #15155

Merged
marcosnils merged 1 commit into
dagger:backport-0.21from
marcosnils:backport-0.21-git-user-defaults
Nov 11, 2026
Merged

marcosnils merged 1 commit into
dagger:backport-0.21from
marcosnils:backport-0.21-git-user-defaults

Conversation

@marcosnils

Copy link
Copy Markdown
Contributor

Reply by Claude, reviewed by Marcos

On 0.21, setting a GitRepository or GitRef argument from .env fails, while passing the same value as a flag works:

REPO=https://github.com/dagger/dagger-test-modules
resolve object ("GitRepository"): Select: Address has no such field: "gitrepository"

An object user default is resolved through the Address field named after its type. The field name was built with strings.ToLower(typename), which is only correct for one-word types such as Secret, File and Directory. For GitRepository and GitRef it selected gitrepository and gitref instead of gitRepository and gitRef. The same resolution serves workspace config settings.

This uses gqlFieldName(typename), as main has done since 79cf408. That change was part of the workspace artifacts work and was never backported.

Testing

TestUserDefaults/TestRemoteGitRepository and TestUserDefaults/TestRemoteGitRef set a GitRepository and a GitRef from .env, pinned to a fixed commit of dagger-test-modules.

  • Without the fix, both fail with Address has no such field: "gitrepository" / "gitref".
  • With the fix, they pass, together with the existing remote and local File and Directory tests:
dagger call engine-dev test --pkg=./core/integration --run='^TestUserDefaults/(TestRemoteGitRepository|TestRemoteGitRef|TestRemoteFile|TestRemoteDirectory|TestLocalFile|TestLocalDirectory)$'

@marcosnils
marcosnils requested a review from vito November 11, 2026 16:23
An object user default resolves its address through the Address field
named after the type. The field name was the type name in lower case,
so GitRepository and GitRef defaults selected gitrepository and gitref,
which do not exist, and failed with "Address has no such field". Use
the camel-cased field name, as main does since 79cf408.

Signed-off-by: Marcos Lilljedahl <[email protected]>
@marcosnils
marcosnils force-pushed the backport-0.21-git-user-defaults branch from a21dcac to 4af96f2 Compare November 11, 2026 16:47
@marcosnils
marcosnils merged commit 3a6e9b7 into dagger:backport-0.21 Nov 11, 2026
77 checks passed
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.

2 participants