From 6ae1ad74d48349e9b7e6e2bb3546b84923fe2d70 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Thu, 7 Mar 2019 16:26:06 +0100 Subject: [PATCH] distgit/pagure: actually apply the hotfix So in out dist-git setup the git hook have a dedicated configuration file which only contains a read-only access to the database. This is because of the way our dist-git is setup where every packager actually has a shell account on the machine and the hook are run by that account. So if the packager manages to get a shell access, they will be able to read this configuration file and we do not want to give them read/write access to the database. Pagure however in the default hook tries to update the database, among other it tries to clear the cached merge status of the open PR when a commit is pushed. For a nice UX, it does this within the hook process, this way there is no race-condition and users accessing a PR right after a push will get an up to date merge status (as it will be re-generated). But we cannot do this in dist-git since we cannot update the database directly, so instead, with this hotfix, we move the process of cleaning up the merge status to an async job that will have read/write access and there may be some race-condition in displaying the merge status but so be it. Signed-off-by: Pierre-Yves Chibon --- roles/distgit/pagure/files/hotfix-20190227-hooks-default.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/distgit/pagure/files/hotfix-20190227-hooks-default.py b/roles/distgit/pagure/files/hotfix-20190227-hooks-default.py index 475969aae2..73136510ae 100644 --- a/roles/distgit/pagure/files/hotfix-20190227-hooks-default.py +++ b/roles/distgit/pagure/files/hotfix-20190227-hooks-default.py @@ -329,7 +329,7 @@ class DefaultRunner(BaseRunner): # Refresh of all opened PRs parent = project.parent or project - pagure.lib.tasks.refresh_pr_cache( + pagure.lib.tasks.refresh_pr_cache.delay( parent.name, parent.namespace, parent.user.user if parent.is_fork else None,