{"action":"created","issue":{"url":"https://api.github.com/repos/duckduckgo/community-platform/issues/630","labels_url":"https://api.github.com/repos/duckduckgo/community-platform/issues/630/labels{/name}","comments_url":"https://api.github.com/repos/duckduckgo/community-platform/issues/630/comments","events_url":"https://api.github.com/repos/duckduckgo/community-platform/issues/630/events","html_url":"https://github.com/duckduckgo/community-platform/pull/630","id":67200985,"number":630,"title":"For Comment: Blog \"Service\"","user":{"login":"jbarrett","id":444449,"avatar_url":"https://avatars.githubusercontent.com/u/444449?v=3","gravatar_id":"","url":"https://api.github.com/users/jbarrett","html_url":"https://github.com/jbarrett","followers_url":"https://api.github.com/users/jbarrett/followers","following_url":"https://api.github.com/users/jbarrett/following{/other_user}","gists_url":"https://api.github.com/users/jbarrett/gists{/gist_id}","starred_url":"https://api.github.com/users/jbarrett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbarrett/subscriptions","organizations_url":"https://api.github.com/users/jbarrett/orgs","repos_url":"https://api.github.com/users/jbarrett/repos","events_url":"https://api.github.com/users/jbarrett/events{/privacy}","received_events_url":"https://api.github.com/users/jbarrett/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/duckduckgo/community-platform/labels/Blog","name":"Blog","color":"c7def8"},{"url":"https://api.github.com/repos/duckduckgo/community-platform/labels/Improvement","name":"Improvement","color":"fbca04"},{"url":"https://api.github.com/repos/duckduckgo/community-platform/labels/WIP","name":"WIP","color":"fef2c0"}],"state":"open","locked":false,"assignee":{"login":"jbarrett","id":444449,"avatar_url":"https://avatars.githubusercontent.com/u/444449?v=3","gravatar_id":"","url":"https://api.github.com/users/jbarrett","html_url":"https://github.com/jbarrett","followers_url":"https://api.github.com/users/jbarrett/followers","following_url":"https://api.github.com/users/jbarrett/following{/other_user}","gists_url":"https://api.github.com/users/jbarrett/gists{/gist_id}","starred_url":"https://api.github.com/users/jbarrett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbarrett/subscriptions","organizations_url":"https://api.github.com/users/jbarrett/orgs","repos_url":"https://api.github.com/users/jbarrett/repos","events_url":"https://api.github.com/users/jbarrett/events{/privacy}","received_events_url":"https://api.github.com/users/jbarrett/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2015-04-08T19:25:40Z","updated_at":"2015-04-14T13:40:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/duckduckgo/community-platform/pulls/630","html_url":"https://github.com/duckduckgo/community-platform/pull/630","diff_url":"https://github.com/duckduckgo/community-platform/pull/630.diff","patch_url":"https://github.com/duckduckgo/community-platform/pull/630.patch"},"body":"@MariagraziaAlastra @nilnilnil @zekiel @jdorweiler @russellholt \r\n\r\nThis is currently Not Working, but I'll go a little into what's different here from the last PR and what's needed to get moving.\r\n\r\nBiggest change from the last discussed PR is using the plugin architecture to wrap DDGC::Config and PSGI Sessions (so e.g. just `use DDGC::Web::Plugin::Session` should populate a user variable in the request, if there is a current user)\r\n\r\nRe-using the model and templates is possibly too messy - attempting a more significant change here has exposed some stuff which won't work or is impractical, e.g.\r\n\r\n- Instances of `DDGC` are heavily relied on by **most or all** components (usually passed in on instantiation)\r\n- `DDGC::DB` does not use a standard schema constructor / connect call so can't just be used as a DBIx::Class schema (with Plugin::DBIC say)\r\n- Templates rely heavily on functionality in [`DDGC`'s Xslate constructor](https://github.com/duckduckgo/community-platform/blob/72a6e3930ca59fee4d087aa966a0c715b79c329f/lib/DDGC.pm#L233-L450) or [`DDGC::Web::View::Xslate`](https://github.com/duckduckgo/community-platform/blob/72a6e3930ca59fee4d087aa966a0c715b79c329f/lib/DDGC/Web/View/Xslate.pm)\r\n\r\nSo for this to work without depending too much on the extant architecture (i.e. to be as discrete as possible from the start), there needs to be parallel development on a DB Schema and views which implement parts that makes sense and leaves behind parts that don't.\r\n\r\nThere are modules like [`DDGC::Markup`](https://github.com/duckduckgo/community-platform/blob/72a6e3930ca59fee4d087aa966a0c715b79c329f/lib/DDGC/Markup.pm) which are instantiated as a member of, and passed a reference to, a `DDGC` instance. These types of instances should probably be plain modules with exports. Where a dependency on session or request parameters exists, they can be passed as parameters, though efforts should be made to reduce this type of dependency anyway.\r\n\r\nNo insurmountable challenges yet :)\r\n\r\nMore tomorrow..."},"comment":{"url":"https://api.github.com/repos/duckduckgo/community-platform/issues/comments/92847556","html_url":"https://github.com/duckduckgo/community-platform/pull/630#issuecomment-92847556","issue_url":"https://api.github.com/repos/duckduckgo/community-platform/issues/630","id":92847556,"user":{"login":"jbarrett","id":444449,"avatar_url":"https://avatars.githubusercontent.com/u/444449?v=3","gravatar_id":"","url":"https://api.github.com/users/jbarrett","html_url":"https://github.com/jbarrett","followers_url":"https://api.github.com/users/jbarrett/followers","following_url":"https://api.github.com/users/jbarrett/following{/other_user}","gists_url":"https://api.github.com/users/jbarrett/gists{/gist_id}","starred_url":"https://api.github.com/users/jbarrett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbarrett/subscriptions","organizations_url":"https://api.github.com/users/jbarrett/orgs","repos_url":"https://api.github.com/users/jbarrett/repos","events_url":"https://api.github.com/users/jbarrett/events{/privacy}","received_events_url":"https://api.github.com/users/jbarrett/received_events","type":"User","site_admin":false},"created_at":"2015-04-14T13:40:54Z","updated_at":"2015-04-14T13:40:54Z","body":"`DDGC::Web` is basically the existing Catalyst app. I'd like to keep this as-is for servicing the extant architecture.\r\n\r\nI experimented with Moo roles for composing Apps, but it didn't really work with this framework - it's applications are \"just\" modules, not classes.\r\n\r\nI should perhaps move the new parts out of the `DDGC::Web` space altogether to distinguish them properly."}}