{"action":"opened","number":174,"pull_request":{"url":"https://api.github.com/repos/c2corg/v6_ui/pulls/174","id":59702307,"html_url":"https://github.com/c2corg/v6_ui/pull/174","diff_url":"https://github.com/c2corg/v6_ui/pull/174.diff","patch_url":"https://github.com/c2corg/v6_ui/pull/174.patch","issue_url":"https://api.github.com/repos/c2corg/v6_ui/issues/174","number":174,"state":"open","locked":false,"title":"Add cache busting","user":{"login":"asaunier","id":1192331,"avatar_url":"https://avatars.githubusercontent.com/u/1192331?v=3","gravatar_id":"","url":"https://api.github.com/users/asaunier","html_url":"https://github.com/asaunier","followers_url":"https://api.github.com/users/asaunier/followers","following_url":"https://api.github.com/users/asaunier/following{/other_user}","gists_url":"https://api.github.com/users/asaunier/gists{/gist_id}","starred_url":"https://api.github.com/users/asaunier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asaunier/subscriptions","organizations_url":"https://api.github.com/users/asaunier/orgs","repos_url":"https://api.github.com/users/asaunier/repos","events_url":"https://api.github.com/users/asaunier/events{/privacy}","received_events_url":"https://api.github.com/users/asaunier/received_events","type":"User","site_admin":false},"body":"GMF 2 also uses Pyramid 1.6 and its cache busting system.\r\n\r\nI have then ported the GMF code\r\nhttps://github.com/camptocamp/c2cgeoportal/blob/master/c2cgeoportal/__init__.py#L344-L352\r\nhttps://github.com/camptocamp/c2cgeoportal/blob/master/c2cgeoportal/lib/cacheversion.py\r\nto our project with a few adaptations (python3, no server caching yet).\r\n\r\nIt works pretty nice and almost out of the box.\r\n\r\nInstead of a random uuid string, I would like to use the short last commit hash provided by https://github.com/c2corg/v6_ui/blob/cache_buster2/config/default#L4\r\nbut I don't know how to get a config parameter from within a standard function (say ``get_cache_version``). I have tried to use some ``CACHE_VERSION`` variable set in the ``main()`` function but it's then not available in ``get_cache_version``. flake8 by the way says that:\r\n> c2corg_ui/__init__.py:3:1: F401 'CACHE_VERSION' imported but unused\r\nc2corg_ui/__init__.py:14:5: F811 redefinition of unused 'CACHE_VERSION' from line 3\r\nc2corg_ui/__init__.py:14:5: F841 local variable 'CACHE_VERSION' is assigned to but never used\r\n\r\nAny know what's the best way to do this? Thanks!","created_at":"2016-02-17T20:18:01Z","updated_at":"2016-02-17T20:18:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/c2corg/v6_ui/pulls/174/commits","review_comments_url":"https://api.github.com/repos/c2corg/v6_ui/pulls/174/comments","review_comment_url":"https://api.github.com/repos/c2corg/v6_ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/c2corg/v6_ui/issues/174/comments","statuses_url":"https://api.github.com/repos/c2corg/v6_ui/statuses/eca8a5f244b9c2fdcb921766f4e619318c620f75","head":{"label":"c2corg:cache_buster2","ref":"cache_buster2","sha":"eca8a5f244b9c2fdcb921766f4e619318c620f75","user":{"login":"c2corg","id":3200587,"avatar_url":"https://avatars.githubusercontent.com/u/3200587?v=3","gravatar_id":"","url":"https://api.github.com/users/c2corg","html_url":"https://github.com/c2corg","followers_url":"https://api.github.com/users/c2corg/followers","following_url":"https://api.github.com/users/c2corg/following{/other_user}","gists_url":"https://api.github.com/users/c2corg/gists{/gist_id}","starred_url":"https://api.github.com/users/c2corg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/c2corg/subscriptions","organizations_url":"https://api.github.com/users/c2corg/orgs","repos_url":"https://api.github.com/users/c2corg/repos","events_url":"https://api.github.com/users/c2corg/events{/privacy}","received_events_url":"https://api.github.com/users/c2corg/received_events","type":"Organization","site_admin":false},"repo":{"id":43445823,"name":"v6_ui","full_name":"c2corg/v6_ui","owner":{"login":"c2corg","id":3200587,"avatar_url":"https://avatars.githubusercontent.com/u/3200587?v=3","gravatar_id":"","url":"https://api.github.com/users/c2corg","html_url":"https://github.com/c2corg","followers_url":"https://api.github.com/users/c2corg/followers","following_url":"https://api.github.com/users/c2corg/following{/other_user}","gists_url":"https://api.github.com/users/c2corg/gists{/gist_id}","starred_url":"https://api.github.com/users/c2corg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/c2corg/subscriptions","organizations_url":"https://api.github.com/users/c2corg/orgs","repos_url":"https://api.github.com/users/c2corg/repos","events_url":"https://api.github.com/users/c2corg/events{/privacy}","received_events_url":"https://api.github.com/users/c2corg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/c2corg/v6_ui","description":"UI for c2c.org v6","fork":false,"url":"https://api.github.com/repos/c2corg/v6_ui","forks_url":"https://api.github.com/repos/c2corg/v6_ui/forks","keys_url":"https://api.github.com/repos/c2corg/v6_ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/c2corg/v6_ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/c2corg/v6_ui/teams","hooks_url":"https://api.github.com/repos/c2corg/v6_ui/hooks","issue_events_url":"https://api.github.com/repos/c2corg/v6_ui/issues/events{/number}","events_url":"https://api.github.com/repos/c2corg/v6_ui/events","assignees_url":"https://api.github.com/repos/c2corg/v6_ui/assignees{/user}","branches_url":"https://api.github.com/repos/c2corg/v6_ui/branches{/branch}","tags_url":"https://api.github.com/repos/c2corg/v6_ui/tags","blobs_url":"https://api.github.com/repos/c2corg/v6_ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/c2corg/v6_ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/c2corg/v6_ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/c2corg/v6_ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/c2corg/v6_ui/statuses/{sha}","languages_url":"https://api.github.com/repos/c2corg/v6_ui/languages","stargazers_url":"https://api.github.com/repos/c2corg/v6_ui/stargazers","contributors_url":"https://api.github.com/repos/c2corg/v6_ui/contributors","subscribers_url":"https://api.github.com/repos/c2corg/v6_ui/subscribers","subscription_url":"https://api.github.com/repos/c2corg/v6_ui/subscription","commits_url":"https://api.github.com/repos/c2corg/v6_ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/c2corg/v6_ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/c2corg/v6_ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/c2corg/v6_ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/c2corg/v6_ui/contents/{+path}","compare_url":"https://api.github.com/repos/c2corg/v6_ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/c2corg/v6_ui/merges","archive_url":"https://api.github.com/repos/c2corg/v6_ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/c2corg/v6_ui/downloads","issues_url":"https://api.github.com/repos/c2corg/v6_ui/issues{/number}","pulls_url":"https://api.github.com/repos/c2corg/v6_ui/pulls{/number}","milestones_url":"https://api.github.com/repos/c2corg/v6_ui/milestones{/number}","notifications_url":"https://api.github.com/repos/c2corg/v6_ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/c2corg/v6_ui/labels{/name}","releases_url":"https://api.github.com/repos/c2corg/v6_ui/releases{/id}","deployments_url":"https://api.github.com/repos/c2corg/v6_ui/deployments","created_at":"2015-09-30T16:52:44Z","updated_at":"2016-01-11T14:17:36Z","pushed_at":"2016-02-17T20:09:28Z","git_url":"git://github.com/c2corg/v6_ui.git","ssh_url":"git@github.com:c2corg/v6_ui.git","clone_url":"https://github.com/c2corg/v6_ui.git","svn_url":"https://github.com/c2corg/v6_ui","homepage":null,"size":700,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":48,"forks":1,"open_issues":48,"watchers":2,"default_branch":"master"}},"base":{"label":"c2corg:master","ref":"master","sha":"8c8e671aa2daf79c3a893805902244f65c67edb7","user":{"login":"c2corg","id":3200587,"avatar_url":"https://avatars.githubusercontent.com/u/3200587?v=3","gravatar_id":"","url":"https://api.github.com/users/c2corg","html_url":"https://github.com/c2corg","followers_url":"https://api.github.com/users/c2corg/followers","following_url":"https://api.github.com/users/c2corg/following{/other_user}","gists_url":"https://api.github.com/users/c2corg/gists{/gist_id}","starred_url":"https://api.github.com/users/c2corg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/c2corg/subscriptions","organizations_url":"https://api.github.com/users/c2corg/orgs","repos_url":"https://api.github.com/users/c2corg/repos","events_url":"https://api.github.com/users/c2corg/events{/privacy}","received_events_url":"https://api.github.com/users/c2corg/received_events","type":"Organization","site_admin":false},"repo":{"id":43445823,"name":"v6_ui","full_name":"c2corg/v6_ui","owner":{"login":"c2corg","id":3200587,"avatar_url":"https://avatars.githubusercontent.com/u/3200587?v=3","gravatar_id":"","url":"https://api.github.com/users/c2corg","html_url":"https://github.com/c2corg","followers_url":"https://api.github.com/users/c2corg/followers","following_url":"https://api.github.com/users/c2corg/following{/other_user}","gists_url":"https://api.github.com/users/c2corg/gists{/gist_id}","starred_url":"https://api.github.com/users/c2corg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/c2corg/subscriptions","organizations_url":"https://api.github.com/users/c2corg/orgs","repos_url":"https://api.github.com/users/c2corg/repos","events_url":"https://api.github.com/users/c2corg/events{/privacy}","received_events_url":"https://api.github.com/users/c2corg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/c2corg/v6_ui","description":"UI for c2c.org v6","fork":false,"url":"https://api.github.com/repos/c2corg/v6_ui","forks_url":"https://api.github.com/repos/c2corg/v6_ui/forks","keys_url":"https://api.github.com/repos/c2corg/v6_ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/c2corg/v6_ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/c2corg/v6_ui/teams","hooks_url":"https://api.github.com/repos/c2corg/v6_ui/hooks","issue_events_url":"https://api.github.com/repos/c2corg/v6_ui/issues/events{/number}","events_url":"https://api.github.com/repos/c2corg/v6_ui/events","assignees_url":"https://api.github.com/repos/c2corg/v6_ui/assignees{/user}","branches_url":"https://api.github.com/repos/c2corg/v6_ui/branches{/branch}","tags_url":"https://api.github.com/repos/c2corg/v6_ui/tags","blobs_url":"https://api.github.com/repos/c2corg/v6_ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/c2corg/v6_ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/c2corg/v6_ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/c2corg/v6_ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/c2corg/v6_ui/statuses/{sha}","languages_url":"https://api.github.com/repos/c2corg/v6_ui/languages","stargazers_url":"https://api.github.com/repos/c2corg/v6_ui/stargazers","contributors_url":"https://api.github.com/repos/c2corg/v6_ui/contributors","subscribers_url":"https://api.github.com/repos/c2corg/v6_ui/subscribers","subscription_url":"https://api.github.com/repos/c2corg/v6_ui/subscription","commits_url":"https://api.github.com/repos/c2corg/v6_ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/c2corg/v6_ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/c2corg/v6_ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/c2corg/v6_ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/c2corg/v6_ui/contents/{+path}","compare_url":"https://api.github.com/repos/c2corg/v6_ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/c2corg/v6_ui/merges","archive_url":"https://api.github.com/repos/c2corg/v6_ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/c2corg/v6_ui/downloads","issues_url":"https://api.github.com/repos/c2corg/v6_ui/issues{/number}","pulls_url":"https://api.github.com/repos/c2corg/v6_ui/pulls{/number}","milestones_url":"https://api.github.com/repos/c2corg/v6_ui/milestones{/number}","notifications_url":"https://api.github.com/repos/c2corg/v6_ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/c2corg/v6_ui/labels{/name}","releases_url":"https://api.github.com/repos/c2corg/v6_ui/releases{/id}","deployments_url":"https://api.github.com/repos/c2corg/v6_ui/deployments","created_at":"2015-09-30T16:52:44Z","updated_at":"2016-01-11T14:17:36Z","pushed_at":"2016-02-17T20:09:28Z","git_url":"git://github.com/c2corg/v6_ui.git","ssh_url":"git@github.com:c2corg/v6_ui.git","clone_url":"https://github.com/c2corg/v6_ui.git","svn_url":"https://github.com/c2corg/v6_ui","homepage":null,"size":700,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":48,"forks":1,"open_issues":48,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/c2corg/v6_ui/pulls/174"},"html":{"href":"https://github.com/c2corg/v6_ui/pull/174"},"issue":{"href":"https://api.github.com/repos/c2corg/v6_ui/issues/174"},"comments":{"href":"https://api.github.com/repos/c2corg/v6_ui/issues/174/comments"},"review_comments":{"href":"https://api.github.com/repos/c2corg/v6_ui/pulls/174/comments"},"review_comment":{"href":"https://api.github.com/repos/c2corg/v6_ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/c2corg/v6_ui/pulls/174/commits"},"statuses":{"href":"https://api.github.com/repos/c2corg/v6_ui/statuses/eca8a5f244b9c2fdcb921766f4e619318c620f75"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":63,"deletions":7,"changed_files":5}}