main: Fix some renaming leftovers

Change-Id: 976516d0db
Implement new commands: pkg install, pkg upgrade

pkg install allows the user to install particular version of SalsaFlow. The
executables are downloaded from the relevant GitHub release and the current
executables are replaced.

pkg upgrade works in a similar way, it just automatically finds the most recent
release and upgrades the executables in case the detected release is more recent
than what is installed.

Change-Id: a3866677ed
Story-Id: SF-25
pkg: Save one roundtrip to GitHub API

Discovered that the GitHub API actually returns the release assets as
part of the release resource. Just the Go GitHub client was not using
it. Sent a pull request to go-github, added Assets field to
RepositoryResource, so now we can save one roundtrip, no need to call
ListReleaseAssets.

Change-Id: de70ecde8b
Story-Id: SF-25
salsaflow.yml: Add code_review_tool key

[ci skip]

Change-Id: ccbc7a6f19
review post: Pull the RB code into a module

This patch pulls the Review Board-specific code behind CodeReviewTool
interface into modules/reviewboard. The code review tool must be from
now on configured in the local config and the implementation is
accessible at runtime using modules.GetCodeReviewTool.

Change-Id: f72ee146aa
Story-Id: SF-8
modules/reviewboard: Check rbt version on init

Review Board module now ensures that the RBTools installed are of the
right version.

Implemented support for hooks into repo init. Any part of the code base
regiter a callback that will be run during repo init (app.Init) to check
some requirements. The hooks are registered via repo.AddInitHook

Change-Id: 3bdf7e2197
Story-Id: SF-11
repo init: Fix weird output

The message saying that the repo has been initialised was being printed
twice. This is fixed now and also some formatting is improved.

Change-Id: 8aab95d805
git/errors: Fix code review issues

Panic in case ErrDirtyFile.relativePath is not set.

Change-Id: 08697dfa2b
salsaflow-commit-msg: Fix empty message handling

The tags were being inserted even though the commit message was empty so
it was impossible to cancel a commit by leaving the message empty.

Change-Id: 6479d90f63
Story-Id: SF-30
repo init: Fix formatting

Change-Id: 4532c62a41
hook/salsaflow-pre-push: Implement the hook

Implement a pre-push hook that makes sure that the Story-Id tag is in
every commit that is being pushed. Push is rejected in case the tag is
missing in one of more of the commits.

Change-Id: 1918f86013
Story-Id: SF-32
story start: Make the output less verbose

Drop the message saying that we are remembering the current branch.

Change-Id: 26d403ee41
Story-Id: unassigned
hooks/salsaflow-pre-push: Skip merge commits

Merge commits are not supposed to be checked for Story-Id.

Change-Id: 723208c325
Story-Id: SF-32
hooks/salsaflow-pre-push: Skip refs to be deleted

In case a ref is being deleted, the associated sha is all zeros. This special
case was not being handled, resulting in the hook failing when it should not.

Change-Id: 594777b359
Story-Id: SF-32
git: Implement full commit message parsing

Commit struct now contains Message field that can be used to get the full commit
message. Also a few utility functions were added or renamed.

Change-Id: 78ba6726a4
Story-Id: SF-15
hooks: Implement review post process changes

The commit-msg hook no longer needs to check for Story-Id. This is what review
post command is doing from now on. The only thing necessary is to insert
Change-Id.

The pre-push hook shall reject any commits not complying with the SalsaFlow
requirements, i.e. the commits not having either Change-Id or Story-Id.

Change-Id: e43075869e
Story-Id: SF-15
IssueTracker: Add StoriesInProgress method

The new method lists the stories that are currently in progress, i.e. the
develop may be still actively working on them.

This is being implemented so that the new review post command can download the
stories in progress and ask the user to choose the story that the commit to be
posted is going to be associated with.

Change-Id: 4569e88140
Story-Id: SF-15
modules/reviewboard: Rewrite the followup message

The message was getting a bit out of date facing the review post changes.

Change-Id: 55f10674fc
Story-Id: SF-15
review post: Implement heavy worklow changes

Firstly, the review post command is from now on doing a bit more than it used
to. Its job from now on is not only to post review requests, but also to ensure
that the Story-Id tags are in all commits that are being posted.

In case the Story-Id tag is not in one or more commit messages, review post
fetches the stories in progress from the issue tracker and starts rewriting the
commit messages. Every time it encounters a commit without Story-Id, it asks the
user to select a story. The commit being processed is then assigned to that
chosen story.

The fact that the stories are fetched from the issue tracker might look strange,
because review post used to use the story branch to get the story ID. But since
it was decided that the mapping can be 1 branch : N stories, we do not depend on
storing the story ID in the branch name, but rather we enforce Story-Id in every
commit.

Secondly, the command also works in two modes now. When the -parent option is
not specified, only the last commit on the current branch (HEAD) is being
posted. In case -parent is set to BRANCH. All commits represented by git
revision range BRANCH.. are posted for code review.

There are a more few new tags to control review post, particularly
  * -no_fetch: do not fetch the repository, do not perform any sync checks
  * -no_rebase: do not rebase the selected branch onto the parent branch

Change-Id: 62adf93f4c
Story-Id: SF-15
Merge branch 'story/refactor-review-post/SF-15' into develop