~sircmpwn/dispatch.sr.ht

3bfde11e943b03e4daca08e6e49dff3df4a52165 — Mykyta Holubakha 2 months ago bcc4c95 0.13.4
Tasks: use builds hostname in context
2 files changed, 6 insertions(+), 4 deletions(-)

M dispatchsrht/tasks/github/common.py
M dispatchsrht/tasks/gitlab/common.py
M dispatchsrht/tasks/github/common.py => dispatchsrht/tasks/github/common.py +3 -2
@@ 14,7 14,7 @@ from srht.config import cfg
from srht.database import Base, db
from srht.flask import csrf_bypass
from srht.oauth import current_user, loginrequired
from urllib.parse import urlencode
from urllib.parse import urlencode, urlparse

_github_client_id = cfg("dispatch.sr.ht::github",
        "oauth-client-id", default=None)


@@ 90,7 90,8 @@ def github_callback():
    db.session.commit()
    return redirect(state)

context = lambda name: "builds.sr.ht" + (f": {name}" if name else "")
context = lambda name: urlparse(_builds_sr_ht).netloc + (f": {name}" if name else "")


def source_url(repo, base, git_commit, source):
    if not source.endswith("/" + base.name):

M dispatchsrht/tasks/gitlab/common.py => dispatchsrht/tasks/gitlab/common.py +3 -2
@@ 12,7 12,7 @@ from srht.config import cfg, cfgb
from srht.database import Base, db
from srht.flask import csrf_bypass
from srht.oauth import current_user, loginrequired
from urllib.parse import urlencode
from urllib.parse import urlencode, urlparse

_root = cfg("dispatch.sr.ht", "origin")
_builds_sr_ht = cfg("builds.sr.ht", "origin", default=None)


@@ 117,7 117,8 @@ def source_url(project, commit, url, source):
        return project.attributes['ssh_url_to_repo'] + "#" + commit.get_id()
    return project.attributes['http_url_to_repo'] + "#" + commit.get_id()

context = lambda name: "builds.sr.ht" + (f": {name}" if name else "")
context = lambda name: urlparse(_builds_sr_ht).netloc + (f": {name}" if name else "")


def update_preparing(commit):
    def go(name):