-
Notifications
You must be signed in to change notification settings - Fork 775
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
File I/O Abstraction: Replace IFileResolver.TryAcquireFileLock
#15826
Conversation
IFileResolver.TryAcquireFileLock
IFileResolver.TryAcquireFileLock
Test this change out locally with the following install scripts (Action run 12290549161) VSCode
Azure CLI
|
Dotnet Test Results 78 files - 39 78 suites - 39 30m 22s ⏱️ - 20m 42s Results for commit 8a124ec. ± Comparison against base commit c730403. This pull request removes 1842 and adds 633 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
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.
Copilot reviewed 53 out of 68 changed files in this pull request and generated no suggestions.
Files not reviewed (15)
- src/Bicep.Cli.IntegrationTests/packages.lock.json: Language not supported
- src/Bicep.Cli.UnitTests/packages.lock.json: Language not supported
- src/Bicep.Cli/packages.lock.json: Language not supported
- src/Bicep.Core.IntegrationTests/packages.lock.json: Language not supported
- src/Bicep.Core.Samples/packages.lock.json: Language not supported
- src/Bicep.Core.UnitTests/BicepTestConstants.cs: Evaluated as low risk
- src/Bicep.Core.UnitTests/Features/FeatureProviderOverrides.cs: Evaluated as low risk
- src/Bicep.Core.UnitTests/Features/OverriddenFeatureProvider.cs: Evaluated as low risk
- src/Bicep.Core.UnitTests/Features/FeatureProviderTests.cs: Evaluated as low risk
- src/Bicep.Core.UnitTests/ApiVersion/ApiVersionProviderTests.cs: Evaluated as low risk
- src/Bicep.Core.IntegrationTests/SourceArchiveTests.cs: Evaluated as low risk
- src/Bicep.Core.UnitTests/Assertions/OciModuleRegistryAssertions.cs: Evaluated as low risk
- src/Bicep.Core.UnitTests/Registry/CachedModules.cs: Evaluated as low risk
- src/Bicep.Cli.IntegrationTests/RestoreCommandTests.cs: Evaluated as low risk
- src/Bicep.Core.IntegrationTests/ExtensionRegistryTests.cs: Evaluated as low risk
Comments skipped due to low confidence (1)
src/Bicep.Core.IntegrationTests/RegistryTests.cs:45
- [nitpick] The variable 'badCacheDirectory' is reassigned to a file handle, which can be confusing. Consider using a different variable name for the file handle, such as 'badCacheFileHandle'.
badCacheDirectory = badCacheDirectory.GetDirectory("file.txt");
{ | ||
if (!OperatingSystem.IsWindows()) | ||
{ | ||
this.FileSystem.File.SetUnixFileMode(this.Uri.GetFileSystemPath(), UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.UserExecute); |
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.
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.
It's not, but chmod 700 seems to be common. Also, the original code has the UserWrite
flag, so keeping it just in case.
@@ -8,6 +8,7 @@ | |||
|
|||
<ItemGroup> | |||
<PackageReference Include="System.IO.Abstractions" Version="21.1.3" /> | |||
<PackageReference Include="System.Memory.Data" Version="6.0.0" /> |
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.
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.
Good question...the package was added by VS automatically via completion. Not sure why the old version is used. Let me bump the version.
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.
Ah it's because Azure.Core
has a transitive dependency on System.Memory.Data 6.0.0
, so VS choosed the local version. Let's keep the current version to avoid any incompatible issues since Azure.Core
is used by Bicep.Core
.
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.
As part of the ongoing file I/O abstraction migration, this PR removes
IFileResolver.TryAcquireFileLock
and transitions it to the new file I/O API. The updates, including changes toIFeatureProvider
,*ArtifactRegistry
, and several related tests, are inevitable side effects of what initially seemed like a straightforward update.Microsoft Reviewers: Open in CodeFlow