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
7f51e58a
Unverified
Commit
7f51e58a
authored
3 years ago
by
Gabriel-Ladzaretti
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix(core/config): Log cached repo config filename and content (#16134)
parent
df70d371
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/onboarding/branch/check.ts
+4
-0
4 additions, 0 deletions
lib/workers/repository/onboarding/branch/check.ts
lib/workers/repository/onboarding/branch/index.spec.ts
+29
-0
29 additions, 0 deletions
lib/workers/repository/onboarding/branch/index.spec.ts
with
33 additions
and
0 deletions
lib/workers/repository/onboarding/branch/check.ts
+
4
−
0
View file @
7f51e58a
...
@@ -76,6 +76,10 @@ export const isOnboarded = async (config: RenovateConfig): Promise<boolean> => {
...
@@ -76,6 +76,10 @@ export const isOnboarded = async (config: RenovateConfig): Promise<boolean> => {
configFileContent
.
renovate
configFileContent
.
renovate
)
{
)
{
logger
.
debug
(
'
Existing config file confirmed
'
);
logger
.
debug
(
'
Existing config file confirmed
'
);
logger
.
debug
(
{
fileName
:
cache
.
configFileName
,
config
:
configFileContent
},
'
Repository config
'
);
return
true
;
return
true
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
lib/workers/repository/onboarding/branch/index.spec.ts
+
29
−
0
View file @
7f51e58a
...
@@ -12,6 +12,7 @@ import {
...
@@ -12,6 +12,7 @@ import {
REPOSITORY_FORKED
,
REPOSITORY_FORKED
,
REPOSITORY_NO_PACKAGE_FILES
,
REPOSITORY_NO_PACKAGE_FILES
,
}
from
'
../../../../constants/error-messages
'
;
}
from
'
../../../../constants/error-messages
'
;
import
{
logger
}
from
'
../../../../logger
'
;
import
type
{
Pr
}
from
'
../../../../modules/platform
'
;
import
type
{
Pr
}
from
'
../../../../modules/platform
'
;
import
{
PrState
}
from
'
../../../../types
'
;
import
{
PrState
}
from
'
../../../../types
'
;
import
*
as
_cache
from
'
../../../../util/cache/repository
'
;
import
*
as
_cache
from
'
../../../../util/cache/repository
'
;
...
@@ -165,6 +166,19 @@ describe('workers/repository/onboarding/branch/index', () => {
...
@@ -165,6 +166,19 @@ describe('workers/repository/onboarding/branch/index', () => {
cache
.
getCache
.
mockReturnValue
({
configFileName
:
'
.renovaterc
'
});
cache
.
getCache
.
mockReturnValue
({
configFileName
:
'
.renovaterc
'
});
platform
.
getJsonFile
.
mockResolvedValueOnce
({});
platform
.
getJsonFile
.
mockResolvedValueOnce
({});
const
res
=
await
checkOnboardingBranch
(
config
);
const
res
=
await
checkOnboardingBranch
(
config
);
expect
(
logger
.
debug
).
toHaveBeenCalledWith
(
'
Checking cached config file name
'
);
expect
(
logger
.
debug
).
toHaveBeenCalledWith
(
'
Existing config file confirmed
'
);
expect
(
logger
.
debug
).
toHaveBeenCalledWith
(
{
fileName
:
'
.renovaterc
'
,
config
:
{},
},
'
Repository config
'
);
expect
(
res
.
repoIsOnboarded
).
toBeTrue
();
expect
(
res
.
repoIsOnboarded
).
toBeTrue
();
});
});
...
@@ -173,6 +187,21 @@ describe('workers/repository/onboarding/branch/index', () => {
...
@@ -173,6 +187,21 @@ describe('workers/repository/onboarding/branch/index', () => {
platform
.
getJsonFile
.
mockResolvedValueOnce
({
renovate
:
{}
});
platform
.
getJsonFile
.
mockResolvedValueOnce
({
renovate
:
{}
});
fs
.
readLocalFile
.
mockResolvedValueOnce
(
'
{}
'
);
fs
.
readLocalFile
.
mockResolvedValueOnce
(
'
{}
'
);
const
res
=
await
checkOnboardingBranch
(
config
);
const
res
=
await
checkOnboardingBranch
(
config
);
expect
(
logger
.
debug
).
toHaveBeenCalledWith
(
'
Checking cached config file name
'
);
expect
(
logger
.
debug
).
toHaveBeenCalledWith
(
'
Existing config file confirmed
'
);
expect
(
logger
.
debug
).
toHaveBeenCalledWith
(
{
fileName
:
'
package.json
'
,
config
:
{
renovate
:
{},
},
},
'
Repository config
'
);
expect
(
res
.
repoIsOnboarded
).
toBeTrue
();
expect
(
res
.
repoIsOnboarded
).
toBeTrue
();
});
});
...
...
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