Skip to content

Commit bfc100a

Browse files
fieldryandRyan Field
authored and
Ryan Field
committed
Remove deprecated jobruns endpoint
1 parent 88d6d01 commit bfc100a

File tree

3 files changed

+1
-114
lines changed

3 files changed

+1
-114
lines changed

goflow_test.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,6 @@ func TestJobsRoute(t *testing.T) {
7171
}
7272
}
7373

74-
func TestJobRunsRoute(t *testing.T) {
75-
var w = httptest.NewRecorder()
76-
req, _ := http.NewRequest("GET", "/api/jobruns", nil)
77-
router.ServeHTTP(w, req)
78-
79-
if w.Code != http.StatusOK {
80-
t.Errorf("httpStatus is %d, expected %d", w.Code, http.StatusOK)
81-
}
82-
}
83-
8474
func TestExecutionsRoute(t *testing.T) {
8575
var w = httptest.NewRecorder()
8676
req, _ := http.NewRequest("GET", "/api/executions", nil)

routes.go

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -54,48 +54,6 @@ func (g *Goflow) addAPIRoutes() *Goflow {
5454
c.JSON(http.StatusOK, msg)
5555
})
5656

57-
// Deprecated: will be removed in v3.0.0
58-
api.GET("/jobruns", func(c *gin.Context) {
59-
jobName := c.Query("jobname")
60-
stateQuery := c.Query("state")
61-
62-
jobruns := make([]jobrun, 0)
63-
64-
for job := range g.Jobs {
65-
stored, _ := readExecutions(g.Store, job)
66-
for _, execution := range stored {
67-
if stateQuery != "" && stateQuery != string(execution.State) {
68-
} else if jobName != "" && jobName != execution.JobName {
69-
} else {
70-
71-
t := taskstate{make(map[string]state, 0)}
72-
73-
for _, task := range execution.TaskExecutions {
74-
t.Taskstate[task.Name] = task.State
75-
}
76-
77-
j := jobrun{
78-
JobName: job,
79-
Submitted: execution.StartedAt,
80-
JobState: jobstate{
81-
State: execution.State,
82-
TaskState: t,
83-
},
84-
}
85-
86-
jobruns = append(jobruns, j)
87-
}
88-
}
89-
}
90-
91-
var msg struct {
92-
Jobruns []jobrun `json:"jobruns"`
93-
}
94-
msg.Jobruns = jobruns
95-
96-
c.JSON(http.StatusOK, msg)
97-
})
98-
9957
api.GET("/executions", func(c *gin.Context) {
10058
jobName := c.Query("jobname")
10159
stateQuery := c.Query("state")

swagger.json

Lines changed: 1 addition & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -119,67 +119,6 @@
119119
}
120120
}
121121
},
122-
"/api/jobruns": {
123-
"get": {
124-
"operationId": "listJobRuns",
125-
"summary": "query and list job runs",
126-
"parameters": [
127-
{
128-
"in": "query",
129-
"name": "jobname",
130-
"schema": {
131-
"type": "string"
132-
},
133-
"description": "(optional) the job name"
134-
},
135-
{
136-
"in": "query",
137-
"name": "state",
138-
"schema": {
139-
"type": "string"
140-
},
141-
"description": "(optional) the job state, valid values are [running, failed, successful]"
142-
}
143-
],
144-
"responses": {
145-
"200": {
146-
"description": "200 response",
147-
"content": {
148-
"application/json": {
149-
"examples": {
150-
"exampleJobRuns": {
151-
"value": {
152-
"jobruns": [
153-
{
154-
"job": "exampleComplexAnalytics",
155-
"submitted": "2023-06-24T07:23:11.208506156Z",
156-
"state": {
157-
"job": "running",
158-
"tasks": {
159-
"state": {
160-
"addOneOne": "running",
161-
"addThreeFour": "notstarted",
162-
"addTwoFour": "notstarted",
163-
"cleanUp": "notstarted",
164-
"sleepOne": "successful",
165-
"sleepTwo": "notstarted",
166-
"totallySkippable": "notstarted",
167-
"whoopsWithConstantDelay": "running",
168-
"whoopsWithExponentialBackoff": "upforretry"
169-
}
170-
}
171-
}
172-
}
173-
]
174-
}
175-
}
176-
}
177-
}
178-
}
179-
}
180-
}
181-
}
182-
},
183122
"/api/executions": {
184123
"get": {
185124
"operationId": "listExecutions",
@@ -208,7 +147,7 @@
208147
"content": {
209148
"application/json": {
210149
"examples": {
211-
"exampleJobRuns": {
150+
"exampleExecutions": {
212151
"value": {
213152
"executions": [
214153
{

0 commit comments

Comments
 (0)