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

Annotate localizer generated Messages classes with NoExternalUse #2656

Merged

Conversation

@daniel-beck
Copy link
Member

daniel-beck commented Dec 6, 2016

Also update to localizer 1.24 which adds support for this.

Using another component's Messages is brittle and always risky, so let's make sure anyone with a recent enough core dependency and using the access-modifier-checker gets an error during build.

This will not break plugins at runtime, just make sure they don't reuse core Messages during build. In time, reuse should fade as core dependencies get updated.

Also update to localizer 1.24 which adds support for this.
@oleg-nenashev
Copy link
Member

oleg-nenashev commented Dec 6, 2016

👍

@KostyaSha
Copy link
Member

KostyaSha commented Dec 6, 2016

Wouldn't this enforce people to copy-paste information?

@daniel-beck
Copy link
Member Author

daniel-beck commented Dec 6, 2016

@KostyaSha Depends. I don't expect there to be a lot of reuse of strings, and past experience points to plugins breaking because nobody really considers Messages.properties to be public (stable) API – similar to doWhatever methods that change signature depending on need e.g. to add a StaplerRequest argument. So I prefer to be cautious to prevent unnecessary breakage rather than trying to micro-optimize something.

@KostyaSha
Copy link
Member

KostyaSha commented Dec 7, 2016

Yes it makes sense. What about help files? i'm using them i.e. for slave description.

@daniel-beck
Copy link
Member Author

daniel-beck commented Dec 7, 2016

@KostyaSha I wouldn't rely too much on those either, at least unless they're based on public non-Restricted databound fields with the default naming convention. In that case, I'd say you're pretty safe from changes.

And FWIW the worst that happens there is that the Jenkins UI displays an error. With Messages (and implicit web methods), it's runtime exceptions and brokenness.

Copy link
Member

KostyaSha left a comment

let's try it could be reverted any time

@daniel-beck daniel-beck merged commit 7292c91 into jenkinsci:master Dec 9, 2016
1 of 2 checks passed
1 of 2 checks passed
Jenkins Looks like there's a problem with this pull request
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
oleg-nenashev added a commit that referenced this pull request Dec 11, 2016
froque added a commit to froque/parameterized-trigger-plugin that referenced this pull request Oct 17, 2019
Remove jenkins.version 1.642.3 to use implicit version 2.138.4

corrections due to changes in jenkins core:
jenkinsci/jenkins#2656
jenkinsci/jenkins#3106
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.