π€ :octocat: GStraccini-bot automates repository management, ensuring organization and health by handling pull requests, issues, comments, and commits.
π€ :octocat: GStraccini-bot is a GitHub bot designed to keep your repository organized and healthy by automating tasks like managing pull requests, issues, comments, and commits. This allows you to focus on solving real problems.
Live Dashboard Β· Documentation Β· Commands Reference Β· Install the Bot
GStraccini-bot automates essential repository tasks, managing pull requests, issues, comments, and commits to help maintain a clean, organized, healthy project environment. This lets you focus on development and problem-solving.
This repository contains the core daemon/workers for GStraccini-bot, available at bot.straccini.com.
To install the bot:
You can see an updated list of available commands by commenting @gstraccini help on a pull request or issue, or by browsing the documentation website.
GStraccini-bot can handle various tasks through chat commands β from managing pull requests to running linters, formatters, and CI/CD actions.
For the full, up-to-date list of commands and how to use them, see the Commands Reference on the documentation website.
[!NOTE] If you are not allowed to use the bot, a thumbs-down reaction will be added to your comment.
GStraccini-bot uses several components to manage repositories:
| Component | Description |
|---|---|
| API | The bot's API project. Stats and configuration endpoints. |
| Docs | The bot's documentation (website). |
| Handler | Handles incoming webhooks. |
| Service | The bot's service project. The main worker who processes tasks. |
| Website | Provides the bot's landing page and dashboard. |
| Workflows | Executes GitHub Actions. |
GStraccini-bot runs automated tasks at regular intervals on its infrastructure:
| Job | Status | Interval |
|---|---|---|
| Branches | π every 1 minute | |
| Comments | π every 1 minute | |
| Installations | π every 1 minute | |
| Issues | π every 1 minute | |
| Pull Requests | π every 1 minute | |
| Pushes | π every 1 minute | |
| Repositories | π every 1 minute | |
| Users | π every 1 minute |
Two of the workers above also reconcile the database with GitHub's actual state on a schedule, independently of webhook events (see ADR-0001):
| Sync | Runs from | When | What |
|---|---|---|---|
| Installations | Installations worker | ποΈ 1st of every month (or the first run after it) | Registers the app's installations, updates their account metadata, marks uninstalled ones, and re-lists the repositories of every installation never synced or last synced over 3 months ago (github_installations.LastSyncDate). |
| Repositories | Repositories worker | β° every hour, one repository | Takes the active repository with the oldest github_repositories.LastSyncDate, refreshes its metadata (name, visibility, owner) and reconciles its open pull requests, open issues and branches. |
Both can be run by hand, from the CLI or through POST /v1/jobs/{syncInstallations|syncRepositories}/:
php Src/Workers/syncInstallations.php [--installation=<id>] [--force] [--throttle=<seconds>] [--dry-run]
php Src/Workers/syncRepositories.php [--repository=<id>] [--limit=<n>] [--throttle=<seconds>] [--dry-run]
Use a bounded, non-retrying database connection for the token cache
https://github.com/guibranco/gstraccini-bot-service/issues/1206
Labels: π§βπ» tech-debt
Don't republish a database token to APCu after a concurrent eviction
https://github.com/guibranco/gstraccini-bot-service/issues/1205
Labels: π§βπ» tech-debt
Skip a rejected token when its database row can't be deleted
https://github.com/guibranco/gstraccini-bot-service/issues/1204
Labels: π§βπ» tech-debt
Evict only the rejected token generation on a delayed 401
https://github.com/guibranco/gstraccini-bot-service/issues/1203
Labels: π§βπ» tech-debt
Retry once with a fresh installation token after a 401
https://github.com/guibranco/gstraccini-bot-service/issues/1202
Labels: π§βπ» tech-debt
[FEATURE] Add pending actions notification when action is required
https://github.com/guibranco/gstraccini-bot-service/issues/1124
Labels: π documentation, enhancement, help wanted, π² database, pull request, π PHP, π·πΌ infrastructure, π§ͺ tests, hacktoberfest, π high effort, π API, settings, documentation, configuration changes
[FEATURE] Enable pull request action buttons from the check run when action is required
https://github.com/guibranco/gstraccini-bot-service/issues/1123
Labels: π bug, help wanted, good first issue, comments, pull request, π PHP, π§ͺ tests, hacktoberfest, π medium effort
[BUG] Validate token generation response in generateInstallationToken to prevent null return
https://github.com/guibranco/gstraccini-bot-service/issues/998
Labels: π bug, π under investigation
[FEATURE] Suggest labels for new issues using LLM and confirm with user
https://github.com/guibranco/gstraccini-bot-service/issues/927
Labels: π documentation, enhancement, help wanted, good first issue, π² database, comments, Issues, pull request, π PHP, integration, configuration, π·οΈ labels, π§ͺ tests, hacktoberfest, π very high effort, π§ AI, documentation
Thank you for your interest in contributing to GStraccini-bot-service! π This repository serves as the core/handler of the GStraccini-bot, processing messages and managing data in SQL tables. Your contributions ensure the bot remains efficient and reliable.
Follow these steps to start contributing:
Fork the Repository π΄: Fork the repository to your GitHub account.
Clone Your Fork π₯οΈ: Clone your forked repository locally using:
git clone https://github.com/your-username/gstraccini-bot-service.git
Set Up Your Environment π οΈ:
This project requires PHP 8.3.
Use Docker Compose for a fully functional local environment:
docker-compose up
Ensure your integrations are set up by creating or editing the secrets in the secrets/ directory.
Create a Branch πΏ: Create a branch for your feature or fix:
git checkout -b feature/your-feature-name
Code Standards π§Ή: Follow PSR-12 coding standards. Use linters to maintain code quality.
Testing π§ͺ:
All new features and fixes must include PHPUnit tests.
Run the test suite to ensure everything works:
vendor/bin/phpunit
Commit Messages π: Use clear, concise, and descriptive commit messages. Follow the Conventional Commits specification.
Documentation π: If your changes affect functionality, update or add relevant documentation.
Push Your Branch β¬οΈ: Push your changes to your forked repository:
git push origin feature/your-feature-name
Open a Pull Request π:
Work with Reviewers π₯:
Please follow our Code of Conduct to maintain a welcoming and inclusive environment for everyone.
secrets/ directory for local tests.If you encounter any issues or have questions, donβt hesitate to:
Your contributions are highly valued and appreciated! Thank you for helping improve GStraccini-bot-service. π
Happy coding! π