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

downgrade go-difflib and go-spew to tagged releases #5830

Merged

Conversation

thaJeztah
Copy link
Contributor

@thaJeztah thaJeztah commented Jan 3, 2025

relates to:

commit d35edbf updated these dependencies to untagged versions. The diff in both dependencies show that there's no code changes, and it's unlikely for those modules to do new releases.

Unfortunate, because of that change all projects depending on kubernetes or any of it's modules now had to upgrade to unreleased versions of these.

This patch reverts those updates (but it may take some time before all other projects can be reverted).

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 3, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @thaJeztah!

It looks like this is your first PR to kubernetes-sigs/kustomize 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kustomize has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 3, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @thaJeztah. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 3, 2025
@dims
Copy link
Member

dims commented Jan 4, 2025

/ok-to-test

@koba1t yes please to the downgrade proposed by @thaJeztah - we should try to use as much of tagged releases as possible unless absolutely necessary (for things in our control!). If we do use untagged release, we should treat that as tech debt and try to close it by working with those repos that we are using (by trying to get them to tag things for us to use)

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 4, 2025
thaJeztah added a commit to thaJeztah/containerd that referenced this pull request Jan 4, 2025
These dependencies were updated to "master" in some modules we depend on,
but have no code-changes since their last release. Unfortunately, this also
causes a ripple effect, forcing all users of the containerd module to also
update these dependencies to an unrelease / un-tagged version.

Both these dependencies will unlikely do a new release in the near future,
so exclude these versions so that we can downgrade to the current release.

For additional details, see [this PR][1] and links mentioned in it.

[1]: kubernetes-sigs/kustomize#5830 (comment)

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Copy link
Member

@stormqueen1990 stormqueen1990 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 4, 2025
@koba1t
Copy link
Member

koba1t commented Jan 4, 2025

/assign

@thaJeztah
Copy link
Contributor Author

For reviewers; make sure I did the changes correctly; I wasn't sure what the correct procedure was, so my steps were;

  • did a "find and replace" for the unwanted versions to revert them
  • ran make test-go-mod (which I saw did a go mod tidy for all modules)

I assume CI should flag if I did it wrong, but just in case 😅

@koba1t
Copy link
Member

koba1t commented Jan 4, 2025

Looks like this problem was introduced at this commit in PR #5541.
The commit d35edbf was just synced version for every go.mod file.

@liggitt was mentioned this dependency. Maybe I should have downgraded this at this time.
kubernetes/kubernetes#124217 (comment)

@koba1t
Copy link
Member

koba1t commented Jan 4, 2025

HI @thaJeztah!

Could you try to execute make workspace-sync command?

kustomize/Makefile

Lines 181 to 185 in 214aa2a

# Pushes dependencies in the go.work file back to go.mod files of each workspace module.
.PHONY: workspace-sync
workspace-sync:
go work sync
./hack/doGoMod.sh tidy

That syncs go module version for every go.mod and go.sum files in this repo.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
commit d35edbf updated these dependencies
to untagged versions. The diff in both dependencies show that there's no
code changes, and it's unlikely for those modules to do new releases.

Unfortunate, because of that change all projects depending on kubernetes
or any of it's modules now had to upgrade to unreleased versions of
these.

This patch reverts those updates (but it may take some time before
all other projects can be reverted).

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah
Copy link
Contributor Author

Ah, right, I see the problem, and that explains why that other PR chose to upgrade it even though it was not a dependency of protobuf.

And digging deeper, it's indeed related to spf13/viper; there's two modules that depend on that;

  • hack
  • cmd/gorepomod (through the hack module)
cd hack
go mod graph | grep ' github.com/davecgh/[email protected]'
sigs.k8s.io/kustomize/cmd/gorepomod github.com/davecgh/[email protected]
sigs.k8s.io/kustomize/hack github.com/davecgh/[email protected]
github.com/spf13/[email protected] github.com/davecgh/[email protected]


cd ../cmd/gorepomod
go mod graph | grep ' github.com/davecgh/[email protected]'
sigs.k8s.io/kustomize/cmd/gorepomod github.com/davecgh/[email protected]
sigs.k8s.io/kustomize/hack github.com/davecgh/[email protected]
github.com/spf13/[email protected] github.com/davecgh/[email protected]

So the actual commit introducing this seems to be ed2ca23 which brings us back to the PR introducing it there (spf13/viper#1574), and the merged, but not yet released fix;

If all modules must be at the same version, I can add an exclude to the hack/go.mod. This is one of the rare occasions where exclude works, because we knoww both go-spec and go-difflib are unlikely to receive updates in the near future, so we can exluce these specific commits / pseudo-versions, which should downgrade them to their latest release without having to upgrade viper and other things.

@thaJeztah thaJeztah force-pushed the downgrade_tagged_releases branch from b6ef55b to 6bcbf9d Compare January 4, 2025 19:44
@k8s-ci-robot
Copy link
Contributor

This PR has multiple commits, and the default merge method is: merge.
You can request commits to be squashed using the label: tide/merge-method-squash

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 4, 2025
golang.org/x/sys v0.23.0 // indirect
golang.org/x/sys v0.28.0 // indirect
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed an extra commit to do a workspace sync before the downgrade, because I got a diff that was unrelated to the downgrade

Comment on lines +5 to +15
exclude (
// These dependencies were updated to "master" in spf13/viper, but have no
// code-changes since the last release. While a fix was merged in viper,
// it's not released yet, and it may take time before other (indirect)
// dependencies also downgraded.
//
// Exclude these versions so that go modules picks their latest release
// before that. For additional details, see; https://github.com/kubernetes-sigs/kustomize/pull/5830
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a exclude in this module

Comment on lines +5 to +15
exclude (
// These dependencies were updated to "master" in spf13/viper, but have no
// code-changes since the last release. While a fix was merged in viper,
// it's not released yet, and it may take time before other (indirect)
// dependencies also downgraded.
//
// Exclude these versions so that go modules picks their latest release
// before that. For additional details, see; https://github.com/kubernetes-sigs/kustomize/pull/5830
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here (there other module depending on viper)

k8s-infra-cherrypick-robot pushed a commit to k8s-infra-cherrypick-robot/containerd that referenced this pull request Jan 6, 2025
These dependencies were updated to "master" in some modules we depend on,
but have no code-changes since their last release. Unfortunately, this also
causes a ripple effect, forcing all users of the containerd module to also
update these dependencies to an unrelease / un-tagged version.

Both these dependencies will unlikely do a new release in the near future,
so exclude these versions so that we can downgrade to the current release.

For additional details, see [this PR][1] and links mentioned in it.

[1]: kubernetes-sigs/kustomize#5830 (comment)

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@skitt
Copy link
Member

skitt commented Jan 6, 2025

Thanks for taking care of this, I was waiting for a viper release but it makes sense to add excludes until that happens.

@skitt
Copy link
Member

skitt commented Jan 6, 2025

#5832 shows what a viper bump would look like. I vote for getting this in first so we don’t have to wait for the release (see spf13/viper#1971).

@thaJeztah
Copy link
Contributor Author

Thanks for looking @skitt - I saw you went down the same rabbit hole as I did 😂 🫶 (but I missed the viper <-> kustomize connection).

Yeah, my main intent was to try and cut the cycle with "minimal" changes, knowing that k8s, containerd, moby have a very complex dependency tree; I opened a similar PR in containerd to do the same / with the same intent.

@liggitt
Copy link
Contributor

liggitt commented Jan 6, 2025

/lgtm
/approve

(note to observers, the only reason the exclude directives are an ok resolution to the viper issue is that the two modules using them are not ones we expect to become transitive dependencies for any other modules)

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 6, 2025
@koba1t koba1t added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Jan 7, 2025
@koba1t
Copy link
Member

koba1t commented Jan 7, 2025

I believe we should not use exclude directives basically because it could potentially break dependencies.
However, the revert is being done on the https://github.com/spf13/viper side. I think it is acceptable to use exclude only until that release.
spf13/viper#1861

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: koba1t, liggitt, thaJeztah

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 7, 2025
@k8s-ci-robot k8s-ci-robot merged commit 2867f35 into kubernetes-sigs:master Jan 7, 2025
10 checks passed
@thaJeztah
Copy link
Contributor Author

I believe we should not use exclude directives basically because it could potentially break dependencies. However, the revert is being done on the https://github.com/spf13/viper side. I think it is acceptable to use exclude only until that release. spf13/viper#1861

/approve

Yeah, I usually would avoid replace as well, but in both these cases there were no code-changes (only changes in README and their CI config), so excluding these specific commits would not impact any module depending on it;

@thaJeztah thaJeztah deleted the downgrade_tagged_releases branch January 7, 2025 10:13
thaJeztah added a commit to thaJeztah/buildkit that referenced this pull request Jan 14, 2025
These dependencies were updated to "master" in some modules we depend on,
but have no code-changes since their last release. Unfortunately, this also
causes a ripple effect, forcing all users of the containerd module to also
update these dependencies to an unrelease / un-tagged version.

Both these dependencies will unlikely do a new release in the near future,
so exclude these versions so that we can downgrade to the current release.

For additional details, see [this PR][1] and links mentioned in it.

[1]: kubernetes-sigs/kustomize#5830 (comment)

Signed-off-by: Sebastiaan van Stijn <[email protected]>
thaJeztah added a commit to thaJeztah/docker that referenced this pull request Jan 14, 2025
These dependencies were updated to "master" in some modules we depend on,
but have no code-changes since their last release. Unfortunately, this also
causes a ripple effect, forcing all users of the containerd module to also
update these dependencies to an unrelease / un-tagged version.

Both these dependencies will unlikely do a new release in the near future,
so exclude these versions so that we can downgrade to the current release.

For additional details, see [this PR][1] and links mentioned in it.

[1]: kubernetes-sigs/kustomize#5830 (comment)

Signed-off-by: Sebastiaan van Stijn <[email protected]>
thaJeztah added a commit to thaJeztah/buildkit that referenced this pull request Jan 14, 2025
These dependencies were updated to "master" in some modules we depend on,
but have no code-changes since their last release. Unfortunately, this also
causes a ripple effect, forcing all users of the containerd module to also
update these dependencies to an unrelease / un-tagged version.

Both these dependencies will unlikely do a new release in the near future,
so exclude these versions so that we can downgrade to the current release.

For additional details, see [this PR][1] and links mentioned in it.

[1]: kubernetes-sigs/kustomize#5830 (comment)

Signed-off-by: Sebastiaan van Stijn <[email protected]>
thaJeztah added a commit to thaJeztah/docker that referenced this pull request Jan 14, 2025
These dependencies were updated to "master" in some modules we depend on,
but have no code-changes since their last release. Unfortunately, this also
causes a ripple effect, forcing all users of the containerd module to also
update these dependencies to an unrelease / un-tagged version.

Both these dependencies will unlikely do a new release in the near future,
so exclude these versions so that we can downgrade to the current release.

For additional details, see [this PR][1] and links mentioned in it.

[1]: kubernetes-sigs/kustomize#5830 (comment)

Signed-off-by: Sebastiaan van Stijn <[email protected]>
thaJeztah added a commit to thaJeztah/docker that referenced this pull request Jan 14, 2025
These dependencies were updated to "master" in some modules we depend on,
but have no code-changes since their last release. Unfortunately, this also
causes a ripple effect, forcing all users of the containerd module to also
update these dependencies to an unrelease / un-tagged version.

Both these dependencies will unlikely do a new release in the near future,
so exclude these versions so that we can downgrade to the current release.

For additional details, see [this PR][1] and links mentioned in it.

[1]: kubernetes-sigs/kustomize#5830 (comment)

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@dims
Copy link
Member

dims commented Jan 15, 2025

@koba1t thank you! Done! kubernetes/kubernetes#129622

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants