You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Docs: update to mention changelog and release changes (#1454)
* Docs: update to mention changelog and release changes
I also took the opportunity to expand the Pull Request documentation, and add a mention of Composer in the general development docs since the tool is important for general development.
* Add detail about patch release's readme.txt editing
Copy file name to clipboardExpand all lines: docs/pull-request.md
+52Lines changed: 52 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,3 +4,55 @@ When you’re first starting out, your natural instinct when creating a new feat
4
4
5
5
**It’s important to break your feature down into small pieces first**, each piece should become its own pull request.
6
6
7
+
## Creating a pull request
8
+
9
+
Once you know what the first small piece of your feature will be, follow this general process while working:
10
+
11
+
### Create a new branch
12
+
13
+
#### Branch Naming Scheme
14
+
15
+
All changes should be developed in a new branch created from the `trunk` branch.
16
+
17
+
Branches use the following naming conventions:
18
+
19
+
*`add/{something}` -- When you are adding a completely new feature
20
+
*`update/{something}` -- When you are iterating on an existing feature
21
+
*`fix/{something}` -- When you are fixing something broken in a feature
22
+
*`try/{something}` -- When you are trying out an idea and want feedback
23
+
24
+
For example, you can run: `git checkout trunk` and then `git checkout -b fix/whatsits` to create a new `fix/whatsits` branch off of `origin/trunk`.
25
+
26
+
The ActivityPub repo uses the following "reserved" branch name conventions:
27
+
28
+
*`release/{X.Y.Z}` -- Used for the release process.
29
+
30
+
### Develop, commit
31
+
32
+
1. Start developing and pushing out commits to your new branch.
33
+
- Push your changes out frequently and try to avoid getting stuck in a long-running branch or a merge nightmare. Smaller changes are much easier to review and to deal with potential conflicts.
34
+
- Don’t be afraid to change, [squash](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html), and rearrange commits or to force push - `git push --force-with-lease origin fix/something-broken`. Keep in mind, however, that if other people are committing on the same branch then you can mess up their history. You are perfectly safe if you are the only one pushing commits to that branch.
35
+
- Squash minor commits such as typo fixes or [fixes to previous commits](http://fle.github.io/git-tip-keep-your-branch-clean-with-fixup-and-autosquash.html) in the pull request.
36
+
1. If you have [Composer installed](https://getcomposer.org/), you can run `composer install` and `composer lint [directory or files updated]` to check your changes against WordPress coding standards. Please ensure your changes respect current coding standards.
37
+
1. If you end up needing more than a few commits, consider splitting the pull request into separate components. Discuss in the new pull request and in the comments why the branch was broken apart and any changes that may have taken place that necessitated the split. Our goal is to catch early in the review process those pull requests that attempt to do too much.
38
+
39
+
### Create a changelog entry
40
+
41
+
Before you push your changes, make sure you create a changelog entry. Those entries provide useful information to end-users and other developers about the changes you've made, and how they can impact their WordPress site.
42
+
43
+
#### How do I create a changelog entry?
44
+
45
+
You can use the `composer changelog:add` command to create a changelog entry, and then follow the prompt and commit the changelog file that was created for you.
46
+
47
+
### Create your Pull Request
48
+
49
+
When you feel that you are ready for a formal review or for merging into `trunk`, push your branch to GitHub and open a Pull Request.
50
+
51
+
As you open your Pull Request, make sure you check the following:
52
+
- Make sure your Pull Request includes a changelog entry, or add the "Skip Changelog" label to the PR.
53
+
- Make sure all required checks listed at the bottom of the Pull Request are passing.
54
+
- Make sure your branch merges cleanly and consider rebasing against `trunk` to keep the branch history short and clean.
55
+
- If there are visual changes, add before and after screenshots in the pull request comments.
56
+
- If possible add unit tests,
57
+
- Provide helpful instructions for the reviewer so they can test your changes. This will help speed up the review process.
Copy file name to clipboardExpand all lines: docs/release-process.md
+21-20Lines changed: 21 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,9 +15,9 @@ Major and minor releases follow the same release process. These releases are cre
15
15
npm run release
16
16
```
17
17
- The script will:
18
-
- Prompt forthe new version number
18
+
- Determine the new version number based on the unreleased changelog entries.
19
19
- Update version numbers in relevant files
20
-
- Update the changelog
20
+
- Update `CHANGELOG.md` and `readme.txt` with the changelog entries
21
21
- Create a new branch
22
22
- Commit changes
23
23
- Push to GitHub
@@ -46,18 +46,16 @@ Patch releases require a more manual process as they need to be created from the
46
46
### Steps
47
47
48
48
1. **Restore Release Branch**
49
-
- Locate the most recent release branch (for `5.3.0` it was [#1371](https://github.com/Automattic/wordpress-activitypub/pull/1371)).
50
-
- If needed, recreate the branch from the last release tag.
51
-
52
-
2. **Create Version PR**
53
-
- Base the version PR on PR [#1192](https://github.com/Automattic/wordpress-activitypub/pull/1192).
54
-
- The release script doesn't support releasing patch versions, so you'll need to manually update version numbers and changelog entries.
55
-
- Manually update version numbers in relevant files.
56
-
- Manually update changelog and readme.txt with the patch version number above the entries that will be part of the release.
57
-
58
-
3. **Cherry-pick Changes**
59
-
- Identify merge commits from `trunk` that need to be included.
60
-
- Cherry-pick each merge commit into the release branch:
49
+
- Locate the most recent release branch (for `5.3.0` it was `release/5.3.0`, created via [#1371](https://github.com/Automattic/wordpress-activitypub/pull/1371)).
50
+
- Click "Restore branch" to recreate it.
51
+
- Locally, checkout that release branch you just restored: `git fetch origin release/5.3.0 && git checkout release/5.3.0`
52
+
53
+
2. **Cherry-pick Changes into the release branch**
54
+
- Identify merge commits from `trunk` that need to be included. You can find them at the bottom of each PR:
@@ -67,12 +65,15 @@ Patch releases require a more manual process as they need to be created from the
67
65
```
68
66
> Note: The `-m 1` flag is required when cherry-picking merge commits. Merge commits have two parent commits - the first parent (`-m 1`) is the target branch of the original merge (usually the main branch), and the second parent (`-m 2`) is the source branch that was being merged. We use `-m 1` to tell Git to use the changes as they appeared in the main branch.
69
67
70
-
4. **Resolve Conflicts**
71
-
- Common conflict areas:
72
-
- `CHANGELOG.md`
73
-
- `readme.txt`
74
-
- Resolve conflicts maintaining chronological order in changelog.
75
-
- Ensure version numbers are correct.
68
+
- Resolve merge conflicts that may come up as you cherry-pick commits.
69
+
70
+
3. **Update changelog and version numbers**
71
+
- Run `composer changelog:write`. It will update `CHANGELOG.md` with the changelog entries you cherry-picked, and will give you a version number for that release.
72
+
- Edit `readme.txt` to paste the changelog entries from `CHANGELOG.md` into the `== Changelog ==` section.
73
+
- The release script doesn't support releasing patch versions, so you'll need to manually update version numbers in the different files (`activitypub.php`, `readme.txt`, and files that may have been changed to introduce an `unreleased` text).
74
+
75
+
4. **Review and push your changes**
76
+
- Review your changes locally, and `git push` to push your changes to the remote.
76
77
77
78
5. **Create Release**
78
79
- On GitHub, navigate to the main page of the repository.
0 commit comments