Page MenuHomePhabricator

Move svgtranslate tool to production instance
Closed, ResolvedPublic2 Story Points

Description

The svgtranslate tool should now be setup in the production instance. We got approval from instance owner to take it over, Everyone under the community-tech-tools project should have access to that instance. Existing files in the tool repo can be deleted.

Event Timeline

Niharika triaged this task as Normal priority.Nov 30 2018, 8:58 PM
Niharika created this task.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 30 2018, 8:58 PM
Restricted Application added a project: Community-Tech. · View Herald TranscriptJan 4 2019, 5:36 AM
Niharika updated the task description. (Show Details)Jan 15 2019, 5:43 AM
Niharika moved this task from Untriaged to Product backlog on the Community-Tech board.
Niharika set the point value for this task to 2.Jan 23 2019, 12:43 AM
Niharika moved this task from To be estimated/discussed to Estimated on the Community-Tech board.
Samwilson moved this task from Ready to In Development on the Community-Tech-Sprint board.

I've done the first part of this.

  • Backed up existing app to 2019-01-28_old_site.tgz
  • Installed new app to ~/app/ and symlinked public_html/ to app/public/
  • Configured URL rewriting

I started configuring OAuth (re-using the existing OAuth consumer, and redirecting the old callback URL) but it's currently failing after redirection with the super-helpful error "Notice: Undefined offset: 1". So I'll keep looking at that soon.

I think there is an issue with the old OAuth consumer (like a different callback URL, and the redirect I've been trying might be breaking something), so have registered a new one. It's https://meta.wikimedia.org/wiki/Special:OAuthListConsumers/view/b92b2d7697f16a8f7a82435b7c20b3dc

With the 1.0.2 version of oauthclient we're now getting the following error when authenticating to Commons:

[2019-02-05 04:33:17] request.CRITICAL: Uncaught PHP Exception MediaWiki\OAuthClient\Exception: "JWT has incorrect format. Received: {"error":"mwoauth-invalid-authorization-wrong-wiki","message":"The authorization headers in your request are not valid for metawiki"}" at /data/project/svgtranslate/app/vendor/mediawiki/oauthclient/src/Client.php line 327 {"exception":"[object] (MediaWiki\\OAuthClient\\Exception(code: 0): JWT has incorrect format. Received: {\"error\":\"mwoauth-invalid-authorization-wrong-wiki\",\"message\":\"The authorization headers in your request are not valid for metawiki\"} at /data/project/svgtranslate/app/vendor/mediawiki/oauthclient/src/Client.php:327)"} []

Is this because the consumer is limited to Commons? I'd thought that even those consumers were still supposed to start the auth process at Meta?

Oh. Yep, that was the problem. :) Logging in now works on the prod site.

I'm now setting up auto deployment of releases (not that we have any yet).

We've been installing svgtranslate without using --no-dev for composer install, so we can use the .env file. There doesn't seem to be a reason to not continue to do this, but it'd be better to not also install all the other dev requirements. So https://github.com/wikimedia/svgtranslate/pull/61 moves symfony/dotenv requirement to the prod requirements section.

Niharika moved this task from Backlog to Done on the SVG Translate Tool board.Feb 7 2019, 8:53 PM

Although this task as written is complete, I'm going to keep it open until the auto-deployment PR is merged.

The deploy script is ready for re-review. I added some docs.

Actually, scratch that. If we're not running on Kubernetes (T213669) then the deployment script can be simplified.

I've updated deploy.sh to use composer etc. directly.

Both staging and production are now running with continuous deployment (the latest tag for production, and the latest master for staging).

There's no QA to be done here I think (although next time we merge to master or tag a commit we'll want to check that the sites update as they should).

Thanks Sam! This is going to revolutionize our deployment process. I hope we can do this for all our ToolForge projects, going forward.

Niharika closed this task as Resolved.Feb 21 2019, 11:43 PM
Niharika moved this task from Product sign-off to Q3 2018-19 on the Community-Tech-Sprint board.
Niharika moved this task from In progress to Done on the SVG Translate Tool board.