-
Notifications
You must be signed in to change notification settings - Fork 619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filtering by label never matches anything #647
Comments
Can you look at the User Support section of the README and follow the directions for capturing logs from the plugin? Then add them here, so I can see what happens when the plugin gets this request from GitLab. Thanks! |
@omehegan here you go
Updated trigger config:
|
re. comment #664 (comment) Builds trigger properly if there is no label filter. Any chance this will be investigated soon? |
Here is the full log from:
|
Any updates? |
I can confirm this too. Just does not work. Removing the label filter, everything is fine. |
@jakub-bochenski thanks. If other people are seeing this, it sounds like a bug. The code for this has not been changed since 2016, perhaps something changed on the GitLab side. I did notice that in one of your logs the plugin said, @Argelbargel or @mreichel would you be able to look at this one? Maybe the label data structure has changed and the plugin is not seeing it? |
@omehegan yes, but that was first bullet of:
just mean to verify builds trigger at all. |
So, it has to be confirmed by community to get status bug? |
I take a look at it. |
@valVk about half of the issues people open are "how do I do this" or they missed something in the docs (which need to be improved, it's on my list). So either a few people report the same problem or, if I/we have time, I try to reproduce the issue to confirm. |
@omehegan that's ok. I'm just "watching" this issue something about a month or month and half, and there weren't any actions, until djdevin confirmed that he has this issue also. So I decided that there is something like in ubuntu community if several users confirmed the same issue, than it will labeled as issue or bug etc. For me this is a big blocker, because I cant launch a build job on a different servers from one repository, and do that job using labels. |
If I can make a suggestion: some projects use the thumbsup count on the issue for this purpose. It has the benefit of not spamming every watcher with "+1" comments. |
Unfortunately, the gitlab documentation is very unclear. I have a fix that solves the problem. BUT, the gitlab API states you get a list of labels back. It is unclear where it is a list of labels and where it is a list of Strings (the labels' names). |
@AYFan or @dblessing can you comment on #647 (comment) from your side? |
@mreichel The documentation indicates |
After some digging the fix proposed by @mreichel is mostly wrong.
And So the current implementation of the gilabl plugin is valid for these points. But when implementing filtering by label (a48a098) the labels were retrieved from the This is no longer the case, the labels associated with a Merge Request are put in a array (key This implies that a new model class needs to be created in |
@benjarobin would you be able to submit a PR for this? |
Well, maybe I can, but it's been 7 years since I have not touched Java. |
@benjarobin thanks at least for clarifying what the problem might be. @ayufan @dblessing do you know if anything changed in how GitLab returns labels from API requests? See #647 (comment) |
@omehegan Ok, it was pretty easy to setup the development environment, I will try to create a pull request this week-end |
@omehegan I've just tried this patch, and seemed that It does not work for me. |
@omehegan I was able to setup the docker, and indeed the patch that I did write is not working with the following build : |
@omehegan I did build my branch, update the plugin using the jenkins Web page, and my build is working fine, I am confused... I am going to double check, but maybe the plugin that you provide is not the right one ? Edit: The |
The plugin built here https://ci.jenkins.io/job/Plugins/job/gitlab-plugin/job/PR-732/1/artifact/target/gitlab-plugin-1.5.5-SNAPSHOT.hpi is working fine : The filtering is working |
@benjarobin yeah you're right, I apologize, I built the master branch of your fork rather than your PR branch. Sorry about that! @valeriy-dp please test the copy that @benjarobin linked just above this. |
@omehegan, I confirm that in this snapshot (https://ci.jenkins.io/job/Plugins/job/gitlab-plugin/job/PR-732/1/artifact/target/gitlab-plugin-1.5.5-SNAPSHOT.hpi) the filtering by label works. You can close the Issue #527. Thank You! Also, it would be useful to parse the label as an environment variable. This feature can be found many uses. |
@Zava2012 thanks for testing. Can you please open two separate issues for the incomplete list of labels, and the desire to have labels as env vars? |
Fix filtering by label never matches anything. Fixes #647.
@Zava2012 |
@valVk, no problem.
Notes: i'm only use Opened Merge Request Events feature. |
Yes, this is what I got in result too. |
Great, thanks. |
Avoid posting a comment for empty comment files
Issue
Context
Problem description
After enabling "filter by label" Merge Requests would never trigger.
When I remove the condition the builds trigger as expected.
I've checked that labels in
MergeRequestObjectAttributes
are always empty.I've checked that Merge Request Hook events contain the labels in JSON payload and Notes events don't.
Still neither of them works.
Job config:
Web hook config:
The text was updated successfully, but these errors were encountered: