Before contributing, ensure you’ve set up your development environment following the setup guide.
One-Time Git Configuration
Configure your Git identity (remove--global if you don’t want it to apply to other repos):
Recommended Git Settings
Normal Development Workflow
This workflow applies if you’ve been added as a collaborator to the repository. If not, you should fork it using the button on GitHub, add it as a remote, and replace allgit push origin steps with git push <remote-name>.
Write and test your code
Make your changes and test them thoroughly. See the Testing section below.
Commit your changes
Review what you’ve changed:Commit with a descriptive message (see commit message style):You can make multiple commits as needed.
Create a pull request
Go to github.com/learning-unlimited/ESP-Website. If you’re logged in, you should see a banner suggesting you make a pull request. Click the button, write a summary, and submit.
Testing
When adding new functionality, add corresponding tests to the appropriate application’s test module or directory.Running Tests
- Docker (Recommended)
- Native
Run all tests:Run tests for a specific module (e.g.,
accounting):Test Suite Reference
Tests are located in application-specific files and directories:esp/accounting/tests.pyesp/application/tests.pyesp/cal/tests.pyesp/dbmail/tests.pyesp/formstack/tests.pyesp/miniblog/tests.pyesp/program/tests.pyesp/survey/tests.pyesp/varnish/tests.pyesp/users/controllers/tests/test_usersearch.pyesp/program/controllers/autoscheduler/tests/
customforms/, resources/, qsd/, qsdmedia/, tagdict/, themes/, utils/, and web/.
Code Reviews
Every change must be reviewed by someone else before merging tomain. This is important because:
- It helps keep code maintainable — you write code that others can understand
- It spreads good coding practices across the team
- It ensures two people are familiar with every piece of code
- It helps catch bugs (though tests are better!)
Exceptions
- If multiple people collaborate on a pull request, one can merge it as long as each has reviewed the other’s code
- Chapter admins with server access may push directly to their chapter’s branch (but should immediately make a PR to main)
- Folks setting up stable release branches may cherry-pick bugfix commits from main
For Reviewers
After you’ve had a few pull requests accepted, you can begin reviewing others’ code. You’ll need to be added as a repository collaborator.Check out these tips for code reviews if you’re new to reviewing code.
- Generally prefer the “squash” option unless the individual changes are fairly distinct or there’s a lot of history to preserve
- Use “merge” if the pull request is from
mainor will be merged into multiple branches - If unsure, ask a more experienced contributor
Urgent Features and Fixes
Deploy and create PR
Pull code as described in the MIT ESP Wiki.Then make a pull request for
urgent-branch-name to main as described above.Rebasing and Squashing
In general, there is no need to rebase or squash. GitHub handles this well enough for reviewers.Only rebase or squash if you know exactly what it means, why you want to do it, and when it’s safe. If unsure, skip it — a simple
git merge works fine.main via the GitHub UI, we generally prefer the “squash” option (see the Code Reviews section above).