Skip to content

Contributing

Kyrch edited this page Jul 3, 2024 · 10 revisions

Note: WIP. Please contact staff in the Discord for corrections or missing information.


This page exists to help developers begin contributing to AnimeThemes.

Assignment

Unless otherwise specified, any issue that does not have an assignee can be claimed by any volunteer.

Leave a comment in the issue indicating interest so that the assignee can be designated by a member. This is a requirement in Github to allow assignment of contributors outside of the organization by members.

If further discussion is needed before work can be started, please make use of the #api channel on the discord.

Development Environment

Follow the Installation Guide to ensure a functional local instance of AnimeThemes forked from this repository.

Enable the forked repository in StyleCI so that code styling guidelines are followed. At the time of writing, analysis is run on push and merge.

Set this repository as upstream to the forked repository.

git remote add upstream git@github.com:AnimeThemes/animethemes-server.git

Check out release branch. At the time of writing, the release branch is named main.

git checkout main

Pull upstream changes so that the local main branch is even with the upstream main branch.

git pull upstream main

Push upstream changes to the forked remote main branch if needed.

git push

Feature Branch Workflow

Once the release branch is even with upstream, create a new feature branch from the release branch. The new feature branch name should be descriptive.

git branch new-feature-branch

Switch to the new feature branch.

git checkout new-feature-branch

Make changes in the new feature branch. Once completed, run tests.

php artisan config:clear && php artisan test --parallel

Execute static code analysis.

./vendor/bin/phpstan analyse --memory-limit=-1

Evaluate code changes against conventions & standards.

Stage changes. Commit changes. Please include issue ID's and use Semantic Commit Messages.

Cleanup Before Pull Request

Fetch the upstream release branch and merge with the fork repo's release branch.

git fetch upstream main
git checkout main
git merge upstream/main

If there were any new commits, rebase the new feature branch.

git checkout new-feature-branch
git rebase main

Pull Request

Push changes to remote.

git push --set-upstream origin new-feature-branch

Confirm StyleCI passing status on push.

Create Pull Request from the new feature branch to the upstream release branch.

Pruning

Once the Pull Request is merged, check out the release branch and delete the feature branch locally.

git checkout main

git branch --delete new-feature-branch

Delete the remote feature branch.

git push origin --delete new-feature-branch

Pull upstream changes so that the fork release branch is even with upstream.

git pull upstream main

Push upstream changes to the fork's remote if needed.

git push

References