Monitoring tools for DDEV add-ons
This repository provides scripts for monitoring DDEV add-ons and their test workflows:
check-addons.sh- Monitors scheduled GitHub Actions workflowsnotify-addon-owners.sh- Notifies owners about disabled test workflows
Both scripts monitor the same set of repositories:
- Topic-based repositories: All repositories with the
ddev-gettopic - Critical DDEV infrastructure: Key repositories like
ddev/ddev,ddev/github-action-add-on-test, etc. - Additional repositories: Configurable list via command line
Monitors DDEV repositories by checking their scheduled GitHub Actions workflows for recent successful runs.
Basic usage:
./check-addons.sh --github-token=<token> --org=ddevAdd additional repositories to monitor:
./check-addons.sh --github-token=<token> --org=ddev --additional-github-repos="owner/repo1,owner/repo2,owner/repo3"--github-token=TOKEN- GitHub personal access token (required)--org=ORG- GitHub organization to filter by (use "all" for all orgs)--additional-github-repos=REPOS- Comma-separated list of additional repositories to monitor
0- All monitored repositories have recent successful scheduled runs1- One or more repositories have failed scheduled runs2- One or more repositories haven't had scheduled runs within the last day3- One or more repositories have no scheduled runs configured5- GitHub token not provided
Notifies repository owners when their test workflows are disabled. Uses GitHub issues for tracking notification history to avoid spamming owners.
Test without taking action:
./notify-addon-owners.sh --github-token=<token> --dry-runBasic usage:
./notify-addon-owners.sh --github-token=<token> --org=ddevTest specific owner's repositories:
./notify-addon-owners.sh --github-token=<token> --org=myusername --dry-run--github-token=TOKEN- GitHub personal access token (required)--org=ORG- GitHub organization to filter by--additional-github-repos=REPOS- Comma-separated list of additional repositories to monitor--dry-run- Show what would be done without taking action--help- Show help information
- Issue-based tracking: Uses GitHub issues to track notification history
- Rate limiting: Maximum 2 notifications per repository with 30-day intervals
- Cooldown period: 60-day cooldown after issue closure to handle repeated disabling
- Automatic cleanup: Closes issues when workflows are re-enabled
- Dry-run mode: Test functionality without affecting real repositories
- First notification: Creates an issue with
automated-notificationandddev-addon-testlabels - Follow-up notifications: Adds comments to existing issues (max 2 total notifications)
- Cooldown period: Waits 60 days after issue closure before re-notifying
- Automatic resolution: Closes issues when workflows are re-enabled
The script identifies repositories that lack test workflows and provides information for manual follow-up:
- Suggests adding test workflows
- Recommends removing the
ddev-gettopic if tests won't be added
This tool only targets public repositories and needs to search/list and create/close issues.
-
Classic PAT (recommended for cross-org/public repos):
- public_repo
-
Fine-grained PAT:
- Repository access: All repositories in the target org(s) or the specific repositories you’ll monitor
- Permissions:
- Issues: Read and Write
- Metadata: Read-only
- Actions: Read-only (optional; not strictly required for reading workflow state on public repos)
Notes
- The Search API for public data does not require special scopes; authenticating primarily increases rate limits.
- Creating/closing issues in public repositories requires public_repo for Classic PAT; no org admin scopes are needed.
- Some repositories may restrict who can open issues (interaction limits or disabled issues). The script handles permission errors gracefully, but no additional scopes can bypass repo-level restrictions.
Usage
- Provide the token via
GITHUB_TOKEN, for example:export GITHUB_TOKEN=ghp_...
The script supports several environment variables for testing and configuration:
NOTIFICATION_INTERVAL_DAYS- Days between notifications (default: 30)RENOTIFICATION_COOLDOWN_DAYS- Days to wait after issue closure before re-notifying (default: 60)
Use the ddev-test organization which contains repositories with disabled workflows:
# Dry run to see what would be done
./notify-addon-owners.sh --github-token=<token> --org=ddev-test --dry-run
# Real run (will create issues if needed)
./notify-addon-owners.sh --github-token=<token> --org=ddev-testTo test the notification timing without waiting for the default intervals:
# Set notification interval to 0 days for immediate re-notification
NOTIFICATION_INTERVAL_DAYS=0 ./notify-addon-owners.sh --github-token=<token> --org=ddev-test --dry-run
# Set cooldown period to 0 days to test immediate re-notification after closure
RENOTIFICATION_COOLDOWN_DAYS=0 ./notify-addon-owners.sh --github-token=<token> --org=ddev-test --dry-runTest with a specific repository:
# Test a single repository
./notify-addon-owners.sh --github-token=<token> --additional-github-repos="owner/repo" --dry-runTo test issue creation and closing behavior:
- First run: Creates initial notification issue
- Re-enable workflows: Run again to see issue closing behavior
- Disable workflows again: Run with
NOTIFICATION_INTERVAL_DAYS=0to test re-notification
Use bash debug mode to troubleshoot issues:
bash -x ./notify-addon-owners.sh --github-token=<token> --org=ddev-test --dry-runThe script requires a GitHub personal access token with the following permissions:
- repo: Full access to repository information, issues, and workflows
- read:org: Read organization information (when using organization filters)
For creating issues, the token must have write permissions for the target repositories.