diff --git a/CHANGELOG.md b/CHANGELOG.md index 29b0a95..84addaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,4 +2,19 @@ Since releasing `v1.0.0`, we've significantly improved the app with stats tracking that shows total pushes and per-repo counts including skipped bot pushes at the `/stats` endpoint, added an improved documentation page with the stats URL, new logo icon, and screenshot example, and created a ping workflow that runs every 5 minutes to keep the Render service from suspending on the free tier. We also fixed a critical security issue by removing an exposed private key from git history using `git filter-repo`, properly set up the `test-repo` as a GitHub submodule with `.gitmodules` configuration, added type annotations to tests for better code quality, and updated the stats to track both user pushes and bot pushes separately. The app has gone through three releases: `v1.0.0` was the initial release, `v1.1.0` added stats tracking, and `v1.2.0` improved stats to include bot push tracking. -Added `REDIS_URL` environment variable support in `v1.3.0` to persist stats across service restarts using Render Key Value, updated the app to serve `docs/index.html` directly at the root `/` endpoint with endpoints `/images/logo.png` and `/app-screenshot.png` to serve images, and simplified the install button text to be more concise. \ No newline at end of file +Added `REDIS_URL` environment variable support in `v1.3.0` to persist stats across service restarts using Render Key Value, updated the app to serve `docs/index.html` directly at the root `/` endpoint with endpoints `/images/logo.png` and `/app-screenshot.png` to serve images, and simplified the install button text to be more concise. + +## Unreleased (2026-04-10) + +- Reduce PR branch history rewriting by only rewriting commit messages when a change is needed, and only for commits unique to the pushed branch (relative to the repository default branch). +- Skip rewriting the repository default branch entirely. +- Push rewritten history using `--force-with-lease` instead of `--force`. +- Update docs and webpage copy to reflect the safer behavior. +- Untrack accidentally committed `__pycache__/*.pyc` files. + +## v1.4.0 (2026-04-09) + +- Only rewrite new commits (relative to the repository default branch). +- Fix tests/mocks around the commit-rewrite behavior. +- Stop tracking Python `__pycache__/*.pyc` artifacts. +- Update changelog for the release. diff --git a/README.md b/README.md index 84c89be..73dc9a7 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,7 @@ To set up the app, start by creating a new GitHub App in your GitHub Settings un Next, install the app on your desired repository or organization. Then, set the required environment variables: `GITHUB_APP_ID` with your app's ID, `GITHUB_PRIVATE_KEY` with the content of the private key file (paste the entire PEM content), and `GITHUB_WEBHOOK_SECRET` with the webhook secret you generated. Run the app locally with `python github_app.py` for testing, or deploy it to a production server like Render, Heroku, or AWS, updating the webhook URL accordingly to ensure it's publicly accessible. -The app operates by receiving push webhooks from GitHub. When a push is made to a repository where the app is installed, GitHub sends a webhook payload to your deployed app endpoint. The app then generates an installation access token using the installation ID from the webhook, clones the repository using that token for authentication, checks out the affected branch, and executes `git filter-branch` to modify commit messages by removing " add ", " Add ", leading "add ", or leading "Add " phrases. Finally, it force pushes the rewritten history back to the branch, skipping actions if the push originated from a bot to prevent infinite loops. - -Be warned that this app rewrites git history, which is a destructive operation that can overwrite remote commits and affect collaborators. Always back up your repository before using it, and communicate with your team to avoid conflicts. +The app operates by receiving push webhooks from GitHub. When a push is made to a repository where the app is installed, GitHub sends a webhook payload to your deployed app endpoint. The app then generates an installation access token using the installation ID from the webhook, clones the repository using that token for authentication, checks out the affected branch, and identifies commits unique to it (relative to the default branch). It then modifies commit messages in these unique commits by removing " add ", " Add ", leading "add ", or leading "Add " phrases. Finally, it pushes the rewritten history back to the branch using `--force-with-lease`, skipping the repository's default branch and actions if the push originated from a bot to prevent infinite loops. The app requires Python 3.8 or later, along with the Flask, PyGitHub, and github-webhook libraries. Install these dependencies using `pip install -r requirements.txt`. @@ -28,4 +26,4 @@ To deploy on Render.com: - `GITHUB_PRIVATE_KEY`: The full content of your private key (PEM format) - `GITHUB_WEBHOOK_SECRET`: Your webhook secret 6. Deploy and note the service URL (e.g., `https://your-app.onrender.com`). -7. Update your GitHub App's webhook URL to `https://your-app.onrender.com/webhook`. \ No newline at end of file +7. Update your GitHub App's webhook URL to `https://your-app.onrender.com/webhook`. diff --git a/__pycache__/github_app.cpython-314.pyc b/__pycache__/github_app.cpython-314.pyc deleted file mode 100644 index 15a9a10..0000000 Binary files a/__pycache__/github_app.cpython-314.pyc and /dev/null differ diff --git a/docs/index.html b/docs/index.html index 172cdcb..07507b8 100644 --- a/docs/index.html +++ b/docs/index.html @@ -172,7 +172,7 @@
Auto-cleanup for commit messages
- Automatically removes "add" prefixes from commit messages when you push. Keep your git history clean without the manual work. + Automatically removes "add" prefixes from commit messages when you push. Only rewrites commit messages when a change is needed, and targets commits unique to your branch (relative to the repo default branch).
@@ -184,18 +184,19 @@