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
7ae3ce32
Commit
7ae3ce32
authored
4 years ago
by
Rhys Arkins
Browse files
Options
Downloads
Patches
Plain Diff
fix(automerge): handle github branch protection failures
parent
eef58e2e
No related branches found
Branches containing commit
Tags
24.60.3
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/workers/branch/automerge.ts
+30
-3
30 additions, 3 deletions
lib/workers/branch/automerge.ts
with
30 additions
and
3 deletions
lib/workers/branch/automerge.ts
+
30
−
3
View file @
7ae3ce32
...
@@ -38,13 +38,40 @@ export async function tryBranchAutomerge(
...
@@ -38,13 +38,40 @@ export async function tryBranchAutomerge(
}
}
logger
.
info
({
branch
:
config
.
branchName
},
'
Branch automerged
'
);
logger
.
info
({
branch
:
config
.
branchName
},
'
Branch automerged
'
);
return
'
automerged
'
;
// Branch no longer exists
return
'
automerged
'
;
// Branch no longer exists
}
catch
(
err
)
{
}
catch
(
err
)
/* istanbul ignore next */
{
// istanbul ignore if
if
(
err
.
message
===
'
not ready
'
)
{
if
(
err
.
message
===
'
not ready
'
)
{
logger
.
debug
(
'
Branch is not ready for automerge
'
);
logger
.
debug
(
'
Branch is not ready for automerge
'
);
return
'
not ready
'
;
return
'
not ready
'
;
}
}
logger
.
info
({
err
},
`Failed to automerge branch`
);
if
(
err
.
message
.
includes
(
'
refusing to merge unrelated histories
'
)
||
err
.
message
.
includes
(
'
Not possible to fast-forward
'
)
)
{
logger
.
warn
({
err
},
'
Branch is not up to date - cannot automerge
'
);
return
'
not ready
'
;
}
if
(
err
.
message
.
includes
(
'
Protected branch
'
))
{
if
(
err
.
message
.
includes
(
'
status check
'
))
{
logger
.
debug
(
{
err
},
'
Branch is not ready for automerge: required status checks are remaining
'
);
return
'
not ready
'
;
}
if
(
err
.
stack
?.
includes
(
'
reviewers
'
))
{
logger
.
info
(
{
err
},
'
Branch automerge is not possible due to branch protection (required reviewers)
'
);
return
'
failed
'
;
}
logger
.
info
(
{
err
},
'
Branch automerge is not possible due to branch protection
'
);
return
'
failed
'
;
}
logger
.
warn
({
err
},
'
Unknown error when attempting branch automerge
'
);
return
'
failed
'
;
return
'
failed
'
;
}
}
}
else
if
(
branchStatus
===
BranchStatus
.
red
)
{
}
else
if
(
branchStatus
===
BranchStatus
.
red
)
{
...
...
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