Repository navigation
Automatically link backport PRs to issues in Development - #95
Conversation
There was a problem hiding this comment.
Should not use the repository.mainRepository config option, but rather only link PRs to issue if they are in the same repo. Effectively only support Closes/fixes #issue, not the cross-repo approach.
Please extract the part that parses the body to pull out fixed issues into a separate utility, and also provide some unit test for that.
|
@stianst Should be ready for another review. |
There was a problem hiding this comment.
Add some more logging; when a PR is linked to an issue do a info level log that states what PR was linked to which issue.
When there is an error (make sure you catch all exceptions) log an error and include the PR that was causing issues. This makes it easier to debug the problem, but also allows to manually update the issue/PR links if we want to fix it.
There was a problem hiding this comment.
🔵 Needs a closer look
The GraphQL linking integration is tested only with mocked clients, leaving installation-authenticated webhook injection, linking to closed issues, and deployed App permissions unverified against GitHub.
No open issues 🎉
What changed in this PR
Automates Development-section links between release-branch backport PRs and referenced issues, addressing #94 and reducing manual tracking.
Changes:
- Adds GraphQL-based linking for open PRs targeting
release/*when opened, edited, or reopened. - Parses and deduplicates closing references from PR descriptions, accepting shorthand, repository-qualified references, and issue URLs within the same repository.
- Adds focused handler and parser tests, plus documentation of the feature’s behavior and scope.
| File | Description |
|---|---|
src/test/java/org/keycloak/gh/bot/utils/PullRequestParserTest.java |
Tests reference formats, repository filtering, deduplication, and invalid numbers. |
src/test/java/org/keycloak/gh/bot/LinkBackportPRsTest.java |
Tests event handling, linking eligibility, missing issues, and GraphQL errors. |
src/main/java/org/keycloak/gh/bot/utils/PullRequestParser.java |
Extracts valid, unique closing references for the current repository. |
src/main/java/org/keycloak/gh/bot/LinkBackportPRs.java |
Handles PR events and links eligible backports to issues through GraphQL. |
README.md |
Documents supported events, reference formats, and linking scope. |
Review effort: Balanced
Closes keycloak#94 Signed-off-by: Martin Bartoš <mabartos@redhat.com>
Signed-off-by: Martin Bartoš <mabartos@redhat.com>
cc: @stianst