{"action":"created","issue":{"url":"https://api.github.com/repos/ipfs/go-ipfs/issues/5142","repository_url":"https://api.github.com/repos/ipfs/go-ipfs","labels_url":"https://api.github.com/repos/ipfs/go-ipfs/issues/5142/labels{/name}","comments_url":"https://api.github.com/repos/ipfs/go-ipfs/issues/5142/comments","events_url":"https://api.github.com/repos/ipfs/go-ipfs/issues/5142/events","html_url":"https://github.com/ipfs/go-ipfs/pull/5142","id":334088149,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2MTQ3NDY5","number":5142,"title":"Feat: pin add --max-depth (arbitrary depth recursive pins)","user":{"login":"hsanjuan","id":1027022,"node_id":"MDQ6VXNlcjEwMjcwMjI=","avatar_url":"https://avatars3.githubusercontent.com/u/1027022?v=4","gravatar_id":"","url":"https://api.github.com/users/hsanjuan","html_url":"https://github.com/hsanjuan","followers_url":"https://api.github.com/users/hsanjuan/followers","following_url":"https://api.github.com/users/hsanjuan/following{/other_user}","gists_url":"https://api.github.com/users/hsanjuan/gists{/gist_id}","starred_url":"https://api.github.com/users/hsanjuan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hsanjuan/subscriptions","organizations_url":"https://api.github.com/users/hsanjuan/orgs","repos_url":"https://api.github.com/users/hsanjuan/repos","events_url":"https://api.github.com/users/hsanjuan/events{/privacy}","received_events_url":"https://api.github.com/users/hsanjuan/received_events","type":"User","site_admin":false},"labels":[{"id":129070658,"node_id":"MDU6TGFiZWwxMjkwNzA2NTg=","url":"https://api.github.com/repos/ipfs/go-ipfs/labels/in%20progress","name":"in progress","color":"ededed","default":false}],"state":"open","locked":false,"assignee":{"login":"hsanjuan","id":1027022,"node_id":"MDQ6VXNlcjEwMjcwMjI=","avatar_url":"https://avatars3.githubusercontent.com/u/1027022?v=4","gravatar_id":"","url":"https://api.github.com/users/hsanjuan","html_url":"https://github.com/hsanjuan","followers_url":"https://api.github.com/users/hsanjuan/followers","following_url":"https://api.github.com/users/hsanjuan/following{/other_user}","gists_url":"https://api.github.com/users/hsanjuan/gists{/gist_id}","starred_url":"https://api.github.com/users/hsanjuan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hsanjuan/subscriptions","organizations_url":"https://api.github.com/users/hsanjuan/orgs","repos_url":"https://api.github.com/users/hsanjuan/repos","events_url":"https://api.github.com/users/hsanjuan/events{/privacy}","received_events_url":"https://api.github.com/users/hsanjuan/received_events","type":"User","site_admin":false},"assignees":[{"login":"Stebalien","id":310393,"node_id":"MDQ6VXNlcjMxMDM5Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/310393?v=4","gravatar_id":"","url":"https://api.github.com/users/Stebalien","html_url":"https://github.com/Stebalien","followers_url":"https://api.github.com/users/Stebalien/followers","following_url":"https://api.github.com/users/Stebalien/following{/other_user}","gists_url":"https://api.github.com/users/Stebalien/gists{/gist_id}","starred_url":"https://api.github.com/users/Stebalien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Stebalien/subscriptions","organizations_url":"https://api.github.com/users/Stebalien/orgs","repos_url":"https://api.github.com/users/Stebalien/repos","events_url":"https://api.github.com/users/Stebalien/events{/privacy}","received_events_url":"https://api.github.com/users/Stebalien/received_events","type":"User","site_admin":false},{"login":"hsanjuan","id":1027022,"node_id":"MDQ6VXNlcjEwMjcwMjI=","avatar_url":"https://avatars3.githubusercontent.com/u/1027022?v=4","gravatar_id":"","url":"https://api.github.com/users/hsanjuan","html_url":"https://github.com/hsanjuan","followers_url":"https://api.github.com/users/hsanjuan/followers","following_url":"https://api.github.com/users/hsanjuan/following{/other_user}","gists_url":"https://api.github.com/users/hsanjuan/gists{/gist_id}","starred_url":"https://api.github.com/users/hsanjuan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hsanjuan/subscriptions","organizations_url":"https://api.github.com/users/hsanjuan/orgs","repos_url":"https://api.github.com/users/hsanjuan/repos","events_url":"https://api.github.com/users/hsanjuan/events{/privacy}","received_events_url":"https://api.github.com/users/hsanjuan/received_events","type":"User","site_admin":false}],"milestone":null,"comments":20,"created_at":"2018-06-20T13:51:32Z","updated_at":"2018-07-27T22:09:34Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/ipfs/go-ipfs/pulls/5142","html_url":"https://github.com/ipfs/go-ipfs/pull/5142","diff_url":"https://github.com/ipfs/go-ipfs/pull/5142.diff","patch_url":"https://github.com/ipfs/go-ipfs/pull/5142.patch"},"body":"This implements #5133 introducing an option to limit how deep we fetch and store\r\nthe DAG associated to a recursive pin (\"--max-depth\"). This feature\r\ncomes motivated by the need to fetch and pin partial DAGs in order to do\r\nDAG sharding with IPFS Cluster.\r\n\r\nThis means that, when pinning something to --max-depth, the DAG will be\r\nfetched only to that depth and not more.\r\n\r\nIn order to get this, the PR introduces new recursive pin types: \"recursive1\"\r\nmeans: the given CID is pinned along with its direct children (maxDepth=1)\r\n\r\n\"recursive2\" means: the given CID is pinned along with its direct children\r\nand its grandchildren.\r\n\r\nAnd so on...\r\n\r\nThis required introducing \"maxDepth\" limits to all the functions walking down\r\nDAGs (in merkledag, pin, core/commands, core/coreapi, exchange/reprovide modules).\r\n\r\nmaxDepth == -1 effectively acts as no-limit, and all these functions behave like\r\nthey did before.\r\n\r\nIn order to facilitate the task, a new CID Set type has been added:\r\nthirdparty/recpinset. This set carries the MaxDepth associated to every Cid.\r\nThis allows to shortcut exploring already explored branches just like the original\r\ncid.Set does. It also allows to store the Recursive pinset (and replaces cid.Set).\r\nrecpinset should be moved outside to a different repo eventually.\r\n\r\nTODO: tests\r\nTODO: refs -r with --max-depth\r\n\r\nLicense: MIT\r\nSigned-off-by: Hector Sanjuan <code@hector.link>"},"comment":{"url":"https://api.github.com/repos/ipfs/go-ipfs/issues/comments/408551054","html_url":"https://github.com/ipfs/go-ipfs/pull/5142#issuecomment-408551054","issue_url":"https://api.github.com/repos/ipfs/go-ipfs/issues/5142","id":408551054,"node_id":"MDEyOklzc3VlQ29tbWVudDQwODU1MTA1NA==","user":{"login":"hsanjuan","id":1027022,"node_id":"MDQ6VXNlcjEwMjcwMjI=","avatar_url":"https://avatars3.githubusercontent.com/u/1027022?v=4","gravatar_id":"","url":"https://api.github.com/users/hsanjuan","html_url":"https://github.com/hsanjuan","followers_url":"https://api.github.com/users/hsanjuan/followers","following_url":"https://api.github.com/users/hsanjuan/following{/other_user}","gists_url":"https://api.github.com/users/hsanjuan/gists{/gist_id}","starred_url":"https://api.github.com/users/hsanjuan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hsanjuan/subscriptions","organizations_url":"https://api.github.com/users/hsanjuan/orgs","repos_url":"https://api.github.com/users/hsanjuan/repos","events_url":"https://api.github.com/users/hsanjuan/events{/privacy}","received_events_url":"https://api.github.com/users/hsanjuan/received_events","type":"User","site_admin":false},"created_at":"2018-07-27T22:09:34Z","updated_at":"2018-07-27T22:09:34Z","author_association":"CONTRIBUTOR","body":"> Decide whether or not to go deeper in the visit function (based on the current depth, the max depth (local to the visit function), and the lowest depth at which we've explored the current CID (visit function state).\r\n\r\nYes, ok that works too and I see the advantage now. Thanks for taking the time to explain."}}
{"actor":{"display_login":"hsanjuan"}}