payload: {"action":"created","issue":{"url":"https://api.github.com/repos/openspending/openspending/issues/1444","repository_url":"https://api.github.com/repos/openspending/openspending","labels_url":"https://api.github.com/repos/openspending/openspending/issues/1444/labels{/name}","comments_url":"https://api.github.com/repos/openspending/openspending/issues/1444/comments","events_url":"https://api.github.com/repos/openspending/openspending/issues/1444/events","html_url":"https://github.com/openspending/openspending/issues/1444","id":433782477,"node_id":"MDU6SXNzdWU0MzM3ODI0Nzc=","number":1444,"title":"Review OS-Viewer and make sure it’s not using babbage model","user":{"login":"akariv","id":265333,"node_id":"MDQ6VXNlcjI2NTMzMw==","avatar_url":"https://avatars3.githubusercontent.com/u/265333?v=4","gravatar_id":"","url":"https://api.github.com/users/akariv","html_url":"https://github.com/akariv","followers_url":"https://api.github.com/users/akariv/followers","following_url":"https://api.github.com/users/akariv/following{/other_user}","gists_url":"https://api.github.com/users/akariv/gists{/gist_id}","starred_url":"https://api.github.com/users/akariv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akariv/subscriptions","organizations_url":"https://api.github.com/users/akariv/orgs","repos_url":"https://api.github.com/users/akariv/repos","events_url":"https://api.github.com/users/akariv/events{/privacy}","received_events_url":"https://api.github.com/users/akariv/received_events","type":"User","site_admin":false},"labels":[{"id":622245110,"node_id":"MDU6TGFiZWw2MjIyNDUxMTA=","url":"https://api.github.com/repos/openspending/openspending/labels/GIFT%20IV%20WP%203","name":"GIFT IV WP 3","color":"d93f0b","default":false},{"id":323092223,"node_id":"MDU6TGFiZWwzMjMwOTIyMjM=","url":"https://api.github.com/repos/openspending/openspending/labels/os-viewer","name":"os-viewer","color":"000000","default":false}],"state":"open","locked":false,"assignee":{"login":"nightsh","id":1579997,"node_id":"MDQ6VXNlcjE1Nzk5OTc=","avatar_url":"https://avatars2.githubusercontent.com/u/1579997?v=4","gravatar_id":"","url":"https://api.github.com/users/nightsh","html_url":"https://github.com/nightsh","followers_url":"https://api.github.com/users/nightsh/followers","following_url":"https://api.github.com/users/nightsh/following{/other_user}","gists_url":"https://api.github.com/users/nightsh/gists{/gist_id}","starred_url":"https://api.github.com/users/nightsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nightsh/subscriptions","organizations_url":"https://api.github.com/users/nightsh/orgs","repos_url":"https://api.github.com/users/nightsh/repos","events_url":"https://api.github.com/users/nightsh/events{/privacy}","received_events_url":"https://api.github.com/users/nightsh/received_events","type":"User","site_admin":false},"assignees":[{"login":"nightsh","id":1579997,"node_id":"MDQ6VXNlcjE1Nzk5OTc=","avatar_url":"https://avatars2.githubusercontent.com/u/1579997?v=4","gravatar_id":"","url":"https://api.github.com/users/nightsh","html_url":"https://github.com/nightsh","followers_url":"https://api.github.com/users/nightsh/followers","following_url":"https://api.github.com/users/nightsh/following{/other_user}","gists_url":"https://api.github.com/users/nightsh/gists{/gist_id}","starred_url":"https://api.github.com/users/nightsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nightsh/subscriptions","organizations_url":"https://api.github.com/users/nightsh/orgs","repos_url":"https://api.github.com/users/nightsh/repos","events_url":"https://api.github.com/users/nightsh/events{/privacy}","received_events_url":"https://api.github.com/users/nightsh/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2019-04-16T13:32:54Z","updated_at":"2019-06-10T11:16:16Z","closed_at":null,"author_association":"MEMBER","body":"- Review Os-Viewer code\r\n- List all locations that are using babbage model and not the fiscal data package\r\n- Create sub-issues for modifying the code of Os-Viewer to remove dependency on babbage model completely"},"comment":{"url":"https://api.github.com/repos/openspending/openspending/issues/comments/500381131","html_url":"https://github.com/openspending/openspending/issues/1444#issuecomment-500381131","issue_url":"https://api.github.com/repos/openspending/openspending/issues/1444","id":500381131,"node_id":"MDEyOklzc3VlQ29tbWVudDUwMDM4MTEzMQ==","user":{"login":"nightsh","id":1579997,"node_id":"MDQ6VXNlcjE1Nzk5OTc=","avatar_url":"https://avatars2.githubusercontent.com/u/1579997?v=4","gravatar_id":"","url":"https://api.github.com/users/nightsh","html_url":"https://github.com/nightsh","followers_url":"https://api.github.com/users/nightsh/followers","following_url":"https://api.github.com/users/nightsh/following{/other_user}","gists_url":"https://api.github.com/users/nightsh/gists{/gist_id}","starred_url":"https://api.github.com/users/nightsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nightsh/subscriptions","organizations_url":"https://api.github.com/users/nightsh/orgs","repos_url":"https://api.github.com/users/nightsh/repos","events_url":"https://api.github.com/users/nightsh/events{/privacy}","received_events_url":"https://api.github.com/users/nightsh/received_events","type":"User","site_admin":false},"created_at":"2019-06-10T11:16:16Z","updated_at":"2019-06-10T11:16:16Z","author_association":"NONE","body":"Further on, we need to make some alterations to babbage-ui:\r\n\r\n- in `src/api/index.js`:\r\n  - `getPackageModel()` requests the babbage model from `/api/3/cubes/<id>/model/`\r\n  - this function is further chained to obtain various data from its result (e.g. measures, dimensions)\r\n  - if we rewrite this to use a different data source (FDP model) but to keep its result structure, then it should be compatible with the rest of the codebase\r\n\r\n---\r\n\r\nIn `os-viewer` we also need to:\r\n\r\n- iterate over filtered FDP model dimensions in order to do a drill-down:\r\n  - `os-viewer/params.js` does a `_.each(hierarchy.dimensions)` on the babbage model, but we can translate that to a filtered down `each()` on `package.model.dimensions` in the FDP model. Or to extract the dimensions aggregate into a separate function. This should be backwards compatible with everything.\r\n  - `os-viewer/index.js` does a `map()` over babbage model hierarchies (`getHierarchiesWithLimitedDimensionValues()`), which we don't have in FDP model and would need to be reconstructed from the same `package.model.dimensions`, where we have keys like `package.model.dimensions.activity.attributes.activity2_code.parent`. This should be enough to provide us a tree.\r\n    - this is used in `fullyPopulateModel()`, which could be left as it is, as the modification above is backwards compatible.\r\n  - `loadDimensionsValues()` in `services/data-package-api` is requesting for each Dimension member a response from `/api/3/cubes/<package_id>/members/<dimension_id>/`\r\n    - maybe we can leave this as is, for it doesn't duplicate the information in the FDP model\r\n- maybe there is a way to pass the model from os-viewer to babbage-ui (and avoid extra requests made by babbage-ui). This way we won't have to also adapt babbage-ui anymore (see the beginning of this comment).\r\n\r\n---\r\n\r\n**Conclusions so far:**\r\n\r\n1. Doing a backwards-compatible rewrite of os-viewer is doable, roughly keeping the functions that get data from the babbage model and replacing the logic inside them to extract information from the FDP model instead\r\n2. The key `dimensions.fact_table` is needed for the package metadata, used to create dataMine URLs.\r\n3. The `join_column` key in each dimension doesn't seem to be used anywhere in the code, either directly or indirectly. I removed it from the model and everything seems to be fine.\r\n4. babbage-ui needs to adapt its package model retrieval, either by requesting an FDP model and reading from it, or directly receiving a pre-built model to work with.\r\n5. I'd still do a branch instead of a fork, remove all the babbage model related lines and functions and start replacing them with FDP-sourced equivalents."}}
other: {"actor":{"display_login":"nightsh"}}