-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(#121): transition to simplified git flow with automatic release…
… of beta versions
- Loading branch information
Showing
18 changed files
with
242 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,13 +2,7 @@ | |
|
||
:+1::tada: First of all, thanks for taking the time to contribute! :tada::+1: | ||
|
||
All your contributions are very welcome, whether it's: | ||
|
||
- Reporting a bug | ||
- Discussing the current state of the code | ||
- Submitting a fix | ||
- Proposing new features | ||
- Becoming a maintainer | ||
All your contributions are very welcome, whether it’s a bug fix, new feature, or enhancement. Please follow the guidelines below to ensure a smooth contribution process. | ||
|
||
Thank you so much! :clap: | ||
|
||
|
@@ -47,17 +41,102 @@ log4brains init | |
|
||
When you are done, run `yarn unlink-cli && npm install -g log4brains` to use the official version again. | ||
|
||
## Checks to run before pushing | ||
## Coding standards | ||
|
||
Ensure that your code follows our style guidelines and is fully tested. We use ESLint for code linting, and Prettier for code formatting. | ||
See the section below for more details about the commands to run. | ||
|
||
## Versioning and Commit Messages | ||
|
||
We use Lerna with [Semantic Versioning](https://semver.org/). Version bumps are determined automatically by commit messages using the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) format: | ||
|
||
- `fix:` for patches | ||
- `feat:` for new features | ||
- `BREAKING CHANGE:` in the footer of the message for major changes | ||
|
||
Example commit message: | ||
|
||
```bash | ||
yarn lint # enforced automatically before every commit with husky+lint-staged | ||
yarn format:fix # enforced automatically before every commit with husky+lint-staged | ||
yarn typescript # enforced automatically before every commit with husky | ||
yarn test:changed # (or `yarn test` to run all the tests) | ||
``` | ||
feat: add a new command to generate specific ADRs | ||
``` | ||
|
||
## Git workflow | ||
|
||
Log4brains follows a **simplified Git Flow** model. Here’s how the process works: | ||
|
||
1. **Fork the Repository**: First, fork the repository and clone it locally. | ||
2. **Create a Feature Branch**: Create a new branch for your feature or bug fix based on the `develop` branch: | ||
```bash | ||
git checkout develop | ||
git checkout -b my-new-feature | ||
``` | ||
3. **Develop and Test**: Make your changes (do not forget the tests!), and ensure the following commands pass before submitting your PR: | ||
|
||
```bash | ||
yarn lint # enforced automatically before every commit with husky+lint-staged | ||
yarn format:fix # enforced automatically before every commit with husky+lint-staged | ||
yarn typescript # enforced automatically before every commit with husky | ||
yarn test:changed # (or `yarn test` to run all the tests) | ||
``` | ||
|
||
If applicable, a pull request without tests will be rejected. | ||
|
||
4. **Rebasing**: Before creating your Pull Request, ensure it is rebased onto the latest develop to ensure that your changes can be merged without conflicts. | ||
|
||
5. **Submit a Pull Request**: When your changes are ready, push your branch to your fork and open a Pull Request (PR) to the `develop` branch of the main repository. | ||
|
||
The PR will automatically trigger tests using GitHub Actions. If all tests pass, you can wait for a maintainer to review your PR. | ||
|
||
6. **Review Process**: A maintainer will review your PR and provide feedback. If approved, your changes will be merged into `develop` (using "Squash and Merge" to maintain a clean history). | ||
|
||
Please do not forget to add tests to your contribution if this is applicable! | ||
It will then trigger automatically a **beta release** to npm, allowing users to install and test the latest changes: | ||
|
||
```bash | ||
npm install log4brains@beta | ||
``` | ||
|
||
This helps us get feedback from early adopters before merging changes into `stable`, and thus triggering a stable release. | ||
|
||
7. **Releasing to Stable**: Once the `develop` branch is stable and tested, the maintainers will merge it into `stable`, and run manually `scripts/release.sh` to publish a new stable release to npm (TODO: should be automated in the future). | ||
|
||
### Urgent hotfix specific case | ||
|
||
In the rare case that an urgent hotfix is needed on the current stable version while not wanting to release the `develop` branch yet, you can follow this process: | ||
|
||
1. Create a new branch from `stable` (instead of `develop`) | ||
2. Develop and test | ||
3. Submit a Pull Request to `stable` (instead of `develop`) | ||
4. A maintainer will review, merge and release the patch | ||
5. Then the maintainer will merge `stable` into `develop` to ensure the hotfix is ported to the beta version | ||
|
||
## License | ||
|
||
By contributing to Log4brains, you agree that your contributions will be licensed under its Apache 2.0 License. | ||
|
||
## Would like to become a co-maintainer? | ||
|
||
As discussed in [discussion #108](https://github.com/thomvaill/log4brains/discussions/108), I (@thomvaill), as the project's sole maintainer, struggle to dedicate enough time to ensure its stability and growth, which is critical for its continued development. To ensure the project's long-term success, it is essential to have multiple maintainers. Therefore, I am actively seeking reliable and committed co-maintainers to share the responsibilities and contribute to the project's future. | ||
|
||
To make it easier I introduce two co-maintainer roles: | ||
|
||
- **Canary Maintainers**: in charge of triaging issues, reviewing PRs, and can merge them into `develop` (and thus trigger a beta release) | ||
- **Core Maintainers**: in charge of the project's overall direction and vision, of releasing stable versions, and can merge `develop` into `stable` (and thus trigger a stable release) | ||
|
||
If you're interested in becoming a co-maintainer, you can start your "Mentorship Phase" by participating in code reviews and helping triage issues. This will help us assess your familiarity with the project and the workflow. | ||
|
||
**Steps to becoming a co-maintainer**: | ||
|
||
1. **Review Open PRs**: Begin by reviewing existing PRs and providing meaningful feedback. A current maintainer will mentor you through the review process. | ||
2. **Help Triaging Issues**: Engage with users by helping resolve issues and providing guidance. | ||
3. **Contribution Consistency**: Regular and meaningful contributions over time will demonstrate your knowledge and commitment. | ||
4. **Reach Out** to <[email protected]> to exress your interest in becomming a co-maintainer. | ||
|
||
Once we identify a trusted contributor, we will elevate them to the **Canary Maintainer** status, with permissions to merge PRs and perform other tasks. | ||
Later, a **Canary Maintainer** can become a **Core Maintainer** if they demonstrate a strong understanding of the project and its direction and if they are motived to take on the additional responsibilities. | ||
|
||
## Issues triage | ||
|
||
_Work in Progress_ | ||
|
||
- **Core Maintainers** are responsible for managing the [milestones](https://github.com/thomvaill/log4brains/milestones) of the project: this enables contributor to see what is planned for the next release, and what is the priority of the issues | ||
- **Canary Maintainers** are responsible for triaging issues and PRs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Transition to Simplified Git Flow | ||
|
||
- Status: draft | ||
- Date: 2024-09-26 | ||
|
||
## Context and Problem Statement | ||
|
||
The existing GitHub Flow process lacked clarity for stable releases and was overly manual, making it hard to delegate and streamline contributions. The need was for a more structured yet simple workflow that would facilitate testing and contributions while automating releases. | ||
|
||
Additional context in [Discussion #108: Does this project need a new maintainer?](https://github.com/thomvaill/log4brains/discussions/108) | ||
|
||
## Decision Drivers | ||
|
||
- Need for automation in releases. | ||
- Be able to merge more quickly whithout breaking the stable branch, while making it possible for beta testers to test the new features. | ||
- Easier delegation to new maintainers. | ||
- Simplified yet structured process for contributors. | ||
- Clearer separation between ongoing development and stable releases. | ||
|
||
## Considered Options | ||
|
||
- Continue with GitHub Flow. | ||
- Transition to Simplified Git Flow. | ||
- Full Git Flow with release branches. | ||
|
||
## Decision Outcome | ||
|
||
Chosen option: **Simplified Git Flow**, because it provides structure (separating development from stable releases) without excessive complexity. It also allows for automated canary/beta releases and easier delegation for merging feature branches to `develop`. | ||
|
||
### Positive Consequences | ||
|
||
- Clear separation of development (`develop`) and stable (`stable`) branches. | ||
- Automated beta releases from `develop` to facilitate early testing. | ||
- Allows contributors to participate in testing beta features and reduces the manual overhead of testing and releasing stable versions | ||
- Easier to delegate responsibilities (Canary vs. Core Maintainers, see [CONTRIBUTING.md](CONTRIBUTING.md)). | ||
- More streamlined versioning via Conventional Commits. | ||
|
||
### Negative Consequences | ||
|
||
- Contributors need to adjust to using `develop` for PRs instead of `stable`. | ||
- Slight learning curve for Conventional Commits. | ||
|
||
## Pros and Cons of the Options | ||
|
||
### Continue with GitHub Flow | ||
|
||
- Good, because it’s simpler with fewer branches. | ||
- Bad, because it lacks separation of development and stable code. | ||
- Bad, because manual testing and release increase bottlenecks. | ||
|
||
### Simplified Git Flow | ||
|
||
- Good, because it balances structure with simplicity. | ||
- Good, because it allows easier delegation to maintainers. | ||
- Bad, because it introduces a new `develop` branch, which may need adjustment for contributors. | ||
|
||
### Full Git Flow | ||
|
||
- Good, because it provides a full release management process. | ||
- Bad, because it adds unnecessary complexity for smaller open-source projects. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.