Skip to content

Platform 1331 httpurl - #48

Merged
irt-shpc merged 4 commits into
mainfrom
PLATFORM-1331-httpurl
Aug 3, 2026
Merged

Platform 1331 httpurl#48
irt-shpc merged 4 commits into
mainfrom
PLATFORM-1331-httpurl

Conversation

@irt-shpc

@irt-shpc irt-shpc commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

The use of subscripted annotated types breaks the isintance check. Revert to using normal pydantic types.
Following the Helm Go code validate the icon in metadata is a valid Url but nothing more stringent.

@irt-shpc
irt-shpc force-pushed the PLATFORM-1331-httpurl branch from ab98b26 to 9293ee7 Compare July 28, 2026 15:00
irt-shpc added a commit that referenced this pull request Jul 28, 2026
The `t.Annotated[str, AfterValidator(validate_str_as(PydanticHttpUrl))]`
construction cannot be used in `isinstance` for Python >=3.11 as it a
subscripted type. In current versions of Python and Pydantic it is recommended
to just use the Pydantic types unless the object absolutely requires
handling as a string. That is not the case in PyHelm3 so use the Pydantic types
as is.

Resolves GitHub issue #48
@irt-shpc
irt-shpc force-pushed the PLATFORM-1331-httpurl branch from 9293ee7 to 14e7c96 Compare July 28, 2026 15:01
irt-shpc added a commit that referenced this pull request Jul 29, 2026
The `t.Annotated[str, AfterValidator(validate_str_as(PydanticHttpUrl))]`
construction cannot be used in `isinstance` for Python >=3.11 as it a
subscripted type. In current versions of Python and pydantic it is recommended
to just use the pydantic types unless the object absolutely requires
handling as a string. That is not the case in pyhelm3 so use the pydantic types
as is.

Furthermore the Go code in Helm only validates that icon is a valid Url
according to RFC 3986 (see
https://github.com/helm/helm/blob/7e641d30a9355b43a9729d04c2771215ed926899/internal/chart/v3/lint/rules/chartfile.go#L193
for the implementation). Therefore use the pydantic `AnyUrl` for the icon field.

Resolves GitHub issue #48
@irt-shpc
irt-shpc force-pushed the PLATFORM-1331-httpurl branch from 14e7c96 to 7ba2f11 Compare July 29, 2026 08:37
The `t.Annotated[str, AfterValidator(validate_str_as(PydanticHttpUrl))]`
construction cannot be used in `isinstance` for Python >=3.11 as it a
subscripted type. In current versions of Python and pydantic it is recommended
to just use the pydantic types unless the object absolutely requires
handling as a string. That is not the case in pyhelm3 so use the pydantic types
as is.

Furthermore the Go code in Helm only validates that icon is a valid Url
according to RFC 3986 (see
https://github.com/helm/helm/blob/7e641d30a9355b43a9729d04c2771215ed926899/internal/chart/v3/lint/rules/chartfile.go#L193
for the implementation). Therefore use the pydantic `AnyUrl` for the icon field.

Resolves GitHub issue #48
@irt-shpc
irt-shpc force-pushed the PLATFORM-1331-httpurl branch from 7ba2f11 to d9d9b3a Compare July 29, 2026 08:40
@irt-shpc
irt-shpc requested a review from amanning9 July 29, 2026 08:40
@irt-shpc
irt-shpc force-pushed the PLATFORM-1331-httpurl branch from d9d9b3a to 5105e8f Compare July 29, 2026 08:42
irt-shpc added 3 commits July 29, 2026 09:43
…urces

Add test cases to create Chart objects from a http url and a local path (as well
as the existing OCI path). Also test that a data url is loaded and handled
correctly.
…pytest

Pytest is quite verbose about reporting warnings that arise during testing,
update packages and deprecated function calls arising from test execution.
@irt-shpc
irt-shpc force-pushed the PLATFORM-1331-httpurl branch from 5105e8f to 53ebb5d Compare July 29, 2026 08:43
@irt-shpc
irt-shpc requested a review from wtripp180901 July 29, 2026 08:59

@wtripp180901 wtripp180901 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants