Navigation Menu

Skip to content

Commit

Permalink
fix(gomod): Revert "fix(gomod): non-0.0.0 digest matching" (#19120)
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Nov 27, 2022
1 parent 20ba978 commit 0f2eb5d
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 42 deletions.
5 changes: 2 additions & 3 deletions lib/modules/datasource/go/index.ts
Expand Up @@ -59,9 +59,8 @@ export class GoDatasource extends Datasource {
return null;
}

// ignore vX.Y.Z-(0.)? pseudo versions that are used Go Modules - look up default branch instead
const tag =
value && !/^v\d+\.\d+\.\d+-0?\.?.*/.test(value) ? value : undefined;
// ignore v0.0.0- pseudo versions that are used Go Modules - look up default branch instead
const tag = value && !value.startsWith('v0.0.0-2') ? value : undefined;

switch (source.datasource) {
case GitTagsDatasource.id: {
Expand Down
2 changes: 0 additions & 2 deletions lib/modules/manager/gomod/__snapshots__/extract.spec.ts.snap
Expand Up @@ -605,12 +605,10 @@ exports[`modules/manager/gomod/extract extractPackageFile() extracts multi-line
},
},
{
"currentDigest": "43d17e14b714",
"currentValue": "v4.0.0-20180807092216-43d17e14b714",
"datasource": "go",
"depName": "gopkg.in/src-d/go-git.v4",
"depType": "require",
"digestOneAndOnly": true,
"managerData": {
"lineNumber": 58,
"multiLine": true,
Expand Down
34 changes: 0 additions & 34 deletions lib/modules/manager/gomod/extract.spec.ts
Expand Up @@ -94,39 +94,5 @@ replace (
],
});
});

it('extracts digest updates for untagged releases', () => {
const goMod = `
module github.com/omercnet/renovate-go-test
go 1.19
require github.com/omercnet/go-untagged v0.0.2-0.20221125140048-3917a80154e7
`;
const res = extractPackageFile(goMod);
expect(res).toEqual({
deps: [
{
currentValue: '1.19',
datasource: 'golang-version',
depName: 'go',
depType: 'golang',
managerData: { lineNumber: 3 },
rangeStrategy: 'replace',
versioning: 'npm',
},
{
currentDigest: '3917a80154e7',
currentValue: 'v0.0.2-0.20221125140048-3917a80154e7',
datasource: 'go',
depName: 'github.com/omercnet/go-untagged',
depType: 'require',
digestOneAndOnly: true,
managerData: { lineNumber: 5 },
},
],
});
});
});
});
4 changes: 1 addition & 3 deletions lib/modules/manager/gomod/extract.ts
Expand Up @@ -28,9 +28,7 @@ function getDep(
} else {
dep.skipReason = 'unsupported-version';
}
const digestMatch = regEx(/v\d+\.\d+\.\d+-\d?\.?\d{14}-([a-f0-9]{12})/).exec(
currentValue
);
const digestMatch = regEx(/v0\.0.0-\d{14}-([a-f0-9]{12})/).exec(currentValue);
if (digestMatch) {
[, dep.currentDigest] = digestMatch;
dep.digestOneAndOnly = true;
Expand Down

0 comments on commit 0f2eb5d

Please sign in to comment.