Merge lp:~cjohnston/ubuntu-ci-services-itself/more-ts-docs-updates into lp:ubuntu-ci-services-itself

Proposed by Chris Johnston
Status: Merged
Approved by: Francis Ginther
Approved revision: 113
Merged at revision: 120
Proposed branch: lp:~cjohnston/ubuntu-ci-services-itself/more-ts-docs-updates
Merge into: lp:ubuntu-ci-services-itself
Diff against target: 464 lines (+181/-168)
1 file modified
docs/components/ticket-system.rst (+181/-168)
To merge this branch: bzr merge lp:~cjohnston/ubuntu-ci-services-itself/more-ts-docs-updates
Reviewer Review Type Date Requested Status
Francis Ginther Approve
Review via email: mp+202030@code.launchpad.net

Commit message

Updates of the TS docs

To post a comment you must log in.
Revision history for this message
Francis Ginther (fginther) wrote :

Approve.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'docs/components/ticket-system.rst'
2--- docs/components/ticket-system.rst 2014-01-15 21:12:09 +0000
3+++ docs/components/ticket-system.rst 2014-01-17 01:40:37 +0000
4@@ -1,6 +1,5 @@
5-Ticket System (former Project Manager)
6-======================================
7-
8+Ticket System
9+=============
10
11 Purpose
12 *******
13@@ -139,16 +138,16 @@
14 Tickets
15 -------
16
17-list
18-~~~~
19+List tickets
20+~~~~~~~~~~~~
21
22 List all open tickets.
23
24 ::
25
26- curl --dump-header - http://162.213.34.2:8000/api/v1/ticket/
27+ curl --dump-header - http://localhost:8000/api/v1/ticket/
28
29-create_ticket
30+Create ticket
31 ~~~~~~~~~~~~~
32
33 Create a ticket from one or more source package uploads.
34@@ -157,46 +156,129 @@
35
36 curl --dump-header - -H "Content-Type: application/json" -X POST --data '{"owner": "owner@example.com", "title": "My first ticket", "description": "This if my first ticket. See what it can do", "bug_id": "12345", "added_binaries": "binary-1,binary-2", "removed_binaries": "binary-3,binary-4"}' http://localhost:8000/api/v1/ticket/
37
38-get_ticket
39+Get ticket
40 ~~~~~~~~~~
41
42-Return the ticket given its id.
43-
44-::
45-
46- curl --dump-header - http://162.213.34.2:8000/api/v1/ticket/1/
47-
48-get_next_ticket
49+*Full ticket*
50+
51+Returns ALL information about the given ticket.
52+
53+::
54+
55+ curl --dump-header - http://localhost:8000/api/v1/fullticket/1/
56+
57+*Model info*
58+
59+Return the ticket model info only for the given ticket.
60+
61+::
62+
63+ curl --dump-header - http://localhost:8000/api/v1/ticket/1/
64+
65+Get Next Ticket
66 ~~~~~~~~~~~~~~~
67
68 Show the current in progress, or the first pending ticket.
69
70 ::
71
72- curl --dump-header - http://162.213.34.2:8000/api/v1/next/
73+ curl --dump-header - http://localhost:8000/api/v1/next/
74
75-get_ticket_status
76+Get ticket status
77 ~~~~~~~~~~~~~~~~~
78
79-Get the ticket status.
80-
81-create_source_package_upload
82+Get the status of all tickets or tickets for a specific status. (Mostly for the WebUI)
83+
84+*All*
85+
86+::
87+
88+ curl --dump-header - http://localhost:8000/api/v1/ticketstatus/
89+
90+*New*
91+
92+::
93+
94+ curl --dump-header - http://localhost:8000/api/v1/ticketstatus/?current_workflow_step=100
95+
96+
97+*Package Building*
98+
99+::
100+
101+ curl --dump-header - http://localhost:8000/api/v1/ticketstatus/?current_workflow_step=200
102+
103+*Image Building*
104+
105+::
106+
107+ curl --dump-header - http://localhost:8000/api/v1/ticketstatus/?current_workflow_step=300
108+
109+*Image Testing*
110+
111+::
112+
113+ curl --dump-header - http://localhost:8000/api/v1/ticketstatus/?current_workflow_step=400
114+
115+*Package Publishing*
116+
117+::
118+
119+ curl --dump-header - http://localhost:8000/api/v1/ticketstatus/?current_workflow_step=500
120+
121+*Failed*
122+
123+::
124+
125+ curl --dump-header - http://localhost:8000/api/v1/ticketstatus/?current_workflow_step=999
126+
127+*Complete*
128+
129+::
130+
131+ curl --dump-header - http://localhost:8000/api/v1/ticketstatus/?current_workflow_step=1000
132+
133+Update ticket status
134+~~~~~~~~~~~~~~~~~~~~
135+
136+To be used by the CLI and the lander
137+
138+::
139+
140+ curl --dump-header - -H "Content-Type: application/json" -X PATCH --data '{"current_workflow_step": "100", "status": "000"}' http://localhost:8000/api/v1/updateticketstatus/1/
141+
142+Update subticket status
143+~~~~~~~~~~~~~~~~~~~~~~~
144+
145+To be used by the CLI and the lander
146+
147+::
148+
149+ curl --dump-header - -H "Content-Type: application/json" -X PATCH --data '{"current_workflow_step": "100", "status": "000"}' http://localhost:8000/api/v1/updatesubticketstatus/1/
150+
151+Create source package upload
152 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
153
154+To be used by the CLI
155+
156 ::
157
158 curl --dump-header - -H "Content-Type: application/json" -X POST --data '{"sourcepackage": "/api/v1/sourcepackage/X/", "version": "1.0"}' http://localhost:8000/api/v1/spu/
159
160-create_artifact
161+Create artifact
162 ~~~~~~~~~~~~~~~
163
164+Valid types are: "SPU", "RESULTS", "LOGS"
165+
166 ::
167
168- curl --dump-header - -H "Content-Type: application/json" -X POST --data '{"name": "my_artifact", "subticket": "/api/v1/ticket/X/", "reference": "http://path.to/artifact/", "type": "SPU"}' http://localhost:8000/api/v1/artifact/
169+ curl --dump-header - -H "Content-Type: application/json" -X POST --data '{"name": "my_artifact", "subticket": "/api/v1/subticket/X/", "reference": "http://path.to/artifact/", "type": "SPU"}' http://localhost:8000/api/v1/artifact/
170
171-create_subticket
172+Create subticket
173 ~~~~~~~~~~~~~~~~
174
175+To be used by the CLI
176+
177 ::
178
179 curl --dump-header - -H "Content-Type: application/json" -X POST --data '{"source_package_upload": "/api/v1/spu/X/, "ticket": "/api/v1/ticket/X/, "assignee": "test@example.com"}' http://localhost:8000/api/v1/subticket/
180@@ -205,98 +287,37 @@
181 Project
182 -------
183
184-get_source_package
185+Get source package
186 ~~~~~~~~~~~~~~~~~~
187
188-*return all binary packages*
189+return all source packages
190
191 ::
192
193 curl --dump-header - http://localhost:8000/api/v1/sourcepackage/
194
195-add_source_package
196+Add source package
197 ~~~~~~~~~~~~~~~~~~
198
199+This action would be completed by the CLI when it encounters a new source package that the ticket system hasn't had before.
200+
201 ::
202
203 curl --dump-header - -H "Content-Type: application/json" -X POST --data '{"name": "my-package"}' http://localhost:8000/api/v1/sourcepackage/
204
205-get_binary_package
206+Get binary package
207 ~~~~~~~~~~~~~~~~~~
208
209-*return all binary packages*
210+return all binary packages
211
212 ::
213
214 curl --dump-header - http://localhost:8000/api/v1/binarypackage/
215
216-add_binary_package
217-~~~~~~~~~~~~~~~~~~
218-
219-::
220-
221- curl --dump-header - -H "Content-Type: application/json" -X POST --data '{"name": "my-package", "sourcepackage": "/api/v1/sourcepackage/1/", "seeded": "False"}' http://localhost:8000/api/v1/binarypackage/
222-
223-Person - TODO
224--------------
225-
226-add_person
227-~~~~~~~~~~
228-
229-Add a person (or a team) to the database.
230-
231-*person*
232-
233-::
234-
235- curl --dump-header - -H "Content-Type: application/json" -X POST --data '{"name": "Chris Johnston", "email": "chris.johnston@canonical.com", "is_team": "False"}' http://localhost:8000/api/v1/person/
236-
237-
238-*team*
239-
240-::
241-
242- curl --dump-header - -H "Content-Type: application/json" -X POST --data '{"name": "Canonical CI Engineering", "email": "canonical-ci-engineering@lists.launchpad.net", "is_team": "True"}' http://localhost:8000/api/v1/person/
243-
244-
245-get_person
246-~~~~~~~~~~
247-
248-*Return all persons*
249-
250-::
251-
252- curl http://localhost:8000/api/v1/person/
253-
254-*search by name*
255-
256-::
257-
258- curl --dump-header - http://localhost:8000/api/v1/person/?name__exact=Chris%20Johnston
259- curl --dump-header - http://localhost:8000/api/v1/person/?name__iexact=chris%20johnston
260- curl --dump-header - http://localhost:8000/api/v1/person/?name__startswith=Chris
261- curl --dump-header - http://localhost:8000/api/v1/person/?name__istartswith=chris
262-
263-*search by email*
264-
265-::
266-
267- curl --dump-header - http://localhost:8000/api/v1/person/?email__exact=chris.johnston@canonical.com
268- curl --dump-header - http://localhost:8000/api/v1/person/?email__iexact=Chris.Johnston@canonical.com
269- curl --dump-header - http://localhost:8000/api/v1/person/?email__startswith=chris
270- curl --dump-header - http://localhost:8000/api/v1/person/?email__istartswith=Chris
271-
272-*show/don't show teams*
273-
274-::
275-
276- curl --dump-header - http://localhost:8000/api/v1/person/?is_team=True
277- curl --dump-header - http://localhost:8000/api/v1/person/?is_team=False
278-
279 Models
280 ******
281
282-Ticket System will be django + REST + Postgres. It will have apps and data models similar to the following.
283+Ticket System will be django + REST + Postgres. The phase 0 models are defined below with the proposed future models coded out below that.
284
285 Phase 0
286 -------
287@@ -304,94 +325,35 @@
288 sourcepackage
289 ~~~~~~~~~~~~~
290
291-::
292-
293- class SourcePackage(models.Model):
294- name = models.CharField(max_length=4096)
295+A source package is an existing source package in the Ubuntu archives. A source package record is created when a source package has changes submitted to the ticket system for the first time.
296+
297+binarypackage
298+~~~~~~~~~~~~~
299+
300+The 'master list' of all binary packages to be tested whenever a change is made. This list can be added to and removed from when creating tickets.
301
302 sourcepackageupload
303 ~~~~~~~~~~~~~~~~~~~
304
305-::
306-
307- class SourcePackageUpload(models.Model):
308- sourcepackage = models.ForeignKey("SourcePackage")
309- version = models.CharField(max_length=4096)
310- date = models.DateTimeField()
311- artifact = models.ForeignKey("Artifact") # Provided by the artifact manager
312-
313+A 'Source Package Upload' is a file uploaded by the user that is related to the changes being made. It will have a related source package and artifacts.
314
315 ticket
316 ~~~~~~
317
318-A ticket can contain only one active subticket per source package. This
319-way we can reference the ticket externally by source package name and ticket
320-number.
321-
322-::
323-
324- class Ticket(models.Model):
325- WORKFLOW_STEPS = (
326- (PACKAGE_BUILDING, "Package Building"),
327- (IMAGE_BUILDING, "Image Building"),
328- (IMAGE_TESTING, "Image Testing"),
329- (PACKAGE_PUBLISHING, "Package Publishing"),
330- )
331- WORKFLOW_STEP_STATUSES = (
332- (PKG_BUILD_WAITING, "Not Started"),
333- (PKG_BUILD_INPROGRESS, "In Progress"),
334- (PKG_BUILD_DONE, "Completed"),
335- (PKG_BUILD_FAILED, "Failed"),
336- (IMAGE_BUILD_WAITING, "Not Started"),
337- (IMAGE_BUILD_INPROGRESS, "In Progress"),
338- (IMAGE_BUILD_DONE, "Completed"),
339- (IMAGE_BUILD_FAILED, "Failed"),
340- (IMAGE_TESTS_WAITING, "Not Started"),
341- (IMAGE_TESTS_INPROGRESS, "In Progress"),
342- (IMAGE_TESTS_PASSED, "Passed"),
343- (IMAGE_TESTS_FAILED, "Failed"),
344- (PKG_PUBLISHING_DONE, "Completed"),
345- (PKG_PUBLISHING_FAILED, "Failed"),
346- )
347- owner = models.ForeignKey("Person")
348- title = models.CharField(max_length=4096)
349- description = models.TextField()
350- bug_id = models.IntegerField(null=True, blank=True)
351- current_workflow_step = models.CharField(choices=WORKFLOW_STEPS)
352- status = models.CharField(choices=WORKFLOW_STEP_STATUSES)
353- base_image = models.CharField(max_length=20)
354+A ticket is created to get a change (or set of changes) into the Ubuntu archive. Creating a ticket allows the changes to be tracked through the processes of package building, image building, image testing and publishing as well as the results to be seen by the user.
355
356 subticket
357 ~~~~~~~~~
358
359-::
360-
361- class SubTicket(models.Model):
362- WORKFLOW_STEPS = (
363- (PACKAGE_BUILDING, "Package Building"),
364- )
365- WORKFLOW_STEP_STATUSES = (
366- (PKG_BUILD_WAITING, "Not Started"),
367- (PKG_BUILD_INPROGRESS, "In Progress"),
368- (PKG_BUILD_DONE, "Completed"),
369- (PKG_BUILD_FAILED, "Failed"),
370- )
371- current_workflow_step = models.CharField(choices=WORKFLOW_STEPS)
372- status = models.CharField(choices=WORKFLOW_STEP_STATUSES)
373- ticket = models.ForeignKey("Ticket")
374- assignee = models.ForeignKey("Person")
375- sourcepackageupload = models.ForeignKey("SourcePackageUpload")
376-
377+Each source package upload that is added to a ticket will have its own subticket. A ticket can contain one of more subtickets. The subticket allows the user to track the progress and results of the package building for each source package upload.
378
379 artifact
380 ~~~~~~~~
381
382-::
383-
384- class Artifact(models.Model):
385- type = models.CharField(choices=["test_result", "source_upload", "test_failure_log"]
386- subticket = models.ForeignKey("subticket")
387- reference = models.CharField(max_length=4096) # Provided by the artifact manager
388+Artifacts can be multiple things. When a ticket is initially created, it will have artifacts attached to it which are the source package upload files. Artifacts can also be test results and log files. They can be assigned to a relevant ticket or subticket based on the step of the process.
389+
390+Future Apps/Models
391+------------------
392
393 person
394 ~~~~~~
395@@ -403,10 +365,6 @@
396 email = models.EmailField(max_length=200)
397 is_team = models.BooleanField(default=False)
398
399-
400-Future Apps/Models
401-------------------
402-
403 testsuites
404 ~~~~~~~~~~
405
406@@ -463,3 +421,58 @@
407 lp_weblink = models.CharField(max_length=4096)
408
409
410+Person API's - TODO
411+-------------------
412+
413+add_person
414+~~~~~~~~~~
415+
416+Add a person (or a team) to the database.
417+
418+*person*
419+
420+::
421+
422+ curl --dump-header - -H "Content-Type: application/json" -X POST --data '{"name": "Chris Johnston", "email": "chris.johnston@canonical.com", "is_team": "False"}' http://localhost:8000/api/v1/person/
423+
424+
425+*team*
426+
427+::
428+
429+ curl --dump-header - -H "Content-Type: application/json" -X POST --data '{"name": "Canonical CI Engineering", "email": "canonical-ci-engineering@lists.launchpad.net", "is_team": "True"}' http://localhost:8000/api/v1/person/
430+
431+
432+get_person
433+~~~~~~~~~~
434+
435+*Return all persons*
436+
437+::
438+
439+ curl http://localhost:8000/api/v1/person/
440+
441+*search by name*
442+
443+::
444+
445+ curl --dump-header - http://localhost:8000/api/v1/person/?name__exact=Chris%20Johnston
446+ curl --dump-header - http://localhost:8000/api/v1/person/?name__iexact=chris%20johnston
447+ curl --dump-header - http://localhost:8000/api/v1/person/?name__startswith=Chris
448+ curl --dump-header - http://localhost:8000/api/v1/person/?name__istartswith=chris
449+
450+*search by email*
451+
452+::
453+
454+ curl --dump-header - http://localhost:8000/api/v1/person/?email__exact=chris.johnston@canonical.com
455+ curl --dump-header - http://localhost:8000/api/v1/person/?email__iexact=Chris.Johnston@canonical.com
456+ curl --dump-header - http://localhost:8000/api/v1/person/?email__startswith=chris
457+ curl --dump-header - http://localhost:8000/api/v1/person/?email__istartswith=Chris
458+
459+*show/don't show teams*
460+
461+::
462+
463+ curl --dump-header - http://localhost:8000/api/v1/person/?is_team=True
464+ curl --dump-header - http://localhost:8000/api/v1/person/?is_team=False

Subscribers

People subscribed via source and target branches