Skip to content
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

Improve Features #3

Merged
merged 2 commits into from Nov 20, 2016
Merged

Improve Features #3

merged 2 commits into from Nov 20, 2016

Conversation

fsimmend
Copy link
Contributor

This pull request adds the following features:

  • appending a comment on reoccurring failures is now configurable (default is false)
  • reopen an issue is configurable (default is false)
  • prepare for job-dsl
  • a custom github repo to collect issues

In order to allow the genius job-dsl configure this plugin, we need to store any state produced by the plugin somewhere outside the config.xml as this file will be regenerated completely. With this pull request, the issue number is persisted in the run action.

In order to allow a dedicated repo to collect issues for example in a multi scm project or to collect the issues for all ci jobs (we have around 3k jobs) in separate team repos, the repo url is now configurable. If not set, the default from the github plugin is chosen.

When this pull request gets applied, i will add a pull request to the job-dsl plugin with the corresponding dsl elements.

fsimmend and others added 2 commits November 18, 2016 10:22
storing state in job config.xml is bad as job-dsl will override it each time and state get lost
<f:textbox />
</f:entry>
<f:entry title="Reopen issue" field="issueReopen">
<f:checkbox default="true"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll probably default this to false - Reopening a previous issue isn't very useful in a lot of cases, particularly if the existing issue is very old. I guess a setting like "Reopen the issue if it's less than X days old, otherwise create a new one" would be helpful.

String title = StringUtils.defaultIfBlank(notifier.getCustomTitle(), descriptor.getIssueTitle());
String body = StringUtils.defaultIfBlank(notifier.getCustomBody(), descriptor.getIssueBody());
String label = StringUtils.defaultIfBlank(notifier.getCustomLabel(), descriptor.getIssueLabel());
final GitHubIssueNotifier.DescriptorImpl globalConfig = jobConfig.getDescriptor();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I didn't know about final. I usually write JavaScript and some C#, so Java is pretty foreign to me 😛

@Daniel15
Copy link
Member

Nice! Thank you for your contribution.

Do you think it'd be straightforward to write unit tests for this plugin? I haven't written Java in a long time (my experience is mainly with C# and JavaScript) so I'm not sure what unit testing in Java is like these days.

@Daniel15 Daniel15 merged commit 85e1ec5 into jenkinsci:master Nov 20, 2016
@Daniel15
Copy link
Member

I'll try to release a new version tomorrow 😄

@Daniel15
Copy link
Member

Daniel15 commented Nov 27, 2016

Published as 1.2 (Jenkins' servers take a few hours to update, but you should see the release soon). Thanks for your contribution! I'll mention you in the changelog :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants