← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~wgrant/launchpad/no-section-error_dir into lp:launchpad

 

William Grant has proposed merging lp:~wgrant/launchpad/no-section-error_dir into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~wgrant/launchpad/no-section-error_dir/+merge/106106

This branch removes the per-script error_dir configurability that was rendered obsolete by hash-based OOPS IDs. Previously each script needed a non-colliding directory, so each had a config section where they specified a different error_dir. But they're all gone from production now, so this support can be removed.

There should only be one behaviour change: the "section name" with which the error utility is configured will now always be appended to the OOPS prefix, rather than only when error_dir is set.
-- 
https://code.launchpad.net/~wgrant/launchpad/no-section-error_dir/+merge/106106
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/no-section-error_dir into lp:launchpad.
=== modified file 'configs/development/launchpad-lazr.conf'
--- configs/development/launchpad-lazr.conf	2012-05-02 01:31:53 +0000
+++ configs/development/launchpad-lazr.conf	2012-05-17 04:19:43 +0000
@@ -8,22 +8,15 @@
 [archivepublisher]
 run_parts_location: none
 
-[branchscanner]
-error_dir: /var/tmp/codehosting.test
-
 [builddmaster]
 root: /var/tmp/builddmaster/
 uploader: scripts/process-upload.py -Mvv
 bzr_builder_sources_list: None
 
-[bzr_lpserve]
-error_dir: /var/tmp/codehosting.test
-
 [canonical]
 show_tracebacks: True
 
 [checkwatches]
-error_dir: /var/tmp/lperr
 sync_debbugs_comments: True
 
 [checkwatches.credentials]
@@ -37,7 +30,6 @@
 log_folder: /var/tmp/bazaar.launchpad.dev/logs
 launchpad_root: https://code.launchpad.dev/
 secret_path: configs/development/codebrowse-secret
-error_dir: /var/tmp/codebrowse.launchpad.dev/errors
 
 [codehosting]
 launch: True
@@ -51,7 +43,6 @@
 rewrite_script_log_file: /var/tmp/bazaar.launchpad.dev/rewrite.log
 host_key_pair_path: lib/lp/codehosting/sshserver/tests/keys
 port: tcp:5022:interface=127.0.0.88
-error_dir: /var/tmp/codehosting.test
 bzr_lp_prefix: lp://dev/
 lp_url_hosts: dev
 access_log: /var/tmp/bazaar.launchpad.dev/codehosting-access.log
@@ -63,12 +54,8 @@
 foreign_tree_store: file:///tmp/foreign-branches
 
 [codeimportdispatcher]
-error_dir: /var/tmp/codehosting.test
 forced_hostname: bazaar-importer
 
-[codeimportworker]
-error_dir: /var/tmp/codehosting.test
-
 [commercial]
 voucher_proxy_url: http://launchpad.dev
 voucher_proxy_port: 2323
@@ -93,9 +80,6 @@
 timeout: 10
 cdimage_file_list_url: file:lib/lp/registry/tests/ubuntu-releases.testdata
 
-[distroseriesdifferencejob]
-error_dir: /var/tmp/soyuz.test
-
 [error_reports]
 oops_prefix: X
 error_dir: /var/tmp/lperr
@@ -113,12 +97,6 @@
 host: keyserver.launchpad.dev
 public_host: keyserver.launchpad.dev
 
-[initializedistroseries]
-error_dir: /var/tmp/soyuz.test
-
-[IPlainPackageCopyJobSource]
-error_dir: /var/tmp/soyuz.test
-
 [launchpad]
 enable_test_openid_provider: True
 openid_provider_vhost: testopenid
@@ -150,7 +128,6 @@
 restricted_download_port: 58085
 restricted_download_url: http://launchpad.dev:58085/
 use_https = False
-error_dir: /var/tmp/codehosting.test
 
 [librarian_server]
 root: /var/tmp/fatsam
@@ -175,7 +152,6 @@
 build_var_dir: /var/tmp/mailman
 xmlrpc_runner_sleep: 5
 smtp: localhost:9025
-error_dir: /var/tmp/mailman-xmlrpc
 list_help_header: http://help.launchpad.dev/ListHelp
 archive_address: archive@xxxxxxxxxxxxxxxx
 list_owner_header_template: http://launchpad.dev/~$team_name
@@ -196,12 +172,6 @@
 port: 11217
 memory_size: 1
 
-[merge_proposal_jobs]
-error_dir: /var/tmp/codehosting.test
-
-[packaging_translations]
-error_dir: /var/tmp/lperr
-
 [personalpackagearchive]
 root: /var/tmp/ppa/
 private_root: /var/tmp/ppa
@@ -226,43 +196,13 @@
 frontend_port: 22435
 uri: /+longpoll/
 
-[reclaimbranchspace]
-error_dir: /var/tmp/codehosting.test
-
 [rosetta]
 global_suggestions_enabled: True
 generate_templates: True
 
-[rosettabranches]
-error_dir: /var/tmp/rosettabranches.test
-
-[poimport]
-error_dir: /var/tmp/poimport
-
-[process_apport_blobs]
-error_dir: /var/tmp/lperr
-
 [profiling]
 profiling_allowed: True
 
-[supermirror_puller]
-error_dir: /var/tmp/codehosting.test
-
-[supermirror_import_puller]
-error_dir: /var/tmp/codehosting.test
-
-[supermirror_mirror_puller]
-error_dir: /var/tmp/codehosting.test
-
-[supermirror_upload_puller]
-error_dir: /var/tmp/codehosting.test
-
-[translations_export_to_branch]
-error_dir: /var/tmp/translations_export_to_branch
-
-[upgrade_branches]
-error_dir: /var/tmp/codehosting.test
-
 [uploader]
 default_recipient_name: Local Root
 default_sender_address: root@localhost

=== modified file 'configs/testrunner/launchpad-lazr.conf'
--- configs/testrunner/launchpad-lazr.conf	2012-05-02 01:31:53 +0000
+++ configs/testrunner/launchpad-lazr.conf	2012-05-17 04:19:43 +0000
@@ -8,22 +8,17 @@
 [canonical]
 cron_control_url: file:lib/lp/services/scripts/tests/cronscripts.ini
 
-[branchscanner]
-error_dir: /var/tmp/lperr.test
-
 [builddmaster]
 socket_timeout: 10
 uploader: scripts/process-upload.py -Mvv
 
 [checkwatches]
 sync_debbugs_comments: True
-error_dir: /var/tmp/lperr.test
 
 [codehosting]
 bzr_lp_prefix: lp://dev/
 host_key_pair_path: lib/lp/codehosting/sshserver/tests/keys
 port: tcp:22222:interface=bazaar.launchpad.dev
-error_dir: /var/tmp/codehosting.test
 access_log: /tmp/test-codehosting-access.log
 internal_branch_by_id_root: file:///var/tmp/bazaar.launchpad.dev/mirrors
 
@@ -134,7 +129,6 @@
 root: /var/tmp/fatsam.test
 
 [mailman]
-error_dir: /var/tmp/mailman-xmlrpc.test
 shared_secret: topsecret
 
 [malone]
@@ -156,27 +150,14 @@
 # processes spawned through some other mechanism.
 port: 11242
 
-[merge_proposal_jobs]
-error_dir: /var/tmp/codehosting.test
-
-[packaging_translations]
-error_dir: /var/tmp/lperr.test
-
-[upgrade_branches]
-error_dir: /var/tmp/codehosting.test
-
 [personalpackagearchive]
 root: /var/tmp/ppa.test/
 
 [ppa_apache_log_parser]
 logs_root: lib/lp/soyuz/scripts/tests/ppa-apache-log-files
 
-[poimport]
-error_dir: /var/tmp/poimport.test
-
 [process_apport_blobs]
 dbuser: process-apport-blobs
-error_dir: /var/tmp/lperr.test
 
 [rabbitmq]
 launch: False
@@ -190,27 +171,9 @@
 frontend_port: none
 uri: none
 
-[request_daily_builds]
-error_dir: /var/tmp/lperr.test
-
 [rosetta]
 generate_templates: True
 
-[rosettabranches]
-error_dir: /var/tmp/rosettabranches.test
-
-[sendbranchmail]
-error_dir: /var/tmp/codehosting.test
-
-[supermirror_import_puller]
-error_dir: /var/tmp/codehosting.test
-
-[supermirror_mirror_puller]
-error_dir: /var/tmp/codehosting.test
-
-[supermirror_upload_puller]
-error_dir: /var/tmp/codehosting.test
-
 [uploader]
 default_recipient_name: Root
 default_sender_name: Root

=== modified file 'lib/lp/services/config/schema-lazr.conf'
--- lib/lp/services/config/schema-lazr.conf	2012-05-03 03:50:57 +0000
+++ lib/lp/services/config/schema-lazr.conf	2012-05-17 04:19:43 +0000
@@ -43,9 +43,6 @@
 # datatype: string
 dbuser: branchscanner
 
-# See [error_reports].
-error_dir: none
-
 
 [builddmaster]
 # The database user which will be used by this process.
@@ -101,12 +98,6 @@
 bzr_builder_sources_list: none
 
 
-# Configuration for spawned Bazaar subprocesses.
-[bzr_lpserve]
-# See [error_reports].
-error_dir: none
-
-
 [canonical]
 # datatype: boolean
 show_tracebacks: False
@@ -132,9 +123,6 @@
 # datatype: string
 dbuser: checkwatches
 
-# See [error_reports].
-error_dir: none
-
 # datatype: integer
 batch_query_threshold: 10
 
@@ -204,9 +192,6 @@
 # datatype: string
 secret_path:
 
-# See [error_reports].
-error_dir: none
-
 
 [codehosting]
 # datatype: string
@@ -251,9 +236,6 @@
 # The comma is used to produce the empty string.
 lp_url_hosts: ,production
 
-# see [error_reports].
-error_dir: none
-
 # datatype: string
 host_key_pair_path: none
 
@@ -416,9 +398,6 @@
 # The maximum number of jobs to run on a machine at one time.
 max_jobs_per_machine: 3
 
-# See [error_reports].
-error_dir: none
-
 
 [codeimportworker]
 # This code is used by the code-import-worker-monitor which lives in
@@ -440,9 +419,6 @@
 # worker-for-branch-${BRANCH_ID} in this directory.
 working_directory_root: /var/tmp/codeimport/data
 
-# See [error_reports].
-error_dir: none
-
 
 [commercial]
 # URL for salesforce proxy.
@@ -468,9 +444,6 @@
 source_interface:
     lp.translations.interfaces.translationpackagingjob.ITranslationPackagingJobSource
 
-# See [error_reports].
-error_dir: none
-
 
 [cveupdater]
 # The database user which will be used by this process.
@@ -589,9 +562,6 @@
 [distroseriesdifferencejob]
 dbuser: distroseriesdifferencejob
 
-# See [error_reports].
-error_dir: none
-
 
 [error_reports]
 # A prefix for "OOPS" codes for this process instance.
@@ -820,9 +790,6 @@
 source_interface:
     lp.soyuz.interfaces.distributionjob.IInitializeDistroSeriesJobSource
 
-# See [error_reports].
-error_dir: none
-
 
 [karmacacheupdater]
 # The database user which will be used by this process.
@@ -1165,10 +1132,6 @@
 
 use_https = True
 
-# See [error_reports].
-# Must be set per librarian instance.
-error_dir: none
-
 
 [librarian_gc]
 # The database user which will be used by this process.
@@ -1284,9 +1247,6 @@
 soft_max_size: 2000000
 hard_max_size: 50000000
 
-# See [error_reports].
-error_dir: none
-
 # Whether Mailman should be built if it is not already.
 # datatype: boolean
 build: false
@@ -1410,9 +1370,6 @@
 # datatype: string
 dbuser: merge-proposal-jobs
 
-# See [error_reports].
-error_dir: none
-
 
 [person_notification]
 # User for person notification db access
@@ -1460,9 +1417,6 @@
 # Set to 'timeout' to make it timeout every time (for tests).
 statement_timeout: 300
 
-# See [error_reports].
-error_dir: none
-
 
 [poppy]
 # The URL of the XML-RPC endpoint that handles authentication of SSH
@@ -1471,9 +1425,6 @@
 # datatype: string
 authentication_endpoint: none
 
-# see [error_reports].
-error_dir: none
-
 # The absolute path to the private key used for the SFTP server.
 # datatype: string
 host_key_private: none
@@ -1513,7 +1464,6 @@
 # The database user which will be used by this process.
 # datatype: string
 dbuser: process-apport-blobs
-error_dir: none
 
 
 [productreleasefinder]
@@ -1573,12 +1523,8 @@
 # datatype: string
 dbuser: reclaim-branch-space
 
-# See [error_reports].
-error_dir: none
-
 [request_daily_builds]
 dbuser: request-daily-builds
-error_dir: none
 
 
 [revisionkarma]
@@ -1626,28 +1572,16 @@
 # datatype: string
 dbuser: translationsbranchscanner
 
-# See [error_reports].
-error_dir: none
-
-
-[translations_export_to_branch]
-# See [error_reports].
-error_dir: none
-
 
 [sendbranchmail]
 # The database user which will be used by this process.
 # datatype: string
 dbuser: send-branch-mail
-error_dir: none
 
 [pofile_stats]
 dbuser: pofilestats
 source_interface: lp.translations.interfaces.pofilestatsjob.IPOFileStatsJobSource
 
-# See [error_reports].
-error_dir: none
-
 
 # For the personal standing updater cron script.
 [standingupdater]
@@ -1676,26 +1610,6 @@
 polling_interval: 10
 
 
-[supermirror_puller]
-# See [error_reports].
-error_dir: none
-
-
-[supermirror_import_puller]
-# See [error_reports].
-error_dir: none
-
-
-[supermirror_mirror_puller]
-# See [error_reports].
-error_dir: none
-
-
-[supermirror_upload_puller]
-# See [error_reports].
-error_dir: none
-
-
 [targetnamecacheupdater]
 # The database user which will be used by this process.
 # datatype: string
@@ -1723,9 +1637,6 @@
 [upgrade_branches]
 dbuser: upgrade-branches
 
-# See [error_reports].
-error_dir: none
-
 
 [uploader]
 # The database user which will be used by this process.
@@ -1861,9 +1772,6 @@
 dbuser: copy_packages
 crontab_group: FREQUENT
 
-# See [error_reports].
-error_dir: none
-
 [IQuestionEmailJobSource]
 # This section is used by cronscripts/process-job-source.py.
 module: lp.answers.interfaces.questionjob

=== modified file 'lib/lp/services/job/runner.py'
--- lib/lp/services/job/runner.py	2012-05-16 19:29:15 +0000
+++ lib/lp/services/job/runner.py	2012-05-17 04:19:43 +0000
@@ -621,11 +621,7 @@
         return getattr(config, self.config_name)
 
     def main(self):
-        section = self.config_section
-        if getattr(section, 'error_dir', None) is not None:
-            # If the error_dir is not set, we will let the error
-            # utility default to using the [error_reports] config.
-            errorlog.globalErrorUtility.configure(self.config_name)
+        errorlog.globalErrorUtility.configure(self.config_name)
         job_source = getUtility(self.source_interface)
         kwargs = {}
         if self.log_twisted:

=== modified file 'lib/lp/services/webapp/errorlog.py'
--- lib/lp/services/webapp/errorlog.py	2012-05-01 23:35:22 +0000
+++ lib/lp/services/webapp/errorlog.py	2012-05-17 04:19:43 +0000
@@ -364,11 +364,8 @@
             add_publisher(amqp_publisher)
         # We want to publish reports to disk for gathering to the central
         # analysis server, but only if we haven't already published to rabbit.
-        error_dir = config[section_name].error_dir
-        if error_dir is None:
-            # Inherit the base error_dir - sharing error dirs is safe.
-            error_dir = config[self._default_config_section].error_dir
-        self._oops_datedir_repo = DateDirRepo(error_dir)
+        self._oops_datedir_repo = DateDirRepo(
+            config[self._default_config_section].error_dir)
         add_publisher(oops.publish_new_only(self._oops_datedir_repo.publish))
         # And send everything within the zope application server (only for
         # testing).

=== modified file 'lib/lp/services/webapp/tests/test_errorlog.py'
--- lib/lp/services/webapp/tests/test_errorlog.py	2012-05-01 23:35:22 +0000
+++ lib/lp/services/webapp/tests/test_errorlog.py	2012-05-17 04:19:43 +0000
@@ -158,19 +158,15 @@
             utility.oops_prefix)
         self.assertEqual(config.error_reports.error_dir,
             utility._oops_datedir_repo.root)
-        # Some external processes may use another config section to
-        # provide the error log configuration.
+        # Some external processes may extend the reporter/prefix with
+        # extra information.
         utility.configure(section_name='branchscanner')
         self.assertEqual('T-branchscanner', utility.oops_prefix)
-        self.assertEqual(config.branchscanner.error_dir,
-            utility._oops_datedir_repo.root)
 
         # The default error section can be restored.
         utility.configure()
         self.assertEqual(config.error_reports.oops_prefix,
             utility.oops_prefix)
-        self.assertEqual(config.error_reports.error_dir,
-            utility._oops_datedir_repo.root)
 
         # We should have had three publishers setup:
         oops_config = utility._oops_config


Follow ups