Thank you for your interest in contributing to CiviWiki. There are many ways to contribute, such as by sharing ideas, design, testing, community building, and development.
The following sections outline common ways to contribute ideas, feature requests, and code.
Make sure to search beforehand to see if the issue has been reported.
The issue tracker should not be used for personal support requests. Please direct those to our live chat
Please try to have as much detail as possible when creating a bug report.
A good example should contain:
-
A short description of the issue.
-
Detailed description of the bug, including the environment/OS/Browser info if possible.
-
Steps to reproduce the bug.
-
Any identified lines of code involved in the issue or other insight that may help resolve the issue. This can also include any relevant error logs.
-
(Optional)Potential solutions to the problem.
A good bug report will help developers solve the problem without wasting time trying to figure out the situation in the first place.
If you have a budding idea or a feature that requires a more community-involved discussion, consider having the development discussion on the live chat or create a thread on loomio. This will allow for a well-thought-out issue that will more likely align with the project's goal.
The following sections describe how to set up a development environment. Note we have tried to simplify our development setup to reduce barriers to entry.
We now use Poetry for Python package management. Please follow the Poetry installation instructions before trying the following steps.
Once Poetry is installed, enable Poetry .env
support by running the following command. This will set all variables defined in the .env
file when activating the virtual environment.
poetry self add poetry-dotenv-plugin
Once Poetry is installed, complete the following steps to install all required modules.
- Make sure you are in the repository root directory
- Initialize the virtual environment with Poetry:
poetry install
To develop the project, activate the virtual environment with the following command.
poetry shell
Once you have installed the project dependencies and activated the virtual environment, change into the project directory.
cd project/
Once you are in the project directory, you can continue the following sections of this guide.
We use pre-commit
to run code-quality checks before every commit. Install pre-commit
in your local project by running the following command (from within the virtual environment.)
pre-commit install
To create the (initial) database structure, run migrations as follows:
python manage.py migrate
Resources, such as CSS and JavaScript files, need to be served from a static directory. Run the following command to collect static files for Django to serve:
python manage.py collectstatic
You will need a super user to log in and manage CiviWiki:
python manage.py createsuperuser
During the first setup, it's helpful to import hardcoded initial entries. In this case, there are two fixtures:
- Sample threads, located in
project/data/sample_threads.json
- Sample categories, located in
project/data/categories.json
Run the following commands to load fixtures:
python manage.py loaddata ./data/categories.json
python manage.py loaddata ./data/sample_threads.json
You can also import all of them in one batch:
python manage.py loaddata ./data/*.json
Once you have installed the dependencies, run the server as follows:
python manage.py runserver
Execute unit tests by running the following command within the project
directory.
python manage.py test
Once CiviWiki runs, visit the front page (probably something like http://localhost:8000). Once there, click "login/register" and then "register new user."
Conflicts are happening quite often in the poetry.lock file. Conflicts generally arise when two people have changed the same lines in a file.
Here are steps for fixing conflicts in poetry.lock
.
- Check out the
develop
branch withgit checkout develop
- Update the
develop
branch withgit pull
- Check out your branch with
git checkout my-branch
- Attempt to merge
develop
into your branch withgit merge develop
- Delete the
poetry.lock
file - Resolve any remaining conflicts
- Re-generate the
poetry.lock
with the commandpoetry lock
The deployment instructions for Heroku can be found in the wiki.
We strive to follow Django Coding Conventions.
We use Compatible Versioning in this project.
Given a version number MAJOR.MINOR, increment the:
MAJOR version when you make backward-incompatible updates of any kind MINOR version when you make 100% backward-compatible updates Additional pre-release and build metadata labels are available as MAJOR extensions.MINOR format.
Compatible Versioning ("ComVer") is SemVer, where every PATCH number is 0 (zero). This way, ComVer is backward compatible with SemVer.
A ComVer release from 3.6 to 3.7 is just a SemVer release from 3.6.0 to 3.7.0. In other words, ComVer is safe to adopt since it is basically SemVer without ever issuing PATCH releases.
This project provides an .editorconfig
file, with some style options such as indent.
To use the .editorconfig
file in VS Code, install the EditorConfig for VS Code
extension. See the EditorConfig documentation for more information.
To use the .editorconfig
file in Pycharm, enable the EditorConfig
plugin. See the IntelliJ IDEA EditorConfig documentation for more information.