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

Feature/1030 sync devices between iot hub and portal #1279

Merged
merged 16 commits into from
Sep 27, 2022

Conversation

hocinehacherouf
Copy link
Contributor

Description

What's new?

Remark: @Sben65, this PR replaces #1276 due an issue on the branch name that prevent git to see it.

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Tests
  • Other

@codecov
Copy link

codecov bot commented Sep 24, 2022

Codecov Report

Base: 88.29% // Head: 88.51% // Increases project coverage by +0.21% 🎉

Coverage data is based on head (c81684e) compared to base (021c811).
Patch coverage: 95.91% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1279      +/-   ##
==========================================
+ Coverage   88.29%   88.51%   +0.21%     
==========================================
  Files         226      232       +6     
  Lines        6828     7024     +196     
==========================================
+ Hits         6029     6217     +188     
- Misses        799      807       +8     
Impacted Files Coverage Δ
...c/AzureIoTHub.Portal/Server/Jobs/SyncDevicesJob.cs 91.46% <91.46%> (ø)
...AzureIoTHub.Portal/Server/Mappers/DeviceProfile.cs 98.43% <98.43%> (ø)
....Portal.Infrastructure/DevelopmentConfigHandler.cs 100.00% <100.00%> (ø)
...b.Portal.Infrastructure/ProductionConfigHandler.cs 100.00% <100.00%> (ø)
...al.Infrastructure/Repositories/DeviceRepository.cs 100.00% <100.00%> (ø)
...astructure/Repositories/LorawanDeviceRepository.cs 100.00% <100.00%> (ø)
src/AzureIoTHubPortal.Domain/Entities/Device.cs 100.00% <100.00%> (ø)
...AzureIoTHubPortal.Domain/Entities/LorawanDevice.cs 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@hocinehacherouf hocinehacherouf force-pushed the feature/1030_sync_devices_between_iot_hub_and_portal branch from 0fc82c2 to ee1cc5d Compare September 24, 2022 10:03
.ReturnsAsync(expectedDeviceModel);

_ = this.mockDeviceRepository.Setup(repository => repository.GetByIdAsync(expectedTwinDevice.DeviceId))
.ReturnsAsync((Device)null);

Check warning

Code scanning / CodeQL

Useless upcast

There is no need to upcast from [null](1) to [Device](2) - the conversion can be done implicitly.
.ReturnsAsync(expectedDeviceModel);

_ = this.mockLorawanDeviceRepository.Setup(repository => repository.GetByIdAsync(expectedTwinDevice.DeviceId))
.ReturnsAsync((LorawanDevice)null);

Check warning

Code scanning / CodeQL

Useless upcast

There is no need to upcast from [null](1) to [LorawanDevice](2) - the conversion can be done implicitly.
Comment on lines +58 to +61
catch (Exception e)
{
this.logger.LogError(e, "Sync devices job has failed");
}

Check notice

Code scanning / CodeQL

Generic catch clause

Generic catch clause.
@hocinehacherouf hocinehacherouf marked this pull request as ready for review September 24, 2022 10:35
@hocinehacherouf hocinehacherouf requested a review from a team as a code owner September 24, 2022 10:35
@hocinehacherouf hocinehacherouf marked this pull request as draft September 24, 2022 10:36
@hocinehacherouf hocinehacherouf marked this pull request as ready for review September 24, 2022 10:44
@hocinehacherouf hocinehacherouf force-pushed the feature/1030_sync_devices_between_iot_hub_and_portal branch from eabb6d5 to 0d21d7e Compare September 26, 2022 14:39
@kbeaugrand kbeaugrand force-pushed the feature/1030_sync_devices_between_iot_hub_and_portal branch from 0d21d7e to 1b333f4 Compare September 27, 2022 07:33
@kbeaugrand kbeaugrand merged commit bf060b4 into main Sep 27, 2022
@kbeaugrand kbeaugrand deleted the feature/1030_sync_devices_between_iot_hub_and_portal branch September 27, 2022 08:27
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.

Feature: Synchronize Devices between IoT Hub and Portal database
3 participants