Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
Renovate Bot
renovate
Commits
4ba04b47
Unverified
Commit
4ba04b47
authored
2 years ago
by
Bastian
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix(gomod): explicitly match Gitlab ID for gitlab enterprise servers (#17611)
parent
6609461c
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/modules/datasource/go/base.spec.ts
+6
-5
6 additions, 5 deletions
lib/modules/datasource/go/base.spec.ts
lib/modules/datasource/go/base.ts
+1
-5
1 addition, 5 deletions
lib/modules/datasource/go/base.ts
with
7 additions
and
10 deletions
lib/modules/datasource/go/base.spec.ts
+
6
−
5
View file @
4ba04b47
import
{
Fixtures
}
from
'
../../../../test/fixtures
'
;
import
{
Fixtures
}
from
'
../../../../test/fixtures
'
;
import
*
as
httpMock
from
'
../../../../test/http-mock
'
;
import
*
as
httpMock
from
'
../../../../test/http-mock
'
;
import
{
mocked
}
from
'
../../../../test/util
'
;
import
{
mocked
}
from
'
../../../../test/util
'
;
import
{
PlatformId
}
from
'
../../../constants
'
;
import
*
as
_hostRules
from
'
../../../util/host-rules
'
;
import
*
as
_hostRules
from
'
../../../util/host-rules
'
;
import
{
GithubTagsDatasource
}
from
'
../github-tags
'
;
import
{
GithubTagsDatasource
}
from
'
../github-tags
'
;
import
{
GitlabTagsDatasource
}
from
'
../gitlab-tags
'
;
import
{
GitlabTagsDatasource
}
from
'
../gitlab-tags
'
;
...
@@ -202,7 +203,7 @@ describe('modules/datasource/go/base', () => {
...
@@ -202,7 +203,7 @@ describe('modules/datasource/go/base', () => {
});
});
it
(
'
supports GitLab EE deps
'
,
async
()
=>
{
it
(
'
supports GitLab EE deps
'
,
async
()
=>
{
hostRules
.
find
.
mockReturnValue
(
{
token
:
'
some-token
'
}
);
hostRules
.
hostType
.
mockReturnValue
(
PlatformId
.
Gitlab
);
httpMock
httpMock
.
scope
(
'
https://my.custom.domain
'
)
.
scope
(
'
https://my.custom.domain
'
)
.
get
(
'
/golang/myrepo?go-get=1
'
)
.
get
(
'
/golang/myrepo?go-get=1
'
)
...
@@ -220,7 +221,7 @@ describe('modules/datasource/go/base', () => {
...
@@ -220,7 +221,7 @@ describe('modules/datasource/go/base', () => {
});
});
it
(
'
supports GitLab EE deps in subgroup
'
,
async
()
=>
{
it
(
'
supports GitLab EE deps in subgroup
'
,
async
()
=>
{
hostRules
.
find
.
mockReturnValue
(
{
token
:
'
some-token
'
}
);
hostRules
.
hostType
.
mockReturnValue
(
PlatformId
.
Gitlab
);
httpMock
httpMock
.
scope
(
'
https://my.custom.domain
'
)
.
scope
(
'
https://my.custom.domain
'
)
.
get
(
'
/golang/subgroup/myrepo?go-get=1
'
)
.
get
(
'
/golang/subgroup/myrepo?go-get=1
'
)
...
@@ -238,7 +239,7 @@ describe('modules/datasource/go/base', () => {
...
@@ -238,7 +239,7 @@ describe('modules/datasource/go/base', () => {
});
});
it
(
'
supports GitLab EE deps in subgroup with version
'
,
async
()
=>
{
it
(
'
supports GitLab EE deps in subgroup with version
'
,
async
()
=>
{
hostRules
.
find
.
mockReturnValue
(
{
token
:
'
some-token
'
}
);
hostRules
.
hostType
.
mockReturnValue
(
PlatformId
.
Gitlab
);
httpMock
httpMock
.
scope
(
'
https://my.custom.domain
'
)
.
scope
(
'
https://my.custom.domain
'
)
.
get
(
'
/golang/subgroup/myrepo/v2?go-get=1
'
)
.
get
(
'
/golang/subgroup/myrepo/v2?go-get=1
'
)
...
@@ -256,7 +257,7 @@ describe('modules/datasource/go/base', () => {
...
@@ -256,7 +257,7 @@ describe('modules/datasource/go/base', () => {
});
});
it
(
'
supports GitLab EE deps in private subgroup with vcs indicator
'
,
async
()
=>
{
it
(
'
supports GitLab EE deps in private subgroup with vcs indicator
'
,
async
()
=>
{
hostRules
.
find
.
mockReturnValue
(
{
token
:
'
some-token
'
}
);
hostRules
.
hostType
.
mockReturnValue
(
PlatformId
.
Gitlab
);
httpMock
httpMock
.
scope
(
'
https://my.custom.domain
'
)
.
scope
(
'
https://my.custom.domain
'
)
.
get
(
'
/golang/subgroup/myrepo.git/v2?go-get=1
'
)
.
get
(
'
/golang/subgroup/myrepo.git/v2?go-get=1
'
)
...
@@ -274,7 +275,7 @@ describe('modules/datasource/go/base', () => {
...
@@ -274,7 +275,7 @@ describe('modules/datasource/go/base', () => {
});
});
it
(
'
supports GitLab EE monorepo deps in subgroup
'
,
async
()
=>
{
it
(
'
supports GitLab EE monorepo deps in subgroup
'
,
async
()
=>
{
hostRules
.
find
.
mockReturnValue
(
{
token
:
'
some-token
'
}
);
hostRules
.
hostType
.
mockReturnValue
(
PlatformId
.
Gitlab
);
httpMock
httpMock
.
scope
(
'
https://my.custom.domain
'
)
.
scope
(
'
https://my.custom.domain
'
)
.
get
(
'
/golang/subgroup/myrepo/monorepo?go-get=1
'
)
.
get
(
'
/golang/subgroup/myrepo/monorepo?go-get=1
'
)
...
...
This diff is collapsed.
Click to expand it.
lib/modules/datasource/go/base.ts
+
1
−
5
View file @
4ba04b47
...
@@ -137,11 +137,7 @@ export class BaseGoDatasource {
...
@@ -137,11 +137,7 @@ export class BaseGoDatasource {
};
};
}
}
const
opts
=
hostRules
.
find
({
if
(
hostRules
.
hostType
({
url
:
goSourceUrl
})
===
PlatformId
.
Gitlab
)
{
hostType
:
PlatformId
.
Gitlab
,
url
:
goSourceUrl
,
});
if
(
opts
.
token
)
{
// get server base url from import url
// get server base url from import url
const
parsedUrl
=
URL
.
parse
(
goSourceUrl
);
const
parsedUrl
=
URL
.
parse
(
goSourceUrl
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment