-
Notifications
You must be signed in to change notification settings - Fork 66
Checklist for testing and merging a PR
- A manual commit bumping the "version" string in
*.opam.locked
used to be necessary (similarly to1f73141
),
within the Release-PR branch, or just after the previous release inmaster
branch. - This is now unneeded since
release-please
v13.5.0.
- install the
git-pr
andgit-prw
extra Git commands; -
cd
in thelearn-ocaml
repository (in the sequel, we assume the remoteorigin
is bound to URL[email protected]:ocaml-sf/learn-ocaml.git
); - run
git pr 200 origin -f
to force-fetch a read-only branch for PR #200,
orgit prw 200 origin -f
to get a read-and-write branch, i.e.,git push
will land in the PR-author's work branch.
- The CI checks must be green.
- Non-trivial PRs should have been tested locally (see the Guidelines above).
- New user-facing features should be documented within the PR, in directory docs/.
- The commits messages should follow the Conventional Commits guidelines.
This is necessary for properly generating the Release-Notes using release-please.
See the related documentation directly in CONTRIBUTING.md
.
There are 3 PR merging strategies in GitHub (Merge
, Merge/Squash
, Merge/Rebase
).
But for merging PRs, we should rather use Merge
or Merge/Squash
:
-
Merge
is always a good, standard choice; -
Merge/Squash
is especially fine if we don't want to keep the commit history of the PR branch or if the PR already contains only one commit; -
whereas
Merge/Rebase
has two drawbacks:- there is no mention anywhere of the PR number in the generated commits messages;
- and the resulting commits are not GPG-signed (cf. the missing
Verified
badge on those commits).
Actually,
Merge/Rebase
might be handy in the specific case of "nested PR merging" (namely: we wouldMerge/Rebase
an intermediate PR into a feature branch (for which the intermediate PR number would be useless), then create a subsequent PR, and finallyMerge
it from the feature branch intoto themaster
branch itself).
One of the aims of this paragraph is to refine/relax the constraint above "The commits messages should follow the Conventional Commits guidelines."
-
First, if
Merge/Squash
looks a sensible choice
(e.g. if the PR contains only one commit, or only focuses on one topic for which keeping the commits apart does not sound necessary),
then the conventional commit constraint is lifted for the PR contributor,
given the Maintainer can easily refine the squashed-commit message, selecting an appropriate commit type. -
Note by the way that if two pending PRs contain common commits
(e.g. if the second PR has been created on top of the first one),
then merging the first PR withMerge/Squash
would always create a conflict with the second PR,
while a regularMerge
would not have this drawback. -
Next, if
Merge
looks a better choice
(e.g. if the PR contains several independent commits that have to be kept for clarity),- then the Merge commit message does not matter (the Maintainer could just select the default one);
- but each individual commit of the PR should be relevant:
for instance, partially-implemented feature commits, followed by fixups commits (even with a prefixfix:
) are not acceptable, given the changelog will ultimately display only one commit for thefeat: Feature title
, so this one should be complete, unless of course if it can be split in several sensible atomic commits.
-
Finally, note that for simplicity,
Release PRs
should rather be integrated usingMerge/Squash
. See e.g. PR #442.
A few useful labels
- good first issue (automatically appears on https://github.com/ocaml-sf/learn-ocaml/contribute)
- needs: merge of dependency (in case we worry about some PR that should not be merged before other merges, we can add this label)