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
430c0552
Commit
430c0552
authored
5 years ago
by
Michael Kriese
Committed by
Rhys Arkins
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix(worker): no config error on dryRun (#4054)
parent
0d2427a0
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/workers/repository/error-config.js
+5
-1
5 additions, 1 deletion
lib/workers/repository/error-config.js
test/workers/repository/error-config.spec.js
+22
-0
22 additions, 0 deletions
test/workers/repository/error-config.spec.js
with
27 additions
and
1 deletion
lib/workers/repository/error-config.js
+
5
−
1
View file @
430c0552
...
...
@@ -23,7 +23,11 @@ async function raiseConfigWarningIssue(config, error) {
logger
.
info
(
'
Updating onboarding PR with config error notice
'
);
body
=
`## Action Required: Fix
${
appName
}
Configuration\n\n
${
body
}
`
;
body
+=
`\n\nOnce you have resolved this problem (in this onboarding branch),
${
appName
}
will return to providing you with a preview of your repository's configuration.`
;
await
platform
.
updatePr
(
pr
.
number
,
onboardingPrTitle
,
body
);
if
(
config
.
dryRun
)
{
logger
.
info
(
'
DRY-RUN: Would update PR #
'
+
pr
.
number
);
}
else
await
platform
.
updatePr
(
pr
.
number
,
onboardingPrTitle
,
body
);
}
else
if
(
config
.
dryRun
)
{
logger
.
info
(
'
DRY-RUN: Would ensure config error issue
'
);
}
else
{
const
res
=
await
platform
.
ensureIssue
(
`Action Required: Fix
${
appName
}
Configuration`
,
...
...
This diff is collapsed.
Click to expand it.
test/workers/repository/error-config.spec.js
+
22
−
0
View file @
430c0552
...
...
@@ -18,6 +18,17 @@ describe('workers/repository/error-config', () => {
const
res
=
await
raiseConfigWarningIssue
(
config
,
error
);
expect
(
res
).
toBeUndefined
();
});
it
(
'
creates issues (dryRun)
'
,
async
()
=>
{
const
error
=
new
Error
(
'
config-validation
'
);
error
.
configFile
=
'
package.json
'
;
error
.
validationMessage
=
'
some-message
'
;
platform
.
ensureIssue
.
mockReturnValue
(
'
created
'
);
const
res
=
await
raiseConfigWarningIssue
(
{
...
config
,
dryRun
:
true
},
error
);
expect
(
res
).
toBeUndefined
();
});
it
(
'
handles onboarding
'
,
async
()
=>
{
const
error
=
new
Error
(
'
config-validation
'
);
error
.
configFile
=
'
package.json
'
;
...
...
@@ -26,5 +37,16 @@ describe('workers/repository/error-config', () => {
const
res
=
await
raiseConfigWarningIssue
(
config
,
error
);
expect
(
res
).
toBeUndefined
();
});
it
(
'
handles onboarding (dryRun)
'
,
async
()
=>
{
const
error
=
new
Error
(
'
config-validation
'
);
error
.
configFile
=
'
package.json
'
;
error
.
validationMessage
=
'
some-message
'
;
platform
.
getBranchPr
.
mockReturnValueOnce
({
number
:
1
,
state
:
'
open
'
});
const
res
=
await
raiseConfigWarningIssue
(
{
...
config
,
dryRun
:
true
},
error
);
expect
(
res
).
toBeUndefined
();
});
});
});
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