8000 Use tags and branches of the main repository for release labels by ahus1 · Pull Request #102 · keycloak/keycloak-github-bot · GitHub
[go: up one dir, main page]

Skip to content

Use tags and branches of the main repository for release labels - #102

Merged
stianst merged 1 commit into
keycloak:mainfrom
ahus1:is-97-main-repository-only
Nov 23, 2026
Merged

stianst merged 1 commit into
keycloak:mainfrom
ahus1:is-97-main-repository-only

Conversation

@ahus1
@ahus1 ahus1 commented Nov 20, 2026
Copy link
Copy Markdown
Member

Follow-up to #98.

The next release label was computed from the branches and tags of the repository the PR was merged in.
The bot is also installed on other repositories, where this produced wrong versions.

Decisions and assumptions:

  • Branches and tags are always read from the repository configured as repository.mainRepository.
  • The main repository is public, so it is read with the client of the event being handled; the bot doesn't need to be installed on it.
  • Labels are still applied to the issues of the repository where the PR was merged.
  • Tags with a suffix like 26.4.18-redhat2 are ignored when computing the next version; a test covers this.
  • When testing on a fork, set repository.mainRepository to keycloak/keycloak and merge the PRs in the fork.

Tested with the bot running against ahus1/keycloak with repository.mainRepository=keycloak/keycloak:

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
@ahus1
ahus1 marked this pull request as ready for review November 20, 2026 11:21
@ahus1
ahus1 requested a review from stianst November 20, 2026 11:21
@stianst
stianst requested a balanced review from Copilot November 23, 2026 10:40
Copilot AI left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the change to source release versions from the configured main repository.

No open issues 🎉

What changed in this PR

Corrects release-label version selection for PRs merged outside the main repository. Versions now come from the configured main repository, while issue labels remain applied in the repository where the PR was merged.

Changes:

  • Reads branches and tags from repository.mainRepository using the event’s GitHub client.
  • Updates tests for separate source and destination repositories, including a cross-repository tag scenario.
  • Documents the main repository as the source for release versions.
File Description
src/​test/​java/​org/​keycloak/​gh/​bot/​AddReleaseLabelOnMergeTest.java Updates client mocks and tests cross-repository release labeling.
src/​main/​java/​org/​keycloak/​gh/​bot/​AddReleaseLabelOnMerge.java Uses the configured main repository for branch and tag lookups.
README.md Clarifies which repository determines release versions.

Review effort: Balanced

@stianst
stianst merged commit 963392c into keycloak:main Nov 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

0