Repository navigation
Conversation
Signed-off-by: Andrea Luzzardi <[email protected]>
5efce47 to
728e38d
Compare
There was a problem hiding this comment.
pyproject.toml is used by pip so it should be good. It's simply a new alternative to setup.py/
|
I think you already explained this to me at least once today, sorry... Why do we need "engine" to be a separate module? Couldn't we just keep all inside the same module, and call that module "the go SDK"? |
|
Have you tried the Go Workspace system? I don't know the support in VS Code, but I think gopls should support it. |
Signed-off-by: Andrea Luzzardi <[email protected]>
Signed-off-by: Andrea Luzzardi <[email protected]>
b9d085c to
3c643c2
Compare
Definitely bikeshedding: why not just |
vito
left a comment
There was a problem hiding this comment.
Interesting! I like the short and sweet SDK import this adds, but have some concerns:
- Will dependencies of the Dagger engine (e.g. Bass until the progress API is finished) have to do something tricky to deal with the
replaceline? This has been a huge pain point for Buildkit->Bass and Buildkit->Dagger. - Will this accidentally make it possible to depend on a different version of the SDK + engine, since they're independently versioned modules?
- Will Dagger contributors and/or SDK authors be confused by this? I don't think I've seen this sort of scheme before. I could easily see someone assuming
go.dagger.io/daggeris the same asgithub.com/dagger/dagger, and normally a repo indicates its "correct" import, but now both are actually valid and mean different things.
Also taking a step back: are there any other motivations for this besides the shorter SDK import?
There was a problem hiding this comment.
I know you mentioned it already, but I'm worried about adding this because dealing with Buildkit's replace has been pretty irritating with Bass. Most things shouldn't be importing Dagger itself, so maybe it's not a big deal, but it'd be good to know how this works/breaks.
Maybe we can apply this change to a throwaway fork that we can tag a fake release for? I've wanted a similar playpen for testing the pkg.go.dev docs + example rendering. Not sure how much work that'd be though with the vanity URL setup.
There was a problem hiding this comment.
Part of what I need to test, I was hoping this would work out of the box without importers having to change anything since it's a replace into the same git repository. But I might be day-dreaming?
There was a problem hiding this comment.
replace rules are not preserved for consumers, and only work locally.
There's a risk there as well; if you use a replace rule, you'll get a "different view of the world" as others. ideally your tests would run both with replace rule, and without (to verify code works both with code from this repo, and from the actual module that's referenced); see moby/sys#68 (but it's messy).
There was a problem hiding this comment.
It'd be nice if we used this as an opportunity to get rid of this replace line to address #3391 but I guess we still need it because we embed the engine.
There was a problem hiding this comment.
Yes, without this SDK won't run. The problem bubbles down to everything importing buildkit (including the SDK)
There was a problem hiding this comment.
@vito I haven't given up hope of solving #3391 while still importing buildkit :) I think @aluzzardi is investigating options.
|
LGTM, it's much nicer to use this import path for Go, it took me a while to find the right import when I tried the SDK the first time. |
Are you referring to this? #3391
My understanding is that we don't want anybody to have a depending on the "engine" go package. So I'm worried about accidentally depending on "engine" (regardless of version).
Same question. I think we should only expose one Go import to the outside world: the SDK. The rest should be a hidden implementation detail. |
Just a convention. We could use
I definitely prefer the shorter one; the trade-off is it moves the work on the landing page and there's no easy way to undo without breaking clients. |
We could keep it as it is today and then colloquially call that module the "Go SDK", but the import paths would still look like today:
The main advantages of using different go.mods are:
However, need to double check all the points @vito raised -- it might not even be doable. |
|
For the topic, I would say that I would try to avoid replace as much as possible. They should be used only locally if possible.
On the
For the non importability of the engine, we should just put everything into My favorite in terms of URL style and semantics would be: It could also be: but then, it would make the LSP not work great (finishing by The not so great alternative would be to make the package explicit as well: import "go.dagger.io/daggersdk"No alias, and the package name is explicit. But then, Maybe Sorry for the bikeshedding, I just add more to the issue. |
Could this handled at the CDN layer? For example with a cloudflare or fastly worker? That way it would decouple that logic from the landing page, reducing the risk of weird interference or breaking it when we change CMS. I'm only proposing this since you mention that you also like the shorter option :) |
Short version: Yes, let's do that. Example: The CDN layer suggestion above illustrates this. SPA providers (e.g. Netlify, Vercel) are NOT meant to run behind a CDN. They already have a CDN (I believe Netlify runs behind AWS CloudFront) and adding another one on top messes up with distribution (e.g. end up with stale pages on deploy because the cache purge logic is handled by their CDN, not ours which ends double caching stale deploys). Using a different sub-domain completely isolates the scope (e.g. landing on Vercel, distribution on S3 -- doesn't matter). That being said, I think at our size we can manage. |
Current state of things:
go.dagger.iopoints to the GitHub org (e.g.github.com/dagger)go.dagger.io/daggergo.dagger.io/dagger/sdk/go/daggerProposal:
go.dagger.io/dagger-- bikeshedding welcome)replaceVisual Representation
Downsides:
replacedirective works well, especially when tag-released