-
Notifications
You must be signed in to change notification settings - Fork 5
[JENKINS-57889] Add HashMap for GitLab filter methods #15
Conversation
Removed serverMap from transient. That might solve the problem but there will be overhead of serialising the map as well. I hope that will be fine if it saves user's time. |
Could you share the exception? But as I recall, Map is not supported: jenkinsci/configuration-as-code-plugin#900 |
You can see the error in the test results - https://gist.github.com/baymac/c26381fa04797c377fd94f4986a740f4 |
You can also reproduce yourself by commenting out the |
@baymac CI says otherwise, did you forget to do an |
The test passes in CI because the code that has been pushed, the constructor doesn't have the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding using a hashmap, I feel like your pre-optimizing for a use case that is never going to be relevant. Most users will have two servers, gitlab.com, and their private instance.
With 10 or 100 servers in the list, even though that will most likely be an unrealistic scenario, an array lookup is still going to be pretty fast.
In a case where there is big team and they all want to setup a server for each of their user to manage webhooks on the project they created, there will be multiple instances of server entries. I think if it is not causing compatibility issues we can benefit from hashmaps. |
The problem I am still having is that |
On a big team they would use an individual Jenkins instance as well 😓 |
Okay, I get it now. I am closing this PR. Can you review #16? |
Added a hashmap that stores (name, server) key, value pair. Kept it transient so that we do not have to serialize it. But the problem is you cannot populate the HashMap in the constructore as some JCasC rules error. Maybe @Casz can englighten what is going wrong.
Some minor documentation changes
Removed gitlab server warnings because a URI check scheme with gitlab might not work. See A public endpoint to validate the GitLab server url gitlab4j/gitlab4j-api#384. I haven't been able to figure a way to validate a gitlab server url without authentication yet.