Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compare PR results against the results without changes #881

Merged
merged 2 commits into from
Dec 11, 2018

Conversation

Hexcles
Copy link
Member

@Hexcles Hexcles commented Dec 7, 2018

Description

The biggest changes are in loadRunsToCompare and api/receiver/create_run.go:

  • In loadRunsToCompare, we now need to handle the master runs and PR runs separately.
  • In api/receiver/create_run.go, we no longer schedule the results processing for runs with the label "pr_base"; otherwise, checks on PRs will be scheduled to be updated twice.

Fixes #708 .

Review Information

Please review commit by commit, as the second one is largely mechanical.

@Hexcles Hexcles requested a review from lukebjerring December 7, 2018 21:41
@wpt-pr-bot
Copy link

Staging instance deployed by Travis CI!
Running at https://compare-against-without-chan-dot-wptdashboard-staging.appspot.com

// If the run is on master, we will have only one match;
// for PRs, we have one for pr_head and one for pr_base.
two := 2
runs, err := shared.LoadTestRuns(ctx, filter.Products, filter.Labels, filter.SHA, filter.From, filter.To, &two, nil)
Copy link
Contributor

@lukebjerring lukebjerring Dec 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the rare case that we have a master commit land with exactly the same SHA, or in the case of duplicate runs, I'm concerned that we'll 404 here when we probably shouldn't. Given that you're deliberately filtering for shared.PRHeadLabel below, why not query for exactly one run with that label? And if it's not found, we try and fetch master @ the same SHA.

So, for say, chrome:

  • let head be chrome[pr_head] @ sha
  • If head is nil, let head be chrome[master] @ sha
  • If head is still nil, return a 404
  • If head is a pr_head, let base be chrome[pr_base] @ sha
  • If base is nil, let base be the latest chrome[master] before head.TimeStart

The last line means "fall back to diffing against master when pr_base can't be found."

EDIT: Sorry for tagging user sha

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a bit too many special conditions and fallbacks. What about making this a bit more generic?

How about we include all labels for a test run in the spec? So for master runs we will have chrome[master,taskcluster,experimental]@sha and for PR runs we have chrome[pr_head,taskcluster,experimental]@sha. Then in this function we can simply test whether labels contain "master" or "pr_head", then use different queries (either the same spec but earlier than sha, or the same spec but with "pr_head" replaced by "pr_base").

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that reduces the complexity, it just makes the original check creator responsible for being very specific about the product spec (rather than just knowing "chrome is starting", it's tightly coupled to head/base concepts).

I'd rather make the regression comparator responsible for what "checking chrome@sha for regressions" means in actuality.

@Hexcles Hexcles force-pushed the compare-against-without-changes branch from 25ad123 to e4a5af7 Compare December 10, 2018 21:57
@Hexcles
Copy link
Member Author

Hexcles commented Dec 10, 2018

@lukebjerring PTAL again (at the first commit). I didn't exactly follow your suggestions; instead, the logic is:

  1. Find the first (latest) run matching the spec.
  2. If the run has label "master", use it as the head run, find an earlier run as the base run to compare against.
  3. If the run has label "pr_base", use it as the base run, find another run matching the spec but also with label "pr_head" as the head run.
  4. If the run has label "pr_head", use it as the head run, find another run matching the spec but also with label "pr_base" as the base run.

(1, 2, 3 are mutually exclusive.)

@Hexcles Hexcles force-pushed the compare-against-without-changes branch from e4a5af7 to ccb58d3 Compare December 10, 2018 22:02
Copy link
Contributor

@lukebjerring lukebjerring left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome; I think this is fairly easy to follow.

api/checks/update.go Outdated Show resolved Hide resolved
Master runs are still compared against the most recent earlier master
runs.

Based on what labels the first run found has, loadRunsToCompare uses
different strategies to find the run to compare against.

Also add some medium tests.

Drive-by changes: simplify logging in api/checks/update.go.
@Hexcles Hexcles force-pushed the compare-against-without-changes branch from da02941 to 0e29dc8 Compare December 11, 2018 15:49
@Hexcles Hexcles merged commit 91217a9 into master Dec 11, 2018
@Hexcles Hexcles deleted the compare-against-without-changes branch December 11, 2018 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants