-
Notifications
You must be signed in to change notification settings - Fork 54
Update pom structure #48
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
Conversation
Based on a fresh plugin project started with https://jenkins.io/doc/developer/tutorial/create/
Corrects Enforcer rule RequireUpperBoundDeps.
Resolves Findbugs URF_UNREAD_FIELD
Resolves Findbugs NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE
Resolves Findbugs RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE
Resolves Findbugs DM_DEFAULT_ENCODING
Resolves Findbugs REC_CATCH_EXCEPTION
Resolves Findbugs NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE
Resolves Findbugs RV_RETURN_VALUE_IGNORED_BAD_PRACTICE
Resolves Findbugs OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE
Accidentally removed too many fields in previous commits and forgot to remove data bound constructor params in another previous commit.
oleg-nenashev
left a comment
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.
Note that there is already #45, which facelifts the plugin without breaking changes and reformatting. It does not fix FindBugs tho
|
|
||
| @DataBoundConstructor | ||
| public HockeyappApplication(String apiToken, String appId, boolean notifyTeam, | ||
| public HockeyappApplication(String apiToken, boolean notifyTeam, |
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.
breaks binary compatibility
|
I see now. Yes, you're quite right. Apologies. (First time contributing to Jenkins, forgive me).
Anyways, thanks for looking at this. |
|
@mezpahlan no problem at all, it happens. Generally we need a plugin maintainer to review and integrate something. I would not mind if your PR gets integrated instead of mine. In #45 I have also replaced bundled libs by Apache HttpComponents Client 4.x API Plugin, but it can be done in a follow-up if needed. I am not sure who is the current plugin maintainer, @Brantone @dkochetkov and @ohoeltke are listed in https://github.com/jenkins-infra/repository-permissions-updater/blob/master/permissions/plugin-hockeyapp.yml
The field is public, so it may be used somehow. My recommendation would be to just use |
Add a suppression to Findbugs with a follow up TODO comment.
|
Thanks I've reverted that binary breaking change and added your suggestions. Hopefully one of the maintainers can also chime in and move this forward. I'd love to help out with further improvements to this plugin in the future too. Happy to help where I can. |
pom.xml
Outdated
| <properties> | ||
| <jenkins.version>1.609.2</jenkins.version> | ||
| <java.level>7</java.level> | ||
| <jenkins-test-harness.version>2.38</jenkins-test-harness.version> |
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.
I would suggest to remove it and let O=PluginPOM use it's default one
pom.xml
Outdated
| <packaging>hpi</packaging> | ||
|
|
||
| <properties> | ||
| <jenkins.version>1.609.2</jenkins.version> |
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.
If you require Java 7, it's better to update to Jenkins 1.625.3. Just because 1.609.x can run on Java 6 and hence the plugin may not work there
| @SuppressFBWarnings(value = {"URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD"}, justification = "Breaks binary compatibility if removed.") | ||
| @XStreamAsAttribute | ||
| public long schemaVersion; | ||
| public long schemaVersion; // TODO: Fix Findbugs gracefully. |
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.
Should it be marked as deprecated then? Just in case thee is really no usages anywhere (including Jelly and Co)
| return FormValidation.errorWithMarkup( | ||
| "You must enter an <a href=\"https://rink.hockeyapp.net/manage/auth_tokens\">API Token</a>."); | ||
| if (value.isEmpty()) { | ||
| final Jenkins instance = Jenkins.getInstance(); |
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.
in 1.625.3 you can use getActiveInstance() IIRC. Jenkins instance cannot be really null here
|
|
||
| private static final Charset UTF8_CHARSET = Charset.forName("UTF-8"); | ||
| private static final String UTF8 = "UTF-8"; | ||
| private static final Charset UTF8_CHARSET = Charset.forName(UTF8); |
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.
In Java 7 you can use StandardCharsets.
pom.xml
Outdated
| <dependency> | ||
| <groupId>org.apache.httpcomponents</groupId> | ||
| <artifactId>httpclient</artifactId> | ||
| <version>4.5.2</version> |
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.
Once the core is updated to 1.625.3, you could use Apache HttpComponents Client 4.x API plugin instead
pom.xml
Outdated
| </dependency> | ||
| <dependency> | ||
| <groupId>commons-codec</groupId> | ||
| <artifactId>commons-codec</artifactId> |
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.
Why don't you just use the version from the core?
Uses the jenkins-test-harness version defined in the parent POM.
We require Java 7 so 1.625.3 is a better fit for that.
These are non-null by design.
We can let someone else manage Apache HttpComponents for us :)
This is inherited from the parent anyway. It also looks wrong.
Appears to be unused in this project.
pom.xml
Outdated
| </developers> | ||
|
|
||
|
|
||
| <url>http://wiki.jenkins-ci.org/display/JENKINS/HockeyApp+Plugin</url> |
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.
# Conflicts: # pom.xml
The current POM structure is quite out of date to what you get when creating an up to date Hello World plugin from the tutorial web pages. This PR updates the structure and versions of the parent POM.
Along with being aligned to the new structure we also resolve Enforcer and Findbug errors that come as a result of the newer Jenkins plugin dependencies.
The overall aim was to add support for a friendly syntax whilst using this plugin in pipeline mode. Getting the POM up to date seems a good first step to that.