-
Notifications
You must be signed in to change notification settings - Fork 100
Fix ArgumentException when analysis target URI contains characters that are illegal in the file system #2860
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
base: main
Are you sure you want to change the base?
Changes from 12 commits
7c33875
9c9d50c
4175e1a
3926882
c47ed20
617c84d
e761588
9f251f5
660ffff
90df443
80c829b
7355bee
ae3facc
c42794f
afef455
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,7 @@ | |
| * BUG: Fix error `ERR997.NoValidAnalysisTargets` when scanning symbolic link files. | ||
| * BUG: Fix `ERR999.UnhandledEngineException: System.IO.FileNotFoundException: Could not find file` when a file name or directory path contains URL-encoded characters. | ||
| * BUG: Fix error `ERR997.NoValidAnalysisTargets` when ambiguous file/directory references are provided to `OrderedFileSpecifier`. Previously, the code required an explicit directory separator to be added to the end of a directory path. Now, the code inspects the file system and assumes that a reference to an existing directory was intended by the user (even without a trailing separator). | ||
| * BUG: Fix `ArgumentException: Illegal characters in path` when analysis target URI contains characters that are illegal in the file system. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You haven't described the method that raises the exception. This means that customers who have a stack frame in an exception might not easily find your note. |
||
| * NEW: Allow null archive uri in `MultithreadedZipArchiveArtifactProvider` (which indicates that enumerated artifact paths should not include the base archive). | ||
| * NEW: Update `LogTargetParseError(IAnalysisContext, Region, string, Exception)` to include optional exception argument to denote code location where parse error occurred. | ||
| * NEW: `MultithreadedAnalyzeCommandBase.EnumerateArtifact` now supports scanning into compressed (OPC) files. Initial support file extensions are: `.apk`, `.appx`, `.appxbundle`, `.docx`, `.epub`, `.jar`, `.msix`, `.msixbundle`, `.odp`, `.ods`, `.odt`, `.onepkg`, `.oxps`, `.pkg`, `.pptx`, `.unitypackage`, `.vsdx`, `.xps`, `.xlsx`, `.zip`. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -74,5 +74,19 @@ private void CleanupDirectoryOrFile(string[] paths) | |
| } | ||
| } | ||
| } | ||
|
|
||
| [Fact] | ||
| public void PathGetExtension_ShouldExtractExtension() | ||
| { | ||
| FileSystem.Instance.PathGetExtension("test.txt").Should().Be(".txt"); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add at least one test with multiple non-sequential dots in the file name. Add at least one test with a period in the directory name. Add a file name that begins with a period (this is legal).Add a file name that ends with a period (not sure what happens here) Add a file name that starts and ends with a period (ditto). Add a file name with sequential dots in the file name One thing about your change is that it hasn't really told us whether the inlined implementation matches our goal of consistent behavior across different versions of .NET (absent the throw behavior). So can you also supplement these tests to compare these behaviors to actual |
||
| FileSystem.Instance.PathGetExtension("C:\\test.abcde").Should().Be(".abcde"); | ||
| FileSystem.Instance.PathGetExtension("C:\\some_dir\\test.yft").Should().Be(".yft"); | ||
| FileSystem.Instance.PathGetExtension("http://example.com/some.file.ext").Should().Be(".ext"); | ||
| FileSystem.Instance.PathGetExtension("some.other.dir/extensionless").Should().Be(string.Empty); | ||
| FileSystem.Instance.PathGetExtension("yet<another>dir\\with|pipes|file.a").Should().Be(".a"); | ||
| FileSystem.Instance.PathGetExtension("yet<another>dir\\with|pipes|file.a.").Should().Be(string.Empty); | ||
| FileSystem.Instance.PathGetExtension("yet<another>dir\\with.pipes|file").Should().Be(".pipes|file"); | ||
| } | ||
|
|
||
| } | ||
| } | ||
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.
The latest Ubuntu image (version 24) doesn't include nuget - actions/runner-images#12086
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.
Version 20 isn't supported any more - actions/runner-images#11101
Uh oh!
There was an error while loading. Please reload this page.
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.
Version 20 is still a required policy:
I don't see how to change that. I probably don't have permission.
@michaelcfanning , do you know what I need to do?