-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
[Storage] Fix file upload with Oauth issue #24291
Conversation
️✔️Az.Accounts
️✔️Az.Compute
️✔️Az.EventGrid
️✔️Az.EventHub
|
Type | Title | Current Coverage | Description |
---|---|---|---|
Test Coverage Less Than 50% | 0.00 % | Test coverage for the module cannot be lower than 50%. |
⚠️ - MacOS
Type | Title | Current Coverage | Description |
---|---|---|---|
Test Coverage Less Than 50% | 0.00% | Test coverage for the module cannot be lower than 50%. |
⚠️ PowerShell Core - Windows
Type | Title | Current Coverage | Description |
---|---|---|---|
Test Coverage Less Than 50% | 0.00% | Test coverage for the module cannot be lower than 50%. |
⚠️ Windows PowerShell - Windows
Type | Title | Current Coverage | Description |
---|---|---|---|
Test Coverage Less Than 50% | 0.00% | Test coverage for the module cannot be lower than 50%. |
️✔️Az.KeyVault
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.ManagedServiceIdentity
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.Monitor
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
⚠️ Az.Network
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
⚠️ Test
⚠️ - Linux
Type Title Current Coverage Last Coverage Description ⚠️ Test Coverage Less Than 80% 78.58 % 84.35% Test coverage cannot be lower than the number of the last release.
⚠️ - MacOS
Type Title Current Coverage Last Coverage Description ⚠️ Test Coverage Less Than 80% 78.58% 84.35% Test coverage cannot be lower than the number of the last release.
⚠️ PowerShell Core - Windows
Type Title Current Coverage Last Coverage Description ⚠️ Test Coverage Less Than 80% 78.58% 84.35% Test coverage cannot be lower than the number of the last release.
⚠️ Windows PowerShell - Windows
Type Title Current Coverage Last Coverage Description ⚠️ Test Coverage Less Than 80% 78.58% 84.35% Test coverage cannot be lower than the number of the last release.
️✔️Az.OperationalInsights
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Test
️✔️ - Linux
️✔️ - MacOS
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.PrivateDns
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.RedisCache
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Test
️✔️ - Linux
️✔️ - MacOS
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.Relay
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.Search
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Test
️✔️ - Linux
️✔️ - MacOS
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.ServiceBus
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Az.Sql
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
⚠️ Az.Storage
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Breaking Change Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
⚠️ Signature Check
⚠️ PowerShell Core - Windows
Type Cmdlet Description Remediation ⚠️ Get-AzStorageAccountMigration Get-AzStorageAccountMigration Changes the ConfirmImpact but does not set the SupportsShouldProcess property to true in the cmdlet attribute. Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue ⚠️ Get-AzStorageAccountMigration Get-AzStorageAccountMigration changes the confirm impact. Please ensure that the change in ConfirmImpact is justified Verify that ConfirmImpact is changed appropriately by the cmdlet. It is very rare for a cmdlet to change the ConfirmImpact.
⚠️ Windows PowerShell - Windows
Type Cmdlet Description Remediation ⚠️ Get-AzStorageAccountMigration Get-AzStorageAccountMigration Changes the ConfirmImpact but does not set the SupportsShouldProcess property to true in the cmdlet attribute. Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue ⚠️ Get-AzStorageAccountMigration Get-AzStorageAccountMigration changes the confirm impact. Please ensure that the change in ConfirmImpact is justified Verify that ConfirmImpact is changed appropriately by the cmdlet. It is very rare for a cmdlet to change the ConfirmImpact. ️✔️Help File Existence Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️File Change Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️UX Metadata Check
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
⚠️ Test
⚠️ - Linux
Type Title Current Coverage Description ⚠️ Test Coverage Less Than 50% 41.76 % Test coverage for the module cannot be lower than 50%.
⚠️ - MacOS
Type Title Current Coverage Description ⚠️ Test Coverage Less Than 50% 41.76% Test coverage for the module cannot be lower than 50%.
⚠️ PowerShell Core - Windows
Type Title Current Coverage Description ⚠️ Test Coverage Less Than 50% 41.76% Test coverage for the module cannot be lower than 50%.
⚠️ Windows PowerShell - Windows
Type Title Current Coverage Description ⚠️ Test Coverage Less Than 50% 41.76% Test coverage for the module cannot be lower than 50%.
️✔️Az.StorageSync
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
️✔️Test
️✔️ - Linux
️✔️ - MacOS
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
⚠️ Az.Synapse
️✔️Build
️✔️PowerShell Core - Windows
️✔️Windows PowerShell - Windows
⚠️ Test
⚠️ - Linux
Type Title Current Coverage Description ⚠️ Test Coverage Less Than 50% 48.80 % Test coverage for the module cannot be lower than 50%.
⚠️ - MacOS
Type Title Current Coverage Description ⚠️ Test Coverage Less Than 50% 48.80% Test coverage for the module cannot be lower than 50%.
⚠️ PowerShell Core - Windows
Type Title Current Coverage Description ⚠️ Test Coverage Less Than 50% 48.80% Test coverage for the module cannot be lower than 50%.
⚠️ Windows PowerShell - Windows
Type Title Current Coverage Description ⚠️ Test Coverage Less Than 50% 48.80% Test coverage for the module cannot be lower than 50%.
// create new buffer, the old buffer will be GC | ||
buffer = new byte[currentBlockSize]; | ||
lastBlockSize = currentBlockSize; | ||
|
||
await stream.ReadAsync(buffer: buffer, offset: 0, count: (int)currentBlockSize); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticed the code below ignores the number of bytes read by ReadAsync
and just assumes the buffer is full. While that works now, would it be safer to change that in case FileStream
changes in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review and the comment!
I have modified the code to respect the bytes count read by ReadAsync
.
I have tested that works with different file size (from 1KB up to 2GB), with random the bytes count read by ReadAsync
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Fix issue #24289
Mandatory Checklist
Please choose the target release of Azure PowerShell
Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.md
and reviewed the following information:ChangeLog.md
file(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
.## Upcoming Release
header in the past tense.ChangeLog.md
if no new release is required, such as fixing test case only.