~comcloudway/builds.sr.ht

d76476e05859015bf06cd5cf8b84ff6c04dd3877 — Thorben Günther 1 year, 7 months ago f67dbed
Fix secret parsing

Currently builds which use secrets will fail [1] with:
Error: GetSecret: pq: invalid input syntax for type uuid: "None"

That is caused by the uuid_or_string function never returning anything,
so the secrets array will simply consist of "None".

[1]: https://builds.sr.ht/~sircmpwn/job/947773
1 files changed, 3 insertions(+), 4 deletions(-)

M buildsrht/manifest.py
M buildsrht/manifest.py => buildsrht/manifest.py +3 -4
@@ 89,12 89,11 @@ class Manifest:

            def uuid_or_string(s):
                try:
                    uuid.UUID(s)
                    return uuid.UUID(s)
                except ValueError:
                    if len(s) >= 3 and len(s) <= 512:
                        s
                    else:
                        raise Exception("Secret names must be between 3 and 512 chars")
                        return s
                    raise Exception("Secret names must be between 3 and 512 chars")

            secrets = list(map(uuid_or_string, secrets))
        if shell is not None and not isinstance(shell, bool):