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
866cedd3
Unverified
Commit
866cedd3
authored
5 years ago
by
Rhys Arkins
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
refactor: fetchDepUpdates no-param-reassign (#5957)
parent
19b789ab
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/workers/repository/process/fetch.ts
+9
-7
9 additions, 7 deletions
lib/workers/repository/process/fetch.ts
with
9 additions
and
7 deletions
lib/workers/repository/process/fetch.ts
+
9
−
7
View file @
866cedd3
...
@@ -16,15 +16,16 @@ import {
...
@@ -16,15 +16,16 @@ import {
PackageUpdateResult
,
PackageUpdateResult
,
}
from
'
../../../manager/common
'
;
}
from
'
../../../manager/common
'
;
import
{
SkipReason
}
from
'
../../../types
'
;
import
{
SkipReason
}
from
'
../../../types
'
;
import
{
clone
}
from
'
../../../util/clone
'
;
async
function
fetchDepUpdates
(
async
function
fetchDepUpdates
(
packageFileConfig
:
ManagerConfig
&
PackageFile
,
packageFileConfig
:
ManagerConfig
&
PackageFile
,
dep
:
PackageDependency
in
dep
:
PackageDependency
):
Promise
<
void
>
{
):
Promise
<
PackageDependency
>
{
/* eslint-disable no-param-reassign */
const
dep
=
clone
(
indep
);
dep
.
updates
=
[];
dep
.
updates
=
[];
if
(
dep
.
skipReason
)
{
if
(
dep
.
skipReason
)
{
return
;
return
dep
;
}
}
const
{
manager
,
packageFile
}
=
packageFileConfig
;
const
{
manager
,
packageFile
}
=
packageFileConfig
;
const
{
depName
,
currentValue
}
=
dep
;
const
{
depName
,
currentValue
}
=
dep
;
...
@@ -76,7 +77,7 @@ async function fetchDepUpdates(
...
@@ -76,7 +77,7 @@ async function fetchDepUpdates(
updates
:
dep
.
updates
,
updates
:
dep
.
updates
,
});
});
}
}
/* eslint-enable no-param-reassign */
return
dep
;
}
}
async
function
fetchManagerPackagerFileUpdates
(
async
function
fetchManagerPackagerFileUpdates
(
...
@@ -87,14 +88,15 @@ async function fetchManagerPackagerFileUpdates(
...
@@ -87,14 +88,15 @@ async function fetchManagerPackagerFileUpdates(
const
{
packageFile
}
=
pFile
;
const
{
packageFile
}
=
pFile
;
const
packageFileConfig
=
mergeChildConfig
(
managerConfig
,
pFile
);
const
packageFileConfig
=
mergeChildConfig
(
managerConfig
,
pFile
);
const
{
manager
}
=
packageFileConfig
;
const
{
manager
}
=
packageFileConfig
;
const
queue
=
pFile
.
deps
.
map
((
dep
)
=>
():
Promise
<
void
>
=>
const
queue
=
pFile
.
deps
.
map
((
dep
)
=>
():
Promise
<
PackageDependency
>
=>
fetchDepUpdates
(
packageFileConfig
,
dep
)
fetchDepUpdates
(
packageFileConfig
,
dep
)
);
);
logger
.
trace
(
logger
.
trace
(
{
manager
,
packageFile
,
queueLength
:
queue
.
length
},
{
manager
,
packageFile
,
queueLength
:
queue
.
length
},
'
fetchManagerPackagerFileUpdates starting with concurrency
'
'
fetchManagerPackagerFileUpdates starting with concurrency
'
);
);
await
pAll
(
queue
,
{
concurrency
:
5
});
// eslint-disable-next-line no-param-reassign
pFile
.
deps
=
await
pAll
(
queue
,
{
concurrency
:
5
});
logger
.
trace
({
packageFile
},
'
fetchManagerPackagerFileUpdates finished
'
);
logger
.
trace
({
packageFile
},
'
fetchManagerPackagerFileUpdates finished
'
);
}
}
...
...
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