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
5dfc850b
Unverified
Commit
5dfc850b
authored
2 years ago
by
Rhys Arkins
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix: immortal digest groups (#18402)
parent
908be274
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/workers/repository/updates/generate.spec.ts
+30
-0
30 additions, 0 deletions
lib/workers/repository/updates/generate.spec.ts
lib/workers/repository/updates/generate.ts
+22
-22
22 additions, 22 deletions
lib/workers/repository/updates/generate.ts
with
52 additions
and
22 deletions
lib/workers/repository/updates/generate.spec.ts
+
30
−
0
View file @
5dfc850b
...
...
@@ -238,6 +238,36 @@ describe('workers/repository/updates/generate', () => {
expect
(
res
.
recreateClosed
).
toBeFalsy
();
});
it
(
'
groups multiple digest updates immortally
'
,
()
=>
{
const
branch
:
BranchUpgradeConfig
[]
=
[
{
manager
:
'
some-manager
'
,
depName
:
'
some-dep
'
,
groupName
:
'
some-group
'
,
branchName
:
'
some-branch
'
,
prTitle
:
'
some-title
'
,
commitMessageExtra
:
'
to {{{newDigestShort}}}
'
,
newValue
:
'
5.1.2
'
,
newDigest
:
'
sha256:abcdef123
'
,
isDigest
:
true
,
},
{
manager
:
'
some-manager
'
,
depName
:
'
some-other-dep
'
,
groupName
:
'
some-group
'
,
branchName
:
'
some-branch
'
,
prTitle
:
'
some-title
'
,
commitMessageExtra
:
'
to {{{newDigestShort}}}
'
,
newValue
:
'
5.2.0
'
,
newDigest
:
'
sha256:abcdef987654321
'
,
isDigest
:
true
,
},
];
const
res
=
generateBranchConfig
(
branch
);
expect
(
res
.
groupName
).
toBeDefined
();
expect
(
res
.
recreateClosed
).
toBeTrue
();
});
it
(
'
groups multiple upgrades different version
'
,
()
=>
{
const
branch
:
BranchUpgradeConfig
[]
=
[
{
...
...
This diff is collapsed.
Click to expand it.
lib/workers/repository/updates/generate.ts
+
22
−
22
View file @
5dfc850b
...
...
@@ -83,6 +83,28 @@ export function generateBranchConfig(
const
toVersions
:
string
[]
=
[];
const
toValues
=
new
Set
<
string
>
();
for
(
const
upg
of
branchUpgrades
)
{
if
(
upg
.
currentDigest
)
{
upg
.
currentDigestShort
=
upg
.
currentDigestShort
??
upg
.
currentDigest
.
replace
(
'
sha256:
'
,
''
).
substring
(
0
,
7
);
}
if
(
upg
.
newDigest
)
{
upg
.
newDigestShort
=
upg
.
newDigestShort
||
upg
.
newDigest
.
replace
(
'
sha256:
'
,
''
).
substring
(
0
,
7
);
}
if
(
upg
.
isDigest
||
upg
.
isPinDigest
)
{
upg
.
displayFrom
=
upg
.
currentDigestShort
;
upg
.
displayTo
=
upg
.
newDigestShort
;
}
else
if
(
upg
.
isLockfileUpdate
)
{
upg
.
displayFrom
=
upg
.
currentVersion
;
upg
.
displayTo
=
upg
.
newVersion
;
}
else
if
(
!
upg
.
isLockFileMaintenance
)
{
upg
.
displayFrom
=
upg
.
currentValue
;
upg
.
displayTo
=
upg
.
newValue
;
}
upg
.
displayFrom
??=
''
;
upg
.
displayTo
??=
''
;
if
(
!
depNames
.
includes
(
upg
.
depName
!
))
{
depNames
.
push
(
upg
.
depName
!
);
}
...
...
@@ -123,28 +145,6 @@ export function generateBranchConfig(
upgrade
.
commitMessageExtra
=
`to v
${
toVersions
[
0
]}
`
;
}
if
(
upgrade
.
currentDigest
)
{
upgrade
.
currentDigestShort
=
upgrade
.
currentDigestShort
??
upgrade
.
currentDigest
.
replace
(
'
sha256:
'
,
''
).
substring
(
0
,
7
);
}
if
(
upgrade
.
newDigest
)
{
upgrade
.
newDigestShort
=
upgrade
.
newDigestShort
||
upgrade
.
newDigest
.
replace
(
'
sha256:
'
,
''
).
substring
(
0
,
7
);
}
if
(
upgrade
.
isDigest
||
upgrade
.
isPinDigest
)
{
upgrade
.
displayFrom
=
upgrade
.
currentDigestShort
;
upgrade
.
displayTo
=
upgrade
.
newDigestShort
;
}
else
if
(
upgrade
.
isLockfileUpdate
)
{
upgrade
.
displayFrom
=
upgrade
.
currentVersion
;
upgrade
.
displayTo
=
upgrade
.
newVersion
;
}
else
if
(
!
upgrade
.
isLockFileMaintenance
)
{
upgrade
.
displayFrom
=
upgrade
.
currentValue
;
upgrade
.
displayTo
=
upgrade
.
newValue
;
}
upgrade
.
displayFrom
??=
''
;
upgrade
.
displayTo
??=
''
;
const
pendingVersionsLength
=
upgrade
.
pendingVersions
?.
length
;
if
(
pendingVersionsLength
)
{
upgrade
.
displayPending
=
`
\`
${
upgrade
...
...
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