All open issues on my github repositories

I wrote a quick little script that turns all my open github issues onto clickable links..

Copy paste the below into githubIssues.js:

// Edit me
var username = "YOURUSERNAME";
var password = "YOURPASSWORD";
// stop Editing!

var gittub = require("node-github");
var github = new gittub({version: "3.0.0"});

github.authenticate({
  type: "basic",
  username: username,
  password: password
});

github.issues.getAll({
  user: "JohnMcLear",
  filter: "subscribed",
  per_page: 100,
  sort: "created",
  direction: "asc"
}, function(err, res) {
  for(var issueKey in res){
    var issue = res[issueKey];
    var line = "<p class='issue'>";
    line += issue.created_at + " ";
    if(issue.repository) line += issue.repository.full_name + " ";
    line += "<a target='_blank' href='"+issue.html_url+"'>";
    line += issue.title+"</a>";
    line += "</p>";
    if(issue.title) console.log(line);
  }
});

Edit your username and password then type:

npm install node-github

then:

node githubIssues.js &gt; issues.html

Open issues.html in your web browser..

Limitations: Max 100 issues due to Github API limit.

Using git bisect to debug Etherpad issues

Sometimes stuff gets broken due to new commits, we need to know which commit broke functionality.

To do this

git pull
git checkout develop

Ensure the bug exists then

git checkout master

Ensure the bug doesn’t exist. If it does checkout older versions IE git checkout release/1.2.8
Next begin the bisect process..

git bisect start

Tell bisect that master is fine

git bisect good

Tell bisect that develop is bad

git checkout develop
git bisect bad

Bisect will then deliver you a commit state, test this new version..

bin/run.sh

Test, Control C.. Did it work? If so…

git bisect good

Did it not work? If so..

git bisect bad

Rinse repeat ‘git bisect good’ and/or ‘git bisect bad’ until it delivers you with a commit SHA then create an issue including the details from the SHA.

Basically bisect will tell you which commit introduced the bug.

Script for checking out pull request

I often have to test specific pull requests and tanks to this post on how to checkout git pull requests I was able to quickly bash together a script

I wrote this to ~/checkoutPR.sh

echo "Getting Pull request #$1"
git fetch origin pull/$1/head:pr-$1
git checkout pr-$1

then

chmod 775 ~/checkoutPR.sh

Then jump into the repo folder
Grab the Pull request # from the URL, replacing %pullrqeuestnumber% with the pull request #

~/checkoutPR.sh %pullrqeuestnumber%

Simple but useful.

The output is something like this

jose@debian:~/etherpad-lite$ ~/./checkoutPR.sh 1672
Getting Pull request #1672
remote: Counting objects: 142, done.
remote: Compressing objects: 100% (43/43), done.
remote: Total 124 (delta 101), reused 104 (delta 81)
Receiving objects: 100% (124/124), 13.58 KiB, done.
Resolving deltas: 100% (101/101), completed with 15 local objects.
From github.com:ether/etherpad-lite
 * [new branch]      refs/pull/1672/head -> pr-1672
Switched to branch 'pr-1672'

Using git flow to release new version

Using git flow to release a new version of software enables developers to easily switch between releases to locate bugs and/or introduce new features.

In this example we are releasing version 1.1.4.

NOTE TO SELF: Remember to bump the version in src/packages.json

# debian/ubuntu only
apt-get install git-flow

# checkout the development branch
git checkout develop

# first time only, accept defaults
git flow init

# start the release process
# note the releases-1.1.4 bit, this should be 1.1.4 only but I'm following the pattern of Etherpad Lite
git flow release start 1.1.4

# publish the release to a new release branch
git flow release publish 1.1.4

Check everything fully one last time IE packages.json and let travis run it’s tests..

git flow release finish 1.2.4
git push origin master --tags

Now in root do

make docs

then copy the out/doc folder to ether.github.com repo doc/vx.x.x folder

mv out/doc/ ../ether.github.com/doc/v1.4.1/

create the windows binary

bin/buildforwindows.sh

copy the last 10 digits of the sha from git log to the end of the windows package file name before .zip

put this .zip in the ether.github.com/downloads folder and commit / push that.