Closed Bug 729097 Opened 12 years ago Closed 12 years ago

Rewrite versions that are on the esr channel to have esr in the version number

Categories

(Socorro :: Backend, task)

task
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: laura, Assigned: lars)

References

Details

(Whiteboard: [esr])

Attachments

(2 files)

For version n channel esr, rewrite version to nesr.

Example: receive raw crash for Fennec, version '10.0.3', channel 'esr'.
In the processed crash and into the database, write the version string as '10.0.3esr'

This should be a configurable rule (loaded from the database?) much like rewriting Fennec to FennecAndroid.
questions:

in the example, 'esr' as the channel is the sole trigger, correct?  No matter what the product, if the channel is 'esr', the version gets rewritten as version + 'esr'

in making this rule configurable, should it be dedicated to just rewriting version numbers based on channel or do you want a more flexible system?  Do you want the ability change one or more arbitrary json fields based on some predicate defined in terms of the json fields?

If the system is to be dedicated to changing the version string based on just the channel, it hardly seems worth encoding into a database table.  How often are we going to add new channels that need to be encoded into the version?

If the system needs to do arbitrarily complex transforms, rather than inventing a new language to express them, I would (somewhat hesitatingly) suggest putting python code into a database table.

  if j.Channel == 'esr':
      j.Version = j.Version + 'esr'

these rules could be loaded from the database, eval'd in an appropriate context and then executed when needed.  This allows the greatest flexibility as rules could be added/modified at run time without restarting the processor.  Great care would have to be taken to make sure this doesn't become an attack vector.

Alternatively, a safer but less flexible method would be to encode the rules in a python module and have the database table just name the rules to be used.  New rules would require recoding and restarting the processor.  

Both of these proposals could encompass the esr rule as well as the existing ProductName rewrite.

Suggestions as to direction?
To answer your first question, yes, this is correct:
"in the example, 'esr' as the channel is the sole trigger, correct?  No matter what the product, if the channel is 'esr', the version gets rewritten as version + 'esr'"

Re the implementation, here are a couple of considerations I think are important:
1.  Whatever we do should cause the least amount of pain for non-Mozilla users
2. I really don't want to put Python code in the database. That way leads to pain.

The only reason I suggested the database was for consistency with the way Fennec/FennecAndroid is handled.

I don't think the system has to be amazingly flexible and arbitrary, but I'd prefer it be somewhere in the middle ground between "completely flexible and horrifyingly complicated" and "a one-time hack".
Depends on: 731000
see http://www.twobraids.com/2012/02/socorro-rule-system.html for a missive on how I'm implementing the solution to this problem.
When processed by Socorro, this crash should display a version of '8.0a1esr' and have a Product of 'FennecAndroid'.
Pull Req 390 submitted: Implemented using a rule based system outlined in this blog post: http://www.twobraids.com/2012/02/socorro-rule-system.html Reviewers ought to read that first to understand what's going on.

Part of the objective was to make it so that the rules could be loaded from the database. While this is implemented, if something were to go wrong (such as Bug 731000 not getting implemented for this deadline), the rule system will fall back to hardcoded rules that accomplish the 'ESR' and 'ProductName' json rewrites.
Pull Req 390 was withdrawn due to the inadvertent inclusion of some unrelated changes.  The new pull req is 393.
Commit pushed to master at https://github.com/mozilla/socorro

https://github.com/mozilla/socorro/commit/bec9210587005e9067345c303d98f86057b1ec06
Merge pull request #393 from twobraids/bug-729097-esr-version

Fixes bug 729097 - Rewrite versions that are on the esr channel to have esr in the version number
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Whiteboard: [esr] → [esr][qa-]
why is this [qa-]?  This should be tested by QA.  Comment #4 outlines how to test.
Whiteboard: [esr][qa-] → [esr][qa+]
Attached image qa - verified
QA verified on stage - :lars thank you for getting the crashes submitted to stage - comment 4 and comment 9 -

Crashes that were submitted displayed the expected version of '8.0a1esr' and have a Product of 'FennecAndroid'.
Status: RESOLVED → VERIFIED
Whiteboard: [esr][qa+] → [esr]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: