Repository navigation
generate: merge module changesets directly - #16
Merged
Merged
Conversation
grouville
approved these changes
Jul 29, 2026
Signed-off-by: Alex Suraci <[email protected]>
used for LSP setup, too much variance Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
otherwise it generates the fixture, which makes e2e fail Signed-off-by: Alex Suraci <[email protected]>
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.
What this is now
Earlier revisions of this PR carried a workaround: rebasing every module changeset onto the shared unstaged workspace before merging, because the engine's
Changeset.withChangesetsapplied git patches over a union of the inputs' before directories and assumed they share a common base. With per-module dependency staging, sibling changesets disagree on their befores, and the patch merge either duplicated repetitive generated code (two identicalAsVolumeblocks indagger.gen.go) or failed hunks outright.The engine now builds merge branches from changeset content rather than patches (dagger/dagger#13773), which removes the common-base requirement entirely. The workaround is gone, and this PR shrinks to a single commit that simplifies
generateon top of the reworked polyfill:PolyfillModuleSource.generatereturns aChangeset!directly — the.generate.changesre-diffing disappears.GoSdk.generatemerges module changesets directly:changeset.withChangesets(modules ... .map { ... .generate }). The fold ontopws.fork.changes(with its nested-generate caveats) and the{{isEmpty}}evaluation-forcing hack are gone — the engine'swithChangesetsnow computes paths in parallel and drops empty changesets itself.generateLocalDependencies), and its changeset still carries only the module's own files. The staged befores still diverge across siblings — that's now fine, because content already present in the merge base is a no-op instead of a double-apply.mod.dang: drops straypubmarkers on module-internal helpers, formatting.Blocked on
dagger.jsoncurrently pinspolyfill@fix-generate; that must go back topolyfill@mainwith a real pin before this lands.Verification
On dagger/dagger with an engine including dagger/dagger#13773: full-repo
dagger generate dagger-go-sdkusing this branch's Dang code applies cleanly, produces exactly one copy of the new API bindings (previously duplicated), is byte-identical to the output the workaround-based revision produced, compiles across all toolchains, and rerunning on a regenerated tree is a no-op.🤖 Generated with Claude Code