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

Fix #1804 - encapsulate sync job by a try-catch per device #1809

Merged

Conversation

kbeaugrand
Copy link
Member

@kbeaugrand kbeaugrand commented Feb 27, 2023

Description

What's new?

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

@kbeaugrand kbeaugrand requested a review from a team as a code owner February 27, 2023 08:02
@kbeaugrand kbeaugrand marked this pull request as draft February 27, 2023 08:31
@kbeaugrand kbeaugrand force-pushed the fix/1804_make_edge_device_sync_job_more_resilient branch from a325a7c to a165d38 Compare February 27, 2023 09:28
@codecov
Copy link

codecov bot commented Feb 27, 2023

Codecov Report

Base: 91.12% // Head: 91.21% // Increases project coverage by +0.08% 🎉

Coverage data is based on head (a810d04) compared to base (3a974aa).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1809      +/-   ##
==========================================
+ Coverage   91.12%   91.21%   +0.08%     
==========================================
  Files         277      277              
  Lines        8993     9004      +11     
==========================================
+ Hits         8195     8213      +18     
+ Misses        798      791       -7     
Impacted Files Coverage Δ
...ub.Portal.Infrastructure/Jobs/SyncEdgeDeviceJob.cs 100.00% <100.00%> (+8.75%) ⬆️

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.

@kbeaugrand kbeaugrand force-pushed the fix/1804_make_edge_device_sync_job_more_resilient branch from a165d38 to 4b25de9 Compare February 27, 2023 09:55
@kbeaugrand kbeaugrand force-pushed the fix/1804_make_edge_device_sync_job_more_resilient branch from 4b25de9 to a810d04 Compare February 27, 2023 11:25
@kbeaugrand kbeaugrand marked this pull request as ready for review February 27, 2023 11:31
var mockJobExecutionContext = MockRepository.Create<IJobExecutionContext>();

var expectedDeviceModel = Fixture.Create<EdgeDeviceModel>();
var fakeTwin = Fixture.Create<Twin>();

Check warning

Code scanning / CodeQL

Useless assignment to local variable

This assignment to [fakeTwin](1) is useless, since its value is never read.
.Returns(Task.CompletedTask);

_ = this.mockEdgeDeviceModelRepository.Setup(c => c.GetByIdAsync(It.IsAny<string>()))
.ReturnsAsync((EdgeDeviceModel)null);

Check warning

Code scanning / CodeQL

Useless upcast

There is no need to upcast from [null](1) to [EdgeDeviceModel](2) - the conversion can be done implicitly.
@hocinehacherouf hocinehacherouf merged commit 929d0ea into main Feb 27, 2023
@hocinehacherouf hocinehacherouf deleted the fix/1804_make_edge_device_sync_job_more_resilient branch February 27, 2023 12:54
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.

Bug: Make the Sync job more resilient
2 participants