Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Payload validation #534

Merged
merged 1 commit into from Aug 3, 2022
Merged

Payload validation #534

merged 1 commit into from Aug 3, 2022

Conversation

mdellweg
Copy link
Member

No description provided.

@mdellweg mdellweg added this to the 0.16.0 milestone Jul 17, 2022
@mdellweg mdellweg changed the title Experiment: Payload validation Payload validation Jul 18, 2022
@mdellweg mdellweg force-pushed the components branch 3 times, most recently from 497aba0 to e8fd71e Compare July 23, 2022 10:00
@mdellweg mdellweg marked this pull request as ready for review July 23, 2022 10:01
@@ -53,7 +53,7 @@ def openapi_group() -> None:

@openapi_group.command()
@pass_pulp_context
def schema(pulp_ctx: PulpContext) -> None:
def spec(pulp_ctx: PulpContext) -> None:
Copy link
Member Author

Choose a reason for hiding this comment

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

I am wondering if we should move the whole "openapi" command group one level up (from pulp debug openapi to pulp openapi).

Copy link
Contributor

Choose a reason for hiding this comment

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

Hrm, I don't have a strong opinion either way. I think I lean ever so slightly to "leave it under the 'debug' top level, because that's what we're doing"

@mdellweg mdellweg requested a review from ggainey July 24, 2022 06:52
@@ -53,7 +53,7 @@ def openapi_group() -> None:

@openapi_group.command()
@pass_pulp_context
def schema(pulp_ctx: PulpContext) -> None:
def spec(pulp_ctx: PulpContext) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

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

Hrm, I don't have a strong opinion either way. I think I lean ever so slightly to "leave it under the 'debug' top level, because that's what we're doing"

result = pulp_ctx.api.api_spec["components"]["schemas"][schema_name]
except KeyError:
raise click.ClickException(
_("No schem component with name {schema_name} found.").format(schema_name=schema_name)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
_("No schem component with name {schema_name} found.").format(schema_name=schema_name)
_("No schema component with name {schema_name} found.").format(schema_name=schema_name)

pulpcore/cli/common/openapi.py Show resolved Hide resolved
repository_ctx.pulp_href
for repository_ctx in repository
if isinstance(repository_ctx, PulpEntityContext)
] + list(repository_href)

exporter_ctx.update(exporter_href, the_exporter)
exporter_ctx.update(exporter_href, payload)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason for this change to be linked to the openapi-validation?

Copy link
Member Author

Choose a reason for hiding this comment

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

Glad that you ask! Yes. the_exporter is the answer of a GET request and it contains fields like pulp_created, pulp_href and so on. Those are not meant to be in the set of parameters of a PATCH call. And out new linting alerts on it.

pulpcore/cli/core/importer.py Show resolved Hide resolved
tests/scripts/test_debug.sh Show resolved Hide resolved
Copy link
Contributor

@ggainey ggainey left a comment

Choose a reason for hiding this comment

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

Changes look good. The test-failures are all pulp_python and bandersnatch being mad at each other. Looks good to go otherwise.

@mdellweg mdellweg merged commit 3bd71ab into pulp:main Aug 3, 2022
@mdellweg mdellweg deleted the components branch August 3, 2022 14:17
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.

None yet

2 participants