Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SmartDataLab
public
applications
renovate
Commits
184a7755
Unverified
Commit
184a7755
authored
3 years ago
by
Martin Herndl
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix: improve re-opening behaviour of group updates (#13830)
parent
ec4cf704
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/workers/repository/updates/generate.spec.ts
+80
-0
80 additions, 0 deletions
lib/workers/repository/updates/generate.spec.ts
lib/workers/repository/updates/generate.ts
+4
-1
4 additions, 1 deletion
lib/workers/repository/updates/generate.ts
with
84 additions
and
1 deletion
lib/workers/repository/updates/generate.spec.ts
+
80
−
0
View file @
184a7755
...
@@ -224,6 +224,86 @@ describe('workers/repository/updates/generate', () => {
...
@@ -224,6 +224,86 @@ describe('workers/repository/updates/generate', () => {
expect
(
res
.
groupName
).
toBeDefined
();
expect
(
res
.
groupName
).
toBeDefined
();
expect
(
res
.
releaseTimestamp
).
toBe
(
'
2017-02-08T20:01:41+00:00
'
);
expect
(
res
.
releaseTimestamp
).
toBe
(
'
2017-02-08T20:01:41+00:00
'
);
});
});
it
(
'
groups multiple upgrades different version but same value
'
,
()
=>
{
const
branch
=
[
{
depName
:
'
depB
'
,
groupName
:
'
some-group
'
,
branchName
:
'
some-branch
'
,
prTitle
:
'
some-title
'
,
commitMessageExtra
:
'
to {{#if isMajor}}v{{newMajor}}{{else}}{{#unless isRange}}v{{/unless}}{{newValue}}{{/if}}
'
,
foo
:
1
,
newValue
:
'
^6.0
'
,
newVersion
:
'
6.0.3
'
,
group
:
{
foo
:
2
,
},
releaseTimestamp
:
'
2017-02-07T20:01:41+00:00
'
,
},
{
depName
:
'
depA
'
,
groupName
:
'
some-group
'
,
branchName
:
'
some-branch
'
,
prTitle
:
'
some-title
'
,
commitMessageExtra
:
'
to {{#if isMajor}}v{{newMajor}}{{else}}{{#unless isRange}}v{{/unless}}{{newValue}}{{/if}}
'
,
foo
:
1
,
newValue
:
'
^6.0
'
,
newVersion
:
'
6.0.1
'
,
group
:
{
foo
:
2
,
},
releaseTimestamp
:
'
2017-02-08T20:01:41+00:00
'
,
},
];
const
res
=
generateBranchConfig
(
branch
);
expect
(
res
.
foo
).
toBe
(
2
);
expect
(
res
.
singleVersion
).
toBeUndefined
();
expect
(
res
.
recreateClosed
).
toBeUndefined
();
expect
(
res
.
groupName
).
toBeDefined
();
expect
(
res
.
releaseTimestamp
).
toBe
(
'
2017-02-08T20:01:41+00:00
'
);
});
it
(
'
groups multiple upgrades different value but same version
'
,
()
=>
{
const
branch
=
[
{
depName
:
'
depB
'
,
groupName
:
'
some-group
'
,
branchName
:
'
some-branch
'
,
prTitle
:
'
some-title
'
,
commitMessageExtra
:
'
to {{#if isMajor}}v{{newMajor}}{{else}}{{#unless isRange}}v{{/unless}}{{newValue}}{{/if}}
'
,
foo
:
1
,
newValue
:
'
^6.0.1
'
,
newVersion
:
'
6.0.2
'
,
group
:
{
foo
:
2
,
},
releaseTimestamp
:
'
2017-02-07T20:01:41+00:00
'
,
},
{
depName
:
'
depA
'
,
groupName
:
'
some-group
'
,
branchName
:
'
some-branch
'
,
prTitle
:
'
some-title
'
,
commitMessageExtra
:
'
to {{#if isMajor}}v{{newMajor}}{{else}}{{#unless isRange}}v{{/unless}}{{newValue}}{{/if}}
'
,
foo
:
1
,
newValue
:
'
^6.0.0
'
,
newVersion
:
'
6.0.2
'
,
group
:
{
foo
:
2
,
},
releaseTimestamp
:
'
2017-02-08T20:01:41+00:00
'
,
},
];
const
res
=
generateBranchConfig
(
branch
);
expect
(
res
.
foo
).
toBe
(
2
);
expect
(
res
.
singleVersion
).
toBeUndefined
();
expect
(
res
.
recreateClosed
).
toBeUndefined
();
expect
(
res
.
groupName
).
toBeDefined
();
expect
(
res
.
releaseTimestamp
).
toBe
(
'
2017-02-08T20:01:41+00:00
'
);
});
it
(
'
groups multiple digest updates
'
,
()
=>
{
it
(
'
groups multiple digest updates
'
,
()
=>
{
const
branch
=
[
const
branch
=
[
{
{
...
...
This diff is collapsed.
Click to expand it.
lib/workers/repository/updates/generate.ts
+
4
−
1
View file @
184a7755
...
@@ -73,6 +73,7 @@ export function generateBranchConfig(
...
@@ -73,6 +73,7 @@ export function generateBranchConfig(
const
depNames
:
string
[]
=
[];
const
depNames
:
string
[]
=
[];
const
newValue
:
string
[]
=
[];
const
newValue
:
string
[]
=
[];
const
toVersions
:
string
[]
=
[];
const
toVersions
:
string
[]
=
[];
const
toValues
=
new
Set
<
string
>
();
branchUpgrades
.
forEach
((
upg
)
=>
{
branchUpgrades
.
forEach
((
upg
)
=>
{
if
(
!
depNames
.
includes
(
upg
.
depName
))
{
if
(
!
depNames
.
includes
(
upg
.
depName
))
{
depNames
.
push
(
upg
.
depName
);
depNames
.
push
(
upg
.
depName
);
...
@@ -80,6 +81,7 @@ export function generateBranchConfig(
...
@@ -80,6 +81,7 @@ export function generateBranchConfig(
if
(
!
toVersions
.
includes
(
upg
.
newVersion
))
{
if
(
!
toVersions
.
includes
(
upg
.
newVersion
))
{
toVersions
.
push
(
upg
.
newVersion
);
toVersions
.
push
(
upg
.
newVersion
);
}
}
toValues
.
add
(
upg
.
newValue
);
if
(
upg
.
commitMessageExtra
)
{
if
(
upg
.
commitMessageExtra
)
{
const
extra
=
template
.
compile
(
upg
.
commitMessageExtra
,
upg
);
const
extra
=
template
.
compile
(
upg
.
commitMessageExtra
,
upg
);
if
(
!
newValue
.
includes
(
extra
))
{
if
(
!
newValue
.
includes
(
extra
))
{
...
@@ -146,8 +148,9 @@ export function generateBranchConfig(
...
@@ -146,8 +148,9 @@ export function generateBranchConfig(
delete
upgrade
.
group
;
delete
upgrade
.
group
;
// istanbul ignore else
// istanbul ignore else
if
(
toVersions
.
length
>
1
&&
!
typesGroup
)
{
if
(
toVersions
.
length
>
1
&&
toValues
.
size
>
1
&&
!
typesGroup
)
{
logger
.
trace
({
toVersions
});
logger
.
trace
({
toVersions
});
logger
.
trace
({
toValues
});
delete
upgrade
.
commitMessageExtra
;
delete
upgrade
.
commitMessageExtra
;
upgrade
.
recreateClosed
=
true
;
upgrade
.
recreateClosed
=
true
;
}
else
if
(
newValue
.
length
>
1
&&
upgrade
.
isDigest
)
{
}
else
if
(
newValue
.
length
>
1
&&
upgrade
.
isDigest
)
{
...
...
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