esc
esc copied to clipboard
Split `esc/` and `esc/cmd` into separate modules.
These changes peel esc/cmd out of the esc module s.t. the latter has no dependency on pulumi/pulumi.
Unfortunately, the esc CLI itself does require a pulumi/pulumi dependency so that it can share credential management with the pulumi CLI.
These changes should at least simplify the dependency graph for pulumi/pulumi somewhat so that pulumi/pulumi/sdk can depend on esc without circularity.
Unfortunately, there is still circularity between esc/cmd and pulumi/pulumi/pkg. We could resolve this by splitting off yet another module that contains the CLI implementation but not the default implementations of various bits that refer to pulumi/pulumi/pkg. That would probably give us the following modules:
github.com/pulumi/esc<-- no pulumi dependenciesgithub.com/pulumi/esc/cmd<-- pkg/ and sdk/ dependenciesgithub.com/pulumi/esc/cmd/cli<-- sdk/ dependency
pulumi/pulumi/sdk could then freely depend on pulumi/esc and pulumi/pulumi/pkg could depend on github.com/pulumi/esc/cmd/cli, all without circularity.
The cost, of course, is a more complicated release process for esc, wherein the commit/tag flow becomes:
- tag
esc/v1.2.3 - update
esc/cmd/clito consumeesc/v1.2.3, then commit + tagesc/cmd/cli/v1.2.3 - update
esc/cmdto consumeesc/cmd/cli/v1.2.3, then commit + tagesc/cmd/v1.2.3
That said, that process is probably worth the simplicity of reasoning about dependencies.
Thoughts?
Thanks for digging into this, Pat!
pulumi/pulumi/sdkcould then freely depend onpulumi/escandpulumi/pulumi/pkgcould depend ongithub.com/pulumi/esc/cmd/cli, all without circularity.
This would be ideal. If others find it unpalatable, I hope we can at least consider the changes in this PR so that pulumi/pulumi/sdk can depend on esc without circularity.
That said, that process is probably worth the simplicity of reasoning about dependencies.
It's unfortunate that it complicates the release process, but it's likely worth it for the simpler dependencies. We can automate the release process to make it easier on ourselves.
Thanks for digging into this, Pat!
pulumi/pulumi/sdkcould then freely depend onpulumi/escandpulumi/pulumi/pkgcould depend ongithub.com/pulumi/esc/cmd/cli, all without circularity.This would be ideal. If others find it unpalatable, I hope we can at least consider the changes in this PR so that
pulumi/pulumi/sdkcan depend onescwithout circularity.
SG. I'll roll those changes into this PR.
That said, that process is probably worth the simplicity of reasoning about dependencies.
It's unfortunate that it complicates the release process, but it's likely worth it for the simpler dependencies. We can automate the release process to make it easier on ourselves.
Yeah I agree with that.
Agreed with what y'all have discussed. Unfortunate about the release process but fixing the circular dependency seems worth it.