mesa/.gitlab-ci/lava
Guilherme Gallo bc86b73bbe ci/lava: Fix lava-tags parsing
python-fire auto-converts `item1,item2` into a tuple, but if there is a
dash `-` inside the argument, it treats it as a string.

Let's validate the data, when it comes as a `str` or `tuple`.

For more details, here are the tested scenarios:

| --lava-tags= | Type  | Value               |
|--------------|-------|---------------------|
| None         | bool  | True                |
| ''           | str   | ''                  |
| tag1         | str   | "tag1"              |
| tag1,        | tuple | ("tag1",)           |
| tag-1,tag-2  | str   | 'tag-1,tag-2'       |
| tag1,tag2    | tuple | ("tag1", "tag2")    |
| ','          | str   | ','                 |
| ',,'         | str   | ',,'                |
| 'tag1,,'     | str   | 'tag1,,'            |

See also:
https://google.github.io/python-fire/guide/#argument-parsing

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31882>
2024-10-31 18:00:27 +00:00
..
utils ci/lava: Fix lava-tags parsing 2024-10-31 18:00:27 +00:00
__init__.py ci/lava: Create LogFollower and move logging methods 2022-07-07 00:28:53 +00:00
exceptions.py ci/lava: Introduce unretriable exception handling 2024-04-22 21:20:07 +00:00
lava_job_submitter.py ci/lava: Fix lava-tags parsing 2024-10-31 18:00:27 +00:00
lava-gitlab-ci.yml ci/lava: Quieten timestamp warnings from tar 2024-10-20 11:32:42 +01:00
lava-submit.sh ci/lava: Refactor is-rootfs-uploaded function 2024-10-31 18:00:27 +00:00