Skip to content

Commit 7336863

Browse files
committed
fixed priority
1 parent 13ed8ea commit 7336863

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

pkg/evergreen/client/evergreen_client.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,10 @@ func (c *EvergreenClient) PatchPatch(patchId string, body patch.Body) ([]string,
105105
return nil, err
106106
}
107107

108-
b, err := c.patch(fmt.Sprintf("rest/v2/patches/%s", patchId), bytes)
108+
_, err = c.patch(fmt.Sprintf("rest/v2/patches/%s", patchId), bytes)
109109
if err != nil {
110-
fmt.Println("ERR")
111-
fmt.Println(string(b))
112110
return nil, err
113111
}
114112

115-
fmt.Println("OK")
116-
fmt.Println(string(b))
117113
return nil, nil
118114
}

pkg/evgprompt/executor.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"os"
99
"os/exec"
1010
"regexp"
11+
"strconv"
1112
"strings"
1213
)
1314

@@ -63,11 +64,16 @@ func (e *Executor) handleEvergreenPatch(s string) {
6364
fmt.Println(string(out))
6465

6566
if priority := flags.GetPriorityValue(s); priority != "" {
67+
p, err := strconv.Atoi(priority)
68+
if err != nil {
69+
fmt.Printf("could not convert priority [%s] to an integer!\n", priority)
70+
}
71+
6672
id := getPatchIdFromCliOutput(string(out))
6773
// set priority of patch
68-
_, err := e.client.PatchPatch(id, patch.Body{Priority: 10})
74+
_, err = e.client.PatchPatch(id, patch.Body{Priority: p})
6975
if err != nil {
70-
panic(err)
76+
fmt.Printf("error updating patch priority: %s\n", err)
7177
}
7278
}
7379

0 commit comments

Comments
 (0)