Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85651055
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1011 B
Referenced Files
None
Subscribers
None
View Options
diff --git a/lilybuild/lilybuild/forgejo.py b/lilybuild/lilybuild/forgejo.py
index b320f22..d53060c 100644
--- a/lilybuild/lilybuild/forgejo.py
+++ b/lilybuild/lilybuild/forgejo.py
@@ -1,23 +1,24 @@
from twisted.internet import defer
from buildbot.www.hooks.github import GitHubEventHandler
PARENT_FIRST = 'PARENT_FIRST'
CHILD_FIRST = 'CHILD_FIRST'
# Forgejo webhooks return the commits in child-first order
# https://codeberg.org/forgejo/forgejo/issues/7737
# This helper class intercepts the payload and reverse the
# order of the commits.
+
class ForgejoEventHandler(GitHubEventHandler):
def __init__(self, commits_order=CHILD_FIRST, **kwargs):
self.commits_order = commits_order
super().__init__(**kwargs)
@defer.inlineCallbacks
def _get_payload(self, request):
payload = yield super()._get_payload(request)
if 'commits' in payload and self.commits_order == CHILD_FIRST:
payload['commits'].reverse()
return payload
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Aug 30, 10:59 AM (1 d, 21 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1737930
Default Alt Text
(1011 B)
Attached To
Mode
rB lilybuild
Attached
Detach File
Event Timeline
Log In to Comment