{"action":"created","issue":{"url":"https://api.github.com/repos/appc/spec/issues/586","repository_url":"https://api.github.com/repos/appc/spec","labels_url":"https://api.github.com/repos/appc/spec/issues/586/labels{/name}","comments_url":"https://api.github.com/repos/appc/spec/issues/586/comments","events_url":"https://api.github.com/repos/appc/spec/issues/586/events","html_url":"https://github.com/appc/spec/pull/586","id":144261407,"number":586,"title":"spec: Define image format string","user":{"login":"sgotti","id":1690273,"avatar_url":"https://avatars.githubusercontent.com/u/1690273?v=3","gravatar_id":"","url":"https://api.github.com/users/sgotti","html_url":"https://github.com/sgotti","followers_url":"https://api.github.com/users/sgotti/followers","following_url":"https://api.github.com/users/sgotti/following{/other_user}","gists_url":"https://api.github.com/users/sgotti/gists{/gist_id}","starred_url":"https://api.github.com/users/sgotti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgotti/subscriptions","organizations_url":"https://api.github.com/users/sgotti/orgs","repos_url":"https://api.github.com/users/sgotti/repos","events_url":"https://api.github.com/users/sgotti/events{/privacy}","received_events_url":"https://api.github.com/users/sgotti/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-29T13:16:10Z","updated_at":"2016-04-01T14:51:26Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/appc/spec/pulls/586","html_url":"https://github.com/appc/spec/pull/586","diff_url":"https://github.com/appc/spec/pull/586.diff","patch_url":"https://github.com/appc/spec/pull/586.patch"},"body":"This patch tries to define image format string (see #479). It tries to handle label values being any kind of string. To do this it requires it to be URL escaped (instead of inventing another escape format). This will break some implementation (see below).\r\n\r\nIf image tags #584 lands the required change will be to replace the `:versionvalue` with `:tag` (URL encoded).\r\n\r\nI'm open to any suggestion for other ways to escape the label value.\r\n\r\n--\r\n spec: Define image format string\r\n\r\nAdd an \"extra\" spec section for image format string\r\n\r\nThis format is actually used by the appc spec golang reference\r\nimplementation and other tools (like rkt) but it has not been defined.\r\n\r\nThere're also various unclear cases in the actual implementationt that\r\nthis definition tries to clarify, but this is going to change some\r\nbehaviors.\r\n\r\nThe main problem is related to the label values. Since labels are\r\nstrings, they can contain any character (also special character like\r\ncarriage return, tabs etc...).\r\n\r\nWith the current implementation there are two main issues related to\r\nlabel value being strings:\r\n* label value containing `,` `:` and `=` cannot be used inside the image format\r\nstring. There's the need to find a way to escape them.\r\n\r\n* Many special character (like non printable characters) are difficult\r\nto represent in the actual format.\r\n\r\nInstead name and label name are of type ACIdentifier, so they can\r\ncontain only a specific set of character and in this set `,`, `:` and\r\n`=` aren't included.\r\n\r\nInstead of adding another ad hoc escape rule this spec requires that the\r\nlabels value must be URL escaped (percent encoding) with UTF-8 encoding.\r\n\r\nThis will break some current implementations:\r\n\r\nFor example rkt stage1 has a version like `1.2.1+gite568957-dirty` and\r\nwith the current image format parsing it works. Now, with the need to URL\r\nescape the labels values it should be expressed as\r\n`1.2.1%2Bgite568957-dirty` (since passing `1.2.1+gite568957-dirty` will\r\nbe interpreted as `1.2.1 gite568957-dirty`)."},"comment":{"url":"https://api.github.com/repos/appc/spec/issues/comments/204425908","html_url":"https://github.com/appc/spec/pull/586#issuecomment-204425908","issue_url":"https://api.github.com/repos/appc/spec/issues/586","id":204425908,"user":{"login":"sgotti","id":1690273,"avatar_url":"https://avatars.githubusercontent.com/u/1690273?v=3","gravatar_id":"","url":"https://api.github.com/users/sgotti","html_url":"https://github.com/sgotti","followers_url":"https://api.github.com/users/sgotti/followers","following_url":"https://api.github.com/users/sgotti/following{/other_user}","gists_url":"https://api.github.com/users/sgotti/gists{/gist_id}","starred_url":"https://api.github.com/users/sgotti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgotti/subscriptions","organizations_url":"https://api.github.com/users/sgotti/orgs","repos_url":"https://api.github.com/users/sgotti/repos","events_url":"https://api.github.com/users/sgotti/events{/privacy}","received_events_url":"https://api.github.com/users/sgotti/received_events","type":"User","site_admin":false},"created_at":"2016-04-01T14:51:26Z","updated_at":"2016-04-01T14:51:26Z","body":"@jonboulle with ACString in #590 one idea will be to just force `,`, `:` and `=` to be escaped with `\\` (`\\\\` to get a `\\`) without quoting since it will give some problems when used inside a shell (inside a shell an user can just single quote the whole app string and use `\\` to escape the reserved app string chars)."}}