File tree 2 files changed +12
-4
lines changed
2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ func parseBuildHistory(d io.Reader) []*History {
14
14
depth := 0
15
15
buildRowCellDepth := - 1
16
16
builds := make ([]* History , 0 )
17
+ isInsideDisplayName := false
17
18
var curBuild * History
18
19
for {
19
20
tt := z .Next ()
@@ -52,11 +53,12 @@ func parseBuildHistory(d io.Reader) []*History {
52
53
}
53
54
// <a update-parent-class=".build-row" href="/job/appscode/job/43/job/build-binary/227/" class="tip model-link inside build-link display-name">#227</a>
54
55
if string (tn ) == "a" {
55
- if hasCSSClass (a , "build-link " ) && buildRowCellDepth > - 1 {
56
+ if hasCSSClass (a , "display-name " ) && buildRowCellDepth > - 1 {
56
57
if href , found := a ["href" ]; found {
57
58
parts := strings .Split (href , "/" )
58
59
if num , err := strconv .Atoi (parts [len (parts )- 2 ]); err == nil {
59
60
curBuild .BuildNumber = num
61
+ isInsideDisplayName = true
60
62
}
61
63
}
62
64
}
@@ -72,6 +74,11 @@ func parseBuildHistory(d io.Reader) []*History {
72
74
}
73
75
}
74
76
}
77
+ case html .TextToken :
78
+ if isInsideDisplayName {
79
+ curBuild .BuildDisplayName = z .Token ().Data
80
+ isInsideDisplayName = false
81
+ }
75
82
case html .EndTagToken :
76
83
tn , _ := z .TagName ()
77
84
if string (tn ) == "td" && depth == buildRowCellDepth {
Original file line number Diff line number Diff line change @@ -100,9 +100,10 @@ func (j *Job) parentBase() string {
100
100
}
101
101
102
102
type History struct {
103
- BuildNumber int
104
- BuildStatus string
105
- BuildTimestamp int64
103
+ BuildDisplayName string
104
+ BuildNumber int
105
+ BuildStatus string
106
+ BuildTimestamp int64
106
107
}
107
108
108
109
func (j * Job ) GetName () string {
You can’t perform that action at this time.
0 commit comments