~sircmpwn/sr.ht-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

[PATCH hub.sr.ht] Submit build for prefix-less patches if project has a single repo

Details
Message ID
<RvkGUH0a6VK6oJIbF9RJX5S0KgJJD5RuiD89lLA7I@cp4-web-036.plabs.ch>
DKIM signature
pass
Download raw message
Patch: +11 -9
When a hub project has a single repository configured, trigger
builds for patch submissions with that repository.
---
 hubsrht/builds.py | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/hubsrht/builds.py b/hubsrht/builds.py
index 8a79160b2ae3..c40b0b7d6d0f 100644
--- a/hubsrht/builds.py
+++ b/hubsrht/builds.py
@@ -20,16 +20,18 @@ def submit_patchset(ml, payload):
    subject = payload["subject"]

    prefix = payload["prefix"]
    if not prefix:
        # TODO: More sophisticated matching is possible
        # - test if patch is applicable to a repo; see the following:
        #   https://github.com/libgit2/pygit2/pull/1019
        # Will be useful for mailing lists shared by many repositories
        return None
    # TODO: More sophisticated matching is possible
    # - test if patch is applicable to a repo; see the following:
    #   https://github.com/libgit2/pygit2/pull/1019
    # Will be useful for mailing lists shared by many repositories
    if prefix:
        repo = (SourceRepo.query
                .filter(SourceRepo.project_id == project.id)
                .filter(func.lower(SourceRepo.name) == prefix.lower())).one_or_none()
    else:
        repo = (SourceRepo.query
                .filter(SourceRepo.project_id == project.id)).one_or_none()

    repo = (SourceRepo.query
            .filter(SourceRepo.project_id == project.id)
            .filter(func.lower(SourceRepo.name) == prefix.lower())).one_or_none()
    if not repo:
        return None
    if repo.repo_type != RepoType.git:
-- 
2.32.0
Details
Message ID
<CCZNEZIFQES7.1USHKUOPHN1HQ@taiga>
In-Reply-To
<RvkGUH0a6VK6oJIbF9RJX5S0KgJJD5RuiD89lLA7I@cp4-web-036.plabs.ch> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
The issue here is if one mailing list is shared between many projects.
We should be able to detect this also with a slightly different SQL
query.

[hub.sr.ht/patches] build failed

builds.sr.ht
Details
Message ID
<CCZNFSUGXVMI.10EVC2R0A8LSF@cirno2>
In-Reply-To
<RvkGUH0a6VK6oJIbF9RJX5S0KgJJD5RuiD89lLA7I@cp4-web-036.plabs.ch> (view parent)
DKIM signature
missing
Download raw message
hub.sr.ht/patches: FAILED in 1m57s

[Submit build for prefix-less patches if project has a single repo][0] from [Simon Ser][1]

[0]: https://lists.sr.ht/~sircmpwn/sr.ht-dev/patches/23933
[1]: contact@emersion.fr

✗ #550100 FAILED  hub.sr.ht/patches/archlinux.yml https://builds.sr.ht/~sircmpwn/job/550100
✓ #550101 SUCCESS hub.sr.ht/patches/debian.yml    https://builds.sr.ht/~sircmpwn/job/550101
✓ #550099 SUCCESS hub.sr.ht/patches/alpine.yml    https://builds.sr.ht/~sircmpwn/job/550099
Reply to thread Export thread (mbox)