Merge lp:~wgrant/launchpad/no-job-oops-prefix into lp:launchpad

Proposed by William Grant on 2012-05-02
Status: Merged
Approved by: William Grant on 2012-05-02
Approved revision: no longer in the source branch.
Merged at revision: 15187
Proposed branch: lp:~wgrant/launchpad/no-job-oops-prefix
Merge into: lp:launchpad
Diff against target: 550 lines (+8/-123)
7 files modified
configs/development/launchpad-lazr.conf (+0/-21)
configs/testrunner/launchpad-lazr.conf (+0/-14)
lib/lp/services/config/schema-lazr.conf (+0/-74)
lib/lp/services/job/runner.py (+2/-3)
lib/lp/services/job/tests/test_runner.py (+2/-3)
lib/lp/services/webapp/errorlog.py (+3/-6)
lib/lp/services/webapp/tests/test_errorlog.py (+1/-2)
To merge this branch: bzr merge lp:~wgrant/launchpad/no-job-oops-prefix
Reviewer Review Type Date Requested Status
Steve Kowalik (community) code 2012-05-02 Approve on 2012-05-02
Review via email: mp+104315@code.launchpad.net

Commit Message

Drop the concept of section-specific OOPS prefixes.

Description of the Change

Now that we use hash-based OOPS IDs, each process no longer requires its own oops_prefix -- they're only important to identify multiple instances of the same service within a single environment (appservers, librarian, codehosting, codebrowse).

The unnecessary prefixes were eliminated from prod configs last year, and the last few are being moved away in <https://code.launchpad.net/~wgrant/lp-production-configs/no-section-oops-prefix/+merge/104314>. This branch removes the non-global oops_prefix config keys. There should be no difference in production, but the test configs still specify service-specific prefixes so there is some test fallout.

To post a comment you must log in.
Steve Kowalik (stevenk) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'configs/development/launchpad-lazr.conf'
2--- configs/development/launchpad-lazr.conf 2012-03-20 20:50:47 +0000
3+++ configs/development/launchpad-lazr.conf 2012-05-02 01:50:24 +0000
4@@ -9,7 +9,6 @@
5 run_parts_location: none
6
7 [branchscanner]
8-oops_prefix: BS
9 error_dir: /var/tmp/codehosting.test
10
11 [builddmaster]
12@@ -19,13 +18,11 @@
13
14 [bzr_lpserve]
15 error_dir: /var/tmp/codehosting.test
16-oops_prefix: BZR
17
18 [canonical]
19 show_tracebacks: True
20
21 [checkwatches]
22-oops_prefix: XCW
23 error_dir: /var/tmp/lperr
24 sync_debbugs_comments: True
25
26@@ -41,7 +38,6 @@
27 launchpad_root: https://code.launchpad.dev/
28 secret_path: configs/development/codebrowse-secret
29 error_dir: /var/tmp/codebrowse.launchpad.dev/errors
30-oops_prefix: CB
31
32 [codehosting]
33 launch: True
34@@ -56,7 +52,6 @@
35 host_key_pair_path: lib/lp/codehosting/sshserver/tests/keys
36 port: tcp:5022:interface=127.0.0.88
37 error_dir: /var/tmp/codehosting.test
38-oops_prefix: SMPSSH
39 bzr_lp_prefix: lp://dev/
40 lp_url_hosts: dev
41 access_log: /var/tmp/bazaar.launchpad.dev/codehosting-access.log
42@@ -73,7 +68,6 @@
43
44 [codeimportworker]
45 error_dir: /var/tmp/codehosting.test
46-oops_prefix: CIW
47
48 [commercial]
49 voucher_proxy_url: http://launchpad.dev
50@@ -100,7 +94,6 @@
51 cdimage_file_list_url: file:lib/lp/registry/tests/ubuntu-releases.testdata
52
53 [distroseriesdifferencejob]
54-oops_prefix: DSDJ
55 error_dir: /var/tmp/soyuz.test
56
57 [error_reports]
58@@ -121,11 +114,9 @@
59 public_host: keyserver.launchpad.dev
60
61 [initializedistroseries]
62-oops_prefix: IDSJ
63 error_dir: /var/tmp/soyuz.test
64
65 [IPlainPackageCopyJobSource]
66-oops_prefix: PCJ
67 error_dir: /var/tmp/soyuz.test
68
69 [launchpad]
70@@ -159,7 +150,6 @@
71 restricted_download_port: 58085
72 restricted_download_url: http://launchpad.dev:58085/
73 use_https = False
74-oops_prefix: L
75 error_dir: /var/tmp/codehosting.test
76
77 [librarian_server]
78@@ -208,10 +198,8 @@
79
80 [merge_proposal_jobs]
81 error_dir: /var/tmp/codehosting.test
82-oops_prefix: DMPJ
83
84 [packaging_translations]
85-oops_prefix: DPT
86 error_dir: /var/tmp/lperr
87
88 [personalpackagearchive]
89@@ -240,7 +228,6 @@
90
91 [reclaimbranchspace]
92 error_dir: /var/tmp/codehosting.test
93-oops_prefix: RBS
94
95 [rosetta]
96 global_suggestions_enabled: True
97@@ -248,11 +235,9 @@
98
99 [rosettabranches]
100 error_dir: /var/tmp/rosettabranches.test
101-oops_prefix: RSBR
102
103 [poimport]
104 error_dir: /var/tmp/poimport
105-oops_prefix: POI
106
107 [process_apport_blobs]
108 error_dir: /var/tmp/lperr
109@@ -262,26 +247,20 @@
110
111 [supermirror_puller]
112 error_dir: /var/tmp/codehosting.test
113-oops_prefix: SMP
114
115 [supermirror_import_puller]
116 error_dir: /var/tmp/codehosting.test
117-oops_prefix: ISMP
118
119 [supermirror_mirror_puller]
120 error_dir: /var/tmp/codehosting.test
121-oops_prefix: MSMP
122
123 [supermirror_upload_puller]
124 error_dir: /var/tmp/codehosting.test
125-oops_prefix: USMP
126
127 [translations_export_to_branch]
128 error_dir: /var/tmp/translations_export_to_branch
129-oops_prefix: TEB
130
131 [upgrade_branches]
132-oops_prefix: UBJD
133 error_dir: /var/tmp/codehosting.test
134
135 [uploader]
136
137=== modified file 'configs/testrunner/launchpad-lazr.conf'
138--- configs/testrunner/launchpad-lazr.conf 2012-04-27 16:22:05 +0000
139+++ configs/testrunner/launchpad-lazr.conf 2012-05-02 01:50:24 +0000
140@@ -9,7 +9,6 @@
141 cron_control_url: file:lib/lp/services/scripts/tests/cronscripts.ini
142
143 [branchscanner]
144-oops_prefix: TSMS
145 error_dir: /var/tmp/lperr.test
146
147 [builddmaster]
148@@ -18,7 +17,6 @@
149
150 [checkwatches]
151 sync_debbugs_comments: True
152-oops_prefix: TCW
153 error_dir: /var/tmp/lperr.test
154
155 [codehosting]
156@@ -26,7 +24,6 @@
157 host_key_pair_path: lib/lp/codehosting/sshserver/tests/keys
158 port: tcp:22222:interface=bazaar.launchpad.dev
159 error_dir: /var/tmp/codehosting.test
160-oops_prefix: SMPSSH
161 access_log: /tmp/test-codehosting-access.log
162 internal_branch_by_id_root: file:///var/tmp/bazaar.launchpad.dev/mirrors
163
164@@ -160,15 +157,12 @@
165 port: 11242
166
167 [merge_proposal_jobs]
168-oops_prefix: TMPJ
169 error_dir: /var/tmp/codehosting.test
170
171 [packaging_translations]
172-oops_prefix: TPT
173 error_dir: /var/tmp/lperr.test
174
175 [upgrade_branches]
176-oops_prefix: TUB
177 error_dir: /var/tmp/codehosting.test
178
179 [personalpackagearchive]
180@@ -179,11 +173,9 @@
181
182 [poimport]
183 error_dir: /var/tmp/poimport.test
184-oops_prefix: TPOI
185
186 [process_apport_blobs]
187 dbuser: process-apport-blobs
188-oops_prefix: TAPPORTBLOB
189 error_dir: /var/tmp/lperr.test
190
191 [rabbitmq]
192@@ -199,31 +191,25 @@
193 uri: none
194
195 [request_daily_builds]
196-oops_prefix: TRDB
197 error_dir: /var/tmp/lperr.test
198
199 [rosetta]
200 generate_templates: True
201
202 [rosettabranches]
203-oops_prefix: TRSBR
204 error_dir: /var/tmp/rosettabranches.test
205
206 [sendbranchmail]
207-oops_prefix: BM
208 error_dir: /var/tmp/codehosting.test
209
210 [supermirror_import_puller]
211 error_dir: /var/tmp/codehosting.test
212-oops_prefix: TISMP
213
214 [supermirror_mirror_puller]
215 error_dir: /var/tmp/codehosting.test
216-oops_prefix: TMSMP
217
218 [supermirror_upload_puller]
219 error_dir: /var/tmp/codehosting.test
220-oops_prefix: TUSMP
221
222 [uploader]
223 default_recipient_name: Root
224
225=== modified file 'lib/lp/services/config/schema-lazr.conf'
226--- lib/lp/services/config/schema-lazr.conf 2012-04-27 16:22:05 +0000
227+++ lib/lp/services/config/schema-lazr.conf 2012-05-02 01:50:24 +0000
228@@ -46,9 +46,6 @@
229 # See [error_reports].
230 error_dir: none
231
232-# See [error_reports].
233-oops_prefix: none
234-
235
236 [builddmaster]
237 # The database user which will be used by this process.
238@@ -107,8 +104,6 @@
239 # Configuration for spawned Bazaar subprocesses.
240 [bzr_lpserve]
241 # See [error_reports].
242-oops_prefix: none
243-# See [error_reports].
244 error_dir: none
245
246
247@@ -140,9 +135,6 @@
248 # See [error_reports].
249 error_dir: none
250
251-# See [error_reports].
252-oops_prefix: none
253-
254 # datatype: integer
255 batch_query_threshold: 10
256
257@@ -215,9 +207,6 @@
258 # See [error_reports].
259 error_dir: none
260
261-# See [error_reports].
262-oops_prefix: none
263-
264
265 [codehosting]
266 # datatype: string
267@@ -255,9 +244,6 @@
268 # datatype: string
269 codehosting_endpoint: none
270
271-# See [error_reports].
272-oops_prefix: none
273-
274 # datatype: string
275 bzr_lp_prefix: lp:
276
277@@ -433,9 +419,6 @@
278 # See [error_reports].
279 error_dir: /var/tmp/codehosting.test/
280
281-# See [error_reports].
282-oops_prefix: none
283-
284
285 [codeimportworker]
286 # This code is used by the code-import-worker-monitor which lives in
287@@ -460,9 +443,6 @@
288 # See [error_reports].
289 error_dir: /var/tmp/codehosting.test/
290
291-# See [error_reports].
292-oops_prefix: none
293-
294
295 [commercial]
296 # URL for salesforce proxy.
297@@ -491,9 +471,6 @@
298 # See [error_reports].
299 error_dir: none
300
301-# See [error_reports].
302-oops_prefix: none
303-
304
305 [cveupdater]
306 # The database user which will be used by this process.
307@@ -615,9 +592,6 @@
308 # See [error_reports].
309 error_dir: none
310
311-# See [error_reports].
312-oops_prefix: none
313-
314
315 [error_reports]
316 # A prefix for "OOPS" codes for this process instance.
317@@ -849,9 +823,6 @@
318 # See [error_reports].
319 error_dir: none
320
321-# See [error_reports].
322-oops_prefix: none
323-
324
325 [karmacacheupdater]
326 # The database user which will be used by this process.
327@@ -1195,8 +1166,6 @@
328 use_https = True
329
330 # See [error_reports].
331-# Must be unique per librarian instance.
332-oops_prefix: none
333 # Must be set per librarian instance.
334 error_dir: none
335
336@@ -1318,9 +1287,6 @@
337 # See [error_reports].
338 error_dir: none
339
340-# See [error_reports].
341-oops_prefix: none
342-
343 # Whether Mailman should be built if it is not already.
344 # datatype: boolean
345 build: false
346@@ -1447,9 +1413,6 @@
347 # See [error_reports].
348 error_dir: none
349
350-# See [error_reports].
351-oops_prefix: none
352-
353
354 [person_notification]
355 # User for person notification db access
356@@ -1498,8 +1461,6 @@
357 statement_timeout: 300
358
359 # See [error_reports].
360-oops_prefix: none
361-# See [error_reports].
362 error_dir: none
363
364
365@@ -1510,9 +1471,6 @@
366 # datatype: string
367 authentication_endpoint: none
368
369-# See [error_reports].
370-oops_prefix: none
371-
372 # see [error_reports].
373 error_dir: none
374
375@@ -1555,7 +1513,6 @@
376 # The database user which will be used by this process.
377 # datatype: string
378 dbuser: process-apport-blobs
379-oops_prefix: none
380 error_dir: none
381
382
383@@ -1618,13 +1575,10 @@
384
385 # See [error_reports].
386 error_dir: none
387-# See [error_reports].
388-oops_prefix: none
389
390 [request_daily_builds]
391 dbuser: request-daily-builds
392 error_dir: none
393-oops_prefix: none
394
395
396 [revisionkarma]
397@@ -1675,23 +1629,16 @@
398 # See [error_reports].
399 error_dir: none
400
401-# See [error_reports].
402-oops_prefix: none
403-
404
405 [translations_export_to_branch]
406 # See [error_reports].
407 error_dir: none
408
409-# See [error_reports].
410-oops_prefix: none
411-
412
413 [sendbranchmail]
414 # The database user which will be used by this process.
415 # datatype: string
416 dbuser: send-branch-mail
417-oops_prefix: none
418 error_dir: none
419
420 [pofile_stats]
421@@ -1701,9 +1648,6 @@
422 # See [error_reports].
423 error_dir: none
424
425-# See [error_reports].
426-oops_prefix: none
427-
428
429 # For the personal standing updater cron script.
430 [standingupdater]
431@@ -1736,33 +1680,21 @@
432 # See [error_reports].
433 error_dir: none
434
435-# See [error_reports].
436-oops_prefix: none
437-
438
439 [supermirror_import_puller]
440 # See [error_reports].
441 error_dir: none
442
443-# See [error_reports].
444-oops_prefix: none
445-
446
447 [supermirror_mirror_puller]
448 # See [error_reports].
449 error_dir: none
450
451-# See [error_reports].
452-oops_prefix: none
453-
454
455 [supermirror_upload_puller]
456 # See [error_reports].
457 error_dir: none
458
459-# See [error_reports].
460-oops_prefix: none
461-
462
463 [targetnamecacheupdater]
464 # The database user which will be used by this process.
465@@ -1794,9 +1726,6 @@
466 # See [error_reports].
467 error_dir: none
468
469-# See [error_reports].
470-oops_prefix: none
471-
472
473 [uploader]
474 # The database user which will be used by this process.
475@@ -1935,9 +1864,6 @@
476 # See [error_reports].
477 error_dir: none
478
479-# See [error_reports].
480-oops_prefix: none
481-
482 [IQuestionEmailJobSource]
483 # This section is used by cronscripts/process-job-source.py.
484 module: lp.answers.interfaces.questionjob
485
486=== modified file 'lib/lp/services/job/runner.py'
487--- lib/lp/services/job/runner.py 2012-04-26 19:42:04 +0000
488+++ lib/lp/services/job/runner.py 2012-05-02 01:50:24 +0000
489@@ -607,9 +607,8 @@
490
491 def main(self):
492 section = self.config_section
493- if (getattr(section, 'error_dir', None) is not None
494- and getattr(section, 'oops_prefix', None) is not None):
495- # If the two variables are not set, we will let the error
496+ if getattr(section, 'error_dir', None) is not None:
497+ # If the error_dir is not set, we will let the error
498 # utility default to using the [error_reports] config.
499 errorlog.globalErrorUtility.configure(self.config_name)
500 job_source = getUtility(self.source_interface)
501
502=== modified file 'lib/lp/services/job/tests/test_runner.py'
503--- lib/lp/services/job/tests/test_runner.py 2012-04-20 19:42:50 +0000
504+++ lib/lp/services/job/tests/test_runner.py 2012-05-02 01:50:24 +0000
505@@ -662,10 +662,9 @@
506 def runFromSource(cls, source, dbuser, logger):
507 expected_config = errorlog.ErrorReportingUtility()
508 expected_config.configure('merge_proposal_jobs')
509- # Check that the unique oops token was applied.
510 self.assertEqual(
511- errorlog.globalErrorUtility.oops_prefix,
512- expected_config.oops_prefix)
513+ 'T-merge_proposal_jobs',
514+ errorlog.globalErrorUtility.oops_prefix)
515 return cls()
516
517 completed_jobs = []
518
519=== modified file 'lib/lp/services/webapp/errorlog.py'
520--- lib/lp/services/webapp/errorlog.py 2012-03-06 23:39:08 +0000
521+++ lib/lp/services/webapp/errorlog.py 2012-05-02 01:50:24 +0000
522@@ -323,12 +323,9 @@
523 # Constants:
524 self._oops_config.template['branch_nick'] = versioninfo.branch_nick
525 self._oops_config.template['revno'] = versioninfo.revno
526- reporter = config[section_name].oops_prefix
527- if reporter is None:
528- # Unconfigured section - make up a reporter slightly more useful
529- # than e.g 'T' or 'LPNET'
530- reporter = (config[self._default_config_section].oops_prefix +
531- '-' + section_name)
532+ reporter = config[self._default_config_section].oops_prefix
533+ if section_name != self._default_config_section:
534+ reporter = '%s-%s' % (reporter, section_name)
535 self._oops_config.template['reporter'] = reporter
536 # Should go in an HTTP module.
537 self._oops_config.template['req_vars'] = {}
538
539=== modified file 'lib/lp/services/webapp/tests/test_errorlog.py'
540--- lib/lp/services/webapp/tests/test_errorlog.py 2012-01-01 02:58:52 +0000
541+++ lib/lp/services/webapp/tests/test_errorlog.py 2012-05-02 01:50:24 +0000
542@@ -161,8 +161,7 @@
543 # Some external processes may use another config section to
544 # provide the error log configuration.
545 utility.configure(section_name='branchscanner')
546- self.assertEqual(config.branchscanner.oops_prefix,
547- utility.oops_prefix)
548+ self.assertEqual('T-branchscanner', utility.oops_prefix)
549 self.assertEqual(config.branchscanner.error_dir,
550 utility._oops_datedir_repo.root)
551