Title: Ragnar: Git Process for Challenges
Author: Chris DeLaurentis
Date: 20141112
Abstract: This document outlines how best to utilize Gitflow for challenge management and suggestions for integration into the Topcoder platform.
Definitions:
Member: a community participant competing on a competition
Manager: a Copilot or Project Manager overseeing the project
Repo: a code repository with the purpose of managing one functional piece of software or designs for a project. ie: SFDC services, mobile app framework, assembled application, storyboard designs, etc.
Team/Group: an organizational unit of members and/or managers applied to a set of repos.
Process:
Account/Access Structure:
- unless required, repositories should be private by default
- team/group based access to repositories
- Member group access includes:
- receive read/write access to repository
- ability to create tickets
- ability to self-assign tickets
- ability to add and remove tags from tickets
- repo user should equate/tie to platform user
- Manager group access includes:
- receive read/write access to repository
- ability to create tickets
- ability to self-assign tickets
- ability to create wiki pages
- administrative control over repo
- repo user should equate/tie to platform user
- requisite teams applied to groups of repos for visibility over other components of a project.
- Member group access includes:
Branching Model Setup (gitlow style):
- create
master
branch. Used for releases only. - branch
master
to create a “develop” branch. Used for active development line and release candidates (via tags). - branch
develop
for each feature being developed (“Admin Widget 1”, “Blog components”). Prefix name of branch with challenge Id. - “Official” branches (master, develop, & features) should be marked “protected”. Note: This is a concept from Gitlab that does not exist in Github currently.
Challenge Setup:
- In your challenge, ask the community to email you/co-pilot and request access to the project group (“Goliath National Bank Team”) by sending their username. This should ideally be automated at sign up of challenge.
- Add community member to the group (example name “Goliath National Bank Team”) with “Developer” access only. This allows them to create tickets, fork the repo, and create branches but will not allow them to touch protected branches. Note: this level of access is a concept from Gitlab that does not exist in Github currently. See https://gitlab.com/help/permissions/permissions.md
- Have member add challenge managers to their private branch as a master and reviews as reporter. Note: this level of access is a concept from Gitlab that does not exist in Github currently.
Submission Process:
- Require community members to fork the project at the feature branch to acquire the current code base. This will allow for concurrent challenge running as each branch is a separate challenge.
- Two options for gaining access to code are available. Note: private forks are unique to Gitlab only and thus protect member code.
- Require submissions of code by through a merge request. The only issue with this method is that the code can be viewed in a “diff” of the merge request.
- Require that the managers & reviewers be added to the private fork as a member. This is not exactly the ideal automation but it does get around the visibility of the code in the merge request diff.
Review Process:
- Test pull/merge request submissions locally before accepting.
- If submission passes, accept merging into feature branch.
- If submission fails, reviewer can make comments directly against code or merge request ticket.
Merging:
- After accepting the winning submission merge request into feature branch merge the feature branch into the “develop” branch after performing integration testing.
- Proper gitflow usage dictates using the --no-ff option to prevent “fast-forwarding” of commits.
Releases:
- Release candidates should come from the “develop” branch and be tagged as such.
- Merge “develop” into the “master” in preparation for release (--no-ff)
- Releases should be pulled from the “master” branch only
- Tag the “master” at each major release (with version number/name)
Wikis:
- Wikis should be utilized extensively as a central repository for project information.
- Types of information include:
- Project description
- Setup guides
- Reference materials
- “Bug Bash” instructions
- Challenge detail listings
Issues List
- Issues lists can be utilized for general bug tracking as well as “Bug Bashing”
- Members can be alerted to issue tickets by utilizing the @all/@organization/team-name mention
- Bug Bashing Process
- Create the following tags on the repo:
_OPEN FOR PICKUP
denoting ticket is available to members to self-assign_READY FOR REVIEW
denoting that a member has completed the requested work_ACCEPTED
denoting managers have accepted ticket solution_PAID
denoting ticket has been processed for paymentPriority X
where X is a value from 1 through 5 denoting Appirio triage priorities (1-Blocker through 5-Enhancement)
- Assign a priority label to tickets.
- Assign a “point” value to all tickets in the ticket title as a prefix.
- Points represent some fixed dollar amount designated by the managers
- As a general rubric, point values are a multiple or priority. ie: Priority 1 issues should be addressed first and thus should hold a higher points value than lower priorities. P1s == 4P, P2 == 3P, etc.
- The purpose of points is to create an arbitrary value for tickets that can be driven up and down on demand. For example, a weekend “double points blitz” can incent members to scramble and burn down tickets faster.
- Mention @all members that a ticket is available for pickup.
- Members self-assign tickets
- Only one ticket is allowed per member at a time.
- If a member has not submitted within 24hrs, the member forfeits the ticket and the ticket is unassigned.
- Member labels ticket as “_READY FOR REVIEW” once their submission is ready.
- After reviewing submission the manager/reviewer marks the ticket as “_ACCEPTED”
- After the manager has accepted the submission and process payment, the ticket is labelled “_PAID” and payment reference placed as a comment on the ticket
Notes:
- This process includes:
- code version control
- project flow control
- submission control
- review control
- issues triage/burndown
- release management
- information centralization
- member-manager communication
As highlighted in the above process nearly the entire challenge life-cycle could essentially be encapsulated inside a git management service such as GitLab. Essentially, branches equate to individual challenges and “bug bashes” as a collection of F2Fs.
Some things that are missing or could be integrated:
- Game-planning: could be tied in or auto created from an API based tool like Smart Sheet.
- Payments: could be tied in through something like tracking of manager comments and @mentions as well as git/web hooks.
- Marketing/Advertising: could be tied back to the platform through something like @mentions as well as git/web hooks.
- SSO: members should have a unified “world-view” that ties their TC handle direct to their git system handle.
- Derived/Big Data Intelligence:
- Repos could be crawled for their technologies and member associations to automagically correlated.
- Costing per line of code could be established based upon commits and tied back to challenge payments and “bug bash” values.
- Project health metrics based upon commits, code comments, issue comments and other interactions.
- Scanning for security leaks of IP
References:
- GitFlow: http://nvie.com/posts/a-successful-git-branching-model/
- GitFlow extension project: https://github.com/nvie/gitflow
- GitLab Flow: https://gitlab.com/help/workflow/gitlab_flow.md
- Zenhub.io https://www.zenhub.io/ cardwall on top of github issues.