The main RERO ILS git
repository has two main branches:
- The
master
branch stays at the latest official release tag. - The
staging
branch (default branch) contains the work being done during a sprint, between two releases. When thestaging
branch is ready for a release, thestaging
branch is pushed intomaster
.
When a release is ready or needed, depending on the presence or absence of new features, a minor or a patch is published.
Mostly, the PRs will be based on the default branch, that is the staging
branch, except when a user story branch is used.
Basically, there's as many branches as servers. For each branch, there's an image on Docker Hub:
- for ils.test.rero.ch:
ils_test
. - for ilsdev.test.rero.ch:
ils_dev
. - for bib.test.rero.ch:
bib_test
.
Each deployment branch is built as needed, especially the ils_dev
branch that
may contain all the commits that need to be tested. On these branches, force
pushing is not an issue, as they aren't used for development.
For the production server, there are at least three branches, allowing to quickly revert to a precedent version: latest and two previous tags.
- for bib.rero.ch:
bib-latest
,bib-1.4.10
,bib-1.4.9
(for example, here the latest being thev1.4.11
), corresponding to three images on Docker Hub.
When a critical bug needs to be fixed as quick as possible, a branch is created
from the last tag in production (usually the master branch), named
<last-tag>-fix
. This branch will contain the fix. Depending on the situation,
then this commit will need to be added to the staging
branch too.
When a less critical bug is fixed by a commit on the staging
branch, a
release is published, which could be a minor or a patch version.
When reaching the end of the current sprint, a release may be published. Depending on breaking changes, it may be a major or a minor version.
Each contributor has his or her own fork and opens a PR (pull request) using
either the rero-ils/staging
branch as its base, or a specific branch
corresponding to a user story (US), such as rero-ils/US-<name>
.
- Fetch the changes:
git fetch --all -p
(fetch changes of all remotes and prune).
- Place yourself in the branch you want to update:
git checkout [branch name]
orgit switch [branch name]
.
- Update your branch:
git pull [remote name] [branch name]
orgit rebase [remote name]/[branch name]
orgit reset --hard [remote name]/[branch name]
(this will overwrite all your local changes).
Very often, you'll need to rebase your working branch on the staging
branch, because the staging
branch has moved just before your PR opening or
merging:
git switch <your-working-branch-name>
git rebase <main-rero-ils-remote-name>/dev
You may need to resolve conflicts.