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
977a0271
Unverified
Commit
977a0271
authored
3 years ago
by
Max Rose
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix(presets): log depreciation only if fallback found (#14281)
parent
9c160821
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/config/presets/util.spec.ts
+9
-1
9 additions, 1 deletion
lib/config/presets/util.spec.ts
lib/config/presets/util.ts
+3
-3
3 additions, 3 deletions
lib/config/presets/util.ts
with
12 additions
and
4 deletions
lib/config/presets/util.spec.ts
+
9
−
1
View file @
977a0271
...
...
@@ -15,15 +15,23 @@ describe('config/presets/util', () => {
fetch
.
mockReset
();
});
it
(
'
works
'
,
async
()
=>
{
fetch
.
mockResolvedValue
({
sub
:
{
preset
:
{
foo
:
true
}
}
});
fetch
.
mockResolvedValue
Once
({
sub
:
{
preset
:
{
foo
:
true
}
}
});
expect
(
await
fetchPreset
({
...
config
,
fetch
})).
toEqual
({
sub
:
{
preset
:
{
foo
:
true
}
},
});
fetch
.
mockRejectedValueOnce
(
new
Error
(
PRESET_DEP_NOT_FOUND
));
fetch
.
mockResolvedValueOnce
({
sub
:
{
preset
:
{
foo
:
true
}
}
});
expect
(
await
fetchPreset
({
...
config
,
fetch
})).
toEqual
({
sub
:
{
preset
:
{
foo
:
true
}
},
});
fetch
.
mockResolvedValueOnce
({
sub
:
{
preset
:
{
foo
:
true
}
}
});
expect
(
await
fetchPreset
({
...
config
,
filePreset
:
'
some/sub
'
,
fetch
})
).
toEqual
({
preset
:
{
foo
:
true
}
});
fetch
.
mockResolvedValueOnce
({
sub
:
{
preset
:
{
foo
:
true
}
}
});
expect
(
await
fetchPreset
({
...
config
,
filePreset
:
'
some/sub/preset
'
,
fetch
})
).
toEqual
({
foo
:
true
});
...
...
This diff is collapsed.
Click to expand it.
lib/config/presets/util.ts
+
3
−
3
View file @
977a0271
...
...
@@ -35,15 +35,15 @@ export async function fetchPreset({
if
(
err
.
message
!==
PRESET_DEP_NOT_FOUND
)
{
throw
err
;
}
logger
.
info
(
'
Fallback to renovate.json file as a preset is deprecated, please use a default.json file instead.
'
);
jsonContent
=
await
fetch
(
pkgName
,
buildFilePath
(
'
renovate.json
'
),
endpoint
,
packageTag
);
logger
.
info
(
'
Fallback to renovate.json file as a preset is deprecated, please use a default.json file instead.
'
);
}
}
else
{
jsonContent
=
await
fetch
(
...
...
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