8687.15.22
by Karl Fogel
Add the copyright header block to the remaining .py files. |
1 |
# Copyright 2009 Canonical Ltd. This software is licensed under the
|
2 |
# GNU Affero General Public License version 3 (see the file LICENSE).
|
|
8555.2.1
by Tim Penhey
Create lp/code level modules for enums, separating out those that rely on bzrlib. |
3 |
|
4 |
"""Enumerations used in the lp/code modules."""
|
|
5 |
||
6 |
__metaclass__ = type |
|
7 |
__all__ = [ |
|
8 |
'BranchLifecycleStatus', |
|
9 |
'BranchLifecycleStatusFilter', |
|
8555.2.4
by Tim Penhey
Move BranchMergeProposalStatus. |
10 |
'BranchMergeProposalStatus', |
8555.2.5
by Tim Penhey
Move the branch subscription enums. |
11 |
'BranchSubscriptionDiffSize', |
12 |
'BranchSubscriptionNotificationLevel', |
|
8555.2.1
by Tim Penhey
Create lp/code level modules for enums, separating out those that rely on bzrlib. |
13 |
'BranchType', |
8555.2.6
by Tim Penhey
Move the visibility policy enums. |
14 |
'BranchVisibilityRule', |
8555.2.8
by Tim Penhey
Moved rest of code import enums. |
15 |
'CodeImportEventDataType', |
16 |
'CodeImportEventType', |
|
17 |
'CodeImportJobState', |
|
18 |
'CodeImportMachineOfflineReason', |
|
19 |
'CodeImportMachineState', |
|
20 |
'CodeImportResultStatus', |
|
8555.2.7
by Tim Penhey
Move code import enums. |
21 |
'CodeImportReviewStatus', |
8555.2.5
by Tim Penhey
Move the branch subscription enums. |
22 |
'CodeReviewNotificationLevel', |
8555.2.9
by Tim Penhey
Move CodeReviewVote enum. |
23 |
'CodeReviewVote', |
8555.2.7
by Tim Penhey
Move code import enums. |
24 |
'RevisionControlSystems', |
8555.2.6
by Tim Penhey
Move the visibility policy enums. |
25 |
'TeamBranchVisibilityRule', |
8555.2.1
by Tim Penhey
Create lp/code level modules for enums, separating out those that rely on bzrlib. |
26 |
'UICreatableBranchType', |
27 |
]
|
|
28 |
||
29 |
from lazr.enum import ( |
|
11403.1.4
by Henning Eggers
Reformatted imports using format-imports script r32. |
30 |
DBEnumeratedType, |
31 |
DBItem, |
|
32 |
EnumeratedType, |
|
33 |
Item, |
|
34 |
use_template, |
|
35 |
)
|
|
8555.2.1
by Tim Penhey
Create lp/code level modules for enums, separating out those that rely on bzrlib. |
36 |
|
37 |
||
38 |
class BranchLifecycleStatus(DBEnumeratedType): |
|
39 |
"""Branch Lifecycle Status
|
|
40 |
||
41 |
This indicates the status of the branch, as part of an overall
|
|
42 |
"lifecycle". The idea is to indicate to other people how mature this
|
|
43 |
branch is, or whether or not the code in the branch has been deprecated.
|
|
44 |
Essentially, this tells us what the author of the branch thinks of the
|
|
45 |
code in the branch.
|
|
46 |
"""
|
|
47 |
||
48 |
EXPERIMENTAL = DBItem(10, """ |
|
49 |
Experimental
|
|
50 |
||
51 |
Still under active development, and not suitable for merging into
|
|
52 |
release branches.
|
|
53 |
""") |
|
54 |
||
55 |
DEVELOPMENT = DBItem(30, """ |
|
56 |
Development
|
|
57 |
||
58 |
Shaping up nicely, but incomplete or untested, and not yet ready for
|
|
59 |
merging or production use.
|
|
60 |
""") |
|
61 |
||
62 |
MATURE = DBItem(50, """ |
|
63 |
Mature
|
|
64 |
||
65 |
Completely addresses the issues it is supposed to, tested, and stable
|
|
66 |
enough for merging into other branches.
|
|
67 |
""") |
|
68 |
||
69 |
MERGED = DBItem(70, """ |
|
70 |
Merged
|
|
71 |
||
72 |
Successfully merged into its target branch(es). No further development
|
|
73 |
is anticipated.
|
|
74 |
""") |
|
75 |
||
76 |
ABANDONED = DBItem(80, "Abandoned") |
|
77 |
||
78 |
||
79 |
class BranchType(DBEnumeratedType): |
|
80 |
"""Branch Type
|
|
81 |
||
82 |
The type of a branch determins the branch interaction with a number
|
|
83 |
of other subsystems.
|
|
84 |
"""
|
|
85 |
||
86 |
HOSTED = DBItem(1, """ |
|
87 |
Hosted
|
|
88 |
||
89 |
Launchpad is the primary location of this branch.
|
|
90 |
""") |
|
91 |
||
92 |
MIRRORED = DBItem(2, """ |
|
93 |
Mirrored
|
|
94 |
||
95 |
Primarily hosted elsewhere and is periodically mirrored
|
|
96 |
from the external location into Launchpad.
|
|
97 |
""") |
|
98 |
||
99 |
IMPORTED = DBItem(3, """ |
|
100 |
Imported
|
|
101 |
||
102 |
Branches that have been converted from some other revision
|
|
103 |
control system into bzr and are made available through Launchpad.
|
|
104 |
""") |
|
105 |
||
106 |
REMOTE = DBItem(4, """ |
|
107 |
Remote
|
|
108 |
||
109 |
Registered in Launchpad with an external location,
|
|
110 |
but is not to be mirrored, nor available through Launchpad.
|
|
111 |
""") |
|
112 |
||
113 |
||
114 |
class UICreatableBranchType(EnumeratedType): |
|
115 |
"""The types of branches that can be created through the web UI."""
|
|
116 |
use_template(BranchType, exclude='IMPORTED') |
|
117 |
||
118 |
||
119 |
class BranchLifecycleStatusFilter(EnumeratedType): |
|
120 |
"""Branch Lifecycle Status Filter
|
|
121 |
||
122 |
Used to populate the branch lifecycle status filter widget.
|
|
123 |
UI only.
|
|
124 |
"""
|
|
125 |
use_template(BranchLifecycleStatus) |
|
126 |
||
127 |
sort_order = ( |
|
128 |
'CURRENT', 'ALL', 'EXPERIMENTAL', 'DEVELOPMENT', 'MATURE', |
|
129 |
'MERGED', 'ABANDONED') |
|
130 |
||
131 |
CURRENT = Item(""" |
|
132 |
Any active status
|
|
133 |
||
134 |
Show the currently active branches.
|
|
135 |
""") |
|
136 |
||
137 |
ALL = Item(""" |
|
138 |
Any status
|
|
139 |
||
140 |
Show all the branches.
|
|
141 |
""") |
|
8555.2.4
by Tim Penhey
Move BranchMergeProposalStatus. |
142 |
|
143 |
||
144 |
class BranchMergeProposalStatus(DBEnumeratedType): |
|
145 |
"""Branch Merge Proposal Status
|
|
146 |
||
147 |
The current state of a proposal to merge.
|
|
148 |
"""
|
|
149 |
||
150 |
WORK_IN_PROGRESS = DBItem(1, """ |
|
151 |
Work in progress
|
|
152 |
||
153 |
The source branch is actively being worked on.
|
|
154 |
""") |
|
155 |
||
156 |
NEEDS_REVIEW = DBItem(2, """ |
|
157 |
Needs review
|
|
158 |
||
159 |
A review of the changes has been requested.
|
|
160 |
""") |
|
161 |
||
162 |
CODE_APPROVED = DBItem(3, """ |
|
163 |
Approved
|
|
164 |
||
165 |
The changes have been approved for merging.
|
|
166 |
""") |
|
167 |
||
168 |
REJECTED = DBItem(4, """ |
|
169 |
Rejected
|
|
170 |
||
171 |
The changes have been rejected and will not be merged in their
|
|
172 |
current state.
|
|
173 |
""") |
|
174 |
||
175 |
MERGED = DBItem(5, """ |
|
176 |
Merged
|
|
177 |
||
178 |
The changes from the source branch were merged into the target
|
|
179 |
branch.
|
|
180 |
""") |
|
181 |
||
182 |
MERGE_FAILED = DBItem(6, """ |
|
183 |
Code failed to merge
|
|
184 |
||
185 |
The changes from the source branch failed to merge into the
|
|
186 |
target branch for some reason.
|
|
187 |
""") |
|
188 |
||
189 |
QUEUED = DBItem(7, """ |
|
190 |
Queued
|
|
191 |
||
192 |
The changes from the source branch are queued to be merged into the
|
|
193 |
target branch.
|
|
194 |
""") |
|
195 |
||
196 |
SUPERSEDED = DBItem(10, """ |
|
197 |
Superseded
|
|
198 |
||
199 |
This proposal has been superseded by anther proposal to merge.
|
|
200 |
""") |
|
8555.2.5
by Tim Penhey
Move the branch subscription enums. |
201 |
|
202 |
||
203 |
class BranchSubscriptionDiffSize(DBEnumeratedType): |
|
204 |
"""Branch Subscription Diff Size
|
|
205 |
||
206 |
When getting branch revision notifications, the person can set a size
|
|
207 |
limit of the diff to send out. If the generated diff is greater than
|
|
208 |
the specified number of lines, then it is omitted from the email.
|
|
209 |
This enumerated type defines the number of lines as a choice
|
|
210 |
so we can sensibly limit the user to a number of size choices.
|
|
211 |
"""
|
|
212 |
||
213 |
NODIFF = DBItem(0, """ |
|
214 |
Don't send diffs
|
|
215 |
||
216 |
Don't send generated diffs with the revision notifications.
|
|
217 |
""") |
|
218 |
||
219 |
HALFKLINES = DBItem(500, """ |
|
220 |
500 lines
|
|
221 |
||
222 |
Limit the generated diff to 500 lines.
|
|
223 |
""") |
|
224 |
||
225 |
ONEKLINES = DBItem(1000, """ |
|
226 |
1000 lines
|
|
227 |
||
228 |
Limit the generated diff to 1000 lines.
|
|
229 |
""") |
|
230 |
||
231 |
FIVEKLINES = DBItem(5000, """ |
|
232 |
5000 lines
|
|
233 |
||
234 |
Limit the generated diff to 5000 lines.
|
|
235 |
""") |
|
236 |
||
237 |
WHOLEDIFF = DBItem(-1, """ |
|
238 |
Send entire diff
|
|
239 |
||
240 |
Don't limit the size of the diff.
|
|
241 |
""") |
|
242 |
||
243 |
||
244 |
class BranchSubscriptionNotificationLevel(DBEnumeratedType): |
|
245 |
"""Branch Subscription Notification Level
|
|
246 |
||
247 |
The notification level is used to control the amount and content
|
|
248 |
of the email notifications send with respect to modifications
|
|
249 |
to branches whether it be to branch attributes in the UI, or
|
|
250 |
to the contents of the branch found by the branch scanner.
|
|
251 |
"""
|
|
252 |
||
253 |
NOEMAIL = DBItem(0, """ |
|
254 |
No email
|
|
255 |
||
256 |
Do not send any email about changes to this branch.
|
|
257 |
""") |
|
258 |
||
259 |
ATTRIBUTEONLY = DBItem(1, """ |
|
260 |
Branch attribute notifications only
|
|
261 |
||
262 |
Only send notifications for branch attribute changes such
|
|
263 |
as name, description and whiteboard.
|
|
264 |
""") |
|
265 |
||
266 |
DIFFSONLY = DBItem(2, """ |
|
267 |
Branch revision notifications only
|
|
268 |
||
269 |
Only send notifications about new revisions added to this
|
|
270 |
branch.
|
|
271 |
""") |
|
272 |
||
273 |
FULL = DBItem(3, """ |
|
274 |
Branch attribute and revision notifications
|
|
275 |
||
276 |
Send notifications for both branch attribute updates
|
|
277 |
and new revisions added to the branch.
|
|
278 |
""") |
|
279 |
||
280 |
||
281 |
class CodeReviewNotificationLevel(DBEnumeratedType): |
|
282 |
"""Code Review Notification Level
|
|
283 |
||
284 |
The notification level is used to control the amount and content
|
|
285 |
of the email notifications send with respect to code reviews related
|
|
286 |
to this branch.
|
|
287 |
"""
|
|
288 |
||
289 |
NOEMAIL = DBItem(0, """ |
|
290 |
No email
|
|
291 |
||
292 |
Do not send any email about code review for this branch.
|
|
293 |
""") |
|
294 |
||
295 |
STATUS = DBItem(1, """ |
|
296 |
Status changes only
|
|
297 |
||
298 |
Send email when votes are cast or status is changed.
|
|
299 |
""") |
|
300 |
||
301 |
FULL = DBItem(2, """ |
|
302 |
Email about all changes
|
|
303 |
||
304 |
Send email about any code review activity for this branch.
|
|
305 |
""") |
|
8555.2.6
by Tim Penhey
Move the visibility policy enums. |
306 |
|
307 |
||
308 |
class BranchVisibilityRule(DBEnumeratedType): |
|
309 |
"""Branch Visibility Rules for defining branch visibility policy."""
|
|
310 |
||
311 |
PUBLIC = DBItem(1, """ |
|
312 |
Public
|
|
313 |
||
314 |
Branches are public by default.
|
|
315 |
""") |
|
316 |
||
317 |
PRIVATE = DBItem(2, """ |
|
318 |
Private
|
|
319 |
||
320 |
Branches are private by default.
|
|
321 |
""") |
|
322 |
||
323 |
PRIVATE_ONLY = DBItem(3, """ |
|
324 |
Private only
|
|
325 |
||
326 |
Branches are private by default. Branch owners are not able
|
|
327 |
to change the visibility of the branches to public.
|
|
328 |
""") |
|
329 |
||
330 |
FORBIDDEN = DBItem(4, """ |
|
331 |
Forbidden
|
|
332 |
||
333 |
Users are not able to create branches in the context.
|
|
334 |
""") |
|
335 |
||
336 |
||
337 |
class TeamBranchVisibilityRule(EnumeratedType): |
|
338 |
"""The valid policy rules for teams."""
|
|
339 |
use_template(BranchVisibilityRule, exclude='FORBIDDEN') |
|
340 |
||
341 |
||
8555.2.7
by Tim Penhey
Move code import enums. |
342 |
class RevisionControlSystems(DBEnumeratedType): |
343 |
"""Revision Control Systems
|
|
344 |
||
345 |
Bazaar brings code from a variety of upstream revision control
|
|
346 |
systems into bzr. This schema documents the known and supported
|
|
347 |
revision control systems.
|
|
348 |
"""
|
|
349 |
||
350 |
CVS = DBItem(1, """ |
|
351 |
Concurrent Versions System
|
|
352 |
||
353 |
Imports from CVS via CSCVS.
|
|
354 |
""") |
|
355 |
||
356 |
SVN = DBItem(2, """ |
|
9946.1.13
by Michael Hudson
more tests, create bzr-svn imports by default |
357 |
Subversion via CSCVS
|
8555.2.7
by Tim Penhey
Move code import enums. |
358 |
|
359 |
Imports from SVN using CSCVS.
|
|
360 |
""") |
|
361 |
||
362 |
BZR_SVN = DBItem(3, """ |
|
363 |
Subversion via bzr-svn
|
|
364 |
||
365 |
Imports from SVN using bzr-svn.
|
|
366 |
""") |
|
367 |
||
368 |
GIT = DBItem(4, """ |
|
369 |
Git
|
|
370 |
||
371 |
Imports from Git using bzr-git.
|
|
372 |
""") |
|
373 |
||
9905.7.5
by Jelmer Vernooij
Support hg imports in database, ui. |
374 |
HG = DBItem(5, """ |
375 |
Mercurial
|
|
376 |
||
377 |
Imports from Mercurial using bzr-hg.
|
|
378 |
""") |
|
379 |
||
13261.6.1
by Jelmer Vernooij
Add enum for imports of Bazaar branches. |
380 |
BZR = DBItem(6, """ |
381 |
Bazaar
|
|
382 |
||
383 |
Mirror of a Bazaar branch.
|
|
384 |
""") |
|
385 |
||
8555.2.7
by Tim Penhey
Move code import enums. |
386 |
|
387 |
class CodeImportReviewStatus(DBEnumeratedType): |
|
388 |
"""CodeImport review status.
|
|
389 |
||
390 |
Before a code import is performed, it is reviewed. Only reviewed imports
|
|
391 |
are processed.
|
|
392 |
"""
|
|
393 |
||
394 |
NEW = DBItem(1, """Pending Review |
|
395 |
||
396 |
This code import request has recently been filed and has not
|
|
397 |
been reviewed yet.
|
|
398 |
""") |
|
399 |
||
400 |
INVALID = DBItem(10, """Invalid |
|
401 |
||
402 |
This code import will not be processed.
|
|
403 |
""") |
|
404 |
||
405 |
REVIEWED = DBItem(20, """Reviewed |
|
406 |
||
407 |
This code import has been approved and will be processed.
|
|
408 |
""") |
|
409 |
||
410 |
SUSPENDED = DBItem(30, """Suspended |
|
411 |
||
412 |
This code import has been approved, but it has been suspended
|
|
413 |
and is not processed.""") |
|
414 |
||
7675.210.4
by Curtis Hovey
Fix imports and restored new enum name that was lost in the enum move and the merge with stabel. |
415 |
FAILING = DBItem(40, """Failed |
8555.2.7
by Tim Penhey
Move code import enums. |
416 |
|
417 |
The code import is failing for some reason and is no longer being
|
|
418 |
attempted.""") |
|
8555.2.8
by Tim Penhey
Moved rest of code import enums. |
419 |
|
420 |
||
421 |
class CodeImportEventType(DBEnumeratedType): |
|
422 |
"""CodeImportEvent type.
|
|
423 |
||
424 |
Event types identify all the events that are significant to the code
|
|
425 |
import system. Either user-driven events, or events recording the
|
|
426 |
operation of unattended systems.
|
|
427 |
"""
|
|
428 |
||
429 |
# Event types are named so that "a FOO event" sounds natural. For example,
|
|
430 |
# MODIFY because "a MODIFIED event" sounds confusing and "a MODIFICATION
|
|
431 |
# event" is awkward.
|
|
432 |
||
433 |
# Code import life cycle.
|
|
434 |
||
435 |
CREATE = DBItem(110, """ |
|
436 |
Import Created
|
|
437 |
||
438 |
A CodeImport object was created.
|
|
439 |
""") |
|
440 |
||
441 |
MODIFY = DBItem(120, """ |
|
442 |
Import Modified
|
|
443 |
||
444 |
A code import was modified. Either the CodeImport object, or an
|
|
445 |
associated object, was modified.
|
|
446 |
""") |
|
447 |
||
448 |
DELETE = DBItem(130, """ |
|
449 |
Import Deleted
|
|
450 |
||
451 |
A CodeImport object was deleted.
|
|
452 |
""") |
|
453 |
||
454 |
# Code import job events.
|
|
455 |
||
456 |
START = DBItem(210, """ |
|
457 |
Job Started
|
|
458 |
||
459 |
An import job was started.
|
|
460 |
""") |
|
461 |
||
462 |
FINISH = DBItem(220, """ |
|
463 |
Job Finished
|
|
464 |
||
465 |
An import job finished, either successfully or by a failure.
|
|
466 |
""") |
|
467 |
||
468 |
PUBLISH = DBItem(230, """ |
|
469 |
Import First Published
|
|
470 |
||
471 |
A code import has completed for the first time and was published.
|
|
472 |
""") |
|
473 |
||
474 |
RECLAIM = DBItem(240, """ |
|
475 |
Job Reclaimed Automatically
|
|
476 |
||
477 |
A code import job has not finished, but has probably crashed and is
|
|
478 |
allowed to run again.
|
|
479 |
""") |
|
480 |
||
481 |
# Code import job control events.
|
|
482 |
||
483 |
REQUEST = DBItem(310, """ |
|
484 |
Update Requested
|
|
485 |
||
486 |
A user requested that an import job be run immediately.
|
|
487 |
""") |
|
488 |
||
489 |
KILL = DBItem(320, """ |
|
490 |
Termination Requested
|
|
491 |
||
492 |
A user requested that a running import job be aborted.
|
|
493 |
""") |
|
494 |
||
495 |
# Code import machine events.
|
|
496 |
||
497 |
ONLINE = DBItem(410, """ |
|
498 |
Machine Online
|
|
499 |
||
500 |
A code-import-controller daemon has started, and is now accepting
|
|
501 |
jobs.
|
|
502 |
""") |
|
503 |
||
504 |
OFFLINE = DBItem(420, """ |
|
505 |
Machine Offline
|
|
506 |
||
507 |
A code-import-controller daemon has finished, or crashed is and no
|
|
508 |
longer running.
|
|
509 |
""") |
|
510 |
||
511 |
QUIESCE = DBItem(430, """ |
|
512 |
Quiescing Requested
|
|
513 |
||
514 |
A code-import-controller daemon has been requested to shut down. It
|
|
515 |
will no longer accept jobs, and will terminate once the last running
|
|
516 |
job finishes.
|
|
517 |
""") |
|
518 |
||
519 |
||
520 |
class CodeImportEventDataType(DBEnumeratedType): |
|
521 |
"""CodeImportEventData type.
|
|
522 |
||
523 |
CodeImportEvent objects record unstructured additional data. Each data
|
|
524 |
item associated to an event has a type from this enumeration.
|
|
525 |
"""
|
|
526 |
||
527 |
# Generic data
|
|
528 |
||
529 |
MESSAGE = DBItem(10, """Message |
|
530 |
||
531 |
User-provided message.
|
|
532 |
""") |
|
533 |
||
534 |
# CodeImport attributes
|
|
535 |
||
536 |
CODE_IMPORT = DBItem(110, """ |
|
537 |
Code Import
|
|
538 |
||
539 |
Database id of the CodeImport, useful to collate events associated to
|
|
540 |
deleted CodeImport objects.
|
|
541 |
""") |
|
542 |
||
543 |
OWNER = DBItem(120, """ |
|
544 |
Code Import Owner
|
|
545 |
||
546 |
Value of CodeImport.owner. Useful to record ownership changes.
|
|
547 |
""") |
|
548 |
||
549 |
OLD_OWNER = DBItem(121, """ |
|
550 |
Previous Owner
|
|
551 |
||
552 |
Previous value of CodeImport.owner, when recording an ownership
|
|
553 |
change.
|
|
554 |
""") |
|
555 |
||
556 |
REVIEW_STATUS = DBItem(130, """ |
|
557 |
Review Status
|
|
558 |
||
559 |
Value of CodeImport.review_status. Useful to understand the review
|
|
560 |
life cycle of a code import.
|
|
561 |
""") |
|
562 |
||
563 |
OLD_REVIEW_STATUS = DBItem(131, """ |
|
564 |
Previous Review Status
|
|
565 |
||
566 |
Previous value of CodeImport.review_status, when recording a status
|
|
567 |
change.
|
|
568 |
""") |
|
569 |
||
570 |
ASSIGNEE = DBItem(140, """ |
|
571 |
Code Import Assignee
|
|
572 |
||
573 |
Value of CodeImport.assignee. Useful to understand the review life
|
|
574 |
cycle of a code import.
|
|
575 |
""") |
|
576 |
||
577 |
OLD_ASSIGNEE = DBItem(141, """ |
|
578 |
Previous Assignee
|
|
579 |
||
580 |
Previous value of CodeImport.assignee, when recording an assignee
|
|
581 |
change.
|
|
582 |
""") |
|
583 |
||
584 |
# CodeImport attributes related to the import source
|
|
585 |
||
586 |
UPDATE_INTERVAL = DBItem(210, """ |
|
587 |
Update Interval
|
|
588 |
||
589 |
User-specified interval between updates of the code import.
|
|
590 |
""") |
|
591 |
||
592 |
OLD_UPDATE_INTERVAL = DBItem(211, """ |
|
593 |
Previous Update Interval
|
|
594 |
||
595 |
Previous user-specified update interval, when recording an interval
|
|
596 |
change.
|
|
597 |
""") |
|
598 |
||
599 |
CVS_ROOT = DBItem(220, """ |
|
600 |
CVSROOT
|
|
601 |
||
602 |
Location and access method of the CVS repository.
|
|
603 |
""") |
|
604 |
||
605 |
CVS_MODULE = DBItem(221, """ |
|
606 |
CVS module
|
|
607 |
||
608 |
Path to import within the CVSROOT.
|
|
609 |
""") |
|
610 |
||
611 |
OLD_CVS_ROOT = DBItem(222, """ |
|
612 |
Previous CVSROOT
|
|
613 |
||
614 |
Previous CVSROOT, when recording an import source change.
|
|
615 |
""") |
|
616 |
||
617 |
OLD_CVS_MODULE = DBItem(223, """ |
|
618 |
Previous CVS module
|
|
619 |
||
620 |
Previous CVS module, when recording an import source change.
|
|
621 |
""") |
|
622 |
||
623 |
SVN_BRANCH_URL = DBItem(230, """ |
|
624 |
Subversion URL
|
|
625 |
||
626 |
Location of the Subversion branch to import.
|
|
627 |
""") |
|
628 |
||
629 |
OLD_SVN_BRANCH_URL = DBItem(231, """ |
|
630 |
Previous Subversion URL
|
|
631 |
||
632 |
Previous Subversion URL, when recording an import source change.
|
|
633 |
""") |
|
634 |
||
635 |
GIT_REPO_URL = DBItem(237, """ |
|
636 |
Git repo URL
|
|
637 |
||
638 |
Location of the Git repo to import.
|
|
639 |
""") |
|
640 |
||
641 |
OLD_GIT_REPO_URL = DBItem(238, """ |
|
642 |
Previous Git repo URL
|
|
643 |
||
644 |
Previous Git repo URL, when recording on import source change.
|
|
645 |
""") |
|
646 |
||
10129.6.6
by Tim Penhey
More updates. |
647 |
URL = DBItem(240, """ |
648 |
Foreign VCS branch URL
|
|
9905.7.5
by Jelmer Vernooij
Support hg imports in database, ui. |
649 |
|
10129.6.6
by Tim Penhey
More updates. |
650 |
Location of the foreign VCS branch to import.
|
9905.7.5
by Jelmer Vernooij
Support hg imports in database, ui. |
651 |
""") |
652 |
||
10129.6.6
by Tim Penhey
More updates. |
653 |
OLD_URL = DBItem(241, """ |
654 |
Previous foreign VCS branch URL
|
|
9905.7.5
by Jelmer Vernooij
Support hg imports in database, ui. |
655 |
|
10129.6.6
by Tim Penhey
More updates. |
656 |
Previous foreign VCS branch location, when recording an import source
|
657 |
change.
|
|
9905.7.5
by Jelmer Vernooij
Support hg imports in database, ui. |
658 |
""") |
659 |
||
8555.2.8
by Tim Penhey
Moved rest of code import enums. |
660 |
# Data related to machine events
|
661 |
||
662 |
OFFLINE_REASON = DBItem(410, """Offline Reason |
|
663 |
||
664 |
Reason why a code import machine went offline.
|
|
665 |
""") |
|
666 |
||
667 |
# Data related to reclaim events
|
|
668 |
||
669 |
RECLAIMED_JOB_ID = DBItem(510, """Reclaimed Job Id |
|
670 |
||
671 |
The database id of the reclaimed code import job.
|
|
672 |
""") |
|
673 |
||
674 |
||
675 |
class CodeImportJobState(DBEnumeratedType): |
|
676 |
"""Values that ICodeImportJob.state can take."""
|
|
677 |
||
678 |
PENDING = DBItem(10, """ |
|
679 |
Pending
|
|
680 |
||
681 |
The job has a time when it is due to run, and will wait until
|
|
682 |
that time or an explicit update request is made.
|
|
683 |
""") |
|
684 |
||
685 |
SCHEDULED = DBItem(20, """ |
|
686 |
Scheduled
|
|
687 |
||
688 |
The job is due to be run.
|
|
689 |
""") |
|
690 |
||
691 |
RUNNING = DBItem(30, """ |
|
692 |
Running
|
|
693 |
||
694 |
The job is running.
|
|
695 |
""") |
|
696 |
||
697 |
||
698 |
class CodeImportMachineState(DBEnumeratedType): |
|
699 |
"""CodeImportMachine State
|
|
700 |
||
701 |
The operational state of the code-import-controller daemon on a given
|
|
702 |
machine.
|
|
703 |
"""
|
|
704 |
||
705 |
OFFLINE = DBItem(10, """ |
|
706 |
Offline
|
|
707 |
||
708 |
The code-import-controller daemon is not running on this machine.
|
|
709 |
""") |
|
710 |
||
711 |
ONLINE = DBItem(20, """ |
|
712 |
Online
|
|
713 |
||
714 |
The code-import-controller daemon is running on this machine and
|
|
715 |
accepting new jobs.
|
|
716 |
""") |
|
717 |
||
718 |
QUIESCING = DBItem(30, """ |
|
719 |
Quiescing
|
|
720 |
||
721 |
The code-import-controller daemon is running on this machine, but has
|
|
722 |
been requested to shut down and will not accept any new job.
|
|
723 |
""") |
|
724 |
||
725 |
||
726 |
class CodeImportMachineOfflineReason(DBEnumeratedType): |
|
727 |
"""Reason why a CodeImportMachine is offline.
|
|
728 |
||
729 |
A machine goes offline when a code-import-controller daemon process shuts
|
|
730 |
down, or appears to have crashed. Recording the reason a machine went
|
|
731 |
offline provides useful diagnostic information.
|
|
732 |
"""
|
|
733 |
||
734 |
# Daemon termination
|
|
735 |
||
736 |
STOPPED = DBItem(110, """ |
|
737 |
Stopped
|
|
738 |
||
739 |
The code-import-controller daemon was shut-down, interrupting running
|
|
740 |
jobs.
|
|
741 |
""") |
|
742 |
||
743 |
QUIESCED = DBItem(120, """ |
|
744 |
Quiesced
|
|
745 |
||
746 |
The code-import-controller daemon has shut down after completing
|
|
747 |
any running jobs.
|
|
748 |
""") |
|
749 |
||
750 |
# Crash recovery
|
|
751 |
||
752 |
WATCHDOG = DBItem(210, """ |
|
753 |
Watchdog
|
|
754 |
||
755 |
The watchdog has detected that the machine's heartbeat has not been
|
|
756 |
updated recently.
|
|
757 |
""") |
|
758 |
||
759 |
||
760 |
class CodeImportResultStatus(DBEnumeratedType): |
|
761 |
"""Values for ICodeImportResult.status.
|
|
762 |
||
763 |
How did a code import job complete? Was it successful, did it fail
|
|
764 |
when trying to checkout or update the source tree, in the
|
|
765 |
conversion step, or in one of the internal house-keeping steps?
|
|
766 |
"""
|
|
767 |
||
768 |
SUCCESS = DBItem(100, """ |
|
769 |
Success
|
|
770 |
||
771 |
Import job completed successfully.
|
|
772 |
""") |
|
773 |
||
10224.12.2
by Michael Hudson
some changes. no new tests but existing ones pass. |
774 |
SUCCESS_NOCHANGE = DBItem(110, """ |
10224.12.6
by Michael Hudson
changes to model/view code |
775 |
Success with no changes
|
10224.12.2
by Michael Hudson
some changes. no new tests but existing ones pass. |
776 |
|
777 |
Import job completed successfully, but there were no new revisions to
|
|
778 |
import.
|
|
779 |
""") |
|
780 |
||
10271.2.4
by Michael Hudson
worker monitor level |
781 |
SUCCESS_PARTIAL = DBItem(120, """ |
782 |
Partial Success
|
|
783 |
||
784 |
Import job successfully imported some but not all of the foreign
|
|
785 |
revisions.
|
|
786 |
""") |
|
787 |
||
8555.2.8
by Tim Penhey
Moved rest of code import enums. |
788 |
FAILURE = DBItem(200, """ |
789 |
Failure
|
|
790 |
||
791 |
Import job failed.
|
|
792 |
""") |
|
793 |
||
794 |
INTERNAL_FAILURE = DBItem(210, """ |
|
795 |
Internal Failure
|
|
796 |
||
797 |
An internal error occurred. This is a problem with Launchpad.
|
|
798 |
""") |
|
799 |
||
13168.11.1
by Jelmer Vernooij
Initial work on supporting FAILURE_INVALID and FAILURE_UNSUPPORTED_FEATURE return types from imports. |
800 |
FAILURE_INVALID = DBItem(220, """ |
801 |
Foreign branch invalid
|
|
802 |
||
803 |
The import failed because the foreign branch did not exist or
|
|
804 |
was not accessible.
|
|
805 |
""") |
|
806 |
||
807 |
FAILURE_UNSUPPORTED_FEATURE = DBItem(230, """ |
|
808 |
Unsupported feature
|
|
809 |
||
810 |
The import failed because of missing feature support in
|
|
811 |
Bazaar or the Bazaar foreign branch support.
|
|
8555.2.8
by Tim Penhey
Moved rest of code import enums. |
812 |
""") |
813 |
||
814 |
RECLAIMED = DBItem(310, """ |
|
815 |
Job reclaimed
|
|
816 |
||
817 |
The job apparently crashed and was automatically marked as
|
|
818 |
complete to allow further jobs to run for this code import.
|
|
819 |
""") |
|
820 |
||
821 |
KILLED = DBItem(320, """ |
|
822 |
Job killed
|
|
823 |
||
824 |
A user action caused this job to be killed before it
|
|
825 |
completed. It could have been an explicit request to kill the
|
|
826 |
job, or the deletion of a CodeImport which had a running job.
|
|
827 |
""") |
|
828 |
||
10365.2.1
by Michael Hudson
oops, SUCCESS_PARTIAL needs to count as a success wrt code_import.consecutive_failure_count |
829 |
successes = [SUCCESS, SUCCESS_NOCHANGE, SUCCESS_PARTIAL] |
10224.12.6
by Michael Hudson
changes to model/view code |
830 |
|
8555.2.8
by Tim Penhey
Moved rest of code import enums. |
831 |
|
8555.2.9
by Tim Penhey
Move CodeReviewVote enum. |
832 |
class CodeReviewVote(DBEnumeratedType): |
833 |
"""Code Review Votes
|
|
834 |
||
835 |
Responses from the reviews to the code author.
|
|
836 |
"""
|
|
837 |
sort_order = ('APPROVE', |
|
838 |
'NEEDS_FIXING', |
|
839 |
'NEEDS_INFO', |
|
840 |
'ABSTAIN', |
|
841 |
'DISAPPROVE', |
|
842 |
'RESUBMIT', |
|
843 |
)
|
|
844 |
||
845 |
DISAPPROVE = DBItem(1, """ |
|
846 |
Disapprove
|
|
847 |
||
848 |
Reviewer does not want the proposed merge to happen.
|
|
849 |
""") |
|
850 |
||
851 |
ABSTAIN = DBItem(2, """ |
|
852 |
Abstain
|
|
853 |
||
854 |
Reviewer cannot or does not want to decide whether the proposed merge
|
|
855 |
should happen.
|
|
856 |
""") |
|
857 |
||
858 |
APPROVE = DBItem(3, """ |
|
859 |
Approve
|
|
860 |
||
861 |
Reviewer wants the proposed merge to happen.
|
|
862 |
""") |
|
863 |
||
864 |
RESUBMIT = DBItem(4, """ |
|
865 |
Resubmit
|
|
866 |
||
867 |
Reviewer thinks that the idea might be sound but the implementation
|
|
868 |
needs significant rework.
|
|
869 |
""") |
|
870 |
||
871 |
NEEDS_FIXING = DBItem(5, """ |
|
872 |
Needs Fixing
|
|
873 |
||
874 |
Reviewer thinks that some fixing is needed before they can approve it.
|
|
875 |
""") |
|
876 |
||
877 |
NEEDS_INFO = DBItem(6, """ |
|
878 |
Needs Information
|
|
879 |
||
880 |
The reviewer needs more information before making a decision.
|
|
881 |
""") |