Page MenuHomePhabricator

Setup: Create trending-edits git repo
Closed, ResolvedPublic5 Estimated Story Points

Description

This project should have its own git repo. The git repo should be setup as follows.

Clone the service template~[1]. IT has got most of the things you need to get started - it exposes endpoints, and it's easy to add your own; it allows you to interact with RESTBase and the MW action API in an easy manner; and it also has a load of goodies that come in handy once the service is in production: a streamlined build and deployment process, logging and metrics collection, scaling, etc. You can read a bit more about it in the documentation~[2]

[1] https://github.com/wikimedia/service-template-node
[2] https://www.mediawiki.org/wiki/Documentation/Services

Event Timeline

Jdlrobson renamed this task from Create trending git repo and setup to Setup: Create trending git repo.Sep 14 2016, 5:02 PM
Jdlrobson created this task.

Based on conversation with @Nuria and @ovasileva I think we're going to call this repo "trending-edits"

NHarateh_WMF changed the point value for this task from 8 to 5.Oct 24 2016, 4:56 PM

trending-edits sounds good to me. Is this going to be code reviewed in Gerrit or GitHub? I think the ops guys prefer Gerrit. Would it help if someone from the services team sets this up?

I'm going to be working European hours, so I'm probably going to take advantage of that. It will be hosted on Gerrit and I'll pull in people where needed.

bearND renamed this task from Setup: Create trending git repo to Setup: Create trending-edits git repo.Oct 26 2016, 4:22 PM

Repo has been requested on https://www.mediawiki.org/wiki/Git/New_repositories/Requests - not sure if anyone is able to approve that :)

Great. Once it's created you could start the initial commits with what's at https://github.com/wikimedia/service-template-node.

We will also need a second repo for prepping deployments mediawiki/services/trending-edits/deploy

This should hold all the node_modules with the same arch as the prod machines, a Git submodule to the src, and some more. Example: https://gerrit.wikimedia.org/r/#/admin/projects/mediawiki/services/mobileapps/deploy

Change 318507 had a related patch set uploaded (by Jdlrobson):
Setup trending edit placeholder route

https://gerrit.wikimedia.org/r/318507

I have requested a deploy repo mediawiki/services/trending-edits/deploy at https://www.mediawiki.org/wiki/Git/New_repositories/Requests.

It's not clear to me who the responsibility of merging https://gerrit.wikimedia.org/r/318507 lies with here. @bearND are you willing to do it or would you prefer someone in the team to do this?

Change 318507 merged by BearND:
Setup trending edit placeholder route

https://gerrit.wikimedia.org/r/318507

I've merged it but looks like that was a bit premature. @mobrovac had a bunch of comments, which should be addressed in a follow-up patch.

All the remaining work are minor fixes which should take a few minutes each to review. Please help me!

@mobrovac has -1ed the following patches but both complaints are satisfied in the other patchsets so I hope the -1 can be removed on both.

The following patch is +1ed by @mobrovac and needs a "brave" +2er! ;-):

The following patch has no review and given it relates to format @bearND and @Fjalapeno should probably have a look:

The following patch also need reviewing:

Piotr to sign off by checking he can set this up.

@Jdlrobson I encountered three errors, two regarding spec.yaml and one regarding tests:

  • the dev config is pointing to spec.template.yaml that doesn't exist
  • when I point to spec.yaml I get an YAMLException: "Could not load the spec: YAMLException: bad indentation of a sequence entry at line 67, column 19: response
  • when I try to do npm test I get an error: TypeError: Cannot assign to read only property 'request' of get trending articles from en.wp.org

Apart of that I'm able to setup trending-edits service, It works and I'm able to access all endpoints.

Change 320754 had a related patch set uploaded (by Jdlrobson):
Update config.yaml files

https://gerrit.wikimedia.org/r/320754

@Jdlrobson I encountered three errors, two regarding spec.yaml and one regarding tests:

  • the dev config is pointing to spec.template.yaml that doesn't exist

the location of the spec, defaults to spec.yaml if not specified

but it does look like the spec is outdated so I've submitted a change to fix this. Thanks!
https://gerrit.wikimedia.org/r/320754

  • when I point to spec.yaml I get an YAMLException: "Could not load the spec: YAMLException: bad indentation of a sequence entry at line 67, column 19: response

I'm not getting this.... weird. Are you symlinking? What happens if you copy? Are permissions okay?

  • when I try to do npm test I get an error: TypeError: Cannot assign to read only property 'request' of get trending articles from en.wp.org

Apart of that I'm able to setup trending-edits service, It works and I'm able to access all endpoints.

Tests are failing. I submitted a fix: https://gerrit.wikimedia.org/r/320755
Does that make that error go away?

when I point to spec.yaml I get an YAMLException: "Could not load the spec: YAMLException: bad indentation of a sequence entry at line 67, column 19: response

It doesn't matter if I copy the file or symlink to it. Maybe it's related to swagger package/yaml parser version?

raynor@DellE6540:~/Work/wmf/trending-edits(master○) » git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
raynor@DellE6540:~/Work/wmf/trending-edits(master○) » npm start

> trending-edits@0.1.0 start /home/raynor/Work/wmf/trending-edits
> service-runner

{"name":"service-template-node","hostname":"DellE6540","pid":26954,"level":40,"levelPath":"warn/spec","msg":"Could not load the spec: Error: ENOENT: no such file or directory, open './spec.template.yaml'","time":"2016-11-10T12:47:44.540Z","v":0}
{"name":"service-template-node","hostname":"DellE6540","pid":26954,"level":30,"levelPath":"info","msg":"Worker 26954 listening on 0.0.0.0:6927","time":"2016-11-10T12:47:44.599Z","v":0}
^C
raynor@DellE6540:~/Work/wmf/trending-edits(master○) » ln -s spec.yaml spec.template.yaml                                                                                                                                         130 ↵
raynor@DellE6540:~/Work/wmf/trending-edits(master⚡) » npm start                         

> trending-edits@0.1.0 start /home/raynor/Work/wmf/trending-edits
> service-runner

{"name":"service-template-node","hostname":"DellE6540","pid":27007,"level":40,"levelPath":"warn/spec","msg":"Could not load the spec: YAMLException: bad indentation of a sequence entry at line 67, column 19:\n              response:\n                      ^","time":"2016-11-10T12:48:00.314Z","v":0}
{"name":"service-template-node","hostname":"DellE6540","pid":27007,"level":30,"levelPath":"info","msg":"Worker 27007 listening on 0.0.0.0:6927","time":"2016-11-10T12:48:00.373Z","v":0}
^C
raynor@DellE6540:~/Work/wmf/trending-edits(master⚡) »

Change 320754 merged by Mobrovac:
Update config.yaml files

https://gerrit.wikimedia.org/r/320754

I'm also getting the same YAMLException as Piotr. The file permissions are -rw-r--r-- and the file is not a symlink.

As of Gerrit 320766, config.yaml is enforced to be a symlink to config.dev.yaml by git.

@pmiazga https://gerrit.wikimedia.org/r/321646 should fix the above issue and allow you to sign off this card (yay!)

Everything looks good, signed off.

@ovasileva - you can move this task from sprint board.