{"action":"created","issue":{"url":"https://api.github.com/repos/google/go-jsonnet/issues/326","repository_url":"https://api.github.com/repos/google/go-jsonnet","labels_url":"https://api.github.com/repos/google/go-jsonnet/issues/326/labels{/name}","comments_url":"https://api.github.com/repos/google/go-jsonnet/issues/326/comments","events_url":"https://api.github.com/repos/google/go-jsonnet/issues/326/events","html_url":"https://github.com/google/go-jsonnet/issues/326","id":498958974,"node_id":"MDU6SXNzdWU0OTg5NTg5NzQ=","number":326,"title":"Static import analysis","user":{"login":"sh0rez","id":26971117,"node_id":"MDQ6VXNlcjI2OTcxMTE3","avatar_url":"https://avatars0.githubusercontent.com/u/26971117?v=4","gravatar_id":"","url":"https://api.github.com/users/sh0rez","html_url":"https://github.com/sh0rez","followers_url":"https://api.github.com/users/sh0rez/followers","following_url":"https://api.github.com/users/sh0rez/following{/other_user}","gists_url":"https://api.github.com/users/sh0rez/gists{/gist_id}","starred_url":"https://api.github.com/users/sh0rez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sh0rez/subscriptions","organizations_url":"https://api.github.com/users/sh0rez/orgs","repos_url":"https://api.github.com/users/sh0rez/repos","events_url":"https://api.github.com/users/sh0rez/events{/privacy}","received_events_url":"https://api.github.com/users/sh0rez/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2019-09-26T15:26:49Z","updated_at":"2019-09-26T16:28:40Z","closed_at":null,"author_association":"NONE","body":"Hi!\r\n\r\nIn an effort to build a static import analysis tool while creating Tanka (https://github.com/grafana/tanka), we have been using some dirty-patching on jsonnet to speed up analysis speed. \r\n\r\nBasically we are implementing a custom Importer that traces its way through the Imports to build a list of transient dependencies after all. \r\n\r\n* Import Analysis: https://github.com/grafana/tanka/blob/00ae3bade02f3198585b5f7112c53929d3d3a146/pkg/jsonnet/transitive.go#L8\r\n* TraceImporter: https://github.com/grafana/tanka/blob/00ae3bade02f3198585b5f7112c53929d3d3a146/pkg/jsonnet/jsonnet.go#L78\r\n\r\nA full evaluation of jsonnet is not required here, which means we abort early: \r\n\r\nhttps://github.com/sh0rez/go-jsonnet/blob/2787aa93adcc2f2b04e915a8f5523d589ead2ef3/vm.go#L202-L218\r\n\r\nHowever, this patch is definitely not the right way, however I am not familiar enough with the jsonnet codebase to do a better one.\r\n\r\nI have seen the efforts in 21c00f1b9ebc856aabf72e2bdb818e1f5b3c11f7 as well, however it is not obvious to me whether I can make use of this.\r\n\r\n@sbarzowski Can you provide some details on this, whether I can use the efforts from 21c00f1b9ebc856aabf72e2bdb818e1f5b3c11f7 for my use-case or how to a better patch into go-jsonnet"},"comment":{"url":"https://api.github.com/repos/google/go-jsonnet/issues/comments/535582874","html_url":"https://github.com/google/go-jsonnet/issues/326#issuecomment-535582874","issue_url":"https://api.github.com/repos/google/go-jsonnet/issues/326","id":535582874,"node_id":"MDEyOklzc3VlQ29tbWVudDUzNTU4Mjg3NA==","user":{"login":"sbarzowski","id":683828,"node_id":"MDQ6VXNlcjY4MzgyOA==","avatar_url":"https://avatars2.githubusercontent.com/u/683828?v=4","gravatar_id":"","url":"https://api.github.com/users/sbarzowski","html_url":"https://github.com/sbarzowski","followers_url":"https://api.github.com/users/sbarzowski/followers","following_url":"https://api.github.com/users/sbarzowski/following{/other_user}","gists_url":"https://api.github.com/users/sbarzowski/gists{/gist_id}","starred_url":"https://api.github.com/users/sbarzowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbarzowski/subscriptions","organizations_url":"https://api.github.com/users/sbarzowski/orgs","repos_url":"https://api.github.com/users/sbarzowski/repos","events_url":"https://api.github.com/users/sbarzowski/events{/privacy}","received_events_url":"https://api.github.com/users/sbarzowski/received_events","type":"User","site_admin":false},"created_at":"2019-09-26T16:28:40Z","updated_at":"2019-09-26T16:28:40Z","author_association":"COLLABORATOR","body":"BTW in a PR I submitted today, there is a fragment which does something very similar to what you describe (i.e. it collects imports recursively): https://github.com/google/go-jsonnet/pull/325/files#diff-80f9fdcc81aed508ba78619f9dd78083R100"}}
{"actor":{"display_login":"sbarzowski"}}