Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Simon Latapie
homer-bot
Commits
eac4d89d
Commit
eac4d89d
authored
Apr 16, 2021
by
Simon Latapie
Browse files
reword Rejected with Not Compliant
because the MR is not really "rejected" (not yet)
parent
343ad580
Changes
3
Hide whitespace changes
Inline
Side-by-side
doc/acceptance.md
View file @
eac4d89d
...
...
@@ -16,9 +16,9 @@ stateDiagram
Submitted: MR Submitted
InReview: In Review
[*] --> Submitted: A VLC developer submitted
Submitted -->
Rejected
: NOT mergeable by gitlab
Submitted -->
NotCompliant
: NOT mergeable by gitlab
Submitted --> PipelineReady: mergeable by gitlab
PipelineReady -->
Rejected
: CI NOK
PipelineReady -->
NotCompliant
: CI NOK
PipelineReady --> Reviewable: CI OK
Reviewable --> InReview: Thread opened\nor\nAnother Developer voted
Reviewable --> Accepted: No vote\nNo thread opened\nduring 72h
...
...
@@ -37,9 +37,9 @@ stateDiagram
Submitted: MR Submitted
InReview: In Review
[*] --> Submitted: A VLC developer submitted
Submitted -->
Rejected
: NOT mergeable by gitlab
Submitted -->
NotCompliant
: NOT mergeable by gitlab
Submitted --> PipelineReady: mergeable by gitlab
PipelineReady -->
Rejected
: CI NOK
PipelineReady -->
NotCompliant
: CI NOK
PipelineReady --> Reviewable: CI OK
Reviewable --> InReview: Thread opened\nor\nAnother Developer voted
InReview --> Acceptable: All threads resolved\nand\nlen(votes) > 0\nand\n Score > 0
...
...
graph.go
View file @
eac4d89d
...
...
@@ -9,7 +9,7 @@ import (
// None state is used in case of errors in the graph traversal
const
(
InitialState
=
GraphNode
(
"Initial"
)
Rejected
State
=
GraphNode
(
"
Rejected
"
)
NotCompliant
State
=
GraphNode
(
"
NotCompliant
"
)
PipelineReadyState
=
GraphNode
(
"PipelineReady"
)
ReviewableState
=
GraphNode
(
"Reviewable"
)
InReviewState
=
GraphNode
(
"InReview"
)
...
...
@@ -92,8 +92,8 @@ func FindMRGraphState(mr *MergeRequest, graph []GraphEdge) (GraphNode, []Check)
// Note: transitions will be evaluated in the order of definitions
func
UserAcceptanceGraph
()
[]
GraphEdge
{
graph
:=
[]
GraphEdge
{}
graph
=
append
(
graph
,
GraphEdge
{
InitialState
,
CheckMergeable
,
PipelineReadyState
,
Rejected
State
})
graph
=
append
(
graph
,
GraphEdge
{
PipelineReadyState
,
CheckPipelines
,
ReviewableState
,
Rejected
State
})
graph
=
append
(
graph
,
GraphEdge
{
InitialState
,
CheckMergeable
,
PipelineReadyState
,
NotCompliant
State
})
graph
=
append
(
graph
,
GraphEdge
{
PipelineReadyState
,
CheckPipelines
,
ReviewableState
,
NotCompliant
State
})
graph
=
append
(
graph
,
SimpleEdge
(
ReviewableState
,
CheckVoteOrThread
,
InReviewState
))
graph
=
append
(
graph
,
SimpleEdge
(
InReviewState
,
CheckAllThreadResolvedAndDevScoreStrict
,
AcceptableState
))
graph
=
append
(
graph
,
SimpleEdge
(
AcceptableState
,
CheckIsNotActiveAnymoreUser
,
AcceptedState
))
...
...
@@ -106,8 +106,8 @@ func UserAcceptanceGraph() []GraphEdge {
// Note: transitions will be evaluated in the order of definitions
func
DeveloperAcceptanceGraph
()
[]
GraphEdge
{
graph
:=
[]
GraphEdge
{}
graph
=
append
(
graph
,
GraphEdge
{
InitialState
,
CheckMergeable
,
PipelineReadyState
,
Rejected
State
})
graph
=
append
(
graph
,
GraphEdge
{
PipelineReadyState
,
CheckPipelines
,
ReviewableState
,
Rejected
State
})
graph
=
append
(
graph
,
GraphEdge
{
InitialState
,
CheckMergeable
,
PipelineReadyState
,
NotCompliant
State
})
graph
=
append
(
graph
,
GraphEdge
{
PipelineReadyState
,
CheckPipelines
,
ReviewableState
,
NotCompliant
State
})
graph
=
append
(
graph
,
SimpleEdge
(
ReviewableState
,
CheckVoteOrThread
,
InReviewState
))
graph
=
append
(
graph
,
SimpleEdge
(
ReviewableState
,
CheckNoActivity
,
AcceptedState
))
graph
=
append
(
graph
,
SimpleEdge
(
InReviewState
,
CheckAllThreadResolvedAndDevScoreNonStrict
,
AcceptableState
))
...
...
main.go
View file @
eac4d89d
...
...
@@ -15,7 +15,7 @@ const (
rootURLEnvVar
=
"GITLAB_API_ROOT_URL"
defaultAPIRootURL
=
"https://code.videolan.org/api/v4"
acceptedLabel
=
"Accepted"
rejected
Label
=
"
Rejected
"
notCompliant
Label
=
"
NotCompliant
"
metadataPrefixBase64
=
"homerbotmeta-base64:"
messageTypeReport
=
"report"
messageTypeWelcome
=
"welcome"
...
...
@@ -88,7 +88,7 @@ func generateReport(mr MergeRequest, success bool, checks []Check) string {
report
+=
fmt
.
Sprintln
(
details
)
report
+=
fmt
.
Sprintln
(
"</p></details>"
)
// Add a message identifier (maybe for future use)
metadata
:=
Metadata
{
MessageType
:
messageTypeReport
,
ReportResult
:
rejected
Label
}
metadata
:=
Metadata
{
MessageType
:
messageTypeReport
,
ReportResult
:
notCompliant
Label
}
if
success
{
metadata
.
ReportResult
=
acceptedLabel
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment