We would love any and all contributions to Open ONI, be they words of encouragement, issue reporting, questions, or collaboration.
Everyone interacting within the Open ONI community is expected to follow the Open ONI Community Code of Conduct
Contents
There is a lot of work to be done on Open ONI. Joining us on Slack and submitting issues are both great ways to get involved without diving into the code.
For those willing to write code, we adhere to our development standards below to keep us all on the same page.
You should start by reviewing the Docker install page to help set up a development environment.
Important: All features should be based on the dev branch! We use a loose
gitflow-like
branching strategy, and master is meant to always be production-ready. Only
major bug fixes (such as security issues) should be applied directly to the
master branch. Also read the following to inform your git use:
https://drewdevault.com/2019/02/25/Using-git-with-discipline.html
First, fork the Open ONI repository in
GitHub so you have rights to push code. Then clone it, check out dev, create a
feature branch, and do your work:
git clone https://github.com/<your github namespace>/open-oni.git
cd open-oni
git checkout dev
git checkout -b feature/my-awesome-oni-thingWhen you're ready, push up your code and
submit a pull request.
Make sure the pull request is against the dev branch, not master.
docker-compose -f test-compose.yml -p onitest up testThis will produce a lot of output and you'll have to scroll back to get read test failure information, but it runs a test container setup that ensures your development data will not be modified.
Below are our coding standards and best practices for Open ONI development.
Language Notes:
- "Use" is a positive instruction, equivalent to "must use".
- "Prefer" indicates a better option and its alternative to watch out for.
- "Avoid" means don't do it unless you have good reason.
- "Don't" means there's never a good reason.
- In existing files, prefer to stay consistent with code style used by the older code
- In new code, use Django coding standards
- Don't mix style fixes with other changes
- Don't rewrite entire files to fix style without communicating to the team (this can result in VERY painful merging)
- Use unix-style line endings
- Use a newline at the end of the file
- Don't leave trailing whitespace
- Try to document every method using block comments
- Prefer docstring-style comments for easier automatic documentation
- Avoid inline comments
- Use Git and GitHub for source control
- Use commit messages that follow the conventions here whenever possible: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
- Use semantic versioning for tags
- Do work in feature branches, named with a prefix
feature/[branch-name] - Publish feature branches to the GitHub repository when:
- Collaboratively developing the feature
- Seeking code review in advance of a pull request
- Sharing the feature externally
- If your code isn't going to be useful or meaningful to others, clean it up first
- Send pull requests to merge features to
dev - Delete branches when they are fully merged and no longer needed
- Developers will collaborate to merge additions to
devintomasterfor releases
- Keep pull requests clean:
- Retain "milestone" commits, representing substantial peices of work
- Squash minor and personal workflow commits into milestones
- Pull requests are subject to review. Someone other than you must merge them
- Prefer environment variables for storing confidential information (database passwords, session secrets, etc)
- When configuration files are required:
- Do provide an example config
- Use .gitignore to ensure the true config is not in source control
- Prefer production config setup via automatic deploys, not manually copying files
Follow these steps for each Open ONI release:
- Ensure
core/version.pyis set to the new version on the release PR - Review and merge the release PR into
master - Create a GitHub release
- Update open-oni.github.io source as necessary
- Merge the
masterbranch back into thedevbranch - Copy the template for unreleased work in
CHANGELOG.mdon thedevbranch - Post an announcement to #general channel on Slack and the Chronam Users mailing list