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

feat: REST API to update entity twin data #3425

Merged
merged 2 commits into from
Mar 6, 2025

Conversation

albinsuresh
Copy link
Contributor

@albinsuresh albinsuresh commented Feb 26, 2025

Proposed changes

REST API to update entity twin data

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (general improvements like code refactoring that doesn't explicitly fix a bug or add any new functionality)
  • Documentation Update (if none of the other choices apply)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Paste Link to the issue


Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA (in all commits with git commit -s)
  • I ran cargo fmt as mentioned in CODING_GUIDELINES
  • I used cargo clippy as mentioned in CODING_GUIDELINES
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

Sorry, something went wrong.

@albinsuresh albinsuresh marked this pull request as draft February 26, 2025 15:38
Copy link

codecov bot commented Feb 26, 2025

Codecov Report

Attention: Patch coverage is 81.86047% with 39 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/core/tedge/src/cli/http/cli.rs 0.00% 12 Missing ⚠️
crates/core/tedge/src/cli/http/command.rs 0.00% 11 Missing ⚠️
...s/core/tedge_agent/src/http_server/entity_store.rs 92.02% 1 Missing and 10 partials ⚠️
...ates/core/tedge_agent/src/entity_manager/server.rs 89.28% 2 Missing and 1 partial ⚠️
...rates/core/tedge_agent/src/entity_manager/tests.rs 92.30% 2 Missing ⚠️
Additional details and impacted files

📢 Thoughts on this report? Let us know!

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

github-actions bot commented Feb 26, 2025

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
589 0 3 589 100 1h38m57.951479s

Copy link
Contributor

@didier-wenzek didier-wenzek left a comment

Choose a reason for hiding this comment

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

  • It would be good to implement tedge http patch along this PR.
  • I was expecting the updated twin data to be published over the twin topics.

@didier-wenzek
Copy link
Contributor

  • It would be good to implement tedge http patch along this PR.

I pushed a commit for that: 4e3e940

@albinsuresh
Copy link
Contributor Author

I was expecting the updated twin data to be published over the twin topics.

Resolved by 6e7c4c6

@didier-wenzek
Copy link
Contributor

  • It would be good to implement tedge http patch along this PR.

I pushed a commit for that: 4e3e940

Oops, this commits has been removed by git push --force. It would be better to use git push --force-with-lease

Copy link
Contributor

@didier-wenzek didier-wenzek left a comment

Choose a reason for hiding this comment

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

I will be happy to merge this PR. However, I have first to re-push the commit adding support for tedge http patch.

},
}
```
* 400: Bad Request
Copy link
Contributor

Choose a reason for hiding this comment

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

I would give a bit more context on these errors, even if one can guess it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resolved by 3e94e0e

@didier-wenzek didier-wenzek temporarily deployed to Test Pull Request March 5, 2025 10:35 — with GitHub Actions Inactive
@didier-wenzek
Copy link
Contributor

I have first to re-push the commit adding support for tedge http patch.

Done: bece5bc

Copy link
Contributor

@reubenmiller reubenmiller left a comment

Choose a reason for hiding this comment

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

Nice feature.

As discussed, we could build upon this interface and also look at providing a similar API endpoint which mirrors the MQTT twin topic (te/{topic-id}/twin/{type}) as this would make it easier for users to switch between the MQTT and HTTP interfaces.

Copy link
Contributor

@didier-wenzek didier-wenzek left a comment

Choose a reason for hiding this comment

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

Approved. Thin-edge registration over HTTP is now a thing. Nice!

albinsuresh and others added 2 commits March 6, 2025 07:05
@albinsuresh albinsuresh force-pushed the feat/twin-data-rest-api branch from bece5bc to 89c2e3c Compare March 6, 2025 07:05
@albinsuresh albinsuresh temporarily deployed to Test Pull Request March 6, 2025 07:05 — with GitHub Actions Inactive
@albinsuresh albinsuresh enabled auto-merge March 6, 2025 07:06
@albinsuresh albinsuresh added this pull request to the merge queue Mar 6, 2025
Merged via the queue into thin-edge:main with commit 98297f0 Mar 6, 2025
33 checks passed
@albinsuresh albinsuresh deleted the feat/twin-data-rest-api branch March 6, 2025 08:23
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

3 participants