sourcehut: revert upstream commits breaking Unix socket support for Redis

This commit is contained in:
Julien Moutinho 2022-02-12 00:42:12 +01:00
parent 8f89db3252
commit 1d958b9a16
6 changed files with 163 additions and 0 deletions

View file

@ -48,6 +48,11 @@ buildPythonPackage rec {
inherit src version;
pname = "gitsrht";
patches = [
# Revert change breaking Unix socket support for Redis
patches/redis-socket/git/0001-Revert-Add-webhook-queue-monitoring.patch
];
nativeBuildInputs = srht.nativeBuildInputs;
propagatedBuildInputs = [

View file

@ -21,6 +21,11 @@ buildPythonPackage rec {
sha256 = "sha256-iywZ6G5E4AJevg/Q1LoB7JMJxBcsAnbhiND++mFy/bw=";
};
patches = [
# Revert change breaking Unix socket support for Redis
patches/redis-socket/lists/0001-Revert-Add-webhook-queue-monitoring.patch
];
nativeBuildInputs = srht.nativeBuildInputs;
propagatedBuildInputs = [

View file

@ -0,0 +1,50 @@
From 5ccb5386304c26f25b0a9eb10ce9edb6da32f91a Mon Sep 17 00:00:00 2001
From: Julien Moutinho <julm+srht@sourcephile.fr>
Date: Sat, 12 Feb 2022 00:11:59 +0100
Subject: [PATCH git.sr.ht] Revert "Add webhook queue monitoring"
This reverts commit 7ea630b776947ab82438d0ffa263b0f9d33ebff3.
Which has broken Unix socket support for Redis.
See https://lists.sr.ht/~sircmpwn/sr.ht-dev/%3C20211208082636.65665-1-me%40ignaskiela.eu%3E#%3C20211216033723.wefibfulfjhqnhem@sourcephile.fr%3E
---
gitsrht/app.py | 3 ---
gitsrht/webhooks.py | 5 +----
2 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/gitsrht/app.py b/gitsrht/app.py
index e9ccb56..4928851 100644
--- a/gitsrht/app.py
+++ b/gitsrht/app.py
@@ -48,9 +48,6 @@ class GitApp(ScmSrhtFlask):
self.add_template_filter(url_quote)
self.add_template_filter(commit_links)
- from gitsrht.webhooks import webhook_metrics_collector
- self.metrics_registry.register(webhook_metrics_collector)
-
@self.context_processor
def inject():
notice = session.get("notice")
diff --git a/gitsrht/webhooks.py b/gitsrht/webhooks.py
index 8a203fe..6240d50 100644
--- a/gitsrht/webhooks.py
+++ b/gitsrht/webhooks.py
@@ -7,13 +7,10 @@ if not hasattr(db, "session"):
db.init()
from srht.webhook import Event
from srht.webhook.celery import CeleryWebhook, make_worker
-from srht.metrics import RedisQueueCollector
from scmsrht.webhooks import UserWebhook
import sqlalchemy as sa
-webhook_broker = cfg("git.sr.ht", "webhooks")
-worker = make_worker(broker=webhook_broker)
-webhook_metrics_collector = RedisQueueCollector(webhook_broker, "srht_webhooks", "Webhook queue length")
+worker = make_worker(broker=cfg("git.sr.ht", "webhooks"))
class RepoWebhook(CeleryWebhook):
events = [
--
2.34.1

View file

@ -0,0 +1,48 @@
From 730e090f31b150d42be4b4722751f8e4610835b0 Mon Sep 17 00:00:00 2001
From: Julien Moutinho <julm+srht@sourcephile.fr>
Date: Sat, 12 Feb 2022 00:38:12 +0100
Subject: [PATCH lists.sr.ht] Revert "Add webhook queue monitoring"
This reverts commit e74e344808e8d523a9786cefcbf64c9a247d7a0e.
Which has broken Unix socket support for Redis.
See https://lists.sr.ht/~sircmpwn/sr.ht-dev/%3C20211208082636.65665-1-me%40ignaskiela.eu%3E#%3C20211216033723.wefibfulfjhqnhem@sourcephile.fr%3E
---
listssrht/app.py | 3 ---
listssrht/webhooks.py | 5 +----
2 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/listssrht/app.py b/listssrht/app.py
index aec59f3..83a355d 100644
--- a/listssrht/app.py
+++ b/listssrht/app.py
@@ -29,9 +29,6 @@ class ListsApp(SrhtFlask):
self.register_blueprint(user)
self.register_blueprint(gql_blueprint)
- from listssrht.webhooks import webhook_metrics_collector
- self.metrics_registry.register(webhook_metrics_collector)
-
@self.context_processor
def inject():
from listssrht.types import ListAccess
diff --git a/listssrht/webhooks.py b/listssrht/webhooks.py
index ae5b1cb..86421ba 100644
--- a/listssrht/webhooks.py
+++ b/listssrht/webhooks.py
@@ -8,11 +8,8 @@ if not hasattr(db, "session"):
db.init()
from srht.webhook import Event
from srht.webhook.celery import CeleryWebhook, make_worker
-from srht.metrics import RedisQueueCollector
-webhook_broker = cfg("lists.sr.ht", "webhooks")
-worker = make_worker(broker=webhook_broker)
-webhook_metrics_collector = RedisQueueCollector(webhook_broker, "srht_webhooks", "Webhook queue length")
+worker = make_worker(broker=cfg("lists.sr.ht", "webhooks"))
class ListWebhook(CeleryWebhook):
events = [
--
2.34.1

View file

@ -0,0 +1,50 @@
From 42a27ea60d8454552d54e1f51f1b976d1067fc32 Mon Sep 17 00:00:00 2001
From: Julien Moutinho <julm+srht@sourcephile.fr>
Date: Sat, 12 Feb 2022 00:30:29 +0100
Subject: [PATCH todo.sr.ht] Revert "Add webhook queue monitoring"
This reverts commit 320a5e8f7cd16ca43928c36f0320593f84d986fa.
Which has broken Unix socket support for Redis.
See https://lists.sr.ht/~sircmpwn/sr.ht-dev/%3C20211208082636.65665-1-me%40ignaskiela.eu%3E#%3C20211216033723.wefibfulfjhqnhem@sourcephile.fr%3E
---
todosrht/flask.py | 3 ---
todosrht/webhooks.py | 6 +-----
2 files changed, 1 insertion(+), 8 deletions(-)
diff --git a/todosrht/flask.py b/todosrht/flask.py
index 5e8ac66..9d0fd27 100644
--- a/todosrht/flask.py
+++ b/todosrht/flask.py
@@ -43,9 +43,6 @@ class TodoApp(SrhtFlask):
self.add_template_filter(urls.tracker_url)
self.add_template_filter(urls.user_url)
- from todosrht.webhooks import webhook_metrics_collector
- self.metrics_registry.register(webhook_metrics_collector)
-
@self.context_processor
def inject():
return {
diff --git a/todosrht/webhooks.py b/todosrht/webhooks.py
index eb8e08a..950047f 100644
--- a/todosrht/webhooks.py
+++ b/todosrht/webhooks.py
@@ -7,13 +7,9 @@ if not hasattr(db, "session"):
db.init()
from srht.webhook import Event
from srht.webhook.celery import CeleryWebhook, make_worker
-from srht.metrics import RedisQueueCollector
import sqlalchemy as sa
-
-webhooks_broker = cfg("todo.sr.ht", "webhooks")
-worker = make_worker(broker=webhooks_broker)
-webhook_metrics_collector = RedisQueueCollector(webhooks_broker, "srht_webhooks", "Webhook queue length")
+worker = make_worker(broker=cfg("todo.sr.ht", "webhooks"))
import todosrht.tracker_import
--
2.34.1

View file

@ -21,6 +21,11 @@ buildPythonPackage rec {
sha256 = "sha256-P0xaQpK7O9zipGSIa5jL1O0L/fKt51EMNGt7XndYQ+g=";
};
patches = [
# Revert change breaking Unix socket support for Redis
patches/redis-socket/todo/0001-Revert-Add-webhook-queue-monitoring.patch
];
nativeBuildInputs = srht.nativeBuildInputs;
propagatedBuildInputs = [