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

Align quality-on-demand with Commonalties regarding optional device object and error messages #326

Conversation

hdamker
Copy link
Collaborator

@hdamker hdamker commented Jul 19, 2024

What type of PR is this?

Add one of the following kinds:

  • correction
  • documentation

What this PR does / why we need it (Updated):

  • Add documentation about "Handling of device information" within the API description. Made device parameter optional within createSession
  • Aligned Device object and info object with Commonalities
  • Updated errorMessages according to Commonalities.
    • Added 422, removed 501 (as createSession is not optional within the API, and then 501 is not any more used)
    • Replaced 400 error response examples with Generic400 from Commonalities, introduced specific error code QUALITY_ON_DEMAND.DURATION_OUT_OF_RANGE

Which issue(s) this PR fixes:

Fixes #313
Fixes #315
Fixes #316

Special notes for reviewers:

Intentionally only done for quality-on-demand to reduce potential merge conflicts.
Done for both APIs quality-on-demand and qos-profiles.

Changelog input (Updated)

Made device object optional within quality-on-demand, added documentation according to Commonalities
Updated error messages according to Commonalities, especially error messages related to device object
Introduced specific error code QUALITY_ON_DEMAND.DURATION_OUT_OF_RANGE

Add documentation about "Handling of device information" within the API description. Made device parameter optional.
Aligned Device object and info with Commonalities
Updated errorMessage according to Commonalities. Added 422, removed 501 (not used). Reduced 400 examples within createSession to the ones not covered by other codes according to chapter 6.2 of Design Guidelines.
@hdamker hdamker self-assigned this Jul 19, 2024
@hdamker
Copy link
Collaborator Author

hdamker commented Jul 19, 2024

@maxl2287 @akoshunyadi @jlurien I created the PR by intention first as draft, but would be great if you can already review.
I would like to rebase if #325 is merged (which is also correcting some errorMessages).

@eric-murray the documentation I copied from Commonalities is only referring to "device" associated with the access token. I get your point that "end user" is more correct. But do you have a proposal not to confuse API consumers here? My proposal to put "(and device)" behind end user is most probably not the best ...

Removing trailing spaces
@jlurien
Copy link
Collaborator

jlurien commented Jul 26, 2024

@hdamker are you planning to remove the draft status? This PR is key for the meta-release as it incorporates the alignments to guidelines. Once this is merged, we can adapt the remaining ones (listSessions, Provisioning) to the updated content. For listSessions I have to define same behaviour for device optionality and adopt the new errors.

@hdamker hdamker marked this pull request as ready for review July 26, 2024 10:44
@hdamker
Copy link
Collaborator Author

hdamker commented Jul 26, 2024

@jlurien Yes, removed the draft status now to be able to discuss it within the meeting. We should agree who (which PR) is changing the 404 errors.

@hdamker
Copy link
Collaborator Author

hdamker commented Jul 26, 2024

@camaraproject/quality-on-demand_maintainers:We are most probably also impacted by the discussion in camaraproject/Commonalities#259 about potential misuse of the API behaviour. Let's discuss how to deal with it in the meeting.

…ision-about-optional-device-object-and-respective-documentation
@hdamker
Copy link
Collaborator Author

hdamker commented Jul 29, 2024

As discussed within QoD Call:

Added error messages from Commonalities in 404, 422
space removed after colon
Added description for SessionInfo schema to address camaraproject#328
Remove trailing space
Added clarification to all relevant endpoints:
"The session must must have been created by the same API client given in the access token"
Removed trailing space
More trailing spaces deleted
Added (mandatory) description in info object about "Identifying a device from the access token"

Updated most error messages with copies from https://github.com/camaraproject/Commonalities/blob/main/artifacts/CAMARA_common.yaml
@jlurien
Copy link
Collaborator

jlurien commented Aug 2, 2024

Some other fixes:

should be

externalDocs:
description: Project documentation at CAMARA
url: https://github.com/camaraproject/QualityOnDemand

  • createSession should have 404 error

@jlurien jlurien self-requested a review August 2, 2024 07:24
Addressed review comments
Address review comment
externalDocs updated
@hdamker
Copy link
Collaborator Author

hdamker commented Aug 2, 2024

externalDocs:
description: Project documentation at CAMARA
url: https://github.com/camaraproject/QualityOnDemand

ExternalDocs object updated in both APIs (I had planned it for the release PR).

  • createSession should have 404 error

Ah, yes - due to the new DEVICE_NOT_FOUND - Thanks! (Nevertheless a bit strange to return 404, if the requested resource has not even been created).

@jlurien
Copy link
Collaborator

jlurien commented Aug 2, 2024

Another ones:

  • org.camaraproject.qod.v0.qos-status-changed -> org.camaraproject.quality-on-demand.vwip.qos-status-changed

Long but it should be the new API name, if we finally keep the proposal.
vwip should be changed to v0 for the rc PR but as we know it will be v0 it doesn't have an impact

  • DurationOutOfRangeForQoSProfile should not be part of Generic400 as that one should only contain the common ones. A separare 400 response would be needed for the operations that receive a duration

  • In New API QOD Provisioning #299 I have considered a Generic404 with just NOT_FOUND and GenericDevice404 with both NOT_FOUND and DEVICE_NOT_FOUND, and I have applied the latest only to operations that may expect a device (and also 422 applies to them)

jlurien added a commit to jlurien/QualityOnDemand that referenced this pull request Aug 2, 2024
@jlurien jlurien mentioned this pull request Aug 2, 2024
@hdamker
Copy link
Collaborator Author

hdamker commented Aug 2, 2024

  • org.camaraproject.qod.v0.qos-status-changed -> org.camaraproject.quality-on-demand.vwip.qos-status-changed

That outside of the scope of this PR, at least we should open an issue for that to make the change more transparent.
Is there a guideline regarding the versioning of events which is different from the API versioning? Otherwise it would be in the release v0.11rc1, but I'm not sure if this is correct.

@hdamker
Copy link
Collaborator Author

hdamker commented Aug 2, 2024

  • DurationOutOfRangeForQoSProfile should not be part of Generic400 as that one should only contain the common ones. A separare 400 response would be needed for the operations that receive a duration
  • In New API QOD Provisioning #299 I have considered a Generic404 with just NOT_FOUND and GenericDevice404 with both NOT_FOUND and DEVICE_NOT_FOUND, and I have applied the latest only to operations that may expect a device (and also 422 applies to them)

I agree that it is clearer if it is visible which examples are belonging to which operation. But in https://github.com/camaraproject/Commonalities/blob/a4f409d3c9e278bd30afc838cee8a261ff450939/artifacts/CAMARA_common.yaml#L209 Generic404 is defined with both NOT_FOUND and DEVICE_NOT_FOUND and even a placeholder for specific codes. But ok, I will apply the approach from your #299.

@jlurien
Copy link
Collaborator

jlurien commented Aug 2, 2024

  • org.camaraproject.qod.v0.qos-status-changed -> org.camaraproject.quality-on-demand.vwip.qos-status-changed

That outside of the scope of this PR, at least we should open an issue for that to make the change more transparent. Is there a guideline regarding the versioning of events which is different from the API versioning? Otherwise it would be in the release v0.11rc1, but I'm not sure if this is correct.

Good question. I though it was intended to match the major version of the API, but I guess the major version of the API could change without evolving the event version (but not the opposite).

@hdamker
Copy link
Collaborator Author

hdamker commented Aug 2, 2024

  • org.camaraproject.qod.v0.qos-status-changed -> org.camaraproject.quality-on-demand.vwip.qos-status-changed

That outside of the scope of this PR, at least we should open an issue for that to make the change more transparent. Is there a guideline regarding the versioning of events which is different from the API versioning? Otherwise it would be in the release v0.11rc1, but I'm not sure if this is correct.

Good question. I though it was intended to match the major version of the API, but I guess the major version of the API could change without evolving the event version (but not the opposite).

Created #332 for the larger topic that we missed the changes within the Event subscription model, which impacts also our implicit subscriptions. Changing the event name is the smaller problem here (btw: I would stay here with v0, not using "wip" in between - the risk is too high to oversee this in the release PR. The version of the event will get only "visible", when there is a released API Version).

Added error schema "GenericDevice404" as discussed in camaraproject#326 (comment)
@hdamker
Copy link
Collaborator Author

hdamker commented Aug 5, 2024

  • DurationOutOfRangeForQoSProfile should not be part of Generic400 as that one should only contain the common ones. A separare 400 response would be needed for the operations that receive a duration
  • In New API QOD Provisioning #299 I have considered a Generic404 with just NOT_FOUND and GenericDevice404 with both NOT_FOUND and DEVICE_NOT_FOUND, and I have applied the latest only to operations that may expect a device (and also 422 applies to them)

I agree that it is clearer if it is visible which examples are belonging to which operation. But in https://github.com/camaraproject/Commonalities/blob/a4f409d3c9e278bd30afc838cee8a261ff450939/artifacts/CAMARA_common.yaml#L209 Generic404 is defined with both NOT_FOUND and DEVICE_NOT_FOUND and even a placeholder for specific codes. But ok, I will apply the approach from your #299.

@jlurien Done in 55c609a. Please check.

@hdamker hdamker requested a review from maxl2287 August 5, 2024 08:00
@hdamker
Copy link
Collaborator Author

hdamker commented Aug 5, 2024

@jlurien @maxl2287 @eric-murray @RandyLevensalor The PR should be ready to be merged. Would be also good to get it merged soon, so that we can base the other PRs on it. Can you do a timely final review?

jlurien
jlurien previously approved these changes Aug 5, 2024
Copy link
Collaborator

@jlurien jlurien left a comment

Choose a reason for hiding this comment

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

LGTM, I assume #335 as a separate one but it is quite independent so merging order should not be relevant

MNO replaced with network operator
Copy link
Collaborator

@RandyLevensalor RandyLevensalor left a comment

Choose a reason for hiding this comment

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

LGTM

@hdamker
Copy link
Collaborator Author

hdamker commented Aug 5, 2024

Given the two approvals from @RandyLevensalor and @jlurien (before the last trivial change) I will merge this one now, so that we can continue to align the other open PRs (if needed).

Please open issues if there other alignment points with Commonalities are open.

@hdamker hdamker merged commit 8b094c7 into camaraproject:main Aug 5, 2024
1 check passed
@hdamker hdamker deleted the 313-align-with-commonality-decision-about-optional-device-object-and-respective-documentation branch August 5, 2024 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants