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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
Renovate Bot
renovate
Commits
d81b2c5e
Unverified
Commit
d81b2c5e
authored
1 year ago
by
Maxime Brunet
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
fix(gomod): use plural for additional dependencies notice (#29361)
parent
27b08bc5
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/modules/manager/gomod/artifacts-extra.spec.ts
+23
-1
23 additions, 1 deletion
lib/modules/manager/gomod/artifacts-extra.spec.ts
lib/modules/manager/gomod/artifacts-extra.ts
+5
-1
5 additions, 1 deletion
lib/modules/manager/gomod/artifacts-extra.ts
with
28 additions
and
2 deletions
lib/modules/manager/gomod/artifacts-extra.spec.ts
+
23
−
1
View file @
d81b2c5e
...
@@ -91,7 +91,7 @@ describe('modules/manager/gomod/artifacts-extra', () => {
...
@@ -91,7 +91,7 @@ describe('modules/manager/gomod/artifacts-extra', () => {
expect
(
res
).
toBeNull
();
expect
(
res
).
toBeNull
();
});
});
it
(
'
returns a notice when there
are
extra dependenc
ies
'
,
()
=>
{
it
(
'
returns a notice when there
is an
extra dependenc
y
'
,
()
=>
{
const
excludeDeps
=
[
'
go
'
,
'
github.com/foo/foo
'
];
const
excludeDeps
=
[
'
go
'
,
'
github.com/foo/foo
'
];
const
res
=
getExtraDepsNotice
(
goModBefore
,
goModAfter
,
excludeDeps
);
const
res
=
getExtraDepsNotice
(
goModBefore
,
goModAfter
,
excludeDeps
);
...
@@ -112,6 +112,28 @@ describe('modules/manager/gomod/artifacts-extra', () => {
...
@@ -112,6 +112,28 @@ describe('modules/manager/gomod/artifacts-extra', () => {
);
);
});
});
it
(
'
returns a notice when there are extra dependencies
'
,
()
=>
{
const
excludeDeps
=
[
'
go
'
];
const
res
=
getExtraDepsNotice
(
goModBefore
,
goModAfter
,
excludeDeps
);
expect
(
res
).
toEqual
(
[
'
In order to perform the update(s) described in the table above, Renovate ran the `go get` command, which resulted in the following additional change(s):
'
,
''
,
''
,
'
- 2 additional dependencies were updated
'
,
''
,
''
,
'
Details:
'
,
'
| **Package** | **Change** |
'
,
'
| :------------------- | :------------------- |
'
,
'
| `github.com/foo/foo` | `v1.0.0` -> `v1.1.1` |
'
,
'
| `github.com/bar/bar` | `v2.0.0` -> `v2.2.2` |
'
,
].
join
(
'
\n
'
),
);
});
it
(
'
adds special notice for updated `go` version
'
,
()
=>
{
it
(
'
adds special notice for updated `go` version
'
,
()
=>
{
const
excludeDeps
=
[
'
github.com/foo/foo
'
];
const
excludeDeps
=
[
'
github.com/foo/foo
'
];
...
...
This diff is collapsed.
Click to expand it.
lib/modules/manager/gomod/artifacts-extra.ts
+
5
−
1
View file @
d81b2c5e
...
@@ -94,8 +94,12 @@ export function getExtraDepsNotice(
...
@@ -94,8 +94,12 @@ export function getExtraDepsNotice(
const
goUpdated
=
extraDeps
.
some
(({
depName
})
=>
depName
===
'
go
'
);
const
goUpdated
=
extraDeps
.
some
(({
depName
})
=>
depName
===
'
go
'
);
const
otherDepsCount
=
extraDeps
.
length
-
(
goUpdated
?
1
:
0
);
const
otherDepsCount
=
extraDeps
.
length
-
(
goUpdated
?
1
:
0
);
if
(
otherDepsCount
>
0
)
{
if
(
otherDepsCount
===
1
)
{
noticeLines
.
push
(
`-
${
otherDepsCount
}
additional dependency was updated`
);
noticeLines
.
push
(
`-
${
otherDepsCount
}
additional dependency was updated`
);
}
else
if
(
otherDepsCount
>
1
)
{
noticeLines
.
push
(
`-
${
otherDepsCount
}
additional dependencies were updated`
,
);
}
}
if
(
goUpdated
)
{
if
(
goUpdated
)
{
...
...
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