You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
adding a linked pre-triage / linked issue check - #51034
the linked issues in the description, commits, and manually linked must all be the same and open issues.
only manually linked issues, which can only be manipulated by contributors, may contain references to other repos - or that could be disallowed as well.
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:
the handling may need to be relaxed for forks
could be changed to not run on a draft
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.
Based upon the meeting and initial copilot reviews, I've updated this more.
PRs are required to have at least 1 linked open issue that exists in the Keycloak repository. It must be present in both the description and the commit messages.
If there is no linked issue, linked to a closed issue, linked to non-issues, or linked to issues in another repo, then the pr will be marked as status/waiting-for-author and a comment added which points out what is wrong and links to the contributing guide.
the only exception to this is if a closed issue is marked as "status/expired-by-bot" - if there are no other problems, a status/issue-expired label will be added
The detection of linked issues is still based upon the github keywords, as described in the PR description
There is now also a workflow for closing or reopening issues. If an issue is closed, and not via expiration, then all linked PRs will be closed. If the issue is marked as expired, then the linked prs are marked as status/issue-expired. If an expired issue is reopened, then the status/expired-by-bot label will be removed from linked prs.
no special accommodation is yet being made for drafts
Not part of this PR - a timed job would then be responsible for checking for the status/waiting-for-author label and auto-closing if that label has existed for more than X amount of time. I would suggest deferring that work in any case just to ensure that the labeling and limited closing of this PR is working as expected.
Thanks for the PR. A general comment: It would be nice to have those scripts as real shell scripts, possibly with a dry-run mode to be able to run them as a developer in a more simple way.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Critical automation defects bypass issue-state validation and can incorrectly close PRs due to cross-repository issue mismatches or suppressed label-request failures.
# Match GitHub closing keywords followed by a same-repo (#NNN),
# cross-repo (owner/repo#NNN), or URL issue reference.
while (/(?i:\b(?:close|closes|closed|fix|fixes|fixed|resolve|resolves|resolved)\b):?[ \t]+(?:(?:(?<cro>[\w-]+)\/(?<crr>[\w-]+)#)|#|(?:https:\/\/github\.com\/(?<urlo>[\w-]+)\/(?<urlr>[\w-]+)\/issues\/))(?<num>\d+)\b/g) {
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Case-sensitive repository matching, incorrect linked-issue state and expiration handling, and incomplete label pagination can reject valid references, mislabel PRs, or close exempt PRs.
Reopening one issue unconditionally clears the PR's expired-issue label, even when another linked issue remains closed with status/expired-by-bot. Recompute expiration across all linked issues before removing the label, matching the aggregate check in pre-triage-pr.sh.
Paginate labels before checking exemptions
.github/scripts/issue-closure.sh:189
These labels come from labels(first: 20), so skip-issue-check is ignored if it falls beyond that page and an exempt PR can be closed. Fetch all labels with pagination before deciding whether to close the PR.
Check external issue state before exemption
.github/scripts/pre-triage-pr.sh:199
The cross-repository exemption skips the issue-state check as well as description consistency. A PR with a valid local issue and a manually linked, closed external issue therefore passes, contrary to the requirement that all linked issues be open; validate state before applying the cross-repository exemption.
Compare repository names case-insensitively
.github/scripts/pre-triage-pr.sh:212
Repository names are case-insensitive on GitHub, but this comparison rejects valid references such as Closes https://github.com/Keycloak/Keycloak/issues/123 as cross-repository links. Normalize repository casing in extracted references and comparisons before checking membership against the canonical GraphQL references.
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
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.