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

fix: add v2 to module path #8169

Merged
merged 8 commits into from
Dec 15, 2022

Conversation

sethrylan
Copy link
Contributor

@sethrylan sethrylan commented Nov 29, 2022

Fixes: #8161

Description

This PR updates the module path to include v2.

Go modules treat v0 and v1 with relaxed versioning requirements. Incrementing to v2 asks for a new module path:

A major version update to a number higher than v1 will also have a new module path. That’s because the module path will have the major version number appended

In skaffold's case, we need module github.com/GoogleContainerTools/skaffold/v2 v2.0.2 so that go get github.com/GoogleContainerTools/skaffold/[email protected] will work.

Go intends for the module path to prevent unintentionally upgrading to a new major version. By adding the version to the module path, developers must deliberately import breaking changes.

I realize that few projects have this issue, because few import the skaffold packages. We do have such a project, and we're looking forward to importing the v2 packages.

@sethrylan sethrylan reopened this Nov 29, 2022
@codecov
Copy link

codecov bot commented Nov 29, 2022

Codecov Report

Merging #8169 (c3db0fe) into main (290280e) will decrease coverage by 4.36%.
The diff coverage is 55.03%.

@@            Coverage Diff             @@
##             main    #8169      +/-   ##
==========================================
- Coverage   70.48%   66.11%   -4.37%     
==========================================
  Files         515      601      +86     
  Lines       23150    29483    +6333     
==========================================
+ Hits        16317    19494    +3177     
- Misses       5776     8528    +2752     
- Partials     1057     1461     +404     
Impacted Files Coverage Δ
cmd/skaffold/app/cmd/completion.go 13.04% <0.00%> (-1.25%) ⬇️
cmd/skaffold/app/cmd/config/list.go 65.21% <ø> (ø)
cmd/skaffold/app/cmd/config/set.go 88.72% <ø> (ø)
cmd/skaffold/app/cmd/config/util.go 54.28% <ø> (ø)
cmd/skaffold/app/cmd/credits.go 100.00% <ø> (ø)
cmd/skaffold/app/cmd/credits/export.go 0.00% <0.00%> (ø)
cmd/skaffold/app/cmd/deploy.go 40.90% <0.00%> (-12.94%) ⬇️
cmd/skaffold/app/cmd/generate_pipeline.go 60.00% <ø> (ø)
cmd/skaffold/app/cmd/inspect_modules.go 65.00% <ø> (ø)
cmd/skaffold/app/cmd/inspect_profiles.go 66.66% <ø> (ø)
... and 406 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@sethrylan
Copy link
Contributor Author

Merging #8169 (1db43b1) into main (290280e) will decrease coverage by 4.24%.

Codecov seems to be comparing to an old commit (290280e was merged over a year ago). Other PRs show the same coverage decrease, so I think this is not related to my module path change.

@aaron-prindle, is there anything else I need to do for this PR?

@ericzzzzzzz ericzzzzzzz added the kokoro:run runs the kokoro jobs on a PR label Nov 29, 2022
@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label Nov 29, 2022
@ericzzzzzzz ericzzzzzzz added the kokoro:force-run forces a kokoro re-run on a PR label Nov 29, 2022
@kokoro-team kokoro-team removed the kokoro:force-run forces a kokoro re-run on a PR label Nov 29, 2022
@aaron-prindle
Copy link
Contributor

aaron-prindle commented Dec 1, 2022

@sethrylan thanks for flagging and submitting this. I think the PR is good as is w/ no changes, I am holding off merging until after our next minor release - v2.1.0 ~Dec 7th. As this touches so many files and I want extra time to make sure that no one downstream somehow was relying on our incorrect convention prior. Lmk if for some reason you believe this should be expedited, thanks

EDIT: Sorry I just saw:

I realize that few projects have this issue, because few import the skaffold packages. We do have such a project, and we're looking forward to importing the v2 packages.

I plan on merging this right after Dec 7th, will that work for your team?

@sethrylan
Copy link
Contributor Author

I plan on merging this right after Dec 7th, will that work for your team?

Yes, that works great. Thank you for the quick review, and let me know if there's anything else for this PR.

@sethrylan
Copy link
Contributor Author

@aaron-prindle, I've merged the latest commits from main to this branch, and updated the .bat file I missed. It might be good to re-run CI to validate.

@aaron-prindle
Copy link
Contributor

Sorry for the delay, our next release was pushed until tomorrow - 12/14/2022. Will get to this by end of this week, sorry for any inconvenience

@aaron-prindle aaron-prindle added the kokoro:run runs the kokoro jobs on a PR label Dec 15, 2022
@kokoro-team kokoro-team removed the kokoro:run runs the kokoro jobs on a PR label Dec 15, 2022
@aaron-prindle aaron-prindle enabled auto-merge (squash) December 15, 2022 02:01
Copy link
Contributor

@aaron-prindle aaron-prindle left a comment

Choose a reason for hiding this comment

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

Our release is still waiting on some high priority fixes, I've been manually testing this locally and reviewed all of the files touched and things look good. It should be safe to merge now from my testing. Merging now

@aaron-prindle aaron-prindle merged commit 88e1c17 into GoogleContainerTools:main Dec 15, 2022
@aaron-prindle
Copy link
Contributor

aaron-prindle commented Dec 15, 2022

Thanks for the PR @sethrylan! Out of curiosity how is your team using the skaffold go module currently? Any insights there might help us to better support the use case, thanks!

@sethrylan
Copy link
Contributor Author

Thanks so much @aaron-prindle!

There are two ways we use the module:

  • We import the schema packages to auto-generate a SkaffoldConfig and output the yaml file. Our projects have many kustomize overlays, so this is a convenience command to auto-generate those sections of the skaffold.yaml.
  • I also want to use the module to solve another issue. Today, we use a skaffold shim; it installs the version that each project needs and updates the path. This allows us to pin skaffold versions in shared environments, but relies on scripts that run in local, remote and CI. Over the last few months, we've added more features to this shim to support our dev workflow. For example, checking if a k8s cluster exists, and starting/creating it if needed, or setting SKAFFOLD_TRIGGER based on context. Our next steps are to use the skaffold module to create a more opinionated tool, optimized for our workflows. I would appreciate any ideas you have about this.

@sethrylan sethrylan deleted the main-8161 branch December 15, 2022 15:52
@aaron-prindle
Copy link
Contributor

Making triage party happy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The v2 module path should be github.com/GoogleContainerTools/skaffold/v2
4 participants