{"action":"closed","issue":{"url":"https://api.github.com/repos/operable/cog/issues/497","repository_url":"https://api.github.com/repos/operable/cog","labels_url":"https://api.github.com/repos/operable/cog/issues/497/labels{/name}","comments_url":"https://api.github.com/repos/operable/cog/issues/497/comments","events_url":"https://api.github.com/repos/operable/cog/issues/497/events","html_url":"https://github.com/operable/cog/issues/497","id":145702549,"number":497,"title":"Bundle config format versioning","user":{"login":"mpeck","id":47858,"avatar_url":"https://avatars.githubusercontent.com/u/47858?v=3","gravatar_id":"","url":"https://api.github.com/users/mpeck","html_url":"https://github.com/mpeck","followers_url":"https://api.github.com/users/mpeck/followers","following_url":"https://api.github.com/users/mpeck/following{/other_user}","gists_url":"https://api.github.com/users/mpeck/gists{/gist_id}","starred_url":"https://api.github.com/users/mpeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpeck/subscriptions","organizations_url":"https://api.github.com/users/mpeck/orgs","repos_url":"https://api.github.com/users/mpeck/repos","events_url":"https://api.github.com/users/mpeck/events{/privacy}","received_events_url":"https://api.github.com/users/mpeck/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/operable/cog/labels/enhancement","name":"enhancement","color":"FFEB94"},{"url":"https://api.github.com/repos/operable/cog/labels/spanner","name":"spanner","color":"A7CEF6"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-04-04T14:35:42Z","updated_at":"2016-06-30T17:29:58Z","closed_at":"2016-06-30T17:29:58Z","body":"# Motivation\r\nCog should continually be changing to support newer and better technologies. For example eventually we hope to support bundle types other than simple and docker. In order to do that one thing we need is a way to version our config formats.\r\n\r\n# Objective\r\nTo provide a means to easily version config files.\r\n\r\n# Early Research\r\ntl;dr These are some early thoughts regarding versioning. It's entirely possible that this could all change. But to summarize, the key take away is as follows:\r\n* leverage json schema\r\n* add functionality to json schema allowing for arbitrary validation functions\r\n* remove custom validation logic from spanner\r\n\r\nCurrently we are leveraging JSON schema and some custom logic to handle config validation. If we could remove our custom logic and fully leverage JSON schema, we should be able to easily update schemas as necessary with relatively little friction. \r\n\r\nThe main issue with using just JSON schema to validate configs revolves around our need to validate rule parsing. JSON schema provides mechanisms for validating that a rule is a string and can even validate based on a regular expression, but we need to go further. We need to verify that rules can be parsed without error. We do this now by pulling rules out of the config after JSON schema validation and parsing them. This is a bit brittle, because it is necessary that we know where in the config rules appear in order to validate them. One possible solution is to patch the JSON schema lib we are using, ExJsonSchema, to accept an arbitrary validation function. This does break the JSON schema standard, but for our use case it may be the best option.\r\n"}}
{"actor":{"display_login":"vanstee"}}