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

feat(gomod): Add gomodSkipVendor postUpdateOption #30025

Merged

Conversation

r0bobo
Copy link
Contributor

@r0bobo r0bobo commented Jul 4, 2024

Changes

This PR adds a postUpdateOption gomodSkipVendor which disables automatic vendoring functionality in the gomod manager.

Context

I'm creating this PR because I've had the issue described in:

Files that are removed by go mod vendor but are then restored in a postUpgradeTask are not added to the final commit.
After finding this comment in a discussion about go vendoring trouble I took a stab at adding the suggested option.

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

@r0bobo r0bobo changed the title Add gomodVendorSkip postUpdateOption for gomod feat(gomod): Add gomodVendorSkip postUpdateOption Jul 4, 2024
Copy link
Collaborator

@rarkins rarkins left a comment

Choose a reason for hiding this comment

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

Add a test for this skip case

lib/config/options/index.ts Outdated Show resolved Hide resolved
lib/modules/manager/gomod/artifacts.ts Outdated Show resolved Hide resolved
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
@r0bobo r0bobo force-pushed the gomod-postupdateoption-gomodvendorskip branch from 6ebfe7a to c25ce26 Compare July 4, 2024 20:26
@r0bobo r0bobo force-pushed the gomod-postupdateoption-gomodvendorskip branch from bc80045 to dc85766 Compare July 4, 2024 20:48
@r0bobo r0bobo changed the title feat(gomod): Add gomodVendorSkip postUpdateOption feat(gomod): Add gomodSkipVendor postUpdateOption Jul 4, 2024
@r0bobo
Copy link
Contributor Author

r0bobo commented Jul 4, 2024

Add a test for this skip case

I added a test that copies the it('supports vendor directory update', ...) case but passes the gomodSkipVendor as well. I started editing the expected output so that the diff would disappear, but I kinda feel like I don't know what I'm doing as I don't understand the testing framework that well. Do you have any pointers on how the test case should look?

rarkins
rarkins previously approved these changes Jul 5, 2024
@rarkins rarkins enabled auto-merge July 5, 2024 03:36
auto-merge was automatically disabled July 5, 2024 20:49

Head branch was pushed to by a user without write access

@r0bobo
Copy link
Contributor Author

r0bobo commented Jul 10, 2024

I've fixed the test so it is now green.

@rarkins rarkins enabled auto-merge July 10, 2024 21:25
@rarkins rarkins added this pull request to the merge queue Jul 10, 2024
Merged via the queue into renovatebot:main with commit 5f21e17 Jul 10, 2024
38 checks passed
@renovate-release
Copy link
Collaborator

🎉 This issue has been resolved in version 37.428.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@r0bobo r0bobo deleted the gomod-postupdateoption-gomodvendorskip branch July 11, 2024 03:57
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants