Skip to content

Commit 0476965

Browse files
authored
master: Patch Update v1.3.4
2 parents df6542d + 55658f9 commit 0476965

20 files changed

Lines changed: 866 additions & 536 deletions

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ body:
1818
options:
1919
- label: I have read the [README.md](../README.md)
2020
required: true
21-
- label: I have searched for existing issues that might be related to this bug
21+
- label: I am using the [latest version of Agent Docstrings](https://github.com/Artemonim/AgentDocstrings/releases/latest)
2222
required: true
23-
- label: I am using the latest version of Agent Docstrings
23+
- label: I have searched for existing issues that might be related to this bug
2424
required: true
2525

2626
- type: dropdown

.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

.github/ISSUE_TEMPLATE/feature_request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ body:
1818
options:
1919
- label: I have read the [README.md](../README.md)
2020
required: true
21-
- label: I am using the latest version of Agent Docstrings
21+
- label: I am using the [latest version of Agent Docstrings](https://github.com/Artemonim/AgentDocstrings/releases/latest)
2222
required: true
23-
- label: I have searched for existing issues to see if this feature has been requested before
23+
- label: I have searched for existing open and closed issues to see if this feature has been requested before
2424
required: true
2525
- label: This feature request is not a bug report (use Bug Report template for bugs)
2626
required: true

.github/ISSUE_TEMPLATE/question.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ body:
1616
label: Pre-submission Checklist
1717
description: Please confirm you have completed these steps
1818
options:
19+
- label: I have read the [README.md](../README.md) and relevant documentation
20+
required: true
1921
- label: I have searched existing issues and discussions for similar questions
2022
required: true
21-
- label: I have read the [README.md](../README.md) and relevant documentation
23+
- label: I have searched for existing open and closed issues to see if this feature has been requested before
2224
required: true
2325
- label: This is not a bug report (use Bug Report template for bugs)
2426
required: true

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<!--
22
Thank you for contributing to AgentDocstringsGenerator!
33
4-
Please provide a clear and concise description of your changes.
54
If your PR is a work in progress, please mark it as a draft.
65
-->
76

@@ -20,34 +19,13 @@ Please check the box that best describes the nature of your change.
2019
- [ ] 🎨 **Style**: Changes that do not affect the meaning of the code (white-space, formatting, etc.).
2120
- [ ]**Revert**: Reverts a previous commit.
2221

23-
---
24-
25-
## Related Issue
26-
27-
<!--
28-
If this PR addresses a specific issue, please link it here.
29-
For example: `Fixes #123` or `Closes #123`.
30-
If there is no related issue, please state that.
31-
-->
32-
33-
- ***
34-
35-
## Description
36-
37-
<!--
38-
Provide a clear and concise summary of the changes.
39-
Explain the "what" and "why" of your contribution.
40-
-->
41-
42-
-
43-
4422
## Checklist
4523

4624
<!--
4725
Go over all the following points, and put an `x` in all the boxes that apply.
4826
-->
4927

50-
- [ ] My code follows the style guidelines of this project.
51-
- [ ] I have performed a self-review of my own code.
28+
- [ ] My changes follows the [Contribution Guide](CONTRIBUTING.md).
29+
- [ ] I have updated `CHANGELOG.md` under the `[NextRelease]` section.
5230
- [ ] New unit tests have been added to cover the changes.
53-
- [ ] Manual testing has been performed
31+
- [ ] Manual testing has been performed to verify the changes.

.github/workflows/ci.yml

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ on:
44
# Run on pull requests into dev or master.
55
pull_request:
66
branches: [master, dev]
7-
# After a PR is merged, the merge commit is pushed to master; we still want tests + coverage once on the resulting commit.
7+
# Push to dev also triggers tests to ensure dev branch is always stable
88
push:
9-
branches: [master]
9+
branches: [dev]
1010

1111
jobs:
1212
test:
1313
# * Runs unit-test matrix:
14-
# - Always on pull_request (dev or master)
15-
# - On push to master (after merge)
14+
# - On pull_request (to dev or master)
15+
# - On push to dev
1616
if: |
1717
github.event_name == 'pull_request' ||
18-
(github.event_name == 'push' && github.ref == 'refs/heads/master')
18+
(github.event_name == 'push' && github.ref == 'refs/heads/dev')
1919
name: Test on Python ${{ matrix.python-version }} (beta=${{ matrix.beta }})
2020
runs-on: ubuntu-latest
2121
strategy:
@@ -25,7 +25,7 @@ jobs:
2525
steps:
2626
- name: Checkout repository
2727
uses: actions/checkout@v4
28-
# For pull_request we check out the PR commit; for push we stay on the pushed ref (master).
28+
# For pull_request we check out the PR commit; for push we stay on the pushed ref (dev).
2929
with:
3030
ref: ${{ github.event.pull_request.head.sha }}
3131

@@ -34,6 +34,14 @@ jobs:
3434
with:
3535
go-version: "1.22"
3636

37+
- name: Cache Go modules
38+
uses: actions/cache@v4
39+
with:
40+
path: ~/go/pkg/mod
41+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
42+
restore-keys: |
43+
${{ runner.os }}-go-
44+
3745
- name: Build Go parsers
3846
run: pwsh -File ./build_goparser.ps1
3947
shell: bash
@@ -43,6 +51,14 @@ jobs:
4351
with:
4452
python-version: ${{ matrix.python-version }}
4553

54+
- name: Cache pip
55+
uses: actions/cache@v4
56+
with:
57+
path: ~/.cache/pip
58+
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
59+
restore-keys: |
60+
${{ runner.os }}-pip-
61+
4662
- name: Install dependencies
4763
run: |
4864
python -m pip install --upgrade pip
@@ -67,9 +83,7 @@ jobs:
6783

6884
report:
6985
# * Only for master: either in PR to master (so reviewers see comment) or after merge push to master.
70-
if: |
71-
(github.event_name == 'pull_request' && github.base_ref == 'master') ||
72-
(github.event_name == 'push' && github.ref == 'refs/heads/master')
86+
if: github.event_name == 'pull_request' && github.base_ref == 'master'
7387
name: Report Coverage
7488
runs-on: ubuntu-latest
7589
needs: test
@@ -104,9 +118,24 @@ jobs:
104118

105119
- name: Verify that version was not bumped
106120
run: |
107-
if ! git diff --quiet origin/dev HEAD -- pyproject.toml; then
108-
echo "::error::Version in pyproject.toml was changed in a PR to dev."
121+
echo "Checking for version changes in pyproject.toml..."
122+
DEV_PYPROJECT_VERSION=$(git show origin/dev:pyproject.toml | grep '^version = ' | awk -F'"' '{print $2}')
123+
HEAD_PYPROJECT_VERSION=$(grep '^version = ' pyproject.toml | awk -F'"' '{print $2}')
124+
125+
if [ "$DEV_PYPROJECT_VERSION" != "$HEAD_PYPROJECT_VERSION" ]; then
126+
echo "::error::Version in pyproject.toml was changed in a PR to dev. (dev: $DEV_PYPROJECT_VERSION, HEAD: $HEAD_PYPROJECT_VERSION)"
109127
echo "Version bumping should only happen in a release PR to master."
110128
exit 1
111129
fi
112130
echo "Version check passed for pyproject.toml"
131+
132+
echo "Checking for version changes in agent_docstrings/__init__.py..."
133+
DEV_INIT_VERSION=$(git show origin/dev:agent_docstrings/__init__.py | grep '^__version__ = ' | awk -F'"' '{print $2}')
134+
HEAD_INIT_VERSION=$(grep '^__version__ = ' agent_docstrings/__init__.py | awk -F'"' '{print $2}')
135+
136+
if [ "$DEV_INIT_VERSION" != "$HEAD_INIT_VERSION" ]; then
137+
echo "::error::Version in agent_docstrings/__init__.py was changed in a PR to dev. (dev: $DEV_INIT_VERSION, HEAD: $HEAD_INIT_VERSION)"
138+
echo "Version bumping should only happen in a release PR to master."
139+
exit 1
140+
fi
141+
echo "Version check passed for agent_docstrings/__init__.py"
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Release Automation
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
create_release:
10+
# We only run it for merge commits from branches release/*
11+
if: startsWith(github.event.head_commit.message, 'Merge pull request') && contains(github.event.head_commit.message, 'from release/')
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write # to create tags and releases
15+
pull-requests: write # to create PR
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
with:
20+
# I need a complete history to read the tags and create a PR
21+
fetch-depth: 0
22+
23+
- name: Get Version
24+
id: get_version
25+
run: |
26+
# Извлекаем версию из pyproject.toml
27+
version=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
28+
echo "version=${version}" >> $GITHUB_OUTPUT
29+
30+
- name: Extract Changelog Notes
31+
id: changelog
32+
uses: mindsers/changelog-reader-action@v2
33+
with:
34+
version: ${{ steps.get_version.outputs.version }}
35+
path: ./CHANGELOG.md
36+
37+
- name: Create GitHub Release
38+
id: create_release
39+
uses: actions/create-release@v1
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
with:
43+
tag_name: v${{ steps.get_version.outputs.version }}
44+
release_name: v${{ steps.get_version.outputs.version }}
45+
body: ${{ steps.changelog.outputs.changes }}
46+
draft: false
47+
prerelease: false
48+
49+
- name: Create back-merge PR to dev
50+
uses: repo-sync/pull-request@v2
51+
with:
52+
source_branch: "master"
53+
destination_branch: "dev"
54+
pr_title: "Post-Release: Merge master back into dev"
55+
pr_body: "Automated PR to sync master back into dev after release v${{ steps.get_version.outputs.version }}."
56+
github_token: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG.md

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

1717
## [NextRelease]
1818

19+
### Header
20+
21+
- **subtitle**: describtion
22+
23+
## [1.3.4]
24+
25+
### Fixed
26+
27+
- **Deterministic Processing**: Fixed a critical bug that caused line numbers in the table of contents to change on every run. This was due to inconsistent newline handling after removing an existing agent docstring. The process is now fully idempotent.
28+
- **Robust Docstring Removal**: Improved the detection logic to correctly find and remove all agent-generated docstrings, even when located in the middle of a file or when multiple (erroneous) docstrings were present. This prevents docstring duplication on repeated runs.
29+
- **Manual Docstring Preservation**: Ensured that manual docstrings are no longer reformatted or modified unless they are being merged with an agent-generated table of contents.
30+
- **Version-Only Change Skipping**: Fixed a bug where files were being unnecessarily modified when only the version number in the auto-generated header differed, while the actual content structure remained unchanged. The tool now performs normalized content comparison that ignores version differences, preventing unnecessary file modifications after Agent Docstrings version updates.
31+
32+
### Documentation
33+
34+
- **Contribution Guide**: Added a new `CONTRIBUTING.md` file with detailed guidelines for development workflow and the release process.
35+
- **README Update**: Updated `README.md` to link to the new contribution guide and reflect the automated release process.
36+
37+
### CI/CD
38+
39+
- **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.
40+
- **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.
41+
- **Workflow Efficiency**: Changed CI triggers to run on pushes to `dev` instead of `master`, eliminating duplicate test runs while maintaining comprehensive coverage.
42+
- **Version Check Precision**: Improved the version bump detection in CI to specifically check version changes in `pyproject.toml` and `agent_docstrings/__init__.py`, preventing false positives from other file modifications.
43+
1944
## [1.3.3]
2045

2146
### Fixed
@@ -154,36 +179,3 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
154179
- **Programmatic API**: Import and use in other Python projects
155180
- **Safe operation**: Only modifies auto-generated docstring blocks, preserves existing documentation
156181
- **Incremental updates**: Only processes files when changes are detected
157-
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)

0 commit comments

Comments
 (0)