Skip to content

Migrate the Go module to Dang v2 - #39

Open
matipan wants to merge 1 commit into
dagger:mainfrom
matipan:dang-v2-local-discovery
Open

Migrate the Go module to Dang v2#39
matipan wants to merge 1 commit into
dagger:mainfrom
matipan:dang-v2-local-discovery

Conversation

@matipan

@matipan matipan commented Aug 3, 2026

Copy link
Copy Markdown

Summary

  • normalize module-selection strings produced by beta workspace settings
  • migrate the Go module and its e2e module to Dang v2
  • finish moving Go source and test-directory discovery onto the mounted workspace snapshot
  • remove DAGGER_GO_WORKSPACE_ID from module container definitions

Why

The include helper already supported indexing a mounted, content-addressed workspace snapshot, but test-directory discovery and per-directory include discovery still reconnected to Dagger through a serialized Workspace ID.

Workspace IDs are scoped to a client session. Embedding one in DAGGER_GO_WORKSPACE_ID changed the helper container definition on every invocation even when repository contents were unchanged, preventing downstream work from reusing cache across CLI sessions.

The local index now writes both include patterns and test-directory lists for every module in one pass. GoModule.testDirectories reads those outputs and passes the module's discovered inputs into each GoDirectory, so the active module path no longer needs an ambient workspace lookup or privileged nested execution for discovery.

The public behavior remains the same: module discovery, local replaces, Go directives, per-directory tests, lint, test, and generate retain their existing APIs and selection semantics.

Validation

  • go test ./... in helpers/go-includes
  • loaded the e2e Dang module with the beta engine
  • passed all existing e2e checks:
    • base-check
    • cgo-cxx-lint-check
    • discovery-check
    • generate-check
    • go-mod-replace-check
    • module-introspection-check
    • nested-module-directive-check
    • per-module-directive-check
    • selection-check
    • single-module-check

@matipan
matipan requested a review from shykes August 3, 2026 15:28
@matipan
matipan marked this pull request as ready for review August 3, 2026 15:29
@matipan
matipan requested review from grouville and kpenfound August 3, 2026 16:19
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.

1 participant