Skip to content

Latest commit

 

History

History
executable file
·
242 lines (177 loc) · 6.78 KB

CONTRIBUTING.md

File metadata and controls

executable file
·
242 lines (177 loc) · 6.78 KB

Development Practices

Git Templates

Use the general git templates for NCI-GDC project. Follow the instruction here to setup for global config or for this particular repo. It contains git hooks to do security scanning for each commit, as well as other type checkings to insure the consistency of coding format.

Feature Pattern

Feature pattern can simplify development

References

Page Object Pattern

Page Object pattern can simplify testing

References

Version Control

Branches

All development should happen on a branch not on master. Branches should formatted as type/GDC-##-couple-words or type/very-short-description.

This branch structure is similar to git flow but customized for our use cases. Also we are not using git flow directly because it has an inflexible release process.

❯ git checkout -b feat/GDC-11-my-feature

References

Commits

Commit messages follow a combination of guidelines set by Angular and Tim Pope.

Examples of valid commits:

type(scope): one line description (50 char or less)
type(scope): one line description (50 char or less)

Longer description (70 or less)
- list of changes
- one more thing
type(scope): one line description (50 char or less)

Longer description (70 or less)
- list of changes
- one more thing

Closes ##, ##
Closes ##

This format is automatically checked by a pre commit git hook.

References

Code Review

All branches should be pushed to Github for code review.

Any branches containing significant work need to be reviewed and signed-off before they can be considered complete.

Rebase

References

❯ git rebase -i master

Merge Branch

Branches can only be merged after the following is completed:

  1. Rebased
  2. Signed Off
  3. Tested by CI

Tags

❯ git tag -s 1.2.3

References

Signed Commits

Tags should be signed.

Generating a PGP Key

❯ brew install gpg 
❯ gpg --gen-key
❯ gpg --list-secret-keys | grep "^sec"
[gpg-key-id]
❯ git config user.signingkey [gpg-key-id]

Adding a maintainer key

❯ gpg -a --export [gpg-key-id] | git hash-object -w --stdin
[object SHA]
❯ git tag -a [object SHA] maintainer-pgp-pub

References

Master Branch

No development should happen on the master branch and tests should never be broken.

Release

Version Schema

Version number are based on the current stage of development, in the form:

0.{Phase}.{Month}-spr{Sprint}

For example the version 0.1.8-spr3 represents Phase 1, Monthly deadline 8, Sprint 3

Prepare release

❯ ./release -v 1.1.1 -a prepare
Preparing release for 1.1.1...                              OK
Checking that there are no uncommited items...              OK
Checking that 1.1.1 is greater than 1.1.1-beta...           OK
Updating from 1.1.1-beta to 1.1.1...                        OK
...
Generating changelog from 1.1.1 to HEAD...
Parsed 2 commits.

... make any final changes to docs here if needed ...

Publish release

❯ ./release -v 1.1.1 -a publish
[master 7d94010] chore(release): Release 1.1.1
 2 files changed, 14 insertions(+), 1 deletion(-)

You need a passphrase to unlock the secret key for
user: "{Maintinear Info}"
2048-bit RSA key, ID {Maintainer Key}, created 2014-10-01

Counting objects: 13, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (12/12), done.
Writing objects: 100% (13/13), 1.92 KiB | 0 bytes/s, done.
Total 13 (delta 6), reused 0 (delta 0)
To [email protected]:nci-gdc/portal-ui.git
 * [new tag]         1.1.1 -> 1.1.1
Total 0 (delta 0), reused 0 (delta 0)
To [email protected]:nci-gdc/portal-ui.git
   5a22164..7d94010  master -> master

Start next release

❯ ./release.sh -v 1.1.2-beta -a next
Preparing release for 1.1.2-beta...                         OK
Checking that there are no uncommited items...              OK
Checking that 1.1.2-beta is greater than 1.1.1...           OK
Updating from 1.1.1 to 1.1.2-beta...                        OK
[master fd6ced3] chore(release): Start Development on 1.1.2-beta
 1 file changed, 1 insertion(+), 1 deletion(-)
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 329 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
To [email protected]:nci-gdc/portal-ui.git
   7d94010..fd6ced3  master -> master

Workflow

  1. clone the repo, git init with template
  2. create a new branch
  3. do some work
  4. commit your changes
  5. push changes to Github for review
  6. repeat 2-4 as necessary
  7. rebase master into your branch and deal with any conflicts.
  8. get someone to review and sign-off on your branch
  9. wait for the CI system to test your branch
  10. have your branch merged into master
  11. repeat 1-9 until sprint complete
  12. run release process