Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Competence Debt #107

Closed
techtonik opened this issue Nov 5, 2015 · 23 comments
Closed

Competence Debt #107

techtonik opened this issue Nov 5, 2015 · 23 comments

Comments

@techtonik
Copy link
Contributor

There is a certain paralysis in http://grtp.co/ (Widgets) development. @whit537 who seems to know how is busy with more important things to put Gratipay back on track. @rummik who created it all switched to other stuff. And I, being a Python coder, lack the knowledge of JavaScript ecosystem to do any changes. So there is a clear need to pave a road how new (Python) people can quickly get up to speed.

"Tank, load the jump program."

What do you need to know to be able to write grtp.co

Or in other word, what is the structure of the competence debt - how much time it takes to recover.

  1. JavaScript (obvious) - take any tutorial (3 days)
  2. NPM - read official site (1 day) or read this intro (5 minutes)
  3. Grunt (switching to Gulp) - (2 days)

Due to a curse of knowledge, shortcuts are important - you may google for a day trying to understand how npm works, or you may read the info that is crafted specifically for your current knowledge state to switch you to the next level in a matter of seconds.

UPDATE (thanks @rummik for feedback):

What do you need to know to be able to maintain and deploy grtp.co site

  1. Linux - how to work in command line, where are configs/files, how to setup users (3 days)
  2. SSH - how to connect, how configure keys (3 days)
  3. Nginx - where is the config, how to locate site sources (1 day)
  4. Git - how to work with Git, where hook scripts are located, how are they executed (3 days)

So the total competence to setup and run grtp.co webserver is 11 + 10 = 21 days. A month of study.

@chadwhitacre
Copy link
Contributor

Actually, @rummik is the one that set up grtp.co. 🐱

@techtonik
Copy link
Contributor Author

!m @rummik

@mattbk
Copy link
Contributor

mattbk commented Nov 8, 2015

+1, !m @techtonik for the initiative.

@rummik
Copy link
Contributor

rummik commented Nov 16, 2015

The way grtp.co works is it uses a git hook to run a grunt task to minify the assets, then uses NGINX to serve static files. Any rendering is done client-side using JS and HTML, and the same with pulling data from the Gratipay API.

V2 was going to be its own server that would run off a Heroku or Dokku instance, and exclusively used SVG for rendering (though there's a small route that would convert the SVGs to PNGs for legacy browsers)

@techtonik, @whit537 For some reason I'm not getting GitHub notifications like I used to, which is why I've been a great deal more dead than usual. Feel free to contact me more directly if there's anything I can help with on the grtp.co codebase. I'm pretty much always around on IRC.

Edit: V2 was pretty much ready when I stopped working on it. I can help get someone else up to speed if they'd like to continue development on it.

@chadwhitacre
Copy link
Contributor

@rummik emerges! 💃

@rummik
Copy link
Contributor

rummik commented Nov 16, 2015

So apparently the extension I'm using updated and required a GH API key to handle things correctly. That's sorted now, so I should get updates on anything I'm tagged in from now on :P

@chadwhitacre
Copy link
Contributor

@rummik Sounds about right. :-P

@techtonik
Copy link
Contributor Author

Updated the info. The grtp.co competence is 21 days of learning from scratch (for a typical C/C++ coder on Windows).

@rummik perhaps you need to check if watch button is active. Maybe they are in spam folder, or maybe there is some email setting in Github. Anyway, I prefer to use https://github.com/notifications bookmark to go through notifications when I have time.

@techtonik
Copy link
Contributor Author

For now I'd like to have a manual instruction how to setup grtp.co website on clean node, including user config etc.

@rummik
Copy link
Contributor

rummik commented Nov 17, 2015

It basically boils down to creating a new droplet, installing Nginx and Node.js, cloning the repo, then copying in the nginx.conf and post-receive hook from infra/.

This is from memory, so there may be something off:

  1. Set up a droplet on DO, and SSH in
  2. Install Nginx, Node.js, Git, and build-essential with apt-get install nginx nodejs git build-essential
  3. Add a grtp user adduser grtp
  4. Run sudo -u grtp mkdir -m 700 ~grtp/.ssh, then copy your SSH key to ~grtp/.ssh/authorized_keys
  5. Initialize an empty repository with sudo -u grtp git init ~grtp/production
  6. Locally, do a git remote add production grtp@<host>:production && git push production
  7. On the server, ln -s ~grtp/production/infra/nginx.conf /etc/nginx/sites-enabled/grtp.co
  8. And then install the git hook on the server with cp ~grtp/production/infra/post-receive ~grtp/production/infra/.git/hooks/

That should cover it. The v2 branch has a much more simplified setup as it deploys to Heroku/Dokku, and it should detail this in the readme file

@rummik
Copy link
Contributor

rummik commented Nov 17, 2015

@techtonik ^

techtonik added a commit that referenced this issue Nov 18, 2015
Describe our current server setup
@techtonik
Copy link
Contributor Author

Awesome. Some questions:

  1. Install Nginx, Node.js, Git, and build-essential

Why build-essential is needed?

  1. Initialize an empty repository with sudo -u grtp git init ~grtp/production

Why not just clone into production?

@rummik
Copy link
Contributor

rummik commented Nov 18, 2015

Why build-essential is needed?

It isn't. I was on autopilot and thought build-essential would net us make

Why not just clone into production?

No good reason. Probably going with autopilot again causing me to suggest the roundabout way

This also misses the build step (running make)

@techtonik
Copy link
Contributor Author

I am getting back to it after I gather my 3 pull requests for Heroku. In the meanwhile let's make a mindmap out of competence debt.

@rummik
Copy link
Contributor

rummik commented Nov 25, 2015

The v2 branch also rolled in Heroku support ^^;

@rummik
Copy link
Contributor

rummik commented Nov 25, 2015

I'd really recommend looking at it before getting too far, since it sounds like there's a lot of duplicate effort happening

@techtonik
Copy link
Contributor Author

I can't merge or review v2, because it mixes, well v2 stuff that I don't know with Gulp/Grunt that I know. So, if those commits are split and rebased, I can merge at least Gulp/Grunt sooner.

@techtonik
Copy link
Contributor Author

I may be able try to fork v2 and rearrange the commits, but chances are low.

@rummik
Copy link
Contributor

rummik commented Nov 27, 2015

I'll see what I can do. I've got work today, but I should be (relatively) free tonight and tomorrow

@techtonik
Copy link
Contributor Author

nginx.conf mentions server certificates - this step is missing.

@mattbk
Copy link
Contributor

mattbk commented Mar 10, 2016

@techtonik, since you might be the only other person who has a dev environment set up for this right now, is there a way you could review my recent PRs?

@techtonik
Copy link
Contributor Author

@mattbk sorry, fell out of loop.

Have to raise this ticket again, because I can not update dependencies, because our tests are written for Dalek, test runner for Grunt is not updated to latest Grunt version, and command line runner for Dalek fails on my system (#170).

The solution is to either update grunt-dalek dalekjs/grunt-dalek#13 and release new version on npm or to rewrite tests to supported framework.

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

No branches or pull requests

4 participants