Skip to content
This repository has been archived by the owner on Nov 6, 2019. It is now read-only.

Add handler for /latest/{platform}[/{test}] urls #166

Merged
merged 1 commit into from
Oct 19, 2017

Conversation

lukebjerring
Copy link
Collaborator

e.g.
localhost:8080/latest/chrome-63.0
302's to
https://storage.googleapis.com/wptd/b952881825/chrome-63.0-linux-summary.json.gz

localhost:8080/latest/chrome/2dcontext/building-paths/canvas_complexshapes_arcto_001.htm
302's to
https://storage.googleapis.com/wptd/b952881825/chrome-63.0-linux/2dcontext/building-paths/canvas_complexshapes_arcto_001.htm

@jeffcarp jeffcarp self-requested a review October 18, 2017 22:21
Copy link
Contributor

@jeffcarp jeffcarp left a comment

Choose a reason for hiding this comment

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

Left some nits

app.yaml Outdated
@@ -25,6 +25,9 @@ handlers:
- url: /static
static_dir: static
secure: always
- url: /latest/.*
script: _go_app
secure: always
Copy link
Contributor

Choose a reason for hiding this comment

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

Adding the route to app.yaml isn't necessary, it'll be caught in the router in main.go.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

//
// URL format:
// /latest/{browser}[/{test}]
func latestTestHandler(w http.ResponseWriter, r *http.Request) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think a more accurate name would be latestSummaryRedirectHandler

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

// Assumes that result files are under a directory named SHA[0:10].
resultsBase := strings.SplitAfter(resultsUrl, "/" + latestRun.Revision)[0];
resultsPieces := strings.Split(resultsUrl, "/")
re := regexp.MustCompile("(-summary)?\\.json\\.gz$")
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this weirdly indented?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep - a tab vs spaces. need to tweak my editor settings.

@lukebjerring lukebjerring force-pushed the latest-run branch 2 times, most recently from e0e89b1 to b3ee362 Compare October 19, 2017 00:07
}
if len(browserPieces) > 3 {
query = query.Filter("OSVersion =", browserPieces[3])
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This makes some assumptions about the structure of platform IDs that aren't enforced (e.g. firefox-57.0-linux doesn't have an OS version), but this is fine for now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, the 4th chunk could be a problem - I just did this so that /latest/chrome[-63.0[-macos[-10]]]/ all "work".

Copy link
Contributor

@jeffcarp jeffcarp left a comment

Choose a reason for hiding this comment

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

This is good to go minus the Go lint errors. Thanks!

@jeffcarp jeffcarp merged commit 2ca1678 into web-platform-tests:master Oct 19, 2017
@jeffcarp
Copy link
Contributor

Thanks, will do a deploy today

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants