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

[uss_qualifier] scd CRSimple checks that mutation is only allowed with the correct OVN #765

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

Shastick
Copy link
Contributor

last piece to implement #760 by having a test case explicitly dedicated to attempting mutation with missing an incorrect OVNs

Only the last commit of this PR is relevant, this will remain a draft until #762 is merged.

Comment on lines +138 to +140
if qe.cause_status_code in [400, 404, 409]:
# An empty OVN can be seen as:
# an incorrect parameter (400), a reference to a non-existing entity (404) as well as a conflict (409)
Copy link
Contributor

Choose a reason for hiding this comment

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

Looking at the OpenAPI definition, I don't think it is correct to add a 404 here. The description is The requested Entity could not be found. The OVN is not an entity.
What motivates this addition?

Copy link
Contributor Author

@Shastick Shastick Sep 13, 2024

Choose a reason for hiding this comment

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

This comment on the equivalent PR for OIRs, so I'm aligning this scenario with it too.

We don't request from an implementation that they send a 404, but returning a 404 would not be entirely wrong either, and we generally want to have a reasonably wide interpretation.

Copy link
Member

Choose a reason for hiding this comment

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

I agree there is some ambiguity in the 404 language. It could be read as "The requested Entity could not be found", meaning that the Entity existing and just not having the specified OVN should not return 404, but rather necessarily 400 or 409. The way I read it is "The requested Entity could not be found", meaning that the Entity, as requested (where request includes specification of the OVN -- essentially a subindex), could not be found. So, I would keep the 404 addition as that also matches the conceptual REST paradigm of a subfolder referring to subresources, and a 404 is the appropriate RESTful response to the absence of the requested subresource. I unfortunately can't make the meeting this week, but I don't feel super strongly about this if there is strong disagreement.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair enough!

)
except QueryError as qe:
self.record_queries(qe.queries)
if qe.cause_status_code in [400, 404, 409]:
Copy link
Contributor

Choose a reason for hiding this comment

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

Same remark as above.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same reply as above

@Shastick
Copy link
Contributor Author

Note: prober step failed while pulling the base image:

ERROR: failed to solve: python:3.12.6-slim: failed to resolve source metadata for docker.io/library/python:3.12.6-slim: failed to authorize: failed to fetch oauth token: unexpected status from POST request to https://auth.docker.io/token: 502 Bad Gateway

I start observing these once or twice a week.

Copy link
Contributor

@mickmis mickmis left a comment

Choose a reason for hiding this comment

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

LGTM

@mickmis mickmis merged commit 9c7934e into interuss:main Sep 24, 2024
20 checks passed
@mickmis mickmis deleted the cr-simple-mutation-scenario branch September 24, 2024 09:57
github-actions bot added a commit that referenced this pull request Sep 24, 2024
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.

3 participants