[JENKINS-76185] Add GitLab merge request compatibility#170
[JENKINS-76185] Add GitLab merge request compatibility#170BartVerc wants to merge 5 commits intojenkinsci:masterfrom
Conversation
9c7781b to
6619583
Compare
|
@MarkEWaite Thanks for picking this up 👍 |
|
I will be on vacation for 2 weeks and won't look further at this until after I return. The plugin needs better documentation to show how to use pull requests as a parameter. If you can help with that documentation and can confirm that it works, that would be great. |
|
Hi @MarkEWaite, I just tested this feature and added the documentation for a Gitlab merge request example. It worked as expected. |
|
@MarkEWaite I think this is ready for review or merge. Let me know if something else needs to be done. |
Thanks! It will likely be several more weeks before I can review it. Many other things are on my list. |
|
Hi @MarkEWaite, any idea when you have time to review this? |
Sorry for the slow progress, but other efforts have received my time. Currently we are preparing for the release of Jenkins 2.541.1 on Jan 21, 2026 and for Jenkins Contributor Summit Jan 30, 2026. It may be Feb 2026 before I look at this. |
|
@BartVerc your comment in the pull request description says that you did not test it manually. Could you test it interactively to confirm that it is working as expected? The change looks good to me. I've asked GitHub Copilot to review it as well, in case it finds something that I missed. |
There was a problem hiding this comment.
Pull request overview
This PR extends the plugin’s PT_PULL_REQUEST support to recognize GitLab merge request refs alongside the existing GitHub and Bitbucket pull request refs, so merge request IDs can be offered in the same parameter type.
Changes:
- Updated the pull-request ref regex to also match GitLab
refs/merge-requests/<id>/headrefs. - Adjusted pull-request ID extraction to use the numeric capture group from the new regex.
- Added regex-focused tests and expanded the README with GitHub/GitLab usage examples.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/Consts.java |
Broadens the ref-matching pattern to include GitLab merge request refs. |
src/main/java/net/uaznia/lukanus/hudson/plugins/gitparameter/GitParameterDefinition.java |
Switches pull-request ID extraction to the new regex capture group. |
src/test/java/net/uaznia/lukanus/hudson/plugins/gitparameter/BasicTests.java |
Updates regex assertions and adds a GitLab merge-request match case. |
src/test/java/net/uaznia/lukanus/hudson/plugins/gitparameter/BasicSafeTests.java |
Mirrors the regex assertion updates and GitLab coverage in the safe test suite. |
README.md |
Documents merge-request support and adds updated checkout examples. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -146,14 +153,39 @@ pipeline { | |||
| stage('Example') { | |||
| steps { | |||
| checkout scmGit(branches: [[name: "pr/${params.A_PULL_REQUEST}/head"]], | |||
| Matcher matcher = PULL_REQUEST_REFS_PATTERN.matcher(remoteReference); | ||
| if (matcher.find()) { | ||
| pullRequestSet.add(matcher.group(1)); | ||
| pullRequestSet.add(matcher.group(2)); |
As mentions in JENKINS-76185, I want to make it possible to use this plugin with Gitlab Merge Requests as well.
I would like to know if I missed something somewhere, as I am not yet familiar with this code base.
Testing done
I tested it by running all the tests by
mvn test.Did not yet test it manually.
Submitter checklist