← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~jcsackett/launchpad/hardwaredb-should-ignore-bad-data into lp:launchpad

 

The proposal to merge lp:~jcsackett/launchpad/hardwaredb-should-ignore-bad-data into lp:launchpad has been updated.

Description changed to:

Summary
=======

Bad data sent to the HWDB caused an OOPS when it failed to validate. While we want to log the bad data as an error, we don't want it to generate an OOPS and get in the OOPS report, because there's nothing we can do about it beyond report bad data coming in from another source.

Preimplementation
=================

Spoke with Curtis Hovey, and explored the problem with him.

Implementation
==============
lib/lp/services/scripts/base.py
-------------------------------
Added a contextmanager for the OopsHandler that temporarily removes it from a logger, and adds it back in after the context expires.

lib/lp/hardwaredb/scripts/hwdbsubmissions.py
--------------------------------------------
Updated the self._logError method for the script to take a parameter indicating whether or not an Oops should be created. The contextmanager created in base.py is used to disable the Oopshandler if the parameter is false. It defaults to true.

lib/canonical/launchpad/scripts/tests/baddatahardwaretest.xml
lib/lp/hardwaredb/tests/test_hwdb_submission_validation.py
----------------------------------------------------------
Tests and test data.

Tests
=====

bin/test -vvct test_hwdb

QA
==

Create a hardware db entry on qastaging, staging, or launchpad.dev, using bad data (the data from the bug's linked oops report would be fine). Fire of the process-hwdb-submission job and confirm that no oops report is created for the bad data you provided.

Lint
====

= Launchpad lint =

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/canonical/launchpad/scripts/tests/baddatahardwaretest.xml
  lib/lp/hardwaredb/scripts/hwdbsubmissions.py
  lib/lp/hardwaredb/tests/test_hwdb_submission_validation.py
  lib/lp/services/scripts/base.py

For more details, see:
https://code.launchpad.net/~jcsackett/launchpad/hardwaredb-should-ignore-bad-data/+merge/56472
-- 
https://code.launchpad.net/~jcsackett/launchpad/hardwaredb-should-ignore-bad-data/+merge/56472
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jcsackett/launchpad/hardwaredb-should-ignore-bad-data into lp:launchpad.



References