Commit Graph

25 Commits

Author SHA1 Message Date
Sebastian Poxhofer 300e3a616c test: shrink oversized fixtures to representative examples (#45666)
* test: reduce oversized expectation literals to representative examples

* test: shrink oversized fixtures instead of trimming assertions

Cut the real-world fixtures down to a representative set of entries that still covers every parser shape, and assert the complete output again with a single toEqual.
2026-09-04 10:40:45 +00:00
Sebastian Poxhofer 2fc46bdcfa test(manager): replace file snapshots with explicit assertions (#45656)
* test(manager): replace file snapshots with explicit assertions

* test(manager): replace inline snapshots with explicit assertions

* test(manager): assert on relevant sections instead of full bodies

* test(manager): drop assertions implied by full equality

* test(manager): address review feedback

* test(manager): assert depType and versioning in the regex matcher
2026-09-04 06:36:39 +00:00
Maximilian Herrmann e5ace746bb fix(gomod): pseudo-version digest updates produce no change when module is absent from go proxy (#44477)
* fix(gomod): pseudo-version digest updates produce no change when module
    is absent from go proxy

* Update lib/modules/manager/gomod/update.spec.ts

Co-authored-by: RahulGautamSingh <rahultesnik@gmail.com>

---------

Co-authored-by: RahulGautamSingh <rahultesnik@gmail.com>
2026-07-21 07:17:45 +00:00
Qixiang Wan f944c8d12e fix(gomod): write full pseudo-version instead of bare hash on digest updates (#41588)
When a Go dependency uses a pseudo-version (v0.0.0-timestamp-hash) and
Renovate detects a newer pseudo-version, updateType is set to 'digest'
via the gomod special-case in lookup/index.ts. The digest update code
path was then writing only the 12-character bare commit hash, producing
invalid go.mod syntax:

  - knative.dev/pkg v0.0.0-20250312035536-b7bbf4be5dbd
  + knative.dev/pkg 4a022ed9999a

Historical cause:

In 2018, the Go module proxy did not yet exist. Renovate queried the
GitHub API for the latest commit SHA and had no way to obtain the correct
commit timestamp, so it fabricated a pseudo-version using the wall-clock
time when Renovate ran. The result was syntactically valid but semantically
wrong. Go 1.11 and 1.12 did not validate pseudo-version timestamps, and
`go get` would normalise the fabricated version to the correct one anyway,
so this worked in practice.

Go 1.13 (2019) introduced strict pseudo-version timestamp validation,
rejecting any pseudo-version whose timestamp does not match the actual
commit time. Renovate's fix (31ce47297) was to drop the fabricated
timestamp entirely and write just the bare commit hash, then rely on
`go get` to expand it into a canonical pseudo-version. However, when
the `go get` command or other subsequent operations fail, Renovate may
leave the go.mod file containing dependencies pinned to bare commit hashes.

Why the fix is now safe:

Since the 2024 goproxy datasource changes, both newValue and newDigest are
extracted from the same proxy version string via pseudoVersionToRelease().
They always reference the same commit, so writing newValue directly produces
correct, syntactically valid go.mod output without depending on `go get` to
clean it up afterward.

Signed-off-by: Qixiang Wan <qwan@outlook.com>
2026-05-06 16:06:01 +00:00
Michael Kriese 3953a78123 refactor: pass packageFile to updateDependency (#42253) 2026-03-30 17:32:36 +00:00
Jamie Tanna d04b07f89b fix(gomod): support major version on replaces with the same Go module (#41359)
As noted in #41260, if a Go module is using a `replace` with both
modules with the same name, the major upgrade fails to produce a valid
`go.mod`, as the `replace` will still partially reference the old
package.
2026-02-24 22:05:13 +00:00
Jamie Tanna d992c98857 test(gomod): remove duplicated test (#41358)
We've already got a test that covers the usage of a `replace` with a
`major` update.
2026-02-20 21:19:11 +00:00
Sergei Zharinov 9d857c1f68 refactor(lint): Organize imports with biome (#40966) 2026-02-06 13:40:01 +00:00
Sergei Zharinov 930cf6633c refactor: Rewrite imports with .ts extensions (#40700)
fix: Additional vi.mock path corrections and prettier formatting
2026-01-26 22:48:17 +00:00
Tobias 52242556e8 fix(manager/gomod): use regex to remove version suffix from name (#35508) 2025-04-23 19:31:52 +00:00
Michael Kriese 19c115c813 test: cleanup (#34785) 2025-03-13 17:52:09 +00:00
Ed Harrod 894250d392 chore(manager/gomod): Update go version to 1.23.3 in tests/examples (#32514)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2024-11-13 15:45:18 +00:00
Rhys Arkins 0354bcb653 fix(gomod): update toolchain (#28476)
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
2024-04-17 12:47:24 +00:00
Sergei Zharinov b69416ce17 refactor(prettier): Force trailing commas (#25631) 2023-11-07 15:50:29 +00:00
Sebastian Poxhofer e4e3b9bbc8 chore: rename fixture package file and lock files so they do not trigger osv scanner (#24625) 2023-09-23 20:30:51 +00:00
Rhys Arkins 36e2b328bb chore: update types reference 2023-08-15 11:31:15 +02:00
Maxime Brunet 7b627e3900 fix(gomod): skip updating import path for incompatible versions (#20812) 2023-03-14 05:09:15 +00:00
Jamie Tanna d19effc48d feat(manager/gomod): update indirect dependencies for Go Modules (#19431) 2022-12-15 18:55:08 +00:00
Maxime Brunet e64739cea5 fix(gomod): avoid duplicating "incompatible" metadata (#17867) 2022-09-28 17:20:40 +00:00
Hasan Awad 3cec44cfa7 fix(manager/gomod): add multi-line replace detection (#17111) 2022-08-11 05:29:53 +00:00
Philip a6e5eefb64 feat(manager/gomod): support updating go version in go.mod files (#16541) 2022-07-18 06:22:50 +00:00
Michael Kriese e5c6f38d75 refactor: enable strict checks (#16168)
* refactor:  enable strict checks

* chore: revert changes

* chore: fix tsconfig
2022-06-21 13:00:21 +02:00
Michael Kriese b4319928f1 refactor: strict manager tests (#16155)
* refactor: strict manager tests

* chore: revert changes

* Update lib/modules/manager/gradle/extract.spec.ts
2022-06-20 17:05:39 +02:00
Michael Kriese 64f5bd5f03 test: enforce lint style rules (#15085) 2022-04-12 14:49:49 +00:00
Rhys Arkins dca3418bbd refactor: lib/modules (#14488)
Moves datasource, manager, platform and versioning code from lib/ into new lib/modules/

BREAKING CHANGE: External tools must update paths to datasource, manager, platform and versioning
2022-03-04 09:04:02 +01:00