Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
9b3799aa
Commit
9b3799aa
authored
Dec 19, 2011
by
Andrew Gerrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder: send commit time to dashboard
R=golang-dev, bradfitz CC=golang-dev
https://golang.org/cl/5489084
parent
0b28de9a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
10 deletions
+15
-10
http.go
misc/dashboard/builder/http.go
+9
-8
main.go
misc/dashboard/builder/main.go
+6
-2
No files found.
misc/dashboard/builder/http.go
View file @
9b3799aa
...
...
@@ -8,10 +8,12 @@ import (
"bytes"
"encoding/json"
"errors"
"fmt"
"io"
"log"
"net/http"
"net/url"
"time"
)
type
obj
map
[
string
]
interface
{}
...
...
@@ -147,20 +149,19 @@ func (b *Builder) updatePackage(pkg string, ok bool, buildLog, info string) erro
*/
}
func
postCommit
(
key
,
pkg
string
,
l
*
HgLog
)
bool
{
err
:=
dash
(
"POST"
,
"commit"
,
url
.
Values
{
"key"
:
{
key
}},
obj
{
func
postCommit
(
key
,
pkg
string
,
l
*
HgLog
)
error
{
t
,
err
:=
time
.
Parse
(
time
.
RFC3339
,
l
.
Date
)
if
err
!=
nil
{
return
fmt
.
Errorf
(
"parsing %q: %v"
,
l
.
Date
,
t
)
}
return
dash
(
"POST"
,
"commit"
,
url
.
Values
{
"key"
:
{
key
}},
obj
{
"PackagePath"
:
pkg
,
"Hash"
:
l
.
Hash
,
"ParentHash"
:
l
.
Parent
,
// TODO(adg): l.Date as int64 unix epoch secs in Time field
"Time"
:
t
.
Unix
()
*
1e6
,
// in microseconds, yuck!
"User"
:
l
.
Author
,
"Desc"
:
l
.
Desc
,
},
nil
)
if
err
!=
nil
{
log
.
Printf
(
"failed to add %s to dashboard: %v"
,
key
,
err
)
return
false
}
return
true
}
func
dashboardCommit
(
pkg
,
hash
string
)
bool
{
...
...
misc/dashboard/builder/main.go
View file @
9b3799aa
...
...
@@ -536,7 +536,7 @@ const xmlLogTemplate = `
<hash>{node|escape}</hash>
<parent>{parent|escape}</parent>
<author>{author|escape}</author>
<date>{date}</date>
<date>{date
|rfc3339date
}</date>
<desc>{desc|escape}</desc>
</log>
`
...
...
@@ -652,7 +652,11 @@ func addCommit(pkg, hash, key string) bool {
}
// Create commit.
return
postCommit
(
key
,
pkg
,
l
)
if
err
:=
postCommit
(
key
,
pkg
,
l
);
err
!=
nil
{
log
.
Printf
(
"failed to add %s to dashboard: %v"
,
key
,
err
)
return
false
}
return
true
}
// fullHash returns the full hash for the given Mercurial revision.
...
...
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