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
4ccbc20b
Unverified
Commit
4ccbc20b
authored
6 years ago
by
Rhys Arkins
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix: match current version (#2135)
fix: match current version
parent
fbb5b3fe
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/util/package-rules.js
+14
-4
14 additions, 4 deletions
lib/util/package-rules.js
lib/workers/repository/updates/flatten.js
+2
-2
2 additions, 2 deletions
lib/workers/repository/updates/flatten.js
with
16 additions
and
6 deletions
lib/util/package-rules.js
+
14
−
4
View file @
4ccbc20b
...
...
@@ -9,7 +9,14 @@ module.exports = {
function
applyPackageRules
(
inputConfig
)
{
let
config
=
{
...
inputConfig
};
const
{
versionScheme
,
packageFile
,
depType
,
depName
,
fromVersion
}
=
config
;
const
{
versionScheme
,
packageFile
,
depType
,
depName
,
currentValue
,
fromVersion
,
}
=
config
;
const
packageRules
=
config
.
packageRules
||
[];
logger
.
trace
(
{
depName
,
packageRules
},
...
...
@@ -94,9 +101,12 @@ function applyPackageRules(inputConfig) {
positiveMatch
=
positiveMatch
||
!
isMatch
;
}
if
(
matchCurrentVersion
)
{
if
(
fromVersion
)
{
const
{
matches
}
=
versioning
(
versionScheme
);
const
isMatch
=
matches
(
fromVersion
,
matchCurrentVersion
);
const
{
matches
,
isVersion
}
=
versioning
(
versionScheme
);
const
compareVersion
=
isVersion
(
currentValue
)
?
currentValue
// it's a version so we can match against it
:
fromVersion
;
// need to match against this fromVersion, if available
if
(
compareVersion
)
{
const
isMatch
=
matches
(
compareVersion
,
matchCurrentVersion
);
positiveMatch
=
positiveMatch
||
isMatch
;
negativeMatch
=
negativeMatch
||
!
isMatch
;
}
else
{
...
...
This diff is collapsed.
Click to expand it.
lib/workers/repository/updates/flatten.js
+
2
−
2
View file @
4ccbc20b
...
...
@@ -18,12 +18,12 @@ function flattenUpdates(config, packageFiles) {
const
packageFileConfig
=
mergeChildConfig
(
managerConfig
,
packageFile
);
for
(
const
dep
of
packageFile
.
deps
)
{
if
(
dep
.
updates
.
length
)
{
le
t
depConfig
=
mergeChildConfig
(
packageFileConfig
,
dep
);
cons
t
depConfig
=
mergeChildConfig
(
packageFileConfig
,
dep
);
delete
depConfig
.
deps
;
depConfig
=
applyPackageRules
(
depConfig
);
for
(
const
update
of
dep
.
updates
)
{
let
updateConfig
=
mergeChildConfig
(
depConfig
,
update
);
delete
updateConfig
.
updates
;
updateConfig
=
applyPackageRules
(
updateConfig
);
// apply major/minor/patch/pin/digest
updateConfig
=
mergeChildConfig
(
updateConfig
,
...
...
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