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
merged 1 commit into from Dec 9, 2016

Conversation

3 participants
@daniel-beck
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.

Annotate localizer generated Messages classes with NoExternalUse
Also update to localizer 1.24 which adds support for this.
@oleg-nenashev

This comment has been minimized.

Show comment
Hide comment
@oleg-nenashev
Member

oleg-nenashev commented Dec 6, 2016

👍

@KostyaSha

This comment has been minimized.

Show comment
Hide comment
@KostyaSha

KostyaSha Dec 6, 2016

Member

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

Member

KostyaSha commented Dec 6, 2016

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

@daniel-beck

This comment has been minimized.

Show comment
Hide comment
@daniel-beck

daniel-beck Dec 6, 2016

Member

@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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@KostyaSha

KostyaSha Dec 7, 2016

Member

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

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

This comment has been minimized.

Show comment
Hide comment
@daniel-beck

daniel-beck Dec 7, 2016

Member

@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.

Member

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.

@KostyaSha

KostyaSha approved these changes Dec 7, 2016 edited

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment