adding a linked pre-triage / linked issue check - #51034
Draft
shawkins wants to merge 2 commits into
Draft
Conversation
Signed-off-by: Steve Hawkins <shawkins@redhat.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds automated pre-triage validation for issue links in pull requests and commits.
Changes:
- Validates linked issues for consistency, repository, and open state.
- Posts failure comments and manages triage labels.
- Supports bypassing validation through a label.
| FAILED=0 | ||
| ERRORS="" | ||
| MARKER="<!-- pre-triage-linked-issues -->" | ||
| SKIP_LABEL="skip-issue-check" |
Comment on lines
+80
to
+82
| if ! commit_msg=$(gh api "repos/$REPO/git/commits/$sha" --jq '.message' 2>&1); then | ||
| add_error "Failed to retrieve commit message for $sha: $commit_msg" | ||
| continue |
Comment on lines
+131
to
+132
| CLOSING_ISSUES_REFERENCES_RAW=$( | ||
| gh api graphql \ |
| fi | ||
|
|
||
| # Find matching line: owner/repo#NNN<TAB>true|false | ||
| state_line=$(printf '%s\n' "$CLOSING_ISSUES_WITH_STATE" | grep -F -- "^$ref"$'\t' || true) |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Steven Hawkins <shawkins@redhat.com>
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.
Refinement of the previous pre-triage check - based in part on #50075 (review)
This removes:
As explained on https://github.com/keycloak/keycloak-ibm-team/issues/31#issuecomment-5004145360 this PR reflects the same understanding of issue linking (all closing keywords, optional colon, casing) that github has with the additional checks:
Violations to the above result in a comment on the PR highlighting what is wrong, a label is added to the PR, and the workflow fails. Alternatively a label can be added to skip this check.
See the comments in the script for some TODOs and other concerns - additional thoughts:
From here if you want to be more strict about the number of linked issues, the syntax used, etc. that can be added - but I would avoid assigning special meaning to keywords.