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
e49572e1
Unverified
Commit
e49572e1
authored
2 years ago
by
Rhys Arkins
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix(datasource/github-tags): don't use github-releases for extra meta (#17650)
parent
ae755d48
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/modules/datasource/github-tags/index.spec.ts
+0
-11
0 additions, 11 deletions
lib/modules/datasource/github-tags/index.spec.ts
lib/modules/datasource/github-tags/index.ts
+1
-28
1 addition, 28 deletions
lib/modules/datasource/github-tags/index.ts
with
1 addition
and
39 deletions
lib/modules/datasource/github-tags/index.spec.ts
+
0
−
11
View file @
e49572e1
import
{
getPkgReleases
}
from
'
..
'
;
import
*
as
httpMock
from
'
../../../../test/http-mock
'
;
import
*
as
_hostRules
from
'
../../../util/host-rules
'
;
import
{
CacheableGithubReleases
}
from
'
../github-releases/cache
'
;
import
{
CacheableGithubTags
}
from
'
./cache
'
;
import
{
GithubTagsDatasource
}
from
'
.
'
;
...
...
@@ -12,10 +11,6 @@ const githubApiHost = 'https://api.github.com';
const
githubEnterpriseApiHost
=
'
https://git.enterprise.com
'
;
describe
(
'
modules/datasource/github-tags/index
'
,
()
=>
{
const
releasesCacheGetItems
=
jest
.
spyOn
(
CacheableGithubReleases
.
prototype
,
'
getItems
'
);
const
tagsCacheGetItems
=
jest
.
spyOn
(
CacheableGithubTags
.
prototype
,
'
getItems
'
...
...
@@ -109,10 +104,6 @@ describe('modules/datasource/github-tags/index', () => {
{
version
:
'
v1.0.0
'
,
releaseTimestamp
:
'
2021-01-01
'
,
hash
:
'
123
'
},
{
version
:
'
v2.0.0
'
,
releaseTimestamp
:
'
2022-01-01
'
,
hash
:
'
abc
'
},
]);
releasesCacheGetItems
.
mockResolvedValueOnce
([
{
version
:
'
v1.0.0
'
,
releaseTimestamp
:
'
2021-01-01
'
,
isStable
:
true
},
{
version
:
'
v2.0.0
'
,
releaseTimestamp
:
'
2022-01-01
'
,
isStable
:
false
},
]
as
never
);
const
res
=
await
getPkgReleases
({
datasource
:
github
.
id
,
depName
});
...
...
@@ -123,7 +114,6 @@ describe('modules/datasource/github-tags/index', () => {
{
gitRef
:
'
v1.0.0
'
,
hash
:
'
123
'
,
isStable
:
true
,
releaseTimestamp
:
'
2021-01-01T00:00:00.000Z
'
,
version
:
'
v1.0.0
'
,
},
...
...
@@ -131,7 +121,6 @@ describe('modules/datasource/github-tags/index', () => {
{
gitRef
:
'
v2.0.0
'
,
hash
:
'
abc
'
,
isStable
:
false
,
releaseTimestamp
:
'
2022-01-01T00:00:00.000Z
'
,
version
:
'
v2.0.0
'
,
},
...
...
This diff is collapsed.
Click to expand it.
lib/modules/datasource/github-tags/index.ts
+
1
−
28
View file @
e49572e1
...
...
@@ -2,12 +2,7 @@ import { logger } from '../../../logger';
import
{
cache
}
from
'
../../../util/cache/package/decorator
'
;
import
{
GithubReleasesDatasource
}
from
'
../github-releases
'
;
import
{
getApiBaseUrl
,
getSourceUrl
}
from
'
../github-releases/common
'
;
import
type
{
DigestConfig
,
GetReleasesConfig
,
Release
,
ReleaseResult
,
}
from
'
../types
'
;
import
type
{
DigestConfig
,
GetReleasesConfig
,
ReleaseResult
}
from
'
../types
'
;
import
{
CacheableGithubTags
}
from
'
./cache
'
;
export
class
GithubTagsDatasource
extends
GithubReleasesDatasource
{
...
...
@@ -88,28 +83,6 @@ export class GithubTagsDatasource extends GithubReleasesDatasource {
releases
:
tagReleases
.
map
((
item
)
=>
({
...
item
,
gitRef
:
item
.
version
})),
};
try
{
// Fetch additional data from releases endpoint when possible
const
releasesResult
=
await
super
.
getReleases
(
config
);
type
PartialRelease
=
Omit
<
Release
,
'
version
'
>
;
const
releaseByVersion
:
Record
<
string
,
PartialRelease
>
=
{};
releasesResult
?.
releases
?.
forEach
((
release
)
=>
{
const
{
version
,
...
value
}
=
release
;
releaseByVersion
[
version
]
=
value
;
});
const
mergedReleases
:
Release
[]
=
[];
tagsResult
.
releases
.
forEach
((
tag
)
=>
{
const
release
=
releaseByVersion
[
tag
.
version
];
mergedReleases
.
push
({
...
release
,
...
tag
});
});
tagsResult
.
releases
=
mergedReleases
;
}
catch
(
err
)
/* istanbul ignore next */
{
logger
.
debug
({
err
},
`Error fetching additional info for GitHub tags`
);
}
return
tagsResult
;
}
}
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