Skip to content

Commit 1ea3c08

Browse files
authored
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
1 parent 6b2caa7 commit 1ea3c08

File tree

4 files changed

+89
-20
lines changed

4 files changed

+89
-20
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: changed
3+
4+
Documentation: expand Pull Request process docs, and mention the new changelog process as well as the updated release process.

docs/development-environment.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,18 @@ This will start a local WordPress environment with the ActivityPub plugin instal
5858

5959
You can open the WordPress site in your browser by visiting `http://localhost:8076`.
6060

61+
### Composer
62+
63+
Composer is used to install development dependencies for the ActivityPub plugin, to run unit tests, and to manage changelog entries.
64+
65+
To install Composer, follow the instructions on the [Composer website](https://getcomposer.org/).
66+
67+
Once Composer is available on your machin, you can install dependencies for the project like so:
68+
69+
```bash
70+
composer install
71+
```
72+
6173
## Running Tests
6274

6375
You can now run the test suite using either npm or composer:

docs/pull-request.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,55 @@ When you’re first starting out, your natural instinct when creating a new feat
44

55
**It’s important to break your feature down into small pieces first**, each piece should become its own pull request.
66

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.
58+

docs/release-process.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ Major and minor releases follow the same release process. These releases are cre
1515
npm run release
1616
```
1717
- The script will:
18-
- Prompt for the new version number
18+
- Determine the new version number based on the unreleased changelog entries.
1919
- Update version numbers in relevant files
20-
- Update the changelog
20+
- Update `CHANGELOG.md` and `readme.txt` with the changelog entries
2121
- Create a new branch
2222
- Commit changes
2323
- Push to GitHub
@@ -46,18 +46,16 @@ Patch releases require a more manual process as they need to be created from the
4646
### Steps
4747
4848
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:
55+
56+
<img width="904" alt="image" src="https://github.com/user-attachments/assets/4c49c5bd-928c-44d2-b64b-39454baa8d9d" />
57+
58+
- Cherry-pick each merge commit into this branch:
6159
```bash
6260
# Checkout the release branch.
6361
git checkout release/5.3.0
@@ -67,12 +65,15 @@ Patch releases require a more manual process as they need to be created from the
6765
```
6866
> 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.
6967
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.
7677
7778
5. **Create Release**
7879
- On GitHub, navigate to the main page of the repository.

0 commit comments

Comments
 (0)