Skip to content

Commit 68c6ace

Browse files
committed
chore: enhance documentation and CI/CD processes
### Added - Introduced a `CONTRIBUTING.md` file with comprehensive guidelines for contributing to the project. - Updated `README.md` to link to the new contribution guide and clarify the automated release process. - Implemented a new `release-automation.yml` workflow for automatic Git tagging, GitHub Releases, and back-merging PRs upon merging release branches into master. - Optimized the CI pipeline by removing redundant test runs on master branch pushes and adding caching for pip dependencies and Go modules. ### Changed - Adjusted CI triggers to run on pushes to `dev` instead of `master`, improving workflow efficiency.
1 parent fe54b10 commit 68c6ace

5 files changed

Lines changed: 142 additions & 40 deletions

File tree

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ contact_links:
33
- name: 📖 Documentation
44
url: https://github.com/Artemonim/AgentDocstrings/blob/master/README.md
55
about: Read the project documentation and setup instructions
6+
- name: 📝 Contribution Guide
7+
url: https://github.com/Artemonim/AgentDocstrings/blob/master/CONTRIBUTING.md
8+
about: Learn how to contribute to the project
69
- name: 💬 Discussions
710
url: https://github.com/Artemonim/AgentDocstrings/discussions
811
about: Ask questions and discuss ideas with the community

CHANGELOG.md

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616

1717
## [NextRelease]
1818

19+
### Documentation
20+
21+
- **Contribution Guide**: Added a new `CONTRIBUTING.md` file with detailed guidelines for development workflow and the release process.
22+
- **README Update**: Updated `README.md` to link to the new contribution guide and reflect the automated release process.
23+
24+
### CI/CD
25+
26+
- **Release Automation**: Added a new `release-automation.yml` workflow that automatically creates Git tags, GitHub Releases, and back-merge PRs when release branches are merged to master.
27+
- **CI Optimization**: Optimized the main CI pipeline by removing redundant test runs on master branch pushes and adding caching for pip dependencies and Go modules to speed up workflow execution.
28+
- **Workflow Efficiency**: Changed CI triggers to run on pushes to `dev` instead of `master`, eliminating duplicate test runs while maintaining comprehensive coverage.
29+
1930
## [1.3.3]
2031

2132
### Fixed
@@ -155,35 +166,3 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
155166
- **Safe operation**: Only modifies auto-generated docstring blocks, preserves existing documentation
156167
- **Incremental updates**: Only processes files when changes are detected
157168

158-
### Technical Features
159-
160-
- Uses `from __future__ import annotations` for forward compatibility
161-
- Compatible with `typing.Union` and `typing.Tuple` for Python 3.8/3.9
162-
- No external dependencies - built on Python standard library only
163-
- Comprehensive test suite with pytest
164-
- Full type checking support with mypy
165-
- Code formatting with black
166-
- Proper packaging for PyPI distribution
167-
168-
### Configuration
169-
170-
- `.agent-docstrings-ignore`: Specify files and patterns to exclude
171-
- `.agent-docstrings-include`: Specify files and patterns to include (whitelist mode)
172-
- Automatic integration with existing `.gitignore` files
173-
- Support for glob patterns in configuration files
174-
175-
### Documentation
176-
177-
- Comprehensive README with usage examples
178-
- Integration guides for pre-commit hooks and CI/CD
179-
- Development setup instructions
180-
- API documentation for programmatic usage
181-
182-
## Version History
183-
184-
- **1.0.1** - Parser and docstring handling improvements
185-
- **1.0.0** - Initial stable release with multi-language support and filtering system
186-
- **0.4.0** - (internal)
187-
- **0.3.0** - (internal)
188-
- **0.2.0** - (internal)
189-
- **0.1.0** - Initial development version (internal)

CONTRIBUTING.md

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# Contributing to AgentDocstringsGenerator
2+
3+
First off, thank you for considering contributing to AgentDocstringsGenerator! It's people like you that make this such a great tool.
4+
5+
This document provides guidelines for contributing to the project. Please feel free to propose changes to this document in a pull request.
6+
7+
## Table of Contents
8+
9+
- [How Can I Contribute?](#how-can-i-contribute)
10+
- [Reporting Bugs](#reporting-bugs)
11+
- [Suggesting Enhancements](#suggesting-enhancements)
12+
- [Pull Requests](#pull-requests)
13+
- [Development Workflow](#development-workflow)
14+
- [Branching Model](#branching-model)
15+
- [Development Steps](#development-steps)
16+
- [Updating the Changelog](#updating-the-changelog)
17+
- [Release Process (for maintainers)](#release-process-for-maintainers)
18+
- [Styleguides](#styleguides)
19+
20+
## How Can I Contribute?
21+
22+
We value community contributions and appreciate your help. Please be respectful in all your interactions.
23+
24+
### Reporting Bugs
25+
26+
If you find a bug, please ensure it hasn't already been reported by searching on GitHub under [Issues](https://github.com/Artemonim/AgentDocstrings/issues). If you can't find an open issue addressing the problem, please open a new one. Include a clear title, a detailed description, and a code sample or test case that demonstrates the issue.
27+
28+
### Suggesting Enhancements
29+
30+
If you have an idea for an enhancement, please open an issue to discuss it first. This allows us to coordinate our efforts and ensure the proposed changes align with the project's goals.
31+
32+
### Pull Requests
33+
34+
We welcome pull requests. Please follow these steps to have your contribution considered:
35+
36+
1. Follow the [Development Workflow](#development-workflow).
37+
2. Ensure that your code adheres to the [Styleguides](#styleguides).
38+
3. Make sure all tests pass.
39+
4. Fill out the pull request template provided.
40+
41+
## Development Workflow
42+
43+
This project uses a GitFlow-like branching model.
44+
45+
### Branching Model
46+
47+
- **`master`**: This branch contains the latest stable release. Direct pushes are not allowed.
48+
- **`dev`**: This is the main development branch. All feature branches should be created from `dev`, and all pull requests should be submitted to `dev`.
49+
- **`feature/*`**: For new features. Branched from `dev`. Example: `feature/new-parser`.
50+
- **`fix/*`**: For bug fixes. Branched from `dev`. Example: `fix/off-by-one-error`.
51+
- **`release/*`**: For preparing new releases. Branched from `dev`. Merged into `master`.
52+
53+
### Development Steps
54+
55+
1. **Fork** the repository on GitHub.
56+
2. **Clone** your fork locally: `git clone https://github.com/YOUR_USERNAME/AgentDocstrings.git`
57+
3. **Set up the environment**:
58+
```bash
59+
cd AgentDocstrings
60+
pip install -e .[dev]
61+
```
62+
4. **Create a new branch** from `dev`:
63+
```bash
64+
git checkout dev
65+
git pull origin dev
66+
git checkout -b feature/your-amazing-feature
67+
```
68+
5. **Make your changes**. Write clean, readable code.
69+
6. **Add or update tests** for your changes in the `tests/` directory.
70+
7. **Run tests** to ensure everything is working correctly: `python -m pytest`
71+
8. **Update the Changelog** `NextRelease` section.
72+
9. **Commit** your changes. Use a clear and descriptive commit message.
73+
10. **Push** your branch to your fork on GitHub: `git push origin feature/your-amazing-feature`
74+
11. **Open a Pull Request** to the `dev` branch of the main repository.
75+
76+
### Updating the Changelog
77+
78+
For every change that affects the user, you must add an entry to the `CHANGELOG.md` file under the `[NextRelease]` section. Follow the format of existing entries.
79+
80+
Example:
81+
82+
```markdown
83+
## [NextRelease]
84+
85+
### TypeOfChange
86+
87+
- **Your Awesome Feature**: A brief description of what you've added.
88+
```
89+
90+
## Release Process (for maintainers)
91+
92+
The release process is partially automated.
93+
94+
1. Create a release branch from `dev`: `git checkout -b release/x.y.z` (e.g., `release/1.4.0`).
95+
2. Update the version using `bump-my-version`:
96+
```bash
97+
# For a patch, minor, or major release
98+
bump-my-version patch/minor/major
99+
```
100+
This command will update the version in `pyproject.toml` and update the `CHANGELOG.md`, replacing `[NextRelease]` with the new version tag.
101+
3. Commit the version bump: `git commit -am "chore: release v.x.y.z"`
102+
4. Push the release branch: `git push origin release/x.y.z`
103+
5. Open a Pull Request from the `release/x.y.z` branch to `master`.
104+
6. Once the PR is merged into `master`, the `release-automation` workflow will automatically:
105+
- Create a Git tag (e.g., `v1.4.0`).
106+
- Create a GitHub Release with the notes from `CHANGELOG.md`.
107+
- Create a Pull Request to merge `master` back into `dev`.
108+
7. The `release.yml` workflow will then automatically publish the package to PyPI upon the creation of the GitHub Release.
109+
110+
## Styleguides
111+
112+
Please follow the coding style of the project to maintain consistency.
113+
114+
- **Python**: [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html), formatted with `black`.
115+
- **Comments**: Use [Better Comments](https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments) style.
116+
- **Docstrings**: Use Google Style Docstrings.

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ This project uses [bump-my-version](https://github.com/callowayproject/bump-my-v
319319

320320
The tool is configured in `pyproject.toml` to automatically update the version string in `agent_docstrings/__init__.py`, `pyproject.toml`, and `CHANGELOG.md`.
321321

322-
**Note**: Per project configuration, this tool only modifies the files. You will need to commit and tag the changes manually after bumping the version.
322+
**Note**: Running `bump-my-version`, you need to create a release branch and a pull request to `master`. The process of tagging, creating a GitHub Release, and publishing to PyPI is automated. For full details, see the [Contribution Guide](CONTRIBUTING.md).
323323

324324
## Support the Project
325325

@@ -337,11 +337,15 @@ Thank you for your support!
337337

338338
## Contributing
339339

340-
1. Fork the repository
341-
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
342-
3. Commit your changes (`git commit -m 'Add amazing feature'`)
343-
4. Push to the branch (`git push origin feature/amazing-feature`)
344-
5. Open a Pull Request
340+
We welcome contributions! Please see our [**Contribution Guide**](CONTRIBUTING.md) for detailed instructions on how to get started, our development workflow, and coding standards.
341+
342+
In short:
343+
344+
1. Fork the repo and create your branch from `dev`.
345+
2. Add your feature or fix.
346+
3. Add/update tests.
347+
4. Update `CHANGELOG.md`.
348+
5. Submit a pull request to `dev`.
345349

346350
## License
347351

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,5 +164,5 @@ replace = '__version__ = "{new_version}"'
164164

165165
[[tool.bumpversion.files]]
166166
filename = "CHANGELOG.md"
167-
search = "## [{current_version}]"
168-
replace = "## [{new_version}]\n\n### Header\n\n- **subtitle**: describtion\n\n## [{current_version}]"
167+
search = "## [NextRelease]"
168+
replace = "## [NextRelease]\n\n### Header\n\n- **subtitle**: describtion\n\n## [{new_version}]"

0 commit comments

Comments
 (0)