Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 26, 2025

fixes: #181

This PR implements automatic GitHub issue creation and management for fuzzing job failures in scheduled workflows. When fuzzing jobs fail during the weekly scheduled runs, the system automatically creates new issues or adds comments to existing ones with proper error handling and repository-standard labeling.

Key Features

  • Automatic Issue Management: Creates new issues for fuzzing failures or comments on existing open fuzzing issues
  • Scheduled-Only Execution: Issues are only created for scheduled cron job failures, not PR runs
  • Enhanced Label-Based Filtering: Uses area/fuzzing label for precise issue identification instead of title pattern matching
  • Proper Labeling: Uses repository-standard labels (area/testing, kind/bug, area/fuzzing, lifecycle/needs-review)
  • Testing Support: Includes --repo parameter for testing against different repositories
  • Error Handling: Graceful fallback when GitHub API operations fail

Implementation

The notification system is implemented as an additional step in the main fuzzing job that runs only on failure (if: failure()). All fuzzing steps from the reusable workflow have been inlined directly into Fuzzing.yml to ensure the notification only triggers for scheduled runs, maintaining the matrix strategy for different fuzzing targets (fuzz_host_print, fuzz_guest_call, fuzz_host_call).

The script searches for existing open issues with the area/fuzzing label and either adds a comment to the most recent one or creates a new issue with comprehensive details including workflow run links and next steps for investigation. The label-based filtering approach eliminates pagination concerns and ensures reliable issue management by using precise label queries instead of title pattern matching.

  • Move fuzzing failure notification from reusable workflow to scheduled workflow
  • Add --repo parameter support for testing
  • Update label from kind/fuzzing to area/fuzzing for consistency
  • Rename variables for clarity: TESTING_LABEL and FUZZING_LABEL

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@Copilot Copilot AI changed the title [WIP] Cron jobs need to alert on failure Add automatic issue creation for fuzzing job failures Aug 26, 2025
@Copilot Copilot AI requested a review from jsturtevant August 26, 2025 23:12
Copilot finished work on behalf of jsturtevant August 26, 2025 23:12
@Copilot Copilot AI changed the title Add automatic issue creation for fuzzing job failures Add automatic issue creation for scheduled fuzzing job failures Aug 27, 2025
@Copilot Copilot AI requested a review from jsturtevant August 27, 2025 21:41
Copilot finished work on behalf of jsturtevant August 27, 2025 21:41
@jsturtevant
Copy link
Contributor

@copilot address feedback

@Copilot Copilot AI requested a review from jsturtevant August 27, 2025 22:04
Copilot finished work on behalf of jsturtevant August 27, 2025 22:04
Copilot finished work on behalf of jsturtevant August 27, 2025 22:09
Copy link
Contributor Author

Copilot AI commented Aug 27, 2025

@copilot address feedback

I've addressed the feedback by reverting to the inline approach where fuzzing steps are directly in Fuzzing.yml and the notification runs as an additional step (not a separate job) only on failure. The script includes --repo parameter support for testing as requested.

Copilot finished work on behalf of jsturtevant August 27, 2025 22:24
Copilot finished work on behalf of jsturtevant August 27, 2025 22:32
@jsturtevant jsturtevant force-pushed the copilot/fix-181 branch 2 times, most recently from deed6c7 to e29625c Compare August 28, 2025 20:38
@jsturtevant jsturtevant added the kind/enhancement For PRs adding features, improving functionality, docs, tests, etc. label Aug 28, 2025
@jsturtevant jsturtevant marked this pull request as ready for review August 28, 2025 20:39
@jsturtevant jsturtevant requested a review from danbugs as a code owner August 28, 2025 20:39
@jsturtevant
Copy link
Contributor

jsturtevant commented Aug 28, 2025

I tested running the script against my fork jsturtevant#3

closed https://github.com/jsturtevant/hyperlight-1/issues?q=is%3Aissue%20state%3Aclosed

ludfjig
ludfjig previously approved these changes Aug 28, 2025
@Copilot Copilot AI changed the title Add automatic issue creation for scheduled fuzzing job failures Add automatic issue creation for scheduled fuzzing job failures with enhanced label-based filtering Aug 28, 2025
Copilot finished work on behalf of jsturtevant August 28, 2025 22:25
Copy link
Contributor

@ludfjig ludfjig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kind/fuzzing -> area/fuzzing

@Copilot Copilot AI changed the title Add automatic issue creation for scheduled fuzzing job failures with enhanced label-based filtering Add automatic issue creation for scheduled fuzzing job failures with area/fuzzing label filtering Aug 29, 2025
Copilot finished work on behalf of jsturtevant August 29, 2025 18:31
@Copilot Copilot AI requested a review from jsturtevant August 29, 2025 18:31
@jsturtevant
Copy link
Contributor

@copilot look at the feedback

@Copilot Copilot AI requested a review from jsturtevant August 29, 2025 21:13
Copilot finished work on behalf of jsturtevant August 29, 2025 21:13
Copilot AI and others added 8 commits August 29, 2025 21:47
- Created dev/notify-fuzzing-failure.sh script to handle GitHub issue creation/updates
- Modified Fuzzing.yml and dep_fuzzing.yml workflows to add failure notifications
- Added proper permissions for issue creation and comments
- Script checks for existing open fuzzing failure issues and either creates new ones or adds comments
- Includes robust error handling and test mode for validation

Co-authored-by: jsturtevant <[email protected]>
… workflow

- Removed notification step and issues permission from dep_fuzzing.yml (reusable workflow)
- Added separate notify-failure job to Fuzzing.yml (scheduled workflow)
- This ensures issues are only created for scheduled cron job failures, not PR runs

Co-authored-by: jsturtevant <[email protected]>
- Added --repo "$REPO" to gh issue comment command (line 103)
- Added --repo "$REPO" to gh issue create command (line 148)
- This enables testing against specific repositories by setting the REPO variable

Co-authored-by: jsturtevant <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement For PRs adding features, improving functionality, docs, tests, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cron jobs need to alert on failure
3 participants