-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Add notify-addon-owners.sh for disabled workflow notifications, fixes ddev/ddev#7597 #5
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
base: main
Are you sure you want to change the base?
Conversation
- New script monitors DDEV add-on repositories for disabled test workflows - Creates GitHub issues to notify repository owners with actionable links - Implements smart notification logic with rate limiting and cooldown periods - Uses dry-run mode for safe testing without affecting repositories - Provides clear error messages for permission/repository access issues - Filters by organization and includes fallback for GitHub search delays ### Technical Details - Monitors repositories with `ddev-get` topic plus critical DDEV infrastructure - Detects disabled workflows using GitHub API - Creates issues with direct workflow re-enablement links - Maximum 2 notifications per repository with 30-day intervals - 60-day cooldown after issue closure - Automatically closes issues when workflows are re-enabled - Handles repositories without test workflows gracefully ### Testing - Dry-run mode shows what would be done without taking action - Organization filtering works correctly (--org=ddev-test, --org=ddev, etc.) - Proper error handling for disabled issues and token permissions - Fallback enumeration when GitHub search indexing is delayed 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…bles - MAX_NOTIFICATIONS, NOTIFICATION_INTERVAL_DAYS, and RENOTIFICATION_COOLDOWN_DAYS can now be set via environment variables - Defaults remain the same (2, 30, 60 respectively) - Enables testing and customization without modifying the script 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Instead of just closing issues, now adds a comment explaining the closure first - Improved dry-run message to be more descriptive about the action - Provides better context to repository owners when issues are resolved 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…sed title system - Removed label dependency from API calls to avoid permission issues - Added date-based title filtering to handle old issues that don't follow new format - Improved error handling for invalid JSON responses in dry-run mode - Fixed variable declaration and assignment separation for better shellcheck compliance - Updated issue title to include date for unique tracking: '⚠️ DDEV Add-on Test Workflows Suspended (YYYY-MM-DD)' 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Fixed variable declaration and assignment separation throughout the script - Removed unused variable current_date from main function - All shellcheck warnings are now resolved 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Documents environment variables for testing - Provides testing scenarios for disabled workflows - Includes testing for notification timing and issue management - Adds debugging instructions and GitHub token requirements - Enables easier testing and development of the script 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Added 2>/dev/null redirection to jq commands to suppress parsing errors - Fixed issues where API responses sometimes returned strings instead of JSON objects - Improved error handling for edge cases in GitHub API responses - Script now runs cleanly without jq errors when NOTIFICATION_INTERVAL_DAYS=0 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Use GitHub API search for finding issues instead of filtering all issues locally - Simplify logic to comment on any existing open issue instead of creating duplicates - Update issue titles with [RESOLVED] prefix when closing resolved issues - Handle both disabled_manually and disabled_inactivity workflow states - Remove label creation to avoid permission issues on external repositories - Add better error handling for API responses - Clean up output to suppress noisy JSON responses 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
@stasadev you don't have to look too carefully, but putting it front of you anyway. It seems to be working well in the places I've tried it. I did it live against Lullabot's add-on. |
- Changed has_test_workflows() to specifically look for 'tests' workflow - Changed has_disabled_test_workflows() to check only 'tests' workflow state - Eliminates false positives from other disabled workflows (like 'Colima tests') - Provides more accurate detection of disabled test workflows for DDEV add-ons 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
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.
Looks good to me.
- Add rate limit tracking from GitHub API headers - Implement gh_api_safe() function that returns exit code 2 for rate limits - Add rate limit monitoring before each API call - Gracefully handle rate limit errors by skipping problematic repositories - Display rate limit status after each repository processed - Prevent script from exiting due to rate limit errors - Continue processing other repositories when one hits rate limits 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add search_failed flag to skip issue operations when search API fails - Implement dual rate limit tracking for core API (5000/hour) vs search API (30/minute) - Add --start-repo option to resume processing from nth repository - Improve rate limit header extraction with proper temp file handling - Add repository numbering display for better progress tracking - Prevent duplicate issues when rate limits prevent existing issue search 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
I think I'll leave this along and pull it after we ping again in a month or so. This had some bad duplicate creation problems even though that had been carefully manually tested. |
Fixes it at least as far as we're going for now.
Technical Details
ddev-get
topic plus critical DDEV infrastructureTesting
🤖 Generated with Claude Code