Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Unified Diff: scheduler/appengine/ui/invocation.go

Issue 2949093003: scheduler: more of s/JobID/JobName/ where JobID != Job.JobID. (Closed)
Patch Set: review Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « scheduler/appengine/ui/common.go ('k') | scheduler/appengine/ui/job.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scheduler/appengine/ui/invocation.go
diff --git a/scheduler/appengine/ui/invocation.go b/scheduler/appengine/ui/invocation.go
index adba3583ebb13e42bc417e7532dfc2f7b517f9d4..ffa2bcd643b0103a5e136395d11587f3763bcce1 100644
--- a/scheduler/appengine/ui/invocation.go
+++ b/scheduler/appengine/ui/invocation.go
@@ -15,11 +15,12 @@ import (
"github.com/luci/luci-go/server/templates"
"github.com/luci/luci-go/scheduler/appengine/engine"
+ "github.com/luci/luci-go/scheduler/appengine/presentation"
)
func invocationPage(c *router.Context) {
projectID := c.Params.ByName("ProjectID")
- jobID := c.Params.ByName("JobID")
+ jobName := c.Params.ByName("JobName")
invID, err := strconv.ParseInt(c.Params.ByName("InvID"), 10, 64)
if err != nil {
http.Error(c.Writer, "No such invocation", http.StatusNotFound)
@@ -36,12 +37,12 @@ func invocationPage(c *router.Context) {
wg.Add(1)
go func() {
defer wg.Done()
- inv, err1 = eng.GetInvocation(c.Context, projectID+"/"+jobID, invID)
+ inv, err1 = eng.GetInvocation(c.Context, projectID+"/"+jobName, invID)
}()
wg.Add(1)
go func() {
defer wg.Done()
- job, err2 = eng.GetJob(c.Context, projectID+"/"+jobID)
+ job, err2 = eng.GetJob(c.Context, projectID+"/"+jobName)
}()
wg.Wait()
@@ -78,9 +79,9 @@ func abortInvocationAction(c *router.Context) {
func handleInvAction(c *router.Context, cb func(string, int64) error) {
projectID := c.Params.ByName("ProjectID")
- jobID := c.Params.ByName("JobID")
+ jobName := c.Params.ByName("JobName")
invID := c.Params.ByName("InvID")
- if !isJobOwner(c.Context, projectID, jobID) {
+ if !presentation.IsJobOwner(c.Context, projectID, jobName) {
http.Error(c.Writer, "Forbidden", 403)
return
}
@@ -89,8 +90,8 @@ func handleInvAction(c *router.Context, cb func(string, int64) error) {
http.Error(c.Writer, "Bad invocation ID", 400)
return
}
- if err := cb(projectID+"/"+jobID, invIDAsInt); err != nil {
+ if err := cb(projectID+"/"+jobName, invIDAsInt); err != nil {
panic(err)
}
- http.Redirect(c.Writer, c.Request, fmt.Sprintf("/jobs/%s/%s/%s", projectID, jobID, invID), http.StatusFound)
+ http.Redirect(c.Writer, c.Request, fmt.Sprintf("/jobs/%s/%s/%s", projectID, jobName, invID), http.StatusFound)
}
« no previous file with comments | « scheduler/appengine/ui/common.go ('k') | scheduler/appengine/ui/job.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698