~rycwo

United Kingdom

https://rycwo.xyz/

Software developer. Passionate about computer graphics, linear algebra, software freedom and simplicity.

~rycwo/general-dev

Last active 2 months ago

~rycwo/everything-else

Last active 2 months ago
View more

Recent activity

[PATCH man.sr.ht] Remove code element for read/write clone URL 13 days ago

From Ryan Chan to ~sircmpwn/sr.ht-dev

---
This change makes the URL consistent with git.sr.ht.

 mansrht/templates/content.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mansrht/templates/content.html b/mansrht/templates/content.html
index 940869c..542a434 100644
--- a/mansrht/templates/content.html
+++ b/mansrht/templates/content.html
@@ -99,7 +99,7 @@ Date:   {{ repo.commit_time }}
           <a href={{ url }}>{{ url }}</a>
           <span class="text-muted pull-right">(read-only)</span><br />
           {% else %}
[message trimmed]

Re: [PATCH sr.ht-docs] Document settings for wikis 2 months ago

From Ryan Chan to ~sircmpwn/sr.ht-dev

Yep - copy/paste mistake. Just made a new patch to fix that, thanks.

[PATCH sr.ht-docs] Fix typo in man.sr.ht manual 2 months ago

From Ryan Chan to ~sircmpwn/sr.ht-dev

---
Fixes a typo spotted by Chris Waldon.

 man.sr.ht/index.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/man.sr.ht/index.md b/man.sr.ht/index.md
index 99e9a40..5aad612 100644
--- a/man.sr.ht/index.md
+++ b/man.sr.ht/index.md
@@ -59,6 +59,6 @@ logged in. Wikis that are private can only be viewed by the owner.
 
 ### Delete
 
[message trimmed]

[PATCH sr.ht-docs] Document settings for wikis 2 months ago

From Ryan Chan to ~sircmpwn/sr.ht-dev

---
 man.sr.ht/index.md | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/man.sr.ht/index.md b/man.sr.ht/index.md
index d58e208..99e9a40 100644
--- a/man.sr.ht/index.md
+++ b/man.sr.ht/index.md
@@ -44,3 +44,21 @@ Publishing your changes is as easy as committing them and pushing them
 upstream. You can collaborate with others on your wiki the same way you
 do on your git.sr.ht projects - a mailing list on lists.sr.ht or
 any other approach that you like.
+
+## Settings
[message trimmed]

[PATCH core.sr.ht] Fix webhook deletion API 2 months ago

From Ryan Chan to ~sircmpwn/sr.ht-dev

dict access in api.ensure_webhooks() was broken because the url was being
replaced when deleting the webhook.
---
 srht/api.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/srht/api.py b/srht/api.py
index 33fd481..305ed5a 100644
--- a/srht/api.py
+++ b/srht/api.py
@@ -70,8 +70,8 @@ def ensure_webhooks(token, baseurl, webhooks):
             del webhooks[url]
             continue # This webhook already configured
         # This webhook is set up incorrectly, delete it
[message trimmed]

Re: [PATCH core.sr.ht] Fix scope checks for webhook subscriptions 2 months ago

From Ryan Chan to ~sircmpwn/sr.ht-dev

On 02-08-2019 15:35, Drew DeVault wrote:
> I hit this same issue yesterday and fixed it differently. Thanks 
> though!

Ah cool. (b^_^)b

[PATCH 3/3] Nullify commit fields for deleted refs 2 months ago

From Ryan Chan to ~sircmpwn/sr.ht-dev

Wikis should display the "new-wiki" page when their corresponding refs are
deleted. This changes ensures that case is handled.
---
 mansrht/blueprints/notify.py | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/mansrht/blueprints/notify.py b/mansrht/blueprints/notify.py
index 045f095..d2ad381 100644
--- a/mansrht/blueprints/notify.py
+++ b/mansrht/blueprints/notify.py
@@ -29,14 +29,22 @@ def ref_update(repo_id):
     for ref in payload["refs"]:
         if ref["name"] == f"refs/heads/{repo.ref}":
             commit = ref.get("new")
[message trimmed]

[PATCH 2/3] Subscribe to webhooks for repo update/delete 2 months ago

From Ryan Chan to ~sircmpwn/sr.ht-dev

Take repo:update and repo:delete events into account so that wikis are updated
accordingly. repo:post-update events now use repo ids as the callback so that
they are "name independent". Repos that are renamed are simply updated in the
db, whilst repos that are deleted also delete their corresponding repos.
---
 ...3db6b65_add_resource_id_to_backing_repo.py | 24 +++++++
 .../e24445a6fabb_add_repo_webhooks_to_user.py | 24 +++++++
 mansrht/blueprints/create.py                  | 23 ++++--
 mansrht/blueprints/manage.py                  |  2 +
 mansrht/blueprints/notify.py                  | 47 ++++++++++--
 mansrht/repo.py                               | 71 ++++++++++++++-----
 mansrht/types/__init__.py                     |  4 +-
 mansrht/types/repo.py                         |  3 +-
 mansrht/wikis.py                              | 22 ++++--
[message trimmed]

[PATCH 1/3] Fix deletion of root wiki 2 months ago

From Ryan Chan to ~sircmpwn/sr.ht-dev

---
 mansrht/wikis.py | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/mansrht/wikis.py b/mansrht/wikis.py
index 0d050d0..6a80ee7 100644
--- a/mansrht/wikis.py
+++ b/mansrht/wikis.py
@@ -75,11 +75,9 @@ def delete_wiki(wiki, owner, delete_from_backend=False):
         backend.delete_repo(repo.name)
 
     root_wiki = RootWiki.query.all()
-    if root_wiki:
-        root_wiki = Wiki.query.filter(Wiki.id == root_wiki[0].id).first()
[message trimmed]

[PATCH man.sr.ht 0/3] Support repo rename/delete for git-backed wikis 2 months ago

From Ryan Chan to ~sircmpwn/sr.ht-dev

I've addressed a couple of the points ddevault mentioned on #sr.ht and squashed
a couple of additional bugs I found. Not 100% sure about deleting the wiki if
the repo is deleted but that _seems_ to make the most sense to me. Maybe there
needs to be an additional warning on the git.sr.ht side, "if this is used to
back a wiki, the wiki will be deleted too!"

These changes should be applied on top of the backend-overhaul branch.

Ryan Chan (3):
  Fix deletion of root wiki
  Subscribe to webhooks for repo update/delete
  Nullify commit fields for deleted refs

 ...3db6b65_add_resource_id_to_backing_repo.py | 24 +++++++