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

#3076 - Add support for private blob storages #3159

Merged
merged 26 commits into from
Aug 26, 2024

Conversation

Metal-Mighty
Copy link
Contributor

Description

What's new?

  • Allows to host images on private blob storages

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

@Metal-Mighty Metal-Mighty requested a review from a team as a code owner August 12, 2024 14:05
@@ -335,7 +333,7 @@
});
}

internal async Task ChangeModel(IoTEdgeModel edgeModel)
public async Task ChangeModel(IoTEdgeModel edgeModel)

Check notice

Code scanning / CodeQL

Local scope variable shadows member Note

Local scope variable 'edgeModel' shadows
CreateEdgeDevicePage.edgeModel
.
@@ -300,7 +300,7 @@
.Where(x => x.Name.Contains(value, StringComparison.InvariantCultureIgnoreCase));
}

internal async Task ChangeModel(IoTEdgeModelListItem edgeModel)
public async Task ChangeModel(IoTEdgeModelListItem edgeModel)

Check notice

Code scanning / CodeQL

Local scope variable shadows member Note

Local scope variable 'edgeModel' shadows
EdgeDeviceListPage.edgeModel
.
var blobClient = blobContainer.GetBlobClient(deviceModelId);

this.logger.LogInformation($"Uploading to Blob storage as blob:\n\t {blobClient.Uri}\n");

_ = await blobClient.UploadAsync(stream, true);

_ = await blobClient.UploadAsync(new MemoryStream(System.Text.Encoding.UTF8.GetBytes(file)), true);

Check warning

Code scanning / CodeQL

Missing Dispose call on local IDisposable Warning

Disposable 'MemoryStream' is created but not disposed.
@Metal-Mighty Metal-Mighty enabled auto-merge (rebase) August 20, 2024 08:07
var expectedImageUri = Fixture.Create<Uri>();
using var imageAsMemoryStream = new MemoryStream(Encoding.UTF8.GetBytes(Fixture.Create<string>()));
var expectedImage = DeviceModelImageOptions.DefaultImage;
var blobDownloadResult = BlobsModelFactory.BlobDownloadResult(BinaryData.FromString(expectedImage));

Check warning

Code scanning / CodeQL

Useless assignment to local variable Warning

This assignment to
blobDownloadResult
is useless, since its value is never read.
Copy link

codecov bot commented Aug 22, 2024

Codecov Report

Attention: Patch coverage is 82.45614% with 50 lines in your changes missing coverage. Please review.

Project coverage is 83.27%. Comparing base (2cb5b0a) to head (7af291a).
Report is 4 commits behind head on main.

Files Patch % Lines
...l.Client/Dialogs/Layer/LinkDeviceLayerDialog.razor 0.00% 16 Missing ⚠️
...ent/Pages/DeviceModels/CreateDeviceModelPage.razor 20.00% 6 Missing and 2 partials ⚠️
...THub.Portal.Client/Pages/Layer/LayerListPage.razor 30.00% 6 Missing and 1 partial ⚠️
...Client/Pages/EdgeModels/CreateEdgeModelsPage.razor 14.28% 4 Missing and 2 partials ⚠️
...Infrastructure/Managers/DeviceModelImageManager.cs 80.95% 4 Missing ⚠️
...ent/Pages/DeviceModels/DeviceModelDetailPage.razor 72.72% 3 Missing ⚠️
...rastructure/Managers/AwsDeviceModelImageManager.cs 75.00% 2 Missing ⚠️
.../IoTHub.Portal.Application/Helpers/DeviceHelper.cs 0.00% 0 Missing and 1 partial ⚠️
...rtal.Client/Components/Planning/EditPlanning.razor 50.00% 1 Missing ⚠️
...onfigurations/CreateDeviceConfigurationsPage.razor 50.00% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3159      +/-   ##
==========================================
+ Coverage   83.00%   83.27%   +0.26%     
==========================================
  Files         327      327              
  Lines       12402    12422      +20     
  Branches      988      980       -8     
==========================================
+ Hits        10294    10344      +50     
+ Misses       1811     1785      -26     
+ Partials      297      293       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Metal-Mighty Metal-Mighty marked this pull request as draft August 22, 2024 12:50
auto-merge was automatically disabled August 22, 2024 12:50

Pull request was converted to draft

@Metal-Mighty Metal-Mighty force-pushed the feature/3076-support-private-blob-storage branch from 0ca05a5 to 265aea4 Compare August 26, 2024 09:11
@Metal-Mighty Metal-Mighty marked this pull request as ready for review August 26, 2024 10:06
@TLeoDev TLeoDev merged commit 9b54297 into main Aug 26, 2024
6 checks passed
@TLeoDev TLeoDev deleted the feature/3076-support-private-blob-storage branch August 26, 2024 12:18
@Metal-Mighty Metal-Mighty restored the feature/3076-support-private-blob-storage branch August 26, 2024 13:01
@Metal-Mighty Metal-Mighty deleted the feature/3076-support-private-blob-storage branch August 27, 2024 11:42
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.

2 participants