~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] hubsrht: Use repository visibility for builds

Details
Message ID
<20230418232910.28987-1-adnan@maolood.com>
DKIM signature
pass
Download raw message
Patch: +35 -8
---
 hubsrht/builds.py   |  3 ++-
 hubsrht/services.py | 40 +++++++++++++++++++++++++++++++++-------
 2 files changed, 35 insertions(+), 8 deletions(-)

diff --git a/hubsrht/builds.py b/hubsrht/builds.py
index 604f8a4..88f900d 100644
--- a/hubsrht/builds.py
+++ b/hubsrht/builds.py
@@ -107,7 +107,8 @@ git am -3 /tmp/{payload["id"]}.patch"""
        }))

        b = builds.submit_build(project.owner, manifest, build_note,
            tags=[repo.name, "patches", key], execute=False, valid=valid)
            tags=[repo.name, "patches", key], execute=False, valid=valid,
            visibility=repo.visibility)
        ids.append(b["id"])
        build_url = f"{buildsrht}/{project.owner.canonical_name}/job/{b['id']}"
        lists.patchset_update_tool(ml.owner, tool_id, "WAITING",
diff --git a/hubsrht/services.py b/hubsrht/services.py
index 5463ea4..fd75907 100644
--- a/hubsrht/services.py
+++ b/hubsrht/services.py
@@ -572,14 +572,40 @@ class TodoService(SrhtService):
        self.put(user, None, url, payload)

class BuildService(SrhtService):
    def submit_build(self, user, manifest, note, tags, execute=True, valid=None):
        return self.post(user, valid, f"{_buildsrht}/api/jobs", {
            "manifest": yaml.dump(manifest.to_dict(), default_flow_style=False),
            "tags": tags,
            "note": note,
            "secrets": False,
            "execute": execute,
    def submit_build(self, user, manifest, note, tags, execute=True, valid=None, visibility=None):
        query = """
        mutation SubmitBuild(
            $manifest: String!,
            $note: String,
            $tags: [String!],
            $secrets: Boolean,
            $execute: Boolean,
            $visibility: Visibility,
        ) {
            submit(
                manifest: $manifest,
                note: $note,
                tags: $tags,
                secrets: $secrets,
                execute: $execute,
                visibility: $visibility,
            ) {
                id
            }
        }
        """
        r = self.post(user, valid, f"{_buildsrht_api}/query", {
            "query": query,
            "variables": {
                "manifest": yaml.dump(manifest.to_dict(), default_flow_style=False),
                "tags": tags,
                "note": note,
                "secrets": False,
                "execute": execute,
                "visibility": visibility.value if visibility else None,
            },
        })
        return r["data"]["submit"]

    def create_group(self, user, job_ids, note, triggers, valid=None):
        return self.post(user, valid, f"{_buildsrht}/api/job-group", {

base-commit: f362bd8835e90c9fe4a30504059437cd5dfb8471
-- 
2.40.0

[hub.sr.ht/patches] build failed

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CS09WK9RRECT.VQN2C648NRTA@cirno2>
In-Reply-To
<20230418232910.28987-1-adnan@maolood.com> (view parent)
DKIM signature
missing
Download raw message
hub.sr.ht/patches: FAILED in 3m26s

[hubsrht: Use repository visibility for builds][0] from [Adnan Maolood][1]

[0]: https://lists.sr.ht/~sircmpwn/sr.ht-dev/patches/40471
[1]: adnan@maolood.com

✓ #975876 SUCCESS hub.sr.ht/patches/alpine.yml    https://builds.sr.ht/~sircmpwn/job/975876
✗ #975877 FAILED  hub.sr.ht/patches/archlinux.yml https://builds.sr.ht/~sircmpwn/job/975877
✓ #975878 SUCCESS hub.sr.ht/patches/debian.yml    https://builds.sr.ht/~sircmpwn/job/975878
Details
Message ID
<CS0JVNG0XU99.2HCR3Q7JJD9S7@taiga>
In-Reply-To
<20230418232910.28987-1-adnan@maolood.com> (view parent)
DKIM signature
pass
Download raw message
Thanks!

To git@git.sr.ht:~sircmpwn/hub.sr.ht
   f362bd8..c4e50c6  master -> master
Reply to thread Export thread (mbox)