-
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
Make useAuthenticatedEndpoint configurable via CasC #965
Conversation
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.
From what I see it is a partial fix at best. It might be acceptable as is if the recent LTS versions are supported, but I am not sure. Up to @omehegan as a maintainer
@@ -143,9 +143,11 @@ | |||
<plugin> |
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.
Not needed for newer developer tools. You can bump plugin POm to the recent version and use the hpi.compatibleSinceVersion
property
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.
Does it look better now?
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.
@oleg-nenashev ping
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.
No. You need a very recent Plugin POM. You still have a version which is few years old
@@ -516,7 +516,7 @@ public static GitLabPushTrigger getFromJob(Job<?, ?> job) { | |||
GitLabPushTrigger trigger = null; | |||
if (job instanceof ParameterizedJobMixIn.ParameterizedJob) { | |||
ParameterizedJobMixIn.ParameterizedJob p = (ParameterizedJobMixIn.ParameterizedJob) job; | |||
for (Trigger t : p.getTriggers().values()) { | |||
for (Object t : p.getTriggers().values()) { |
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.
unrelated
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.
This is what I am talking about in my opening comment. The return type of jenkins.model.ParameterizedJobMixIn.ParameterizedJob#getTriggers
has changed that's why I need to do this change if I update dependency to jenkins-core. Otherwise I get the following compile error:
Error:(519, 52) java: incompatible types: java.lang.Object cannot be converted to hudson.triggers.Trigger
src/main/java/com/dabsquared/gitlabjenkins/connection/GitLabConnectionConfig.java
Outdated
Show resolved
Hide resolved
src/main/java/com/dabsquared/gitlabjenkins/connection/GitLabConnectionConfig.java
Show resolved
Hide resolved
src/test/java/com/dabsquared/gitlabjenkins/casc/GitLabConnectionConfigTest.java
Outdated
Show resolved
Hide resolved
Test fails due to the unsatisfied plugin dependency.
I'f guess you want to just update the dependency |
Plugin POM is quite obsolete in this plugin. |
Well I already tried to do that and that resulted in further plugin dependency issues. I'll demonstrate it. |
This is a valid behavior. You can always add a |
@Smasherr unfortunately I have not had any time to work on this plugin for the past few months, I am not even keeping up with GitHub updates for the time being. If @oleg-nenashev can advise on best practices, and you can implement them, I would be happy to merge. |
I will handle updating this @oleg-nenashev @Smasherr |
Could you please reference my PR in yours so I get notified? |
@Smasherr Is there an associated Github issue with this PR? What about a Jenkins jira? If so, can you link them? If not, can you open them and note this PR? |
Here you go: |
@markyjackson-taulia How's the progress, can I somehow support you? |
@markyjackson-taulia Hi, any news on this topic? |
Can this PR be closed? |
It seems so, yes. |
To make
useAuthenticatedEndpoint
configurable via YAML and configuration-as-code-plugin it was needed to change the visibility of its setter inGitLabConnectionConfig
. I also used the recommended technique forGlobalConfiguration#configure
by callingStaplerRequest#bindJSON
inside of it.I added an integration test with CasC, which tests evaluating
useAuthenticatedEndpoint
in YAML. Adding this test required updating Jenkins dependency from 1.609.3 to 2.187 and a little refactoring due to changes injenkins.model
.