Skip to content
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

Turn packages into modules for independent versioning #166

Open
ian-shim opened this issue Mar 28, 2024 · 4 comments
Open

Turn packages into modules for independent versioning #166

ian-shim opened this issue Mar 28, 2024 · 4 comments
Assignees

Comments

@ian-shim
Copy link
Contributor

Right now, the entire repository is versioned together.
If there is a desired patch for one package, but that version has an undesired update on another package, I cannot make an upgrade.
Ideally, each package is versioned separately, so that developers can upgrade specific packages.

@afkbyte afkbyte self-assigned this Mar 29, 2024
@afkbyte
Copy link
Contributor

afkbyte commented Mar 29, 2024

Hey! Would you want a go.work at root or something to generate a go.work including each of the modules?

This discussion for reference: golang/go#53502

@samlaf
Copy link
Collaborator

samlaf commented Mar 29, 2024

Good find @afkbyte . Didn't read through the whole issue, still confused as to what exactly is happening with the go.work file. The last message (golang/go#53502 (comment)) is saying it's needed for vscode to be able to identify the different go.mod files in the repo.

image

Not sure what the exact tradeoffs he's mentioning are, aka what's wrong with checking the go.work file into the repo. Are you aware of this @ian-shim ?

@samlaf samlaf changed the title Independent versioning across different packages Turn packages into modules for independent versioning Dec 4, 2024
@samlaf
Copy link
Collaborator

samlaf commented Dec 4, 2024

Coming back to this super old issue because I just randomly got more context on how golang does packaging/moduling/versioning.

Basically in golang modules are the unit of versioning: packages cannot be independently versioned. So I updated the title to reflect that this requires moving to modules.

Now as to whether we want to use a go.work or not, I think that is an independent question. That issue was closed and the main https://go.dev/ref/mod#workspaces updated with a recommendation to NOT commit the go.work (not sure about that vscode issue though):
image

From reading https://go.dev/blog/get-familiar-with-workspaces, it seems like go workspaces are more of a devex tool to help develop different modules together without having to go add replace directives in all of their respective go.mod files. So basically you can spin up go workspaces as you wish, just for development purposes. But if our modules in the sdk don't have that many dependencies, then we don't even need to use workspaces, we can just while developing go add some replace directives.

The aws sdk is an example of a multi-module repo that doesn't have a go.work checked in: https://github.com/search?q=repo%3Aaws%2Faws-sdk-go-v2%20go.mod&type=code

@shrimalmadhur
Copy link
Collaborator

I like the idea of breaking into modules. Rust sdk has similar models of crates. This might also help in defining better interface between modules and push us not to break.

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

No branches or pull requests

4 participants