Skip to content

Drop the polyfill for native workspace APIs - #16

Draft
grouville wants to merge 1 commit into
dagger:mainfrom
grouville:polyfill-removal
Draft

Drop the polyfill for native workspace APIs#16
grouville wants to merge 1 commit into
dagger:mainfrom
grouville:polyfill-removal

Conversation

@grouville

Copy link
Copy Markdown
Member

Migrates this SDK off github.com/dagger/polyfill, onto the engine's own workspace APIs — part of dagger/dagger#13769 (tracking checklist there; engine PRs dagger/dagger#13854 and dagger/dagger#13855).

Same mechanical mapping as the go-sdk migration (findConfigDirs, fork, withNewDirectory with /-anchored paths, moduleSource(...).coremoduleSource(...), the polyfill's generategeneratedContextChangeset). Two spots worth a closer look:

  • generateAllModule folds per-module changesets through the empty changeset.withChangesets(...) builder — same shape as go-sdk — instead of onto a fork's empty changeset; the reason to avoid ws.changes (nested per-dependency generation) is unchanged and still commented.
  • this suite is what caught the reduced-generated-context artifact fixed in workspace: fork + cwd-measured changesets (polyfill removal, part 2) dagger#13855 (core: outside-cwd removals in a generated context are artifacts, not errors) — the e2e generate checks exercise exactly the nested per-dependency flow.

Verified locally against a dev engine built from the two engine PRs: dagger check46/48. The two that don't pass:

  • sdk-sdk:scaffolded-module-loads: the sdk-sdk contract checks install a release CLI inside their runner and therefore cannot load an SDK requiring the unreleased engine — the same red-until-release condition as CI itself.
  • e-2-e:generate:generate-all-check: one real open edge in the nested per-dependency generation flow — the merged changeset is missing the dependent module's sdk/index.ts. This suite already caught (and got fixed in workspace: fork + cwd-measured changesets (polyfill removal, part 2) dagger#13855) two engine-side interactions of the same flavor: outside-cwd removal artifacts of reduced generated contexts, and changeset merges dying when content removes .git. This last one looks like a sibling of those — the dependency's raw changeset carries reduced-context removal artifacts at the workspace root, and the octopus merge lets them swallow the dependent's additions. Tracked on stdlib: remove dependency on polyfill module dagger#13769; needs an engine-side look at how reduced generated contexts diff, rather than more SDK-side patching.

CI stays red until the engine release that ships these APIs exists. The engineVersion bump assumes v1.0.0-beta.10 — adjust if the release numbers differently. The bump and the dependency removal must land together: the version gate is what scopes the engine's new changeset rooting to migrated modules.

Same migration as go-sdk (dagger/dagger#13769): findConfigDirs, fork,
moduleSource and generatedContextChangeset are engine APIs now, and
the per-module generate no longer needs .changes on a polyfill fork —
the engine returns the changeset directly, already measured from the
caller's cwd past the engineVersion cutover.

Staging paths anchor at "/" because the native fork resolves relative
paths from the cwd, where the polyfill's took workspace-root paths.
The engineVersion bump and the dependency removal land together: the
version gate scopes the engine's new changeset rooting to migrated
modules.

Signed-off-by: Guillaume de Rouville <guillaume@dagger.io>
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