-
Notifications
You must be signed in to change notification settings - Fork 61
create pr for version bump gh bot #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
the-roaring
merged 19 commits into
main
from
miguel/stg-513-auto-merge-gh-actions-publish-pr
Jun 29, 2025
Merged
Changes from 12 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
950dd9a
create pr for version bump gh bot
miguelg719 e35223b
add python-semantic-release config to pyproject.toml
the-roaring 916ce9a
track version variables with psr instead of bumpversion
the-roaring c2da2e0
set major_on_zero to false for now
the-roaring 8494b09
fix semantic-release configs
the-roaring 2c53673
add excluded conventional commit patterns
the-roaring a87601a
format changelog as .rst
the-roaring db8cc3e
fix toml formatting
the-roaring 14de1a4
add python-semantic-release github action
the-roaring 65adcd1
fix package version variable to match pyproject version
the-roaring 2086a55
add changeset scripts and github action
the-roaring e7c8eca
add testing script for the changesets tool
the-roaring d165779
revert python-semantic-release related changes
the-roaring 4b4d4a5
remove bumpversion
the-roaring f3157f7
deprecate old publish workflow
the-roaring 91b620e
copy in workflows from pychangeset
the-roaring d67b5c3
add pychangeset to repo
the-roaring 476b885
change version variable to single source from pyproject.toml
the-roaring 84891b9
ruff fix
the-roaring File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,122 @@ | ||
# Testing the Changeset System | ||
|
||
This document explains how to test the changeset system implementation. | ||
|
||
## Quick Test | ||
|
||
Run the automated test suite: | ||
```bash | ||
./test_changesets.py | ||
# or | ||
python3 test_changesets.py | ||
``` | ||
|
||
This will: | ||
1. Backup your current files | ||
2. Test all components of the changeset system | ||
3. Restore your files to their original state | ||
4. Show a summary of test results | ||
|
||
## Manual Testing | ||
|
||
### 1. Create a Changeset | ||
|
||
```bash | ||
# Interactive mode | ||
./changeset | ||
|
||
# Or with parameters | ||
python3 .changeset/scripts/changeset.py --type patch --message "Fixed a bug" | ||
``` | ||
|
||
### 2. Test Version Bumping | ||
|
||
```bash | ||
# Dry run to see what would happen | ||
python3 .changeset/scripts/version.py --dry-run | ||
|
||
# Actually bump the version | ||
python3 .changeset/scripts/version.py | ||
``` | ||
|
||
### 3. Test Changelog Generation | ||
|
||
```bash | ||
# Dry run to preview changelog | ||
python3 .changeset/scripts/changelog.py --dry-run | ||
|
||
# Generate changelog | ||
python3 .changeset/scripts/changelog.py | ||
``` | ||
|
||
### 4. Test Pre-commit Hooks | ||
|
||
```bash | ||
# Validate changeset files | ||
python3 .changeset/scripts/validate-changesets.py .changeset/*.md | ||
|
||
# Check if changeset exists (will fail on main branch) | ||
python3 .changeset/scripts/check-changeset.py | ||
``` | ||
|
||
## GitHub Actions Testing | ||
|
||
The GitHub Actions will trigger when: | ||
1. **Push to main**: Creates/updates a "Version Packages" PR | ||
2. **Merge version PR**: Publishes to PyPI and creates GitHub release | ||
|
||
To test locally: | ||
1. Create a feature branch | ||
2. Make some changes | ||
3. Create a changeset: `./changeset` | ||
4. Commit and push | ||
5. Open PR to main | ||
6. When merged, the actions will run | ||
|
||
## Expected Behavior | ||
|
||
### Changeset Creation | ||
- Creates a markdown file in `.changeset/` with a random name | ||
- File contains package name, change type, and description | ||
- Shows changed files compared to main branch | ||
|
||
### Version Bumping | ||
- Reads all changesets | ||
- Determines version bump (major > minor > patch) | ||
- Updates version in `pyproject.toml` and `__init__.py` | ||
- Archives processed changesets | ||
- Creates data file for changelog generation | ||
|
||
### Changelog Generation | ||
- Reads changeset data from version script | ||
- Generates formatted changelog entry | ||
- Updates CHANGELOG.md with new version section | ||
- Groups changes by type (major/minor/patch) | ||
|
||
### GitHub Actions | ||
- `changesets.yml`: Runs on push to main | ||
- `changeset-publish.yml`: Runs when version PR is merged | ||
- Creates PR with version bumps and changelog updates | ||
- Publishes to PyPI when PR is merged | ||
|
||
## Troubleshooting | ||
|
||
### "No changeset found" error | ||
- Make sure you're not on main/master branch | ||
- Create a changeset with `./changeset` | ||
- Check `.changeset/` directory for `.md` files | ||
|
||
### Version not bumping correctly | ||
- Check `.changeset/config.json` is valid JSON | ||
- Ensure changesets have correct format | ||
- Look for error messages in script output | ||
|
||
### Changelog not generating | ||
- Make sure version script ran first | ||
- Check for `.changeset/.changeset-data.json` | ||
- Verify CHANGELOG.md exists or will be created | ||
|
||
### Pre-commit hooks not working | ||
- Install pre-commit: `pip install pre-commit` | ||
- Set up hooks: `pre-commit install` | ||
- Run manually: `pre-commit run --all-files` |
This file contains hidden or 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,64 @@ | ||
# Changesets | ||
|
||
This directory contains changeset files that track changes to the codebase. The changeset system is inspired by the JavaScript changesets tool but adapted for Python projects. | ||
|
||
## How it works | ||
|
||
1. **Creating a changeset**: When you make changes that should be included in the changelog, run: | ||
```bash | ||
python .changeset/scripts/changeset.py | ||
# or use the wrapper script: | ||
./changeset | ||
``` | ||
|
||
This will prompt you to: | ||
- Select the type of change (major, minor, or patch) | ||
- Provide a description of the change | ||
|
||
A markdown file will be created in this directory with a random name like `warm-chefs-sell.md`. | ||
|
||
2. **Version bumping**: The GitHub Action will automatically: | ||
- Detect changesets in PRs to main | ||
- Create or update a "Version Packages" PR | ||
- Bump the version based on the changesets | ||
- Update the CHANGELOG.md | ||
|
||
3. **Publishing**: When the "Version Packages" PR is merged: | ||
- The package is automatically published to PyPI | ||
- A GitHub release is created | ||
- The changesets are archived | ||
|
||
## Changeset format | ||
|
||
Each changeset file looks like: | ||
```markdown | ||
--- | ||
"stagehand": patch | ||
--- | ||
|
||
Fixed a bug in the browser automation logic | ||
``` | ||
|
||
## Configuration | ||
|
||
The changeset behavior is configured in `.changeset/config.json`: | ||
- `baseBranch`: The branch to compare against (usually "main") | ||
- `changeTypes`: Definitions for major, minor, and patch changes | ||
- `package`: Package-specific configuration | ||
|
||
## Best practices | ||
|
||
1. Create a changeset for every user-facing change | ||
2. Use clear, concise descriptions | ||
3. Choose the appropriate change type: | ||
- `patch`: Bug fixes and small improvements | ||
- `minor`: New features that are backwards compatible | ||
- `major`: Breaking changes | ||
|
||
## Workflow | ||
|
||
1. Make your code changes | ||
2. Run `./changeset` to create a changeset | ||
3. Commit both your code changes and the changeset file | ||
4. Open a PR | ||
5. The changeset will be processed when the PR is merged to main |
This file contains hidden or 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,26 @@ | ||
{ | ||
"baseBranch": "main", | ||
"changelogFormat": "markdown", | ||
"access": "public", | ||
"commit": false, | ||
"changeTypes": { | ||
"major": { | ||
"description": "Breaking changes", | ||
"emoji": "💥" | ||
}, | ||
"minor": { | ||
"description": "New features", | ||
"emoji": "✨" | ||
}, | ||
"patch": { | ||
"description": "Bug fixes", | ||
"emoji": "🐛" | ||
} | ||
}, | ||
"package": { | ||
"name": "stagehand", | ||
"versionPath": "stagehand/__init__.py", | ||
"versionPattern": "__version__ = \"(.*)\"", | ||
"pyprojectPath": "pyproject.toml" | ||
} | ||
} |
This file contains hidden or 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,5 @@ | ||
--- | ||
"stagehand": patch | ||
--- | ||
|
||
Test manual changeset creation | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's just start with an empty changelog