renovate icon indicating copy to clipboard operation
renovate copied to clipboard

fix(gomod): getting dep name with no version

Open sangheee opened this issue 3 years ago • 2 comments

Changes

Fixed getting a name with no version when doing a go mod update.

Context

There is a process that compares depName and depName with no version. and when getting depName with no version from depName, It only can handle the depName that has three elements separated by '/'. It causes some problems like described below:

- gomodules.xyz/jsonpatch/v2 v2.2.0
+ gomodules.xyz/jsonpatch/v2/v3 v3.0.1

It should upgrade like gomodules.xyz/jsonpatch/v3 v3.0.1.

Also, Handling the depName containing gopkg.in/ is duplication because it is handled below. https://github.com/renovatebot/renovate/blob/55898f85ae2f1c727ae0478a059b5c392ccc9c51/lib/modules/manager/gomod/update.ts#L97-L101

Documentation (please check one with an [x])

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

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

I have verified these changes via:

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

sangheee avatar Dec 06 '22 00:12 sangheee

Can you add a test to prevent regression please?

JamieMagee avatar Dec 06 '22 05:12 JamieMagee

@JamieMagee added :)

sangheee avatar Dec 07 '22 07:12 sangheee

@sangheee as you haven't granted maintainer edit permissions, we can't update this branch or fix any of the problems. Please reopen with "Maintainers can edit" permissions.

rarkins avatar Mar 04 '23 11:03 rarkins