Skip to content

rafalkaliszczuk/git-nudge

Repository files navigation

⏳ git-nudge

CI/CD Pipeline License: MIT Python 3.11+ Docker Image

git-nudge is a lightweight, modular automation tool designed to remind your team about inactive Merge Requests (MRs) or Pull Requests (PRs). It sends clean, actionable reports to your communication channels (like Slack), ensuring no code review is left behind.


✨ Features

  • 🦊 GitLab Support: Fetch stale Merge Requests from any project.
  • 🐙 GitHub Support: Coming soon! 🚀
  • 💬 Slack Integration: Beautifully formatted Slack blocks with author and assignee info.
  • 🕒 Smart Filtering: Only notify about requests inactive for a specific number of days.
  • 📦 Docker Ready: Run it anywhere without Python dependency.
  • 🛠️ Modular Architecture: Easy to add new providers or notifiers (Discord, Teams).

🚀 Quick Start

Docker (Recommended)

Run it immediately using Docker (replace with your variables or use .env file):

docker run --env-file .env rkali77/git-nudge:latest

Manual Installation

pip install git+https://github.com/rafalkaliszczuk/git-nudge.git
git-nudge

🛠️ Configuration

Configure git-nudge using environment variables. You can use a .env file for local development.

Core Settings

Variable Description Default
STALE_THRESHOLD_DAYS Days of inactivity before a request is considered "stale" 2
REQUESTS_DISPLAY_LIMIT Maximum number of requests to show in one notification 5

🦊 GitLab Provider

Variable Description Example
GITLAB_TOKEN Personal Access Token with read_api scope glpat-XXXXXXXX
GITLAB_PROJECT_ID Your GitLab Project ID 123456
GITLAB_API_URL Custom GitLab instance URL (optional) https://gitlab.example.com/api/v4

💬 Slack Notifier

Variable Description Example
SLACK_WEBHOOK_URL Incoming Webhook URL https://hooks.slack.com/services/...

🤖 Deployment Examples

GitLab CI/CD (Scheduled)

Add this to your .gitlab-ci.yml to run the nudge every morning using the Docker image:

stages:
  - notify

stale-mr-nudge:
  stage: notify
  image:
    name: rkali77/git-nudge:latest
    entrypoint: [""]
  script:
    - git-nudge
  rules:
    - if: $CI_PIPELINE_SOURCE == "schedule"
    - if: $CI_PIPELINE_SOURCE == "web"

How to set up the Schedule in GitLab:

  1. Navigate to your project and go to Build > Pipeline schedules.
  2. Click New schedule.
  3. Enter the Cron schedule (e.g., 0 9 * * 1-5 for 9:00 AM every weekday).
  4. Select the Target branch (e.g., main).
  5. Click Save pipeline schedule.
  6. Important: Go to Settings > CI/CD > Variables and add all required variables (GITLAB_TOKEN, SLACK_WEBHOOK_URL, etc.) so the pipeline can access them.

For more details, see the official GitLab Pipeline Schedules documentation.


🧪 Development & Testing

We use uv for fast, reliable dependency management.

# Setup environment
uv sync --extra dev

# Run tests
uv run pytest -v

# Run linting/formatting
uv run pre-commit run --all-files

🤝 Contributing

Contributions are welcome! Whether it's adding a new provider (GitHub, Bitbucket) or a new notifier (Teams, Discord), feel free to open a PR.

  1. Fork the repo.
  2. Create your feature branch (git checkout -b feature/amazing-feature).
  3. Commit your changes (git commit -m 'Add some amazing feature').
  4. Push to the branch (git push origin feature/amazing-feature).
  5. Open a Pull Request.

📄 License

Distributed under the MIT License. See LICENSE for more information.

About

GitNudge is a lightweight Python tool that helps teams keep pull requests moving. It automatically detects inactive GitHub Pull Requests and GitLab Merge Requests and sends friendly Slack reminders, so nothing important gets stuck or forgotten. Designed to be simple, configurable, and easy to integrate into existing workflows.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors