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

Use semantic import versioning for published staging repos #72638

Open
nikhita opened this issue Jan 7, 2019 · 30 comments
Open

Use semantic import versioning for published staging repos #72638

nikhita opened this issue Jan 7, 2019 · 30 comments
Labels
area/code-organization Issues or PRs related to kubernetes code organization area/release-eng Issues or PRs related to the Release Engineering subproject kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/release Categorizes an issue or PR as relevant to SIG Release.
Projects

Comments

@nikhita
Copy link
Member

nikhita commented Jan 7, 2019

Published staging repos like kubernetes/api, etc have tags like kubernetes-1.13.1 which correspond to the v1.13.1 tag in kubernetes/kubernetes. Due to the kubernetes- prefix, tools like dep don't pick up the new version.

We could start using semantic versioning for tags in published repos as well. One way to do that (as pointed by @sttts on slack) is to have the tags as 13.0.1. This is also a faithful representation of our compatibility guarantees.

This would require a change to the publishing-bot.

/sig api-machinery
/sig release
/area release-infra
/cc @sttts @pohly @lavalamp @deads2k @liggitt

@nikhita nikhita added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 7, 2019
@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/release Categorizes an issue or PR as relevant to SIG Release. area/release-eng Issues or PRs related to the Release Engineering subproject labels Jan 7, 2019
@pohly
Copy link
Contributor

pohly commented Jan 7, 2019

I understand that each new Kubernetes release must bump the major version of the mirrored repos, because in each major release new features might have been added and there might have been breaking API changes.

Is that what is meant with the compatibility guarante, i.e. it is not about the compatibility of some Kubernetes client built using these repos and the next Kubernetes release?

I'm fine with using 13.0.1, I'm just trying to understand.

@neolit123
Copy link
Member

neolit123 commented Jan 7, 2019

repos like kubernetes/api, etc have tags like kubernetes-1.13.1 which correspond to the v1.13.1 tag in kubernetes/kubernetes

this ain't good.

is to have the tags as 13.0.1

and it will break once k8s 2.0.0 is out?

@pohly
Copy link
Contributor

pohly commented Jan 7, 2019

When k8s 2.0.0 comes along, the mirrored repos can switch to 100.0.0 and then increment major by one for following releases.

@fedebongio
Copy link
Contributor

/cc @caesarxuchao

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 7, 2019
@nikhita
Copy link
Member Author

nikhita commented Apr 9, 2019

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 9, 2019
@justaugustus justaugustus added this to Backlog in SIG Release Apr 28, 2019
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 8, 2019
@neolit123
Copy link
Member

We could start using semantic versioning for tags in published repos as well. One way to do that (as pointed by sttts on slack) is to have the tags as 13.0.1. This is also a faithful representation of our compatibility guarantees.

one question i had there is what happens once the k8s MAJOR becomes 2.

@neolit123
Copy link
Member

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 8, 2019
@nikhita
Copy link
Member Author

nikhita commented Jul 9, 2019

one question i had there is what happens once the k8s MAJOR becomes 2.

I believe the idea is v215.0.1 for v2.15.1 of k/k. cc @sttts

@nikhita
Copy link
Member Author

nikhita commented Jul 9, 2019

xref kubernetes/publishing-bot#196

@neolit123
Copy link
Member

given k/k is not following semver directly (breaking api changes for MINOR), i don't see why we should diverge the staging repos to comply with semver and have different tags - i.e. why not simply do 1to1 mapping and have breaking API changes in MINORs there too?

@nikhita
Copy link
Member Author

nikhita commented Jul 9, 2019

why not simply do 1to1 mapping and have breaking API changes in MINORs there too?

k/k is not expected to be imported directly so it doesn't matter if it doesn't respect semver. However, the published repos are expected to be imported and if we want to use versioned imports for it, we need to respect semver because versioned imports will have the major version in the import paths. And users will be expected to update their import paths only when there are breaking changes.

@neolit123
Copy link
Member

i see, so it's a problem with the semantic MAJOR imports go does.
in any case, v215.0.1 or 15.0.1 will surely end up as being confusing.

@pohly
Copy link
Contributor

pohly commented Jul 9, 2019

This leads to the next question: will the published packages use versioned imports themselves?

If I import one package, the expectation is that it imports the correct version of all its dependencies.

@neolit123
Copy link
Member

neolit123 commented Jul 9, 2019

if someone starts doing v15/ imports it means they have to update their imports on a much higher rate because this v15 maps to a MINOR behind the lines that updates every 3 months.

the diffs for such changes will be big and frequent.

versioned imports have the benefits of mixing APIs and code from different MAJORs, but do we have use cases for that outside of core (v1)? the alternative the users have here is pinning at the go.mod side, which is certainly less flexible, but preferred in my opinion given the k8s (k/k) versioning.

@nikhita
Copy link
Member Author

nikhita commented Jul 9, 2019

If I import one package, the expectation is that it imports the correct version of all its dependencies.

Yes, this is the intention.

if someone starts doing v15/ imports it means they have to update their imports on a much higher rate because this v15 maps to a MINOR behind the lines that updates every 3 months.

This is true, such is the curse of versioned imports and a faster release cycle. :)

Experimenting in kubernetes/publishing-bot#196 to figure out how disruptive versioned imports could be.

versioned imports have the benefits of mixing APIs and code from different MAJORs, but do we have use cases for that outside of core (v1)?

Honestly, I'm not sure how useful combining different major versions will be for our repos since a bunch of them use global variables and things can quickly get 🔥 with them. I think the biggest benefit will be to seamlessly work with go modules.

Having said that, we will publish two tags for each tag of k/k - one with versioned imports and one without them.

@dims
Copy link
Member

dims commented Jul 9, 2019

@liggitt @sttts WDYT?

@nikhita
Copy link
Member Author

nikhita commented Jul 9, 2019

xref kubernetes/client-go#631

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 7, 2019
@dims
Copy link
Member

dims commented Oct 28, 2019

/area code-organization

@k8s-ci-robot k8s-ci-robot added the area/code-organization Issues or PRs related to kubernetes code organization label Oct 28, 2019
@dims
Copy link
Member

dims commented Oct 28, 2019

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 28, 2019
@liggitt liggitt changed the title Use semantic versioning for published staging repos Use semantic import versioning for published staging repos Oct 28, 2019
@k8s-ci-robot
Copy link
Contributor

@nikhita: The label(s) area/release-infra cannot be applied. These labels are supported: api-review, community/discussion, community/maintenance, community/question, cuj/build-train-deploy, cuj/multi-user, platform/aws, platform/azure, platform/gcp, platform/minikube, platform/other

In response to this:

Published staging repos like kubernetes/api, etc have tags like kubernetes-1.13.1 which correspond to the v1.13.1 tag in kubernetes/kubernetes. Due to the kubernetes- prefix, tools like dep don't pick up the new version.

We could start using semantic versioning for tags in published repos as well. One way to do that (as pointed by @sttts on slack) is to have the tags as 13.0.1. This is also a faithful representation of our compatibility guarantees.

This would require a change to the publishing-bot.

/sig api-machinery
/sig release
/area release-infra
/cc @sttts @pohly @lavalamp @deads2k @liggitt

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 26, 2020
@nikhita
Copy link
Member Author

nikhita commented Jan 27, 2020

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 27, 2020
@liggitt liggitt added the lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. label Jan 27, 2020
@nikhita
Copy link
Member Author

nikhita commented Sep 22, 2020

/priority important-longterm

@k8s-ci-robot k8s-ci-robot added the priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. label Sep 22, 2020
@justaugustus
Copy link
Member

@nikhita -- Is this still relevant?

@xmudrii
Copy link
Member

xmudrii commented Apr 6, 2021

Currently, there are no plans for implementing this. It has been decided to leave the issue open to avoid duplicates. Ref: https://kubernetes.slack.com/archives/CJH2GBF7Y/p1600779436038700?thread_ts=1600768354.032500&cid=CJH2GBF7Y

@pohly
Copy link
Contributor

pohly commented Apr 6, 2021

I vaguely remember a plan (or at least the intention) to ensure that different tags really reference different commits. Do I remember correctly and is that still planned even if the bigger changes around semantic versioning don't get implemented?

Right now it can happen that v0.20.0 and v0.21.0-beta.1 (or so - I'm making this specific example up) reference the same commit if nothing in the code changed. This becomes confusing during code review because then go get foo@v0.20.0 records foo as being imported from v0.21.0-beta.1 in go.mod.

@justaugustus
Copy link
Member

@kubernetes/publishing-bot-reviewers -- is this still something we'd like to pursue?

@puerco puerco moved this from Untriaged to Triaged/backlog in SIG Release Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/code-organization Issues or PRs related to kubernetes code organization area/release-eng Issues or PRs related to the Release Engineering subproject kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/release Categorizes an issue or PR as relevant to SIG Release.
Projects
No open projects
SIG Release
  
Triaged/backlog
Development

No branches or pull requests

10 participants