More information about contributing to 360Giving software
Generalised workflow for making a change in a 360Giving software repository
- Git clone (
git clone
) or update existing repository (git pull
) - Create new branch (
git checkout -b initials/new_branch_topic
) - Make changes
- Commit changes to branch
- Push changes to github
- Create pull request
- If CI tests pass and pull request is ready - assign reviewers to review pull request. If not ready set pull request as draft. If webfront end changes make sure 360Giving have approved.
- After pull request approved merge
- Deploy to live
Linear git history without merge commits is preferred.
If a pull request/branch is out of date with live
use "Update via rebase" in the GitHub interface or $ git pull --rebase origin live
and then force push when happy)
If sole collaborator prefix the git topic branch name using your initials (or other known identifier) and a forward slash, for example mw/fix_issue_102
. This helps to make sure ownership and uniqueness is communicated (especially when checking out branches locally/outside of github).
Commits are made as small as is reasonable to encapsulate a single change.
Git Commits are atomic, each commit is self contained such that someone can check out a repository at any commit and have a working system, this allows easier testing of changes, the use of Git Bisect and makes it easier to relate the log message and the code changes.
In the subject line of log messages the name of the logical units of the code or module is added before a summary seperated by a colon, use existing names where possible. A longer description is then added below if needed. This helps when scanning down the git log to see what changes to which units/modules were made.
If an issue is related to the commit use the full URL of issues, so that if commits are moved around between repositories, the links will not be broken and the unique URIs are created.
Example:
tests: Add test blah to make sure blah-de blah doesn't regress
This adds a test case to prevent the regression in the blah module loader by loading some sample data.
Fixes: https://github.com/example/issue/123
To create consistent and readable code please follow the guides:
- Before committing new python code make sure to run python-black via
$ black
, also check the github actions for per-project python linting, e.g. flake8 - Style:
# Underscores in variables:
variable_names = "things"
# Camel case in class names:
class ClassNames(object):
pass
# Underscores in function names
def function_names():
return 1
- Indent with 2 spaces
- Style:
<div>
<p>Hi</p>
</div>
- Indent with 2 spaces
- variables and function names camelCase
- line endings using semi colons
- Style:
function abcdAlpha(param){
}
let obj = {
propertyA: 1,
propertyB: 2,
};