gocd-contrib / gomatic

A Python API for configuring GoCD
https://pypi.python.org/pypi/gomatic
MIT License
142 stars 60 forks source link

Config repo tag: Attributes changed #40

Closed arvindsv closed 6 years ago

arvindsv commented 6 years ago

In GoCD 17.9 (coming next week), the <config-repo/> tag has changed a bit. The changes are explained https://github.com/gocd/gocd/issues/3648 and https://github.com/gocd/gocd/issues/3671.

I'm not sure how you handle different versions, but for 17.9 at least, something around this will probably have to change.

From what I can see in the GoCD code, the ID gets generated automatically, if not provided.

/cc @dudadornelles

dudadornelles commented 6 years ago

Thanks for the heads up.

As for dealing with versions, I'll double check but I didn't see anything in the codebase that deals with them. I'm thinking we could have the version being a parameter for whatever ensure method might have its behavior dependent on version or we could potentially get some metadata from the server url after you create the go configurator and make it available in the configurator.

1st option

def ensure_config_repo(self, url, plugin, cvs='git', configuration=None, version=None):
    # do something if version and version > x else do something else

2nd option

def ensure_config_repo(self, url, plugin, cvs='git', configuration=None):
    version = self.__configurator.version  # i believe every element has access to the configurator
    # do something if version and version > x else do something else
arvindsv commented 6 years ago

Makes sense. Hopefully, there won't be too many of these changes. I'll try and let you know whenever I see one. Thanks!

dudadornelles commented 6 years ago

there is an endpoint that tells the version: https://api.gocd.org/current/#the-version-object

dudadornelles commented 6 years ago

Fixed in 0.5.7!