fix: annotate push() subject as oras.oci.Subject - #256
Shubham-Padkonde wants to merge 3 commits into
Conversation
push() documents subject as oras.oci.Subject and serializes it with dataclasses.asdict(), but the parameter was annotated Optional[str], so type checkers rejected the documented usage push(..., subject=Subject.from_manifest(manifest)). Closes oras-project#253 Signed-off-by: Shubham Padkonde <shubhampadkonde12@gmail.com>
| uploaded["manifest"] = manifest | ||
| return Response() | ||
|
|
||
| container = client.get_container("registry.example/repository:tag") |
There was a problem hiding this comment.
Do we not want to test this with the testing (real) registry?
Signed-off-by: Shubham Padkonde <shubhampadkonde12@gmail.com>
|
Added the real-registry regression in dea276a: it pushes an artifact with subject metadata and checks the subject descriptor returned by the registry. The two subject tests passed against a local Distribution registry before this identical patch was signed; formatting, import ordering, pyflakes and diff checks passed. Hosted checks are running. Prepared with Codex assistance. |
|
The intent of my comment is to ask what is the point of doing monkeypatch if the best test is against a real registry. |
Signed-off-by: Shubham Padkonde <shubhampadkonde12@gmail.com>
|
Removed the mocked subject-upload test in 02c653b and retained the real-registry round-trip test, including the public type-annotation assertion. The retained test passes against the local Distribution registry; Black and isort checks pass. Hosted CI is rerunning. Prepared with Codex assistance. |
push() documents subject as oras.oci.Subject and serializes it with dataclasses.asdict(), but the parameter was annotated Optional[str], so type checkers rejected the documented usage
push(..., subject=Subject.from_manifest(manifest)).
Closes #253