Merge lp:~canonical-ci-engineering/ubuntu-ci-services-itself/pm into lp:ubuntu-ci-services-itself

Proposed by Ursula Junque
Status: Rejected
Rejected by: Chris Johnston
Proposed branch: lp:~canonical-ci-engineering/ubuntu-ci-services-itself/pm
Merge into: lp:ubuntu-ci-services-itself
Diff against target: 447 lines (+362/-58) (has conflicts)
4 files modified
docs/components/planned.rst (+1/-1)
docs/components/project-manager.rst (+0/-41)
docs/components/test-database.rst (+0/-16)
docs/components/ticket-system.rst (+361/-0)
Conflict adding file docs/components/ticket-system.rst.  Moved existing file to docs/components/ticket-system.rst.moved.
To merge this branch: bzr merge lp:~canonical-ci-engineering/ubuntu-ci-services-itself/pm
Reviewer Review Type Date Requested Status
Francis Ginther Approve
Vincent Ladeuil (community) Approve
Review via email: mp+198139@code.launchpad.net

Commit message

Adding the design, modeling and beginning API calls for Houston.

Description of the change

Adding the design, modelling and part of the REST API calls for Houston (former project manager) phase 0.

Design section explains the approach to process source packages only.

NOTE: Nicely formatted page: http://162.213.34.2/rtd/components/houston.html

To post a comment you must log in.
Revision history for this message
Vincent Ladeuil (vila) wrote :

Overall: sounds great but already a bit complex, I wonder if we can simplify things a bit.

Some details:

24 +* Runs as a persistent service, when it goes down, the engine halts.
25 +* State needs to serialized whenever it is updated, so that status can be regenerated on a restart.

+1

57 +* PPA Assigner - Provides two PPAs to perform package builds, one for MPs themselves, another for MPs + trunk.

Isn't phase 0 using a single PPA only ?

60 +* Integration Test Runner - Runs the specified tests on up to 3 images.
61 +

Just 'Test Runner', the 'Integration' is silent ;)

80 + package: chris-foobar-pkg
81 + version: 1.1-0ubuntu2
82 + source: chris-foobar-src

Is there a strong reason to use ':' or can we use '=' instead ?

I don't want to bikeshed there so if you feel strongly about, go for
it. Otherwise, this is configuration data and I'd rather use '=' to make
sure we keep it simple and don't turn it into a full json that only experts
can decipher ;)

233 + WORKFLOW_STEPS = (
239 + WORKFLOW_STEP_STATUSES = (

I don't get why those are split, aren't them all just states for the ticket ?

1 === added file 'docs/components/houston.rst'
380 === removed file 'docs/components/project-manager.rst'

O.M.G. !

This is a sin, please use 'bzr mv docs/components/project-manger.rst docs/components/houston.rst' !

A kitten dies everytime you do remove+add ;-)

More seriously, bzr supports renames, use that feature, it preserves
history, in this specific case it would have more clearly show what you did
change in this proposal.

....

Ha right, that was a rewrite on the side and the remove was revno 27.

Ok, the kitten survived after all ;)

Summary, no need to block on the questions asked above, the answers can come in a followup, this is significant progress, let's land it.

review: Approve
Revision history for this message
Francis Ginther (fginther) wrote :

In general this is all good for phase 0, I don't see anything missing.

Just some small nit-picking:
 - For "submitting a file to project manager" would it be easier to state the format needed (yaml, json, etc.) and the required keys?
 - The Interactions/Ticket System reflects the older design. Might just want to focus on the Phase 0 plan of interacting with the Lander and the UI.
 - I can't think of an immediate need to have multiple users defined for phase 0. But I can see the potential need for having at least a default user defined.

As these don't appear to directly impact the design, I'll approve.

review: Approve
Revision history for this message
Chris Johnston (cjohnston) wrote :

Attempt to merge into lp:ubuntu-ci-services-itself failed due to conflicts:

duplicate in docs/components/ticket-system.rst.moved

Revision history for this message
Vincent Ladeuil (vila) wrote :

> duplicate in docs/components/ticket-system.rst.moved

Probably caused by someone modifying that file on trunk since you branched, you need to merge locally, resolve the conflict and push again.

Revision history for this message
Chris Johnston (cjohnston) wrote :

This was superseded by another MP

Unmerged revisions

35. By Ursula Junque

Changing references from houston to ticket system

34. By Ursula Junque

Renaming houston to ticket system

33. By Chris Johnston

Fix build error

32. By Ursula Junque

Added set_subticket_status

31. By Ursula Junque

Added 'Not Started' status to workflow steps

30. By Ursula Junque

More formatting

29. By Ursula Junque

REST API in same title level as other to show in planned page

28. By Ursula Junque

API formatting

27. By Ursula Junque

removing ticket system as it's inside houston now

26. By Ursula Junque

s/project-manager/houston/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'docs/components/planned.rst'
2--- docs/components/planned.rst 2013-12-06 15:26:40 +0000
3+++ docs/components/planned.rst 2013-12-09 17:50:28 +0000
4@@ -4,7 +4,7 @@
5 .. toctree::
6 :maxdepth: 2
7
8- project-manager
9+ houston
10 ticket-manager
11 web-server
12 branch-listener
13
14=== removed file 'docs/components/project-manager.rst'
15--- docs/components/project-manager.rst 2013-11-25 23:32:31 +0000
16+++ docs/components/project-manager.rst 1970-01-01 00:00:00 +0000
17@@ -1,41 +0,0 @@
18-Project Manager
19-===============
20-
21-.. toctree::
22- :maxdepth: 2
23-
24- ticket-system
25- test-database
26-
27-*Purpose:*
28-
29-* Brains of the CI system. Contains project centric knowledge such as location of trunk names of integration tests, point of contact, etc. Also knows status of current MPs being built and a queue of MPs to process.
30-* The project manager maintains the following sets of data:
31- * The history and status of tickets.
32- * The definition and configuration of individual projects.
33- * The test database.
34-
35-*Deployment:*
36-
37-* Can run as a juju service.
38-* Runs as a persistent service, when it goes down, the engine halts.
39-* State needs to serialized whenever it is updated, so that status can be regenerated on a restart.
40-* Public facing UI is provided by the Web Server.
41-
42-*Interactions:*
43-
44-* Ticket Manager - Requests project metadata and provides status updates on tickets active in the CI system.
45-* Landing Manager - Requests project metadata and provides updates on status of a branch through the CI system.
46-* Web Server - Provides the UI.
47-
48-*Development Plan:*
49-
50-* Define API.
51-* Define backend ticket storage.
52-* Define backend project specification storage.
53-* Define backend test database storage.
54-* Integrate with the Web Server.
55-* Integrate with the Landing Manager, supply metadata to build and test a single project and generate an automatic low-cost ticket.
56-* Handle status updates from the Landing Manager.
57-* Integrate with the Ticket Manager to supply metadata to establish a ticket workflow with multiple projects and tests.
58-* Handle status updates from the Ticket Manager.
59
60=== removed file 'docs/components/test-database.rst'
61--- docs/components/test-database.rst 2013-11-16 10:12:08 +0000
62+++ docs/components/test-database.rst 1970-01-01 00:00:00 +0000
63@@ -1,16 +0,0 @@
64-Tests Database (sub-function of Project Manager)
65-================================================
66-
67-*Purpose:*
68-
69-* Repository of tests per project. (What else?)
70-
71-*Deployment:*
72-
73-* Built into the Project Manager
74-
75-*Interactions:*
76-
77-* Ticket System - Supplies available and default test suites.
78-* Integration Test Service - Supplies test provisioning and execution details.
79-
80
81=== added file 'docs/components/ticket-system.rst'
82--- docs/components/ticket-system.rst 1970-01-01 00:00:00 +0000
83+++ docs/components/ticket-system.rst 2013-12-09 17:50:28 +0000
84@@ -0,0 +1,361 @@
85+Ticket System (former Project Manager)
86+==================================================
87+
88+
89+Purpose
90+*******
91+
92+The Ticket System contains project centric knowledge such as location of trunk names of integration tests, point of contact, etc. as well as the ticketing management for the CI Engine which includes the status of current MPs being built and a queue of MPs to process.
93+
94+It maintains the following sets of data:
95+
96+* The history and status of tickets (the ticket tracker).
97+* The definition and configuration of projects, their branches, source packages and produced binary packages (the project manager).
98+* The test database. (This will not be part of phase 0)
99+
100+Deployment
101+**********
102+
103+* Can run as a juju service.
104+* Runs as a persistent service, when it goes down, the engine halts.
105+* State needs to serialized whenever it is updated, so that status can be regenerated on a restart.
106+
107+Development Plan
108+****************
109+
110+Phase 0
111+-------
112+
113+* Define API.
114+* Define backend ticket storage.
115+* Define backend project specification storage.
116+* Handle status updates from the Landing Manager.
117+* Provide read API for the Web Server.
118+
119+Future
120+------
121+
122+* Integrate with the Landing Manager, supply metadata to build and test a single project and generate an automatic low-cost ticket (phase 0 will accept only source package uploads directly, the branch polling for new merges and creation of automatic tickets is in the future.)
123+* Define backend test database storage, and if it should be a separated system component.
124+
125+Interactions
126+************
127+
128+Project Manager
129+---------------
130+
131+* Provide API for any system component that needs information about a project/branch/merge proposal/source package/binary package.
132+
133+Ticket System
134+-------------
135+
136+* Provide API for Web UI
137+* PPA Assigner - Provides two PPAs to perform package builds, one for MPs themselves, another for MPs + trunk.
138+* Branch/Source Builder - MP branches are dispatched to the builder.
139+* Image Builder - Generates up to 3 images to be used for testing: feature branches + base image, feature branches + latest image, feature branches + trunk + latest image.
140+* Integration Test Runner - Runs the specified tests on up to 3 images.
141+
142+
143+Design
144+******
145+
146+Project Manager
147+---------------
148+
149+In phase 0 the project manager will store and manage information about:
150+
151+ * Source package upload: component that will be tracked by a subticket. Is a direct source package upload.
152+ * Source package: a source package as found in the archive.
153+
154+We'll be provided a list of binary packages that should be monitored and tested, and a script outside project manager will generate the respective sources list.
155+
156+This data will be updated by submitting a file to project manager, that should contain the binary name, source package name and version. Entries are separated by a newline. As below:
157+
158+::
159+
160+ package: chris-foobar-pkg
161+ version: 1.1-0ubuntu2
162+ source: chris-foobar-src
163+
164+ ...
165+
166+
167+For next phases, we'll extend it to store info about:
168+
169+ * Binary package: a binary package as found in the archive, produced by a known source package.
170+ * Upstream project: a launchpad project, that might have branches.
171+ * Bazaar branches: launchpad bazaar branches, might be associated with a source package. A branch can produce only one source package at a time.
172+ * Merge proposal: a launchpad merge proposal, that will be tracked by a subticket.
173+
174+
175+
176+Ticket System
177+-------------
178+
179+Tickets and subtickets
180+~~~~~~~~~~~~~~~~~~~~~~
181+
182+A ticket is a way of grouping parts of a bug fix or feature.
183+In the ticket you'll describe the objective, add relevant information like
184+blueprints or other references and the ticket status will reflect the status
185+of its subtickets. Other system components will rely on the ticket status to take actions.
186+
187+A subticket refers to a source package upload or a merge proposal.
188+
189+When a developer submits the package upload request, the ticket system creates a subticket for each uploaded package and/or merge proposal, and a ticket that contains all of them.
190+
191+In phase 0, it won't be possible to add more subtickets to a ticket after ticket is created (no editing). To create a ticket with several parts, the developer needs to submit all of them at once.
192+If a subticket fails, the developer needs to submit another request that will generate another ticket with a subticket.
193+
194+The ticket and subtickets will keep only the current step of the workflow they are and their status, as defined in ticket and subticket models.
195+
196+In phase 1, if the subticket processing fails, the subticket is closed as failed, and the developer can submit another source package upload to the same ticket. It'll also be possible to add merge proposal subtickets.
197+
198+
199+Ticket System features
200+~~~~~~~~~~~~~~~~~~~~~~
201+
202+Create, monitor and manage ticket related activities
203+
204+* Define and create a ticket including:
205+
206+ * describe the targeted feature
207+ * Links to any bugs/BPs/other design docs that are related
208+ * People/teams working/owning on the ticket
209+ * Components involved (packages/PPAs/feature branches/infrastructure required to code/test/build/deploy)
210+ * PPA(s) dedicated to the ticket
211+ * Describe the test suites that need to be run (smarts can be added in the long run to assist users in choosing the Right test to run). In phase 0 it consists on the dep8 tests in all source packages that are relevant.
212+ * Knowing what image is supposed to be ‘frozen’ for developing against
213+
214+* Provides test and status of a ticket:
215+
216+ * Built images in the image store
217+ * Status of the ticket as it progresses through the CI engine
218+ * Clear indication of merge/build/test failures and where the failure occurred, make it obvious to developers what a corrective course of action should be
219+ * Provide a means to execute a landing when all criteria have passed
220+
221+* Provides ticket management:
222+
223+ * list and status of all tickets
224+
225+
226+REST APIs
227+*********
228+
229+Tickets
230+-------
231+
232+list
233+~~~~
234+
235+List all open tickets.
236+
237+create_ticket
238+~~~~~~~~~~~~~
239+
240+Create a ticket from one or more source package uploads.
241+
242+get_ticket
243+~~~~~~~~~~
244+
245+Return the ticket given its id.
246+
247+get_ticket_status
248+~~~~~~~~~~~~~~~~~
249+
250+Get the ticket status.
251+
252+set_ticket_status
253+~~~~~~~~~~~~~~~~~
254+
255+Set the ticket status.
256+
257+set_subticket_status
258+~~~~~~~~~~~~~~~~~~~~
259+
260+Set a subticket status, given the ticket number and the source package name.
261+
262+Person
263+------
264+
265+add_person
266+~~~~~~~~~~
267+
268+Add a person to the database.
269+
270+get_person
271+~~~~~~~~~~
272+
273+Return a person from the database, given it's nickname/email.
274+
275+Models
276+******
277+
278+Ticket System will be django + REST + Postgres. It will have apps and data models similar to the following.
279+
280+Phase 0
281+-------
282+
283+sourcepackage
284+~~~~~~~~~~~~~
285+
286+::
287+
288+ class SourcePackage(models.Model):
289+ name = models.CharField(max_length=4096)
290+
291+sourcepackageupload
292+~~~~~~~~~~~~~~~~~~~
293+
294+::
295+
296+ class SourcePackageUpload(models.Model):
297+ sourcepackage = models.ForeignKey("SourcePackage")
298+ version = models.CharField(max_length=4096)
299+ date = models.DateTimeField()
300+ artifact = models.ForeignKey("Artifact") # Provided by the artifact manager
301+
302+
303+ticket
304+~~~~~~
305+
306+A ticket can contain only one active subticket per source package. This
307+way we can reference the ticket externally by source package name and ticket
308+number.
309+
310+::
311+
312+ class Ticket(models.Model):
313+ WORKFLOW_STEPS = (
314+ (PACKAGE_BUILDING, "Package Building"),
315+ (IMAGE_BUILDING, "Image Building"),
316+ (IMAGE_TESTING, "Image Testing"),
317+ (PACKAGE_PUBLISHING, "Package Publishing"),
318+ )
319+ WORKFLOW_STEP_STATUSES = (
320+ (PKG_BUILD_WAITING, "Not Started"),
321+ (PKG_BUILD_INPROGRESS, "In Progress"),
322+ (PKG_BUILD_DONE, "Completed"),
323+ (PKG_BUILD_FAILED, "Failed"),
324+ (IMAGE_BUILD_WAITING, "Not Started"),
325+ (IMAGE_BUILD_INPROGRESS, "In Progress"),
326+ (IMAGE_BUILD_DONE, "Completed"),
327+ (IMAGE_BUILD_FAILED, "Failed"),
328+ (IMAGE_TESTS_WAITING, "Not Started"),
329+ (IMAGE_TESTS_INPROGRESS, "In Progress"),
330+ (IMAGE_TESTS_PASSED, "Passed"),
331+ (IMAGE_TESTS_FAILED, "Failed"),
332+ (PKG_PUBLISHING_DONE, "Completed"),
333+ (PKG_PUBLISHING_FAILED, "Failed"),
334+ )
335+ owner = models.ForeignKey("Person")
336+ title = models.CharField(max_length=4096)
337+ description = models.TextField()
338+ bug_id = models.IntegerField(null=True, blank=True)
339+ current_workflow_step = models.CharField(choices=WORKFLOW_STEPS)
340+ status = models.CharField(choices=WORKFLOW_STEP_STATUSES)
341+ base_image = models.CharField(max_length=20)
342+
343+subticket
344+~~~~~~~~~
345+
346+::
347+
348+ class SubTicket(models.Model):
349+ WORKFLOW_STEPS = (
350+ (PACKAGE_BUILDING, "Package Building"),
351+ )
352+ WORKFLOW_STEP_STATUSES = (
353+ (PKG_BUILD_WAITING, "Not Started"),
354+ (PKG_BUILD_INPROGRESS, "In Progress"),
355+ (PKG_BUILD_DONE, "Completed"),
356+ (PKG_BUILD_FAILED, "Failed"),
357+ )
358+ current_workflow_step = models.CharField(choices=WORKFLOW_STEPS)
359+ status = models.CharField(choices=WORKFLOW_STEP_STATUSES)
360+ ticket = models.ForeignKey("Ticket")
361+ assignee = models.ForeignKey("Person")
362+ sourcepackageupload = models.ForeignKey("SourcePackageUpload")
363+
364+
365+artifact
366+~~~~~~~~
367+
368+::
369+
370+ class Artifact(models.Model):
371+ type = models.CharField(choices=["test_result", "source_upload", "test_failure_log"]
372+ ticket_component = models.ForeignKey("TicketComponent")
373+ reference = models.CharField(max_length=4096) # Provided by the artifact manager
374+
375+person
376+~~~~~~
377+
378+::
379+
380+ class Person(models.Model):
381+ name = models.CharField(max_length=4096)
382+ email = models.EmailField(max_length=200)
383+ is_team = models.BooleanField(default=False)
384+
385+
386+Future Apps/Models
387+------------------
388+
389+testsuites
390+~~~~~~~~~~
391+
392+::
393+
394+ class TestSuites(models.Model):
395+ pass
396+
397+
398+project
399+~~~~~~~
400+
401+::
402+
403+ class Project(models.Model):
404+ # Class that defines an upstream project.
405+ name = models.CharField(max_length=4096)
406+ display_name = models.CharField(max_length=4096)
407+ maintainer = models.ForeignKey("Person")
408+ contact = models.ForeignKey("Person")
409+ description = models.TextField()
410+
411+branch
412+~~~~~~
413+
414+::
415+
416+ class Branch(models.Model):
417+ unique_name = models.CharField(max_length=4096)
418+ owner = models.ForeignKey("Person")
419+ type = models.CharField(choice=["trunk", "development", "maintenance", "regular"])
420+ project = models.ForeignKey("Project", null=True, blank=True)
421+
422+
423+binarypackage
424+~~~~~~~~~~~~~
425+
426+::
427+
428+ class BinaryPackage(models.Model):
429+ name = models.CharField(max_length=4096)
430+ sourcepackage = models.ForeignKey("SourcePackage")
431+ seeded = models.BooleanField(default=False)
432+
433+
434+mergeproposal
435+~~~~~~~~~~~~~
436+
437+::
438+
439+ class MergeProposal(models.Model):
440+ branch = models.ForeignKey("Branch")
441+ submitter = models.ForeignKey("Person")
442+ status = models.CharField(choices=["work_in_progress", "needs_review", "approved", "rejected", "merged"])
443+ lp_weblink = models.CharField(max_length=4096)
444+
445+
446
447=== renamed file 'docs/components/ticket-system.rst' => 'docs/components/ticket-system.rst.moved'

Subscribers

People subscribed via source and target branches

to all changes: