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 scm.sr.ht] Overwrite fragment of source spec if needed

Message ID
DKIM signature
Download raw message
Patch: +4 -2
Currently, `_add_commit_id_fragment()` only tests if the `basename()` of
the sources spec matches the repo name. However, if a manifest contains
e.g. the source `https://git.sr.ht/~foo/repo#main`, the `basename()` is
"repo#main" and will not match the repo name "repo".

This causes problems, as automatically generated Manifests for patch
submissions may end with two source specs referencing the same repo,
causing the clone stage to fail.

A better approach was already taken in `_auto_setup_auto_source()` a few
lines above: properly parsing the URL and calling `basename()` only on
the path. Applying the same approach here fixes the issue.
 scmsrht/submit.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/scmsrht/submit.py b/scmsrht/submit.py
index 01e1965..9617255 100644
--- a/scmsrht/submit.py
+++ b/scmsrht/submit.py
@@ -142,8 +142,10 @@ class BuildSubmitterBase:
    def _add_commit_id_fragment(self, commit_id, m):
        sources = m.get('sources', [])
        for i, source in enumerate(sources):
            if os.path.basename(source) == self.repo.name:
                sources[i] = source + "#" + commit_id
            srcurl = urlparse(source)
            srcurl_repo_name = os.path.basename(srcurl.path)
            if srcurl_repo_name == self.repo.name:
                sources[i] = srcurl._replace(fragment=commit_id).geturl()

class SubmitResult:
    def __init__(self):

[scm.sr.ht/patches/alpine.yml] build success

builds.sr.ht <builds@sr.ht>
Message ID
<20240514112407.1023028-1-ch@bitfehler.net> (view parent)
DKIM signature
Download raw message
scm.sr.ht/patches/alpine.yml: SUCCESS in 22s

[Overwrite fragment of source spec if needed][0] from [Conrad Hoffmann][1]

[0]: https://lists.sr.ht/~sircmpwn/sr.ht-dev/patches/51838
[1]: ch@bitfehler.net

✓ #1220393 SUCCESS scm.sr.ht/patches/alpine.yml https://builds.sr.ht/~sircmpwn/job/1220393
Message ID
<20240514112407.1023028-1-ch@bitfehler.net> (view parent)
DKIM signature
Download raw message

To git@git.sr.ht:~sircmpwn/scm.sr.ht
   e9a6399..37e5f61  master -> master
Reply to thread Export thread (mbox)