{"action":"created","issue":{"url":"https://api.github.com/repos/pantsbuild/pants/issues/5908","repository_url":"https://api.github.com/repos/pantsbuild/pants","labels_url":"https://api.github.com/repos/pantsbuild/pants/issues/5908/labels{/name}","comments_url":"https://api.github.com/repos/pantsbuild/pants/issues/5908/comments","events_url":"https://api.github.com/repos/pantsbuild/pants/issues/5908/events","html_url":"https://github.com/pantsbuild/pants/pull/5908","id":329115110,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyNDUzMDY1","number":5908,"title":"WIP: source attribute is automatically promoted to sources","user":{"login":"illicitonion","id":1131704,"node_id":"MDQ6VXNlcjExMzE3MDQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1131704?v=4","gravatar_id":"","url":"https://api.github.com/users/illicitonion","html_url":"https://github.com/illicitonion","followers_url":"https://api.github.com/users/illicitonion/followers","following_url":"https://api.github.com/users/illicitonion/following{/other_user}","gists_url":"https://api.github.com/users/illicitonion/gists{/gist_id}","starred_url":"https://api.github.com/users/illicitonion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/illicitonion/subscriptions","organizations_url":"https://api.github.com/users/illicitonion/orgs","repos_url":"https://api.github.com/users/illicitonion/repos","events_url":"https://api.github.com/users/illicitonion/events{/privacy}","received_events_url":"https://api.github.com/users/illicitonion/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-06-04T15:52:11Z","updated_at":"2018-06-05T13:46:57Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/pantsbuild/pants/pulls/5908","html_url":"https://github.com/pantsbuild/pants/pull/5908","diff_url":"https://github.com/pantsbuild/pants/pull/5908.diff","patch_url":"https://github.com/pantsbuild/pants/pull/5908.patch"},"body":"This means that either the `source` or `sources` attribute can be used\r\nfor any rule which expects sources. Places that `source` was expected\r\nstill verify that the correct number of sources are actually present.\r\nPlaces that `sources` was expected will automatically promote `source`\r\nto `sources`.\r\n\r\nThis is a step towards all `sources` attributes being\r\n`EagerFilesetWithSpec`s, which will make them cached in the daemon, and\r\nmake them easier to work with with both v2 remote execution and in the\r\nv2 engine in general. It also provides common hooks for input file\r\nvalidation, rather than relying on them being done ad-hoc in each\r\n`Target` constructor.\r\n\r\nFor backwards compatibility, both attributes will be populated on\r\n`Target`s, but in the future only the sources value will be provided.\r\n\r\n`sources` is guaranteed to be an `EagerFilesetWithSpec` whichever of\r\nthese mechanisms is used.\r\n\r\nA hook is provided for rules to perform validation on `sources` at build\r\nfile parsing time. Hooks are put in place for non-contrib rule types\r\nwhich currently take a `source` attribute to verify that the correct\r\nnumber of sources are provided. I imagine at some point we may want to\r\nadd a \"file type\" hook too, so that rules can error if files of the\r\nwrong type were added as sources.\r\n\r\nThis is a breaking change for rules which use both the `source` and `sources` attributes (and where the latter is not equivalent to the former), or where the `source` attribute is used to refer to something other than a file. `source` is now becoming a\r\nreserved attribute name, as `sources` and `dependencies` already are.\r\n\r\nThis is also a breaking change for rules which use the `source`\r\nattribute, but never set `sources` in a Payload. These will now fail to\r\nparse.\r\n\r\nThis is also a slightly breaking change for the `page` rule - before,\r\nomitting the `source` attribute would parse, but fail at runtime. Now,\r\nit will fail to parse."},"comment":{"url":"https://api.github.com/repos/pantsbuild/pants/issues/comments/394715049","html_url":"https://github.com/pantsbuild/pants/pull/5908#issuecomment-394715049","issue_url":"https://api.github.com/repos/pantsbuild/pants/issues/5908","id":394715049,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDcxNTA0OQ==","user":{"login":"illicitonion","id":1131704,"node_id":"MDQ6VXNlcjExMzE3MDQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1131704?v=4","gravatar_id":"","url":"https://api.github.com/users/illicitonion","html_url":"https://github.com/illicitonion","followers_url":"https://api.github.com/users/illicitonion/followers","following_url":"https://api.github.com/users/illicitonion/following{/other_user}","gists_url":"https://api.github.com/users/illicitonion/gists{/gist_id}","starred_url":"https://api.github.com/users/illicitonion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/illicitonion/subscriptions","organizations_url":"https://api.github.com/users/illicitonion/orgs","repos_url":"https://api.github.com/users/illicitonion/repos","events_url":"https://api.github.com/users/illicitonion/events{/privacy}","received_events_url":"https://api.github.com/users/illicitonion/received_events","type":"User","site_admin":false},"created_at":"2018-06-05T13:46:57Z","updated_at":"2018-06-05T13:46:57Z","author_association":"CONTRIBUTOR","body":"Thanks @jsirois! (Turns out I was trying to init in a bad place :))"}}
{"actor":{"display_login":"illicitonion"}}