-
Notifications
You must be signed in to change notification settings - Fork 46
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
[Carry #50] separate command-line to a separate module #152
Merged
Conversation
This file contains 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 is a very quick attempt at "what this will look like") This repository provides both command-line utilities, and a module for external consumers. Currently, both are part of the same module; as a result, dependencies of both the module *and* the command-line utilities are listed in the repositories go.mod. This affects consumers of this project, because (due to go module's nature of dependency (version) resolution), those consumers will inherit all dependencies, or will be "forced" to use the same version of the CLI dependencies. This is a very quick attempt at separating the CLI utilities from the "module", by creating a separate go.mod (and module) for the CLI utilities. I'm not fond of the name (github.com/containerd/imgcrypt/cmd) for that module (possibly renaming to github.com/containerd/imgcrypt/cli would be slightly clearer). This change _will_ add some additional work when tagging releases; a separate tag should be created for the cli utilities (tagging as `cmd/vX.Y.Z`), and the "github.com/containerd/imgcrypt" dependency in the go.mod inside the cmd directory may need to be updated to reflect the latest version of the main module when tagging new releases (as the replace rule is non-transitional); something like: 1. update `github.com/containerd/imgcrypt` version in cmd/go.mod to "next release" 2. tag both `v<new release>` and `cmd/v<new version>` in tandem. CI / validation also needs to be updated to verify both `go.mod` and `go.sum` files are correct / up-to-date. Possibly checks should be added to make sure the main module is isolated from the cmd module (i.e., the "module" should not import any path from the cmd directory: the reverse is of course OK (and expected)). Finally; use of the 'vendor' directory may need to be discussed; it is common to only use a vendor directory for projects that produce binaries, but omit the vendor directory for "library" projects. In this case (if vendoring is still desired), the vendor directory should be removed from the root of the repository, and moved inside the `cmd` directory. Originally-from: Sebastiaan van Stijn <github@gone.nl> Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This was referenced Mar 28, 2024
mikebrow
approved these changes
Mar 28, 2024
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.
LGTM
thaJeztah
approved these changes
Apr 3, 2024
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.
LGTM, thanks!
stefanberger
approved these changes
Apr 4, 2024
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.
LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Carry:
Rebased and removed the entire
vendor/
dir for simplicity.