Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
c5643c3c
Commit
c5643c3c
authored
Aug 04, 2015
by
Brendan Burns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix submit queue when there are multiple LGTMs
parent
714b39f0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
1 deletion
+57
-1
github.go
contrib/submit-queue/github/github.go
+3
-1
github_test.go
contrib/submit-queue/github/github_test.go
+54
-0
No files found.
contrib/submit-queue/github/github.go
View file @
c5643c3c
...
@@ -111,7 +111,9 @@ func validateLGTMAfterPush(client *github.Client, user, project string, pr *gith
...
@@ -111,7 +111,9 @@ func validateLGTMAfterPush(client *github.Client, user, project string, pr *gith
for
ix
:=
range
events
{
for
ix
:=
range
events
{
event
:=
&
events
[
ix
]
event
:=
&
events
[
ix
]
if
*
event
.
Event
==
"labeled"
&&
*
event
.
Label
.
Name
==
"lgtm"
{
if
*
event
.
Event
==
"labeled"
&&
*
event
.
Label
.
Name
==
"lgtm"
{
lgtmTime
=
event
.
CreatedAt
if
lgtmTime
==
nil
||
event
.
CreatedAt
.
After
(
*
lgtmTime
)
{
lgtmTime
=
event
.
CreatedAt
}
}
}
}
}
if
lgtmTime
==
nil
{
if
lgtmTime
==
nil
{
...
...
contrib/submit-queue/github/github_test.go
View file @
c5643c3c
...
@@ -424,6 +424,60 @@ func TestValidateLGTMAfterPush(t *testing.T) {
...
@@ -424,6 +424,60 @@ func TestValidateLGTMAfterPush(t *testing.T) {
lastModified
:
time
.
Unix
(
11
,
0
),
lastModified
:
time
.
Unix
(
11
,
0
),
shouldPass
:
false
,
shouldPass
:
false
,
},
},
{
issueEvents
:
[]
github
.
IssueEvent
{
{
Event
:
stringPtr
(
"labeled"
),
Label
:
&
github
.
Label
{
Name
:
stringPtr
(
"lgtm"
),
},
CreatedAt
:
timePtr
(
time
.
Unix
(
12
,
0
)),
},
{
Event
:
stringPtr
(
"labeled"
),
Label
:
&
github
.
Label
{
Name
:
stringPtr
(
"lgtm"
),
},
CreatedAt
:
timePtr
(
time
.
Unix
(
11
,
0
)),
},
{
Event
:
stringPtr
(
"labeled"
),
Label
:
&
github
.
Label
{
Name
:
stringPtr
(
"lgtm"
),
},
CreatedAt
:
timePtr
(
time
.
Unix
(
10
,
0
)),
},
},
lastModified
:
time
.
Unix
(
11
,
0
),
shouldPass
:
true
,
},
{
issueEvents
:
[]
github
.
IssueEvent
{
{
Event
:
stringPtr
(
"labeled"
),
Label
:
&
github
.
Label
{
Name
:
stringPtr
(
"lgtm"
),
},
CreatedAt
:
timePtr
(
time
.
Unix
(
10
,
0
)),
},
{
Event
:
stringPtr
(
"labeled"
),
Label
:
&
github
.
Label
{
Name
:
stringPtr
(
"lgtm"
),
},
CreatedAt
:
timePtr
(
time
.
Unix
(
11
,
0
)),
},
{
Event
:
stringPtr
(
"labeled"
),
Label
:
&
github
.
Label
{
Name
:
stringPtr
(
"lgtm"
),
},
CreatedAt
:
timePtr
(
time
.
Unix
(
12
,
0
)),
},
},
lastModified
:
time
.
Unix
(
11
,
0
),
shouldPass
:
true
,
},
}
}
for
_
,
test
:=
range
tests
{
for
_
,
test
:=
range
tests
{
client
,
server
,
mux
:=
initTest
()
client
,
server
,
mux
:=
initTest
()
...
...
Write
Preview
Markdown
is supported
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