Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request refactors label-checking logic to improve code reusability and adds validation to prevent rescuing jobs not generated by myshoes. The changes extract duplicate label validation logic into a centralized utility function and ensure the system always adds the "dependabot" label for compatibility.
- Extracts duplicate label-checking logic into a reusable
IsRequestedMyshoesLabelfunction - Adds label validation to the rescue job process to skip jobs without appropriate myshoes labels
- Updates runner setup to always include the "dependabot" label regardless of GitHub URL configuration
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/gh/label.go | New utility function for checking if jobs have appropriate myshoes labels |
| pkg/web/webhook.go | Replaces local label checking with the new centralized function |
| pkg/starter/starter.go | Adds label validation to rescue job processing with logging |
| pkg/starter/scripts.go | Simplifies label assignment to always include "dependabot" label |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes: #228
dependabotlabel.Summary (generated)
This pull request refactors label-checking logic to improve code reusability and maintainability. The key changes include introducing a new utility function
IsRequestedMyshoesLabelin thepkg/gh/label.gofile and replacing duplicate label-checking logic with calls to this function across the codebase.Refactoring and code reuse:
IsRequestedMyshoesLabelfunction inpkg/gh/label.goto encapsulate the logic for checking if a job has appropriate labels (myshoes,self-hosted, ordependabot).pkg/web/webhook.gowith a call to the newgh.IsRequestedMyshoesLabelfunction, removing the redundantisRequestedMyshoesLabelfunction. [1] [2]Functional changes:
enqueueRescueRunfunction inpkg/starter/starter.goto skip rescue jobs without the required labels by using the newgh.IsRequestedMyshoesLabelfunction. This adds logging for skipped jobs.Minor adjustments:
githubURLvariable inpkg/starter/scripts.goand adjusted related code for label handling. [1] [2]