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

Partialy restore binary compatibility with 2.13 and older releases #29

Merged
merged 2 commits into from Jan 13, 2017

Conversation

olivergondza
Copy link
Member

The tests are passing for me in openstack-cloud-plugin without any modification there. I will give it a bit more manual testing with old and new c-f-p and report here. Anyway, I really believe the compatibility must be preserved here.

@olivergondza olivergondza changed the title Partialy restore binary compatibility with 2.13 and older releases [WIP] Partialy restore binary compatibility with 2.13 and older releases Jan 12, 2017
@olivergondza
Copy link
Member Author

@imod, this will make update to 2.14+ much less painful.

@olivergondza olivergondza changed the title [WIP] Partialy restore binary compatibility with 2.13 and older releases Partialy restore binary compatibility with 2.13 and older releases Jan 12, 2017
* @deprecated Use <tt>GlobalConfigFiles.get().getConfigs()</tt> instead.
*/
@Deprecated
public Collection<Config> getAllConfigs() {
Copy link
Member

Choose a reason for hiding this comment

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

although this makes the API some how compatible again, it is semantically wrong. GlobalConfigFiles.get().getConfigs(); just returns the global configuration files and none in any folders. So I don't think this is a good idea.

The same applies to all the other methods...

Copy link
Member

Choose a reason for hiding this comment

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

If you think this is a good solution for the openstack extention of the config-file-provider, then I think you should just access GlobalConfigFiles.get() directly

Copy link
Member

Choose a reason for hiding this comment

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

maybe I judged to fast, let me think about it again - sorry...

Copy link
Member

Choose a reason for hiding this comment

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

The correct way to access configuration files is via org.jenkinsci.plugins.configfiles.ConfigFiles and not via GlobalConfigFiles - GlobalConfigFiles should never be accessed directly.

Readding these methods to this class for sure cause wrong usage.

So I'm really puzzled about this change...

Copy link
Member

Choose a reason for hiding this comment

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

I like this approach. It would also restore compatibility for Job DSL.

But getAllConfigs() should only return the configs managed by this provider. See https://github.com/jenkinsci/config-file-provider-plugin/blob/config-file-provider-2.13/src/main/java/org/jenkinsci/lib/configprovider/ConfigProvider.java#L77-L82. This change would return all global configs.

@olivergondza
Copy link
Member Author

To my understanding, in past there ware only global files and now you have added support for folder specific files as well. The migration just tool all the files and moved it to "global space". These methods I put back used to return global files and that is what I want to preserve as plugins that was not adjusted to this change expect exactly that. What do you think?

@imod
Copy link
Member

imod commented Jan 12, 2017

Looking at it from that perspective does actually make it quite reasonable. But then I guess the message next to deprecated should be adjusted to reflect this, rather then referencing GlobalConfigFiles. Also, I think in the openstack plugin you should inform the user about this limitation in the description of the UserDataConfig.

@olivergondza
Copy link
Member Author

@imod, @daspilker, can we agree on getting these methods back mimicking the old behavior and cutting the release ASAP?

I really seems that I return all configs, not only the ones related to given provider. Will fix.

@olivergondza
Copy link
Member Author

I have updated the code to list only methods bound to this provider. The rest is manipulating configs by id that is documented to be unique accross providers so it should be fine.

@imod
Copy link
Member

imod commented Jan 13, 2017

👍 I will merge this

@imod imod merged commit 6d524f7 into jenkinsci:master Jan 13, 2017
@imod
Copy link
Member

imod commented Jan 13, 2017

@olivergondza thanks!!

@olivergondza
Copy link
Member Author

Can you release it today? I have started working on a reflexion-based workaround for openstack-cloud to support 2.15 - 2.15.3 but it might not be necessary if we get 2.15.4 soon enough. Thanks

@olivergondza olivergondza deleted the restore-copatibility branch January 13, 2017 13:24
@imod
Copy link
Member

imod commented Jan 13, 2017

@olivergondza yes, I will release it today

@imod
Copy link
Member

imod commented Jan 13, 2017

@olivergondza version 2.15.4 just released

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