Skip to content

Commit 5a113a2

Browse files
committed
feat(ISV-5877): Implement uploading to TPA
Signed-off-by: Jan Koscielniak <jakoscie@redhat.com>
1 parent 54312d4 commit 5a113a2

13 files changed

Lines changed: 1143 additions & 59 deletions

File tree

poetry.lock

Lines changed: 117 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ dependencies = [
3333
"pydantic (>=2.11.4,<3.0.0)",
3434
"python-dateutil (>=2.9.0.post0,<3.0.0)",
3535
"packageurl-python (>=0.16.0,<0.17.0)",
36-
"aiofiles (>=24.1.0,<25.0.0)"
36+
"aiofiles (>=24.1.0,<25.0.0)",
37+
"httpx (>=0.28.1,<0.29.0)"
3738
]
3839

3940
[project.urls]
@@ -85,6 +86,7 @@ pylint = "^3.3.7"
8586
pytest-asyncio = "^1.0.0"
8687
types-python-dateutil = "^2.9.0.20241206"
8788
types-aiofiles = "^24.1.0.20250516"
89+
pytest-httpx = "^0.35.0"
8890

8991
[build-system]
9092
requires = ["poetry-core>=2.0.0,<3.0.0"]

src/mobster/cli.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
from pathlib import Path
55
from typing import Any
66

7-
from mobster.cmd import augment, upload
7+
from mobster.cmd import augment
88
from mobster.cmd.generate import modelcar, oci_artifact, oci_image, oci_index, product
9+
from mobster.cmd.upload import upload
910

1011

1112
def setup_arg_parser() -> argparse.ArgumentParser:
@@ -302,7 +303,10 @@ def upload_tpa_parser(subparsers: Any) -> None:
302303
default=1,
303304
help="Number of workers to execute uploads in parallel",
304305
)
305-
tpa_parser.add_argument("--from-dir", type=Path, help="Directory to upload from")
306-
tpa_parser.add_argument("--file", type=Path, help="File to upload")
306+
307+
# Create a mutually exclusive group and require one of the arguments
308+
source_group = tpa_parser.add_mutually_exclusive_group(required=True)
309+
source_group.add_argument("--from-dir", type=Path, help="Directory to upload from")
310+
source_group.add_argument("--file", type=Path, help="File to upload")
307311

308312
tpa_parser.set_defaults(func=upload.TPAUploadCommand)

src/mobster/cmd/upload.py

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/mobster/cmd/upload/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Upload module for the Mobster application."""

0 commit comments

Comments
 (0)