Git Project Manager / Commission Open Source

<2018-10-25 Thu> on Yann Esposito's blog

Code from this talk → Git Project Manager

git is a Distributed Concurrent Versions System

GitHub is a Centralized git host

Can we do without Github™?

Betteridge's law

Betteridge's law of headlines is an adage that states:

Any headline that ends in a question mark can be answered by the word no.

Here the answer is YES!

  • Linux (only mail)
  • GHC used a self hosted instance of phabricator + trac
  • many others I don't know

All right, we can, but should we?

__   _______ ____  _
\ \ / / ____/ ___|| |
 \ V /|  _| \___ \| |
  | | | |___ ___) |_|
  |_| |_____|____/(_)

Short History

GitHub™

GitHub™: Social Network

GitHub™: its free!

If you're not paying for it, you're the product being sold.

$$: Pay for private repositories

GitHub™: Features!!!

From their website (in that order):

GitHub™: Metas

Most GitHub™ features put data in their own internal closed representation:

Note there are tools to export them. Ex: migrate to Gitlab

GitHub™ is great today but can suck tomorrow

GitHub™ force all your team member to use GitHub™

Were you already forced to:

REAL STORY @WORK: github dashboard is slow & terrible for the manager.

Why you shouldn't rely too much on GitHub™?

Why not self hosted Gitlab then?

Gitlab is a better alternative but:

git clone

Git Project Manager

Problems

Solution

  • use text files for everything DO NOT FORCE ANY TOOL
  • only rely on conventions, better on standardized conventions HELP TO WRITE SPECIFIC OPEN SOURCE TOOLS

Git Project Manager gpm

Tool freedom

gpm conventions

Encouraged but not enforced gpm conventions

git is awesome!

battery included:

org-mode is awesome

DEMO

Create a git project

mkdir -p /tmp/gpm-playground/testprj
cd /tmp/gpm-playground/testprj
echo "Hello GPM" > README
git init .
git add README
git commit -m "Initial commit"

gpm init (1)

gpm init
GPM -- Git Project Manager
==========================
Create a new branch gpm (be sure the branch gpm doesn't already exists)
    git checkout --orphan gpm
Switched to a new branch 'gpm'
cleanup the branch
    git rm --cached -r .
    git clean -fd

gpm init (2)

* issue.org
    git add issues.org
    git add templat
* wiki.org
    git add wiki.or
* reviews.org
    create some example review for inspiration
      reviews/write-contributing-yogsototh.org
    git add reviews
    create some review templates
      templates/new-review.org
    git add templates

gpm init (3)

* hooks/
    Copyings default hooks into the hooks directory
    git add hoo
* server init
create dir: /Users/yaesposi/.local/share/gpm/public
    git init .
    git rev-parse --show-toplevel
    git rev-parse --show-toplevel
    git clone --mirror /tmp/gpm-playground/testprj
               ~/.local/share/gpm/public/testprj.git
Cloning into bare repository '.../testprj.git'...
done.
    git update-server-info
    git commit -m 'gpm initialized'
    git checkout master
Switched to branch 'master'

The gpm branch

> git checktout gpm
> tree
.
├── hooks
│   ├── applypatch-msg.sample
│   ├── commit-msg.sample
│   └── ...
├── issues.org
├── reviews
│   └── write-contributing-yogsototh.org
├── templates
│   ├── new-issue.org
│   └── new-review.org
└── wiki.org

3 directories, 16 files

Hooks

> gpm hooks
Usage: gpm hooks sync
  Handle hooks for this git repository

Available options:
  -h,--help                Show this help text

Available commands:
  sync                     Synchronize hooks from gpm branch

issues.org Basic

#+TODO: TODO(t) STARTED(s) WAITING(w) | DONE(d) CANCELLED(c)
* Basic Usages
** TODO Do thing 3
** STARTED Do thing 2
** DONE Do thing 1

issues.org Complex workflow, review

 #+PROPERTY: ASSIGNEE
 #+PROPERTY: REVIEWER
 #+TODO: REVIEW(i) | MERGED(m)
 #+TODO: ACCEPTED(a) CHANGE_REQUESTED(c) QUESTION(q) FEEDBACK(f) | REFUSED(r)
 ** REVIEW Basic review process
  :PROPERTIES:
  :BRANCH:   explain-review-process
  :ASSIGNEE: yogsototh
  :END:

*** ACCEPTED Review finished
   :PROPERTIES:
   :REVIEWER: shubby
   :END:

issues.org Full Professional Usage

#+TAGS: epic(e) user_story(u) task(t) qa(q) ops(o)

 * Some Title                                                                               :epic:
 ** Some User Story                                                                       :story:
 *** Dev Task                                                                         :task:dev:
 *** Document Task                                                                    :task:doc:
 *** QA Task                                                                           :task:qa:
 *** Ops Task                                                                         :task:ops:

gpm new-issue

> gpm new-issue -i

gpm serve

Usage: gpm serve (start | stop | update | path)
  Serve the git to the web

Available options:
  -h,--help                Show this help text

Available commands:
  start                    Start to serve all gpm tracked repositories
  stop                     Stop to serve all gpm tracked repositories
  update                   Update the served git repository
  path                     Show the path of the bare repository

gpm review: classical workflow

  1. dev create a new feature branch
  2. reviewer review the branch
  3. dev pull the gpm branch and gpm retrieve the reviews
  4. dev take feedbacks into account
  5. goto 2 until reviewer accept the branch
  6. integration manager/dictator/lieutenant merge the branch

gpm review: reviewer (step 2 of previous slide)

  1. reviewer pull the remote feature branch
  2. gpm review start: create a local file
  3. write the review: org-annotate-file FTW!
  4. stop the review: copy the local file in gpm branch and commit it
  5. gpm update to serve the updated gpm branch

Conclusion

Proof of concept

Lot of things already done

Going further: Decentralized Web

Decentralized Authentication: IndieAuth

Mainly you OWN & CONTROL your identity and the informations about it.

Decentralized Comments: webmention

Decentralized Web

Follow: