-
Notifications
You must be signed in to change notification settings - Fork 4
Drop the polyfill for native workspace APIs #14
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.
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
Open
grouville
wants to merge
1
commit into
dagger:main
Choose a base branch
from
grouville:polyfill-removal
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,13 @@ | ||
| { | ||
| "name": "mod-test-e2e", | ||
| "engineVersion": "v0.20.8", | ||
| "engineVersion": "v1.0.0-beta.10", | ||
| "sdk": { | ||
| "source": "dang" | ||
| }, | ||
| "dependencies": [ | ||
| { | ||
| "name": "mod-test", | ||
| "source": "../../../mod-test" | ||
| }, | ||
| { | ||
| "name": "polyfill", | ||
| "source": "github.com/dagger/polyfill@main" | ||
| } | ||
| ] | ||
| } |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,9 @@ | ||
| name = "sdk-sdk" | ||
| engineVersion = "v1.0.0-0" | ||
| engineVersion = "v1.0.0-beta.10" | ||
|
|
||
| [runtime] | ||
| source = "dang" | ||
|
|
||
| [[dependencies]] | ||
| name = "polyfill" | ||
| source = "github.com/dagger/polyfill@main" | ||
|
|
||
| [[dependencies]] | ||
| name = "mod-test" | ||
| source = "./mod-test" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,11 +20,11 @@ type SdkHarness { | |
| } | ||
|
|
||
| """ | ||
| Return the SDK module under test prepared by the workspace polyfill. | ||
| Return the SDK module under test from the native workspace API. | ||
| """ | ||
| pub sdkTarget(ws: Workspace!): SdkTarget! { | ||
| let module = sdkModule(ws) | ||
| target(module.workspaceView, module.sourceRootPath) | ||
| target(module.contextDirectory, module.sourceRootSubpath) | ||
| } | ||
|
|
||
| """ | ||
|
|
@@ -35,35 +35,35 @@ type SdkHarness { | |
| """ | ||
| pub contractView(ws: Workspace!): Directory! { | ||
| let module = sdkModule(ws) | ||
| let view = module.workspaceView | ||
| let view = module.contextDirectory | ||
|
|
||
| if (module.sourceRootPath == ".") { | ||
| if (module.sourceRootSubpath == ".") { | ||
| view | ||
| } else if (view.exists(module.sourceRootPath + "/dagger.json")) { | ||
| view.withFile("dagger.json", view.file(module.sourceRootPath + "/dagger.json")) | ||
| } else if (view.exists(module.sourceRootSubpath + "/dagger.json")) { | ||
| view.withFile("dagger.json", view.file(module.sourceRootSubpath + "/dagger.json")) | ||
| } else { | ||
| view.withFile("dagger-module.toml", view.file(module.sourceRootPath + "/dagger-module.toml")) | ||
| view.withFile("dagger-module.toml", view.file(module.sourceRootSubpath + "/dagger-module.toml")) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, we're not using the polyfill module is this function so why does it changes? is there a bug in the sdk-sdk module?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above |
||
| } | ||
| } | ||
|
|
||
| """ | ||
| Return the workspace-relative source root path of the SDK module under test. | ||
| """ | ||
| pub sourceRootPath(ws: Workspace!): String! { | ||
| sdkModule(ws).sourceRootPath | ||
| sdkModule(ws).sourceRootSubpath | ||
| } | ||
|
|
||
| """ | ||
| Return the SDK module at the workspace root. | ||
| """ | ||
| let sdkModule(ws: Workspace!): PolyfillModuleSource! { | ||
| let sdkModule(ws: Workspace!): ModuleSource! { | ||
| let configs = ws.directory("/", include: ["dagger.json", "dagger-module.toml"]) | ||
|
|
||
| if (configs.exists("dagger.json") == false and configs.exists("dagger-module.toml") == false) { | ||
| raise noSdkModuleMessage | ||
| } | ||
|
|
||
| polyfill.workspace(ws).moduleSource(".") | ||
| ws.moduleSource("/") | ||
| } | ||
|
|
||
| let noSdkModuleMessage: String! = "no SDK module detected at the workspace root. Run from an SDK module workspace, or pass one with -W <sdk-repo>" | ||
|
|
||
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand that change, it was already using the native API, why this part changes?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's surprising 😇
The polyfill usage is hidden in this line:
let sdkModule(ws: Workspace!): PolyfillModuleSource!So
workspaceViewandsourceRootPathwere fields from the polyfill wrapperPolyfillModuleSource.Now
sdkModulereturns a nativeModuleSource, whose equivalents arecontextDirectoryandsourceRootSubpath.No behavior change was intended, just converting the types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay lgtm then!