Upgrading Plugin to use Credentials

60 views
Skip to first unread message

Gavin

unread,
Oct 17, 2015, 1:25:12 PM10/17/15
to Jenkins Developers
I was looking through the wiki and archives to find out if I there is already a topic on this but I don't think my search terms are good enough.

I'm taking over maintainership of an existing plugin and want to add credential-plugin support, but don't want to break any existing installs. 
Is there any example code on how to handle upgrades and problematically adding credentials.

I know there's at least one functional that can be overridden to massage data that comes in from the XML file, but I can never remember the name of it.

Thanks,
Gavin

Gavin

unread,
Oct 17, 2015, 1:40:22 PM10/17/15
to jenkin...@googlegroups.com
I did find the backwards compatibility page - https://wiki.jenkins-ci.org/display/JENKINS/Hint+on+retaining+backward+compatibility

I won't turn down any examples on upgrading to credentials though.

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-dev/Vcrmkqg3oW8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/0158e489-9fbe-4644-8e95-cf1b2b8f2f3e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jesse Glick

unread,
Oct 19, 2015, 11:56:59 AM10/19/15
to Jenkins Dev
On Sat, Oct 17, 2015 at 1:40 PM, Gavin <hal...@gmail.com> wrote:
> I won't turn down any examples on upgrading to credentials though.

`ssh-plugin` IIRC.

Gavin Mogan

unread,
Nov 13, 2015, 8:11:48 PM11/13/15
to jenkin...@googlegroups.com
https://github.com/jenkinsci/sauce-ondemand-plugin/blob/master/src/main/java/hudson/plugins/sauce_ondemand/PluginImpl.java

I've added a readResolve to that to create credentials like ssh-plugin does. I've noticed SystemCredentialsProvider.getInstance is null at this time. Is there a proper way to delay this from happening? Or a later hook I can attach to?

Gavin


--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-dev/Vcrmkqg3oW8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-de...@googlegroups.com.

Jesse Glick

unread,
Nov 14, 2015, 7:30:15 AM11/14/15
to Jenkins Dev

`ItemListener.onLoaded` perhaps.

Gavin Mogan

unread,
Nov 19, 2015, 6:19:43 PM11/19/15
to jenkin...@googlegroups.com
I really had not played with the credentials stuff before. This is really a great addition.

Is there a way to setup a parent default credential? (job -> folder -> global)

Right now I'm doing this by hand, but it gets kinda complicated if i want to support folders as well.


On Sat, Nov 14, 2015 at 4:30 AM, Jesse Glick <jgl...@cloudbees.com> wrote:

`ItemListener.onLoaded` perhaps.

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-dev/Vcrmkqg3oW8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-de...@googlegroups.com.

Jesse Glick

unread,
Nov 20, 2015, 1:17:30 PM11/20/15
to Jenkins Dev
On Thu, Nov 19, 2015 at 6:19 PM, Gavin Mogan <ga...@gavinmogan.com> wrote:
> Is there a way to setup a parent default credential? (job -> folder -> global)

There is not currently any support for per-job credentials
(JENKINS-27398), but per-folder credentials are routine. The user may
configure credentials at the system level, a folder (or subfolder…),
or as part of the user account. Standard Credentials plugin APIs will
automatically search in the correct providers, if called with
appropriate arguments.

Gavin

unread,
Jan 7, 2016, 3:16:10 PM1/7/16
to jenkin...@googlegroups.com
I'm getting ready to merge and do a release and realized a code review from credentials experts might be a good plan.

Sadly I don't have a clean patch to submit but if someone could take a quick look at https://github.com/jenkinsci/sauce-ondemand-plugin/compare/master...saucelabs:develop that would be great.

Gavin

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-dev/Vcrmkqg3oW8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-de...@googlegroups.com.

Jesse Glick

unread,
Jan 7, 2016, 3:40:53 PM1/7/16
to Jenkins Dev
On Thu, Jan 7, 2016 at 3:16 PM, Gavin <hal...@gmail.com> wrote:
> I'm getting ready to merge and do a release and realized a code review from
> credentials experts might be a good plan.

Stephen Connolly would be the best person to ask.
Reply all
Reply to author
Forward
0 new messages