Skip to content

Commit 7330e57

Browse files
committed
chore(dev): implement development automation and update docs
Add comprehensive Makefile for development automation and refactor contributing guide for clarity and completeness. - Add Makefile with features: * Development commands (fmt, clippy, test, audit) * Release management with semantic versioning * Changelog automation with git-cliff * Colored output and helpful messages * Development vs release checks separation * Package verification and publishing support - Update CONTRIBUTING.md: * Add detailed guide for development workflow * Improve release process documentation * Add troubleshooting section * Include yanking instructions * Add best practices * Update commands to use Make The new automation system simplifies development setup, standardizes quality checks, and provides a clear process for contributors.
1 parent 9b8d59b commit 7330e57

File tree

2 files changed

+298
-133
lines changed

2 files changed

+298
-133
lines changed

CONTRIBUTING.md

+156-133
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,128 @@
11
# Contributing Guide
22

3-
Thank you for considering contributing to this project! This guide will help you understand our workflow, coding standards, and release process. Whether you're fixing a bug, adding a feature, or improving documentation, your contribution is highly appreciated!
3+
Thank you for considering contributing to this project! This guide will help you understand our workflow, coding standards, and release process.
4+
5+
## Ways to Contribute
6+
7+
1. **Opening Issues**
8+
- Report bugs with detailed descriptions
9+
- Suggest enhancements
10+
- Request features
11+
- Create detailed issue descriptions using templates
12+
- Use issue templates for bugs and features
13+
14+
2. **Adding Context**
15+
- Provide reproduction steps
16+
- Share code snippets
17+
- Add screenshots
18+
- Write use cases
19+
- Add examples and scenarios
20+
- Link to related issues or PRs
21+
22+
3. **Resolving Issues**
23+
- Fix bugs
24+
- Implement features
25+
- Improve documentation
26+
- Enhance performance
27+
- Demonstrate that an issue is not a problem
28+
- Open pull requests with fixes
29+
30+
4. **Reviewing Pull Requests**
31+
- Review code changes
32+
- Test proposed features
33+
- Suggest improvements
34+
- Share domain expertise
35+
- Help maintain code quality
36+
- Participate in technical discussions
37+
38+
## Development Setup
39+
40+
We use Make to automate development tasks. Start by setting up your environment:
441

5-
## Ways to contribute
6-
7-
There are fundamentally four ways an individual can contribute:
42+
```bash
43+
make setup
44+
```
845

9-
1. **By opening an issue:** For example, if you believe that you have uncovered a bug,
10-
creating a new issue in the issue tracker is the way to report it.
11-
2. **By adding context:** Providing additional context to existing issues,
12-
such as screenshots and code snippets.
13-
3. **By resolving issues:** Either demonstrating that the issue is not a problem,
14-
or opening a pull request with a fix.
15-
4. **By reviewing pull requests:** Help review and discuss proposed changes.
46+
This installs required tools:
1647

17-
**Anybody can participate in any stage of contribution**. We urge you to participate in the discussion around bugs and participate in reviewing PRs.
48+
- `cargo-audit`: Security vulnerability scanning
49+
- `cargo-edit`: Dependency management
50+
- `git-cliff`: Changelog generation
1851

1952
## Development Workflow
2053

21-
1. **Fork and clone the repository**
54+
1. **Fork and Clone**
2255

2356
```bash
2457
git clone https://github.com/fluentlabs-xyz/gblend.git
2558
cd gblend
2659
```
2760

28-
2. **Create a new branch**
61+
2. **Setup Environment**
2962

3063
```bash
31-
git checkout -b feat/your-feature
64+
make setup
3265
```
3366

34-
3. **Sync with the main repository** (if necessary):
67+
3. **Create Feature Branch**
3568

3669
```bash
37-
git remote add upstream https://github.com/fluentlabs-xyz/gblend.git
38-
git pull upstream main
70+
git checkout -b feat/your-feature
71+
# or
72+
git checkout -b fix/your-bugfix
3973
```
4074

41-
4. **Make changes following the commit convention**
42-
43-
5. **Test your changes**
75+
4. **Sync with upstream** (if necessary)
4476

4577
```bash
46-
cargo test
47-
cargo fmt -- --check
48-
cargo clippy -- -D warnings
78+
git remote add upstream https://github.com/fluentlabs-xyz/gblend.git
79+
git pull upstream main
4980
```
5081

51-
6. **Push changes**
82+
5. **Make Changes**
83+
- Write code
84+
- Add tests
85+
- Update documentation
86+
87+
6. **Verify Changes**
5288

5389
```bash
54-
git push origin feat/your-feature
90+
# During development - run individual checks
91+
make fmt # Check formatting
92+
make clippy # Check lints
93+
make test # Run tests
94+
make audit # Check dependencies
95+
96+
# Before creating PR - run all checks
97+
make check # Full verification
5598
```
5699

57-
7. **Open a Pull Request**
58-
- Go to your fork on GitHub
59-
- Click "New Pull Request"
60-
- Choose the appropriate template:
61-
- Use the default template for general changes
62-
- Use the feature template for new features
63-
- Use the bugfix template for bug fixes
64-
- Fill in all required sections of the template
65-
- Link any related issues using the `Closes #issue-number` syntax
66-
- Request reviews from maintainers
67-
- Ensure all checks are passing
100+
7. **Create Pull Request**
101+
- Use conventional commits
102+
- Link related issues
103+
- Fill PR template
104+
- Request reviews
68105

69106
## Commit Convention
70107

71-
We use [Conventional Commits](https://www.conventionalcommits.org/):
108+
We follow [Conventional Commits](https://www.conventionalcommits.org/):
72109

73-
```bash
74-
# Format
110+
```
75111
<type>[optional scope]: <description>
76112
77-
# Types
113+
Types:
78114
feat: New features
79115
fix: Bug fixes
80-
docs: Documentation changes
81-
style: Code style changes
82-
refactor: Code changes without features/fixes
83-
test: Tests changes
84-
chore: Build process changes
85-
86-
# Examples
87-
feat(auth): add OAuth support
88-
fix(ui): resolve button alignment issue
116+
docs: Documentation only
117+
style: Style/formatting changes
118+
refactor: Code refactoring
119+
test: Testing changes
120+
chore: Maintenance tasks
121+
122+
Examples:
123+
feat(api): add user authentication
124+
fix(ui): correct button alignment
89125
docs: update installation guide
90-
test: add unit tests for auth module
91126
```
92127

93128
## Release Process
@@ -102,87 +137,55 @@ We follow [Semantic Versioning](https://semver.org/) (MAJOR.MINOR.PATCH):
102137

103138
### Creating a Release
104139

105-
1. **Install cargo-edit**
106-
107-
```bash
108-
cargo install cargo-edit
109-
```
110-
111-
2. **Update version**
112-
113-
For incremental version updates:
114-
115-
```bash
116-
# For MAJOR version bump (breaking changes)
117-
cargo set-version --bump major
118-
119-
# For MINOR version bump (new features)
120-
cargo set-version --bump minor
121-
122-
# For PATCH version bump (bug fixes, small changes)
123-
cargo set-version --bump patch
124-
```
125-
126-
For setting a specific version:
140+
1. **Verify Release Readiness**
127141

128142
```bash
129-
cargo set-version 1.2.3
143+
make check-release
130144
```
131145

132-
For pre-release versions:
146+
2. **Prepare Release**
133147

134148
```bash
135-
# For alpha releases
136-
cargo set-version 1.2.3-alpha.1
137-
138-
# For beta releases
139-
cargo set-version 1.2.3-beta.1
140-
141-
# For release candidate versions
142-
cargo set-version 1.2.3-rc.1
143-
```
144-
145-
3. **Generate changelog using git-cliff**
149+
# Using semantic versioning
150+
make release VERSION=major # Breaking changes
151+
make release VERSION=minor # New features
152+
make release VERSION=patch # Bug fixes
146153

147-
```bash
148-
# Update changelog
149-
git cliff --tag v1.2.3 -o CHANGELOG.md
154+
# Or specific version
155+
make release VERSION=1.2.3
150156

151-
# Or append unreleased changes
152-
git cliff --unreleased --tag v1.2.3 --prepend CHANGELOG.md
157+
# Pre-release versions
158+
make release VERSION=1.2.3-alpha.1 # Alpha releases
159+
make release VERSION=1.2.3-beta.1 # Beta releases
160+
make release VERSION=1.2.3-rc.1 # Release candidates
153161
```
154162

155-
4. **Commit version and changelog**
163+
3. **Review Changes**
164+
- Check generated changelog
165+
- Review version updates
166+
- Verify all changes are included
167+
168+
4. **Commit Release**
156169

157170
```bash
158-
git add Cargo.toml CHANGELOG.md
159-
git commit -m "chore: release version 1.2.3"
171+
make commit-version
160172
```
161173

162-
5. **Create and push a release tag**
174+
5. **Push Release**
163175

164176
```bash
165-
git tag -a v1.2.3 -m "Release v1.2.3"
166-
git push origin v1.2.3
177+
git push origin main v1.2.3
167178
```
168179

169-
6. **Automated Publishing**
170-
- Pushing the tag `v*.*.*` will automatically trigger the GitHub Action workflow
171-
- The workflow will:
172-
1. Check code formatting
173-
2. Run clippy lints
174-
3. Run tests
175-
4. Publish to crates.io using the `CARGO_REGISTRY_TOKEN`
180+
### Managing the Changelog
176181

177-
7. **Create GitHub Release**
178-
- Go to Releases page
179-
- Click "Draft a new release"
180-
- Select the tag
181-
- Use git-cliff to generate release notes:
182+
```bash
183+
# Preview upcoming changes
184+
make changelog-preview
182185

183-
```bash
184-
git cliff --current --strip header
185-
```
186+
# Update changelog
187+
make changelog
188+
```
186189

187190
### Managing Published Versions
188191

@@ -207,20 +210,6 @@ Important notes about yanking:
207210
- Has backwards compatibility issues
208211
- Was accidentally published
209212

210-
### Release Checklist
211-
212-
| Checkpoint | Command/Action | Status |
213-
|---------------------------------|--------------------------------------|--------|
214-
| Install cargo-edit | `cargo install cargo-edit` | [ ] |
215-
| Version bump | `cargo set-version 1.2.3` | [ ] |
216-
| Changelog generated | `git cliff` | [ ] |
217-
| Tests passing | `cargo test` | [ ] |
218-
| Formatting checked | `cargo fmt -- --check` | [ ] |
219-
| Linting checked | `cargo clippy -- -D warnings` | [ ] |
220-
| Dependencies reviewed | Check `Cargo.toml` | [ ] |
221-
| Breaking changes documented | Update CHANGELOG.md | [ ] |
222-
| `CARGO_REGISTRY_TOKEN` present | Check GitHub Secrets | [ ] |
223-
224213
### Troubleshooting Releases
225214

226215
If the automated publishing fails:
@@ -242,16 +231,50 @@ After yanking a version:
242231
3. Notify users through GitHub Issues
243232
4. Update release notes to indicate the version is yanked
244233

245-
## Code of Conduct
234+
## Development Commands
235+
236+
Run `make help` to see all available commands. Common tasks:
237+
238+
```bash
239+
# Main commands
240+
make check # Run all development checks
241+
make check-release # Full release verification
242+
make clean # Clean build artifacts
243+
244+
# Individual checks
245+
make fmt # Check formatting
246+
make clippy # Run linter
247+
make test # Run tests
248+
make audit # Security audit
249+
```
246250

247-
We follow the [Contributor Covenant](https://www.contributor-covenant.org/). Please be respectful and inclusive while contributing to the project.
251+
## Best Practices
252+
253+
1. **Code Quality**
254+
- Write tests for new features
255+
- Maintain code coverage
256+
- Follow project style guide
257+
- Add documentation
258+
259+
2. **Pull Requests**
260+
- Keep changes focused
261+
- Update tests
262+
- Add documentation
263+
- Respond to reviews
264+
265+
3. **Communication**
266+
- Be respectful
267+
- Provide context
268+
- Ask questions
269+
- Stay engaged
248270

249271
## Getting Help
250272

251-
If you need help with your contribution:
273+
- Issues: Report bugs and request features
274+
- Pull Requests: Get feedback on changes
252275

253-
- Open a discussion in the GitHub Discussions tab
254-
- Ask in the project's communication channels
255-
- Check existing documentation and issues
276+
Every contributor was once a beginner - don't hesitate to ask for help!
277+
278+
## Code of Conduct
256279

257-
Remember: every contributor was once a beginner. Don't hesitate to ask for help or clarification.
280+
We follow the [Contributor Covenant](https://www.contributor-covenant.org/). Be respectful and inclusive in all interactions.

0 commit comments

Comments
 (0)