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
path_utilities: Adjust GetContainingPackage() and Edk2Path behavior #186
Merged
Commits on Nov 9, 2022
-
path_utilities: Adjust GetContainingPackage() and Edk2Path behavior
Fixes tianocore#183, fixes tianocore#185 Updates the Edk2Path constructor with the following changes: - Avoid changing global object state during intermediary validation operations. If an exception were returned or execution is otherwise interrupted the `PackagePathList` and `WorkspacePath` will have predictable values only set once validation succeeds. - Raise a `NotADirectoryError` exception on invalid directory input. This allows the caller to implement more focused exception handling. - Update the definition of a package to be a directory with a .dec file and use that as the basis for detecting nested packages. - Update the nested package path algorithm to fix tianocore#183 and prevent exceeding ascension in the directory hierarchy beyond the maximum root directory being compared. - Minor documentation cleanup. Update GetContainingPackage() with the following changes: - Only return a containing package if a file is in a directory with a .dec file. Avoid returning directory parents outside edk2 packages. Closes tianocore#185. - Minor documentation cleanup. Updates both functions to remove superfluous logging and leave it to the caller to manage logging messages based on the context of the actions they are trying to perform. Updates unit tests to align with updated function expectations. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for f24102e - Browse repository at this point
Copy the full SHA f24102eView commit details -
PR Update: Add back PR tianocore#113 support
Allows callers to pass package paths that may not be valid directories and control whether an exception is raised with the error_on_invalid_pp Edk2Path constructor parameter. Restores behavior introduced in tianocore#113 Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for a98108b - Browse repository at this point
Copy the full SHA a98108bView commit details -
PR Update: Instantiate Edk2Path object in test case
Updates test_get_relative_path_when_package_path_inside_package() to instantiate an Edk2Path object to ensure it can initialize properly by not raising an exception and be used to get the relative path of a file in the workspace.
Configuration menu - View commit details
-
Copy full SHA for 1ec4d03 - Browse repository at this point
Copy the full SHA 1ec4d03View commit details -
PR Update: Add a nested package test case
Adds a test case to verify nested packages raise an exception. This provides full test coverage of the checks in the Edk2Path constructor. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Configuration menu - View commit details
-
Copy full SHA for a11f8ee - Browse repository at this point
Copy the full SHA a11f8eeView commit details -
Configuration menu - View commit details
-
Copy full SHA for f880856 - Browse repository at this point
Copy the full SHA f880856View commit details -
Configuration menu - View commit details
-
Copy full SHA for 86da9dd - Browse repository at this point
Copy the full SHA 86da9ddView commit details -
Configuration menu - View commit details
-
Copy full SHA for e4e18c7 - Browse repository at this point
Copy the full SHA e4e18c7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4d3bc4d - Browse repository at this point
Copy the full SHA 4d3bc4dView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.