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

ETag for discovery resource requests with batch interface #491

Merged
merged 1 commit into from
Aug 18, 2023

Conversation

Danielius1922
Copy link
Member

Fix issues reported by SonarCloud and add tests.

@ocf-conformance-test-tool
Copy link

🎉 Thank you for your code contribution! To guarantee the change/addition is conformant to the OCF Specification, we would like to ask you to execute OCF Conformance Testing of your change ☝️ when your work is ready to be reviewed.


ℹ️ To verify your latest change (a1427cf), label this PR with OCF Conformance Testing.

⚠️ Label is removed with every code change.

@Danielius1922 Danielius1922 force-pushed the adam/feature/etag-discovery-resource branch 10 times, most recently from 841a162 to ca433a5 Compare July 30, 2023 13:27
@Danielius1922 Danielius1922 force-pushed the adam/feature/etag branch 3 times, most recently from 16a8bee to 9649776 Compare July 31, 2023 15:58
Base automatically changed from adam/feature/etag to master August 1, 2023 07:16
@Danielius1922 Danielius1922 force-pushed the adam/feature/etag-discovery-resource branch 7 times, most recently from 90507fe to 7f7d5e2 Compare August 12, 2023 12:54
api/oc_discovery.c Outdated Show resolved Hide resolved
api/oc_discovery.c Outdated Show resolved Hide resolved
api/oc_resource_internal.h Outdated Show resolved Hide resolved
messaging/coap/engine.c Outdated Show resolved Hide resolved
@Danielius1922 Danielius1922 force-pushed the adam/feature/etag-discovery-resource branch from d865ca4 to 813c683 Compare August 15, 2023 08:06
api/oc_resource_internal.h Outdated Show resolved Hide resolved
api/oc_resource.c Outdated Show resolved Hide resolved
@Danielius1922 Danielius1922 force-pushed the adam/feature/etag-discovery-resource branch from fe03708 to c8bf990 Compare August 15, 2023 14:56
api/oc_collection.c Outdated Show resolved Hide resolved
api/oc_ri.c Outdated Show resolved Hide resolved
@Danielius1922 Danielius1922 force-pushed the adam/feature/etag-discovery-resource branch from c8bf990 to fe47ee7 Compare August 15, 2023 16:19
api/oc_collection.c Outdated Show resolved Hide resolved
@Danielius1922 Danielius1922 force-pushed the adam/feature/etag-discovery-resource branch 5 times, most recently from 7e887a0 to e3b4bce Compare August 18, 2023 08:42
@jkralik jkralik marked this pull request as ready for review August 18, 2023 09:32
@Danielius1922 Danielius1922 added the OCF Conformance Testing OCF Conformance Testing required label Aug 18, 2023
@Danielius1922 Danielius1922 force-pushed the adam/feature/etag-discovery-resource branch from e3b4bce to 1e5745d Compare August 18, 2023 15:28
@ocf-conformance-test-tool ocf-conformance-test-tool bot removed the OCF Conformance Testing OCF Conformance Testing required label Aug 18, 2023
@Danielius1922 Danielius1922 force-pushed the adam/feature/etag-discovery-resource branch from 1e5745d to 6d76808 Compare August 18, 2023 16:24
When a GET request is made to the /oic/res resource with the batch
interface, an array of contents representing discoverable and
accessible resources is returned. This enhancement focuses on
the calculation and handling of ETags in this scenario.

ETags are utilized to track changes in resources. The ETag for each
resource is updated whenever a change occurs. In the current IoT
implementation the ETag value for resources continually increases,
ensuring uniqueness among resources.

In the context of the batch interface for the /oic/res resource
the ETag value is calculated. The highest ETag value is selected
from the resources included in the payload as well as the /oic/res
resource itself as the ETag of the payload. This approach
guarantees that the ETag used for the batch interface accurately
represents the state of the included resources.
@Danielius1922 Danielius1922 force-pushed the adam/feature/etag-discovery-resource branch from 6d76808 to 9f333cb Compare August 18, 2023 16:39
@sonarcloud
Copy link

sonarcloud bot commented Aug 18, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

86.2% 86.2% Coverage
0.0% 0.0% Duplication

warning The version of Java (11.0.14.1) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

@Danielius1922 Danielius1922 merged commit bd19efd into master Aug 18, 2023
116 checks passed
@Danielius1922 Danielius1922 deleted the adam/feature/etag-discovery-resource branch August 18, 2023 17:47
@github-actions github-actions bot locked and limited conversation to collaborators Aug 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants