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

Subscribers

People subscribed via source and target branches

to all changes: