fix: return 409 Conflict for duplicate resources and parse profile tags#828
fix: return 409 Conflict for duplicate resources and parse profile tags#828madhavilosetty-intel merged 1 commit intomainfrom
Conversation
d75536c to
b60c3c2
Compare
83843fd to
948490b
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #828 +/- ##
==========================================
+ Coverage 40.11% 40.13% +0.01%
==========================================
Files 114 114
Lines 10886 10892 +6
==========================================
+ Hits 4367 4371 +4
- Misses 6117 6119 +2
Partials 402 402 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
18f9f01 to
31b00c8
Compare
There was a problem hiding this comment.
Pull request overview
This PR introduces a connection-status update pathway for devices, including tracking “last connected” / “last disconnected” timestamps, and wires it into the CIRA (TCP) tunnel authentication flow. It also adjusts a couple of related behaviors around HTTP error handling and Vault/certificate handling (including additional tests).
Changes:
- Add
UpdateConnectionStatus(guid, status)to the devices usecase/repository interfaces and implement it in the SQL device repo (writesconnectionstatuspluslastconnected/lastdisconnected). - Update CIRA tunnel registration to mark a device as connected on successful authentication, with new unit coverage.
- Improve Vault/certificate fallback behaviors and add tests; adjust HTTP “not unique” handling to return
409 Conflict.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/usecase/sqldb/device.go | Adds SQL repo method to update connectionstatus and set lastconnected/lastdisconnected. |
| internal/usecase/sqldb/device_test.go | Extends devices test schema and adds tests for UpdateConnectionStatus. |
| internal/usecase/devices/interfaces.go | Extends repository and feature interfaces with UpdateConnectionStatus. |
| internal/usecase/devices/repo.go | Adds usecase wrapper method UpdateConnectionStatus. |
| internal/usecase/devices/repo_test.go | Adds usecase-level test coverage for UpdateConnectionStatus. |
| internal/controller/tcp/cira/tunnel.go | Marks device connected on successful CIRA authentication. |
| internal/controller/tcp/cira/tunnel_test.go | Adds tests verifying registration triggers connection status updates (and continues on update failure). |
| internal/controller/ws/v1/interface.go | Extends WS feature interface (adds UpdateConnectionStatus and SetLinkPreference). |
| internal/controller/httpapi/v1/error.go | Changes not-unique handling to 409 Conflict with a default message when empty. |
| internal/certificates/generate.go | Adds log messages when Vault store is nil (local-only storage). |
| internal/certificates/generate_test.go | Adds Vault/local-file interaction tests for root + webserver cert flows (and nil-store cases). |
| cmd/app/main.go | Logs when Vault is not configured and continues with local-only cert storage. |
| cmd/app/main_test.go | Adds tests for CIRA cert setup disabled and Vault config error cases. |
| internal/mocks/wsv1_mocks.go | Regenerated mocks (method ordering changes + adds UpdateConnectionStatus). |
| internal/mocks/devicemanagement_mocks.go | Regenerated mocks to include UpdateConnectionStatus (and reorder SetLinkPreference). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
1a3ec2a to
3bdb3bd
Compare
0e8c520 to
d6698d3
Compare
|
🎉 This PR is included in version 1.22.4 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
No description provided.