tanzu-framework icon indicating copy to clipboard operation
tanzu-framework copied to clipboard

tanzu-framework/cli/runtime module is not getting released

Open marckhouzam opened this issue 2 years ago • 2 comments

Bug description

The new github.com/vmware-tanzu/tanzu-framework/cli/runtime sub-module needs to be consumed by plugins outside of tanzu-framework. However, sub-modules in tanzu-framework are not being released according to Go import rules and therefore cannot be cleanly consumed.

The problem is that when tagging the repo with say v0.27.0, it seems submodules are not released along with the main module. This means that consumers that look for the new module github.com/vmware-tanzu/tanzu-framework/cli/runtime will not find a released version. Consumers will instead get the latest version off the main branch. This is a quality issue.

We can confirm the situation in pkg.go.dev as shown below:

  • notice the v0.27.0 version of github.com/vmware-tanzu/tanzu-framework at https://pkg.go.dev/github.com/vmware-tanzu/tanzu-framework
  • but notice the unreleased version for the sub-module github.com/vmware-tanzu/tanzu-framework/cli/runtime at https://pkg.go.dev/github.com/vmware-tanzu/tanzu-framework/cli/runtime

From what I can see in this submodule tutorial, submodules need to be tagged with a tag that looks like <submodule name>/v0.27.0 for them to be released e.g. https://github.com/go-modules-by-example/submodules/tags

Affected product area (please put an X in all that apply)

  • ( ) APIs
  • ( ) Addons
  • ( ) CLI
  • ( ) Docs
  • ( ) IAM
  • ( ) Installation
  • (x) Plugin
  • ( ) Security
  • ( ) Test and Release
  • ( ) User Experience
  • (x) Developer Experience

Expected behavior

The github.com/vmware-tanzu/tanzu-framework/cli/runtime module is released at the same time as tanzu-framework and can be imported by consumers.

Steps to reproduce the bug

In a plugin repo outside of Framework:

  • Updated go.mod file to use tanzu framework v0.26.0
  • Run go mod tidy
  • tanzu-framwork entry gets removed from mod file (that is ok)
  • new entry github.com/vmware-tanzu/tanzu-framework/cli/runtime v0.0.0-20221114195246-1db2c7ce587b gets added into the go.mod file (the entry is the latest available on the main branch at the moment go mod tidy is run) - This is not ok

Version (include the SHA if the version is not obvious)

Environment where the bug was observed (cloud, OS, etc)

Relevant Debug Output (Logs, manifests, etc)

marckhouzam avatar Nov 16 '22 20:11 marckhouzam

We might also need to tag below submodules as well because cli/runtime has dependency on them

replace (
	github.com/vmware-tanzu/tanzu-framework/apis/cli => ../../apis/cli
	github.com/vmware-tanzu/tanzu-framework/apis/config => ../../apis/config
)

anujc25 avatar Nov 18 '22 00:11 anujc25

For Using v0.28.0 Runtime sub module we need to import below

require (
         // CommitId of v0.28.0
	github.com/vmware-tanzu/tanzu-framework/cli/runtime v0.0.0-20230214111918-af087107ddc3
)

require (
	github.com/vmware-tanzu/tanzu-framework/apis/cli v0.0.0-20230214111918-af087107ddc3 // indirect
)

mpanchajanya avatar Feb 21 '23 23:02 mpanchajanya