Closed Bug 1553314 Opened 6 years ago Closed 6 years ago

Remove configman-style required_config from Rules

Categories

(Socorro :: Processor, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jwhitlock, Assigned: willkg)

References

Details

Attachments

(4 files)

In bug 1409648 / https://github.com/mozilla-services/socorro/pull/4253, rules were simplified, but still have some configman code:

  • Rules are derived from socorro.processor.rules.base.Rule, which is based on configman.RequiredConfig. Tests pass if this is removed.
  • Rules include a required_config class attribute, but these are unused, but instead use the the ProcessorApp.config passed into the rule at initialization. This should be removed, and replaced with initialization of instance attributes in the __init__ method (my preference), or documentation of what config items are used.

This may be part of replacing configman with everett (bug 1529342).

See Also: → 1553251

For BreakpadStackwalkerRule2015, it would look something like:

def __init__(self, config, *args, **kwargs):
    super().__init__(*args, **kwargs)
    self.symbols_urls = config.symbols_urls
    self.command_line = config.command_line
    self.command_pathname = config.command_pathname
    ...

    self.metrics = markus.get_metrics('processor.breakpadstackwalkerrule')

This is the version where we want to use the configman or everett config object at initialization, but not stored and used during the life of the object. If that's not a design goal, then we could document the config items used in the class docstring, or leave it implied by config. usage in the code.

I really thought we had fixed Rules so they didn't use configman anymore, so I'm a bit surprised. It's entirely possible that I fixed this in a branch locally, but haven't lifted it, yet. I'll look to see if I've done this already.

I'm going to grab this to see if I've done this already. I think this is a defect--we shouldn't have vestigial configuration because that just confuses things and creates problems.

Assignee: nobody → willkg
Type: enhancement → defect

This turns out to be a bigger problem. Because of the way we did configuration where it's not namespaced, the configuration for running mdsw applies to all the ExternalProcessRules which is wrong. The JitCrashCategorizationRule needs different command configuration.

Given that, I'm bumping this up to a P2 since it's a defect and it's preventing the JitCrashCategorizationRule from running.

Priority: P3 → P2

:willkg, please confirm this works as expected on stage.

Flags: needinfo?(willkg)
Flags: needinfo?(willkg)

I compared processed crash data between prod and stage and it's the same (module things like timestamps and timings and such which we'd expect to be different).

Stage looks good. :+1:

Deployed to production, new crashes are being processed. Thanks willkg!

Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: