Plugin Hosting Request - Datadog Build Reporter

42 views
Skip to first unread message

John Zeller

unread,
Aug 24, 2015, 5:01:31 PM8/24/15
to Jenkins Developers
Hello!

My name is John Zeller, and I am a Software Engineer at Datadog. We have built a plugin to gather pre/post build data, and forward it to our API. We'd like to have this plugin hosted on jenkins-ci.

Here are the details requested here:
  • https://github.com/DataDog/jenkins-datadog-plugin
  • Personal Github Username: JohnLZeller
  • Jenkins-ci.org Username: Datadog
  • This plugin is used to forward metrics, events, and service checks to your account at Datadog, automatically. This is different from other plugins because no other plugin forwards data to Datadog, out of the box.

Please let me know if there is any more information that I can provide!

Kanstantsin Shautsou

unread,
Aug 24, 2015, 6:05:10 PM8/24/15
to Jenkins Developers
At first look https://github.com/DataDog/jenkins-datadog-plugin/blob/master/src/main/java/org/datadog/jenkins/plugins/datadogbuildreporter/DatadogBuildListener.java#L428 :
-  private String apiKey; -> use credentials
- stream handling probably requires tries
- listener.getLogger().println("Started build!"); -> printing messages with unknown source place is a headache for debug, put some prefix
...

John Zeller

unread,
Aug 25, 2015, 6:07:14 PM8/25/15
to Jenkins Developers
Thanks for the feedback! I agree, using credentials is better. I looked around to find a good way to grab the credentials list, and I am having a bit of trouble.

Do you know of a good example of allowing the user to choose a credential from the `Manage Jenkins -> Configure System` screen, and then retrieving that chosen credential again?

Kanstantsin Shautsou

unread,
Aug 25, 2015, 6:14:25 PM8/25/15
to jenkin...@googlegroups.com
Better look on any existing plugin, you need 
1) add credentials into plugin dependency
2) add in jelly/groovy page credentials form, then refer it as <c:credentials>…
3) add in descriptor magic doFill* method
4) store credentialsID instead direct apiKey
5) whenever you need real apiKey resolve credentialsId into real password and use it
6) don’t expose in jenkins API credentials for not auth people (have no examples).

--
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/GXkpWaPm-wE/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/e27747a4-05d6-4612-992e-6df6c66400d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

John Zeller

unread,
Aug 26, 2015, 2:49:04 PM8/26/15
to Jenkins Developers
Updated our plugin to store the api key as a Secret, and to use a logging function that prepends logging messages with some context.

The decision was made to go with storing the api key as a Secret for a couple of reasons. 1) Using full credentials is an unnecessary step, as this isn't truly a username/password set. 2) The api key provides write only, and so would not compromise further secrets if spilled. 3) The api key is revokable.

Please let me know if you have any further questions.

Daniel Beck

unread,
Aug 26, 2015, 7:44:49 PM8/26/15
to jenkin...@googlegroups.com
Forked to https://github.com/jenkinsci/datadog-plugin and invited you to it.

Welcome aboard!

Also created a component in Jira for this plugin with Datadog as component lead.
> --
> You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/27bf567d-7777-4a8b-a40f-0c9986512107%40googlegroups.com.

John Zeller

unread,
Aug 27, 2015, 12:44:14 PM8/27/15
to Jenkins Developers, m...@beckweb.net
Thanks Daniel! :D
Reply all
Reply to author
Forward
0 new messages