Why didn't validate_and_test.py catch type mismatches

RESOLVED FIXED

Status

Socorro
General
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: peterbe, Assigned: peterbe)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

a year ago
See https://bugzilla.mozilla.org/show_bug.cgi?id=1343619
We added some fields to JSON Schema, ran the validate_and_test.py but it didn't notice the type difference. It should. 

The resolve this, take the original from https://github.com/mozilla/socorro/pull/3682 and run validate_and_test.py and it should find flaws on some types.
(Assignee)

Updated

a year ago
Assignee: nobody → peterbe
(Assignee)

Comment 1

a year ago
One immediate thought is that doesn't ProcessedCrash filter out fields if you view the crash without an access token or cookie?
(Assignee)

Comment 2

a year ago
(In reply to Peter Bengtsson [:peterbe] from comment #1)
> One immediate thought is that doesn't ProcessedCrash filter out fields if
> you view the crash without an access token or cookie?

Scratch that.
(Assignee)

Comment 3

a year ago
The reason it can't work is both simple and sad. 

What the processor does is that it takes the processed crash, merges it with the raw crash and renames fields according to Super Search Fields. 
E.g.

 processed_crash = {'foo': 'Foo'}
 raw_crash = {'DOMIPCEnabled': '1'}
 merged = {'foo': 'Foo', 'DOMIPCEnabled': '1'}
 renamed_according_to_supersearch_fields = {'foo': 'Foo', 'dom_ipc_enabled': '1'}
 and send that to the Telemetry S3 bucket. 

When validate_and_test.py, I think, was originally written we only used fields from the processed crash. It was our gentle start. 

The solution to this must be to try to simulate what https://github.com/mozilla/socorro/blob/3d63f17aabc6a10875d2d23507077df42970bbf8/socorro/external/boto/crashstorage.py#L338-L377 does. 

As a side-note, either this is a lie (as in, it's not doing any validation) or it's buggy: https://github.com/mozilla/socorro/blob/3d63f17aabc6a10875d2d23507077df42970bbf8/socorro/external/boto/crashstorage.py#L373
(Assignee)

Comment 4

a year ago
A possible solution is to change validate_and_test.py to import `from socorro.external.boto.crashstorage import TelemetryBotoS3CrashStorage` and using some Auth Token or something try to pull down the SuperSearchFields and do the merge locally and *then* validate.

Comment 6

a year ago
Commit pushed to master at https://github.com/mozilla/socorro

https://github.com/mozilla/socorro/commit/b378c36cada9fd85d6e8b8fff8b32941a62237da
fixes bug 1343623 - validate_and_test.py should test more realistically (#3683)

Updated

a year ago
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.