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

Add redirector worker #1

Merged
merged 2 commits into from
Oct 10, 2019
Merged

Add redirector worker #1

merged 2 commits into from
Oct 10, 2019

Conversation

alexgibson
Copy link
Member

@alexgibson
Copy link
Member Author

@jgmize r?

workers/redirector.js Outdated Show resolved Hide resolved
test/redirector-test.js Outdated Show resolved Hide resolved
workers/redirector.js Outdated Show resolved Hide resolved
@pmac
Copy link
Member

pmac commented Oct 3, 2019

It seems possible to return the bedrock response directly instead of redirecting. Would that be desirable, or do we for analytics and/or SEO reasons not want to do that?

@alexgibson
Copy link
Member Author

It seems possible to return the bedrock response directly instead of redirecting. Would that be desirable, or do we for analytics and/or SEO reasons not want to do that?

I think the answer here is that shadowing could confuse Google since the content would keep changing, but let me double check with Raphael.

@alexgibson
Copy link
Member Author

alexgibson commented Oct 3, 2019

Ok, I double checked with Raphael and he says as long as our experimental pages have a canonical that points to the original URLs (which they do), then a 302 is fine. Shadowing is also ok, but only as long as experiments aren't drastically changing the page. Shadowing is a little more risky, since copy changes could essentially get indexed.

"url": "https://github.com/mozmeao/www-workers/issues"
},
"devDependencies": {
"@dollarshaveclub/cloudworker": "^0.1.1",

Choose a reason for hiding this comment

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

wow, never thought I'd see dollarshaveclub in a PR :-)

@alexgibson
Copy link
Member Author

alexgibson commented Oct 4, 2019

@jgmize I pushed a commit with some review fixes, plus a couple of other small details. Here's a summary:

  • Removed origin as a variable (switching to relative paths in the config).
  • Set sample rate for /en-US/firefox/new/ to 6%.
  • Added an additional unit test that checks query params are being preserved on redirect URLs.
  • Unit tests now use https://bedrock-stage.gcp.moz.works/ for an origin, so they won't conflict with a real worker running on www-dev etc.
  • Added ESLint config check to CI.
  • Added .editorconfig file.

I've set the updated worker script running on https://www.allizom.org/en-US/firefox/new/ and done some manual testing. It still seems to be working as expecte 👍

@alexgibson alexgibson force-pushed the add-redirector-worker branch from d84e588 to 14d6592 Compare October 4, 2019 13:37
Copy link
Contributor

@jgmize jgmize left a comment

Choose a reason for hiding this comment

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

Nice work @alexgibson!

@jgmize jgmize merged commit 4504688 into master Oct 10, 2019
@jgmize jgmize deleted the add-redirector-worker branch October 10, 2019 15:16
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.

4 participants