Closed Bug 1423549 Opened 7 years ago Closed 6 years ago

PerformanceSignature specifies unique_together twice, so the first is ignored

Categories

(Tree Management :: Perfherder, enhancement, P1)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: emorley, Assigned: igoldan)

Details

Attachments

(1 file)

I noticed that PerformanceSignature has:

    class Meta:
        db_table = 'performance_signature'
        # make sure there is only one signature per repository with a
        # particular set of properties
        unique_together = ('repository', 'framework', 'platform',
                           'option_collection', 'suite', 'test',
                           'last_updated', 'extra_options')
        # make sure there is only one signature of any hash per
        # repository (same hash in different repositories is allowed)
        unique_together = ('repository', 'framework', 'signature_hash')

(https://github.com/mozilla/treeherder/blob/149830984bc4e42cd6f39cde5d2c529c32813e07/treeherder/perf/models.py#L84-L91)

ie: the value for `unique_together` is overwritten, meaning there are fewer constraints (and indexes) actually set than meets the eye.

Will, do you know what should be defined here?
Flags: needinfo?(wlachance)
Oops. I think I meant to define two unique together constraints. I think as long as we have signature hashes, we need both. Converting this to one unique_together (a tuple of tuples) should do the trick. Would you mind terribly doing this? I don't have a full treeherder environment set up at the moment.
Flags: needinfo?(wlachance)
Assignee: nobody → igoldan
Attachment #9006196 - Flags: review?(wlachance)
Comment on attachment 9006196 [details] [review]
Link to GitHub pull-request: https://github.com/mozilla/treeherder/pull/3979

Thanks Ionut!
Attachment #9006196 - Flags: review?(wlachance) → review+
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: