- Fork the project
- Create a branch from
master
for your fix/feature/etc preferably following Git Flow naming (see below) - When done, commit locally
- Execute and adapt the Behat tests to make sure nothing is broken (see below)
- Create a pull request (PR) explaining what you did, and/or referencing the issue #id you have worked on
It is considered a good practice to use Git Flow branch names when contributing to open source projects.
It consists in a keyword prefix with a trailing slash (ex: feature/
) and your contribution name, e.g.: feature/make-coffee-automatically
.
Here are some other meaningful branch prefixes that are commonly used:
develop
: Use locally. This is a main branch where all the development happens. Feature and fix branches usually branch off from here.
Do not try to PR on master!
feature/
: Used to add a new feature on the project
release/
: Branches off from develop when the codebase reaches a point where it's ready for release. It’s used for final polishing and bug fixing before the code is merged into master and tagged with a version number. We don't use release numbers yet, but we should start doing so.
fix/
: Used for making quick fixes to the production version
enhancement/
or improvement/
: For small but meaningful changes that enhance features without adding completely new functionality.
refactor/
: For code refactoring that doesn’t necessarily add new features or fix bugs but improves the structure or design of the code.
docs/
: When making changes to documentation, like updating README files or adding comments to code.
chore/
: Routine tasks that need to be done, such as updating dependencies.
ui/
: Specifically for UI and design changes, like updating layouts, colors, and other visual elements.
ui/admin-pages
: for the generator pages incore/
ui/public-pages
: for the generated pages incore/app
Bear in mind that the project is still running Boostrap 4!
content/
: For updates focused on content changes, like text, images, or other media.
This project implements two suites of Behat tests: Admin (for the generator) and Public (for the generated pages).
- Kindly read the tests documentation in tests/README.md
- Install the Composer dependencies and run both test suites
- Make sure that you didn't break anything with your changes
- Edit the tests accordingly
- Create new tests accordingly
- When everything is green, perform the actions in "What is tested now, and how to update the coverage list?" so that everybody knows the code coverage.
To ensure that your pull request (PR) for the new feature will not have conflicts with the main branch of the project, follow these steps:
First, make sure your forked local master branch is up to date with the upstream repository (this repo).
git checkout master
Switched to branch 'master'
Your branch is ahead of 'origin/master' by 13 commits.
(use "git push" to publish your local commits)
git pull upstream master # Replace 'upstream' with the name of the remote for the original project
From https://github.com/jan-vandenberg/cruddiy
* branch master -> FETCH_HEAD
Already up to date.
Then, rebase your feature branch (fix/xxx
, tests
, feature/yyy
, ui/public
...) onto your updated master branch. This will apply your changes on top of the latest changes from the original project.
git checkout tests
Switched to branch 'tests' # replace tests with the name of the branch you've worked on
Your branch is up to date with 'origin/tests'.
git rebase master
Current branch tests is up to date.
If there are any conflicts, Git will pause the rebase and allow you to resolve them. Once you've resolved all conflicts, continue the rebase with git rebase --continue
. Repeat this process until the rebase is complete.
After the rebase, run the test suites to ensure your changes don't introduce any issues.
git push origin tests
Go to your fork on GitHub, and create a new pull request from your working branch to the master branch of the original repository.
Once the PR is created, GitHub will show if there are any merge conflicts. If there are conflicts, it means that there have been changes in the master branch of the original repository that conflict with your changes.
If there are conflicts in the PR, you may need to pull the latest changes from the original repository again, rebase your branch, resolve conflicts, and force push again.
Once your PR has no conflicts, it's ready for review by the project maintainers. @jan-vandenberg is the official maintainer (and creator).
- PHP 8+
- MySQL 5.7 or MariaDB 10.3
- The Behat Admin test suite will create a basic database structure for a small project.
- In
schema/Example - All field types.sql
we have a definition for all field types - We still have issues with some field types (see #75)
- You can use feature/import schema to import it and have a consistent set accross tests. The Admin test suite is actually importing one of the schemas.