GitHub Tag Format for Multi-Module Go Repository #637
renuka-fernando
started this conversation in
General
Replies: 2 comments
-
|
+1 for the new format |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
+1 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Problem Statement
Our repository is a multi-module Go monorepo with several Go modules located in subdirectories:
The Issue with Current Tag Format
We currently use tags like:
gateway-v0.2.0platform-api-v0.0.2ai-gateway-v0.2.0This format does NOT work with Go's module system for modules that need to be imported as public dependencies.
Why This Matters: The SDK Module
The
sdkmodule (github.com/wso2/api-platform/sdk) is designed to be imported by:For external developers to import the SDK using standard Go tooling:
And run:
Go requires the tag to match the module path:
sdk/v0.3.0Go Module Versioning Rules for Subdirectories
From the Go Modules Reference:
Current Tags Analysis
go get?sdk/v0.3.0<module-path>/vX.Y.Zgateway-v0.2.0<name>-vX.Y.Zplatform-api-v0.0.2<name>-vX.Y.Zhelm-gateway-0.2.0<name>-X.Y.ZProposed Solution
For Public Go Modules (SDK)
Use the Go-required format:
<module-path>/vX.Y.ZFor Internal/Non-Importable Components
We have two options:
Option A: Keep Current Format
Continue using
<component>-vX.Y.Zfor components that are NOT meant to be imported as Go modules:Pros:
Cons:
Option B: Use Slash Format for Everything (Recommended)
Pros:
0.x.x- now is the best time to standardize before1.0.0Cons:
Recommendation
Adopt Option B: Use slash format (
<component>/vX.Y.Z) for all tags.Since all components are still at
0.x.x, migration cost is minimal. Standardizing now avoids:1.0.0Tag Format Summary
sdk/v0.3.0sdk/vX.Y.Zgateway-v0.2.0gateway/vX.Y.Zplatform-api-v0.0.2platform-api/vX.Y.Zhelm-gateway-0.2.0helm/gateway/vX.Y.Zgateway-operator-0.2.0gateway-operator/vX.Y.ZReferences
Beta Was this translation helpful? Give feedback.
All reactions