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

When creating a request with the POST /request?cmd=create endpoint, an optional review requires a state parameter that is ignored #17028

Open
oSoMoN opened this issue Oct 28, 2024 · 3 comments

Comments

@oSoMoN
Copy link
Contributor

oSoMoN commented Oct 28, 2024

When using the POST /request?cmd=create API endpoint to create a new request, an optional <review> tag without a state attribute results in an HTTP 400 (bad request).

But if I set the state attribute to a valid value (e.g. "declined"), it is ignored and reset to "new".

Expected result

  • If I specify a valid state value, that value should be honoured, not reset to "new".
  • I should be able to create a request with a review with no state, and the build service would default it to "new".
@eduardoj
Copy link
Member

The state attribute of a review element is ignored by design. See: b15cf19

You can always create a request, and then add reviews.

@oSoMoN
Copy link
Contributor Author

oSoMoN commented Oct 29, 2024

The state attribute of a review element is ignored by design. See: b15cf19

Ok, so the first point in "Expected result" can be discarded.

What about the second point, i.e. not validating strictly the RNG schema, to allow creating a request containing a review without a state?

@eduardoj
Copy link
Member

The state attribute of a review element is ignored by design. See: b15cf19

Ok, so the first point in "Expected result" can be discarded.

👍

What about the second point, i.e. not validating strictly the RNG schema, to allow creating a request containing a review without a state?

That can work, yes.

However, I would be more in favor of following the RNG schema in every case, also for creating a request. I mean, when creating a request, it should be checked that all of its reviews have the state new.

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

No branches or pull requests

2 participants