diff --git a/edk2toolext/invocables/edk2_pr_eval.py b/edk2toolext/invocables/edk2_pr_eval.py index 3690094a5..3825d3efb 100644 --- a/edk2toolext/invocables/edk2_pr_eval.py +++ b/edk2toolext/invocables/edk2_pr_eval.py @@ -180,6 +180,18 @@ def get_packages_to_build(self, possible_packages: list) -> dict: if rc != 0: return {} + # + # Policy 0 - A file outside a package was modified and force build + # all packages on a modified file outside a package setting + # is enabled. + # + for f in files: + if not self.edk2_path_obj.GetContainingPackage(os.path.abspath(f)): + return dict.fromkeys(possible_packages, + "Policy 0 - Build all packages if " + "a file is modified outside a " + "package.") + remaining_packages = possible_packages.copy() # start with all possible packages and remove each # package once it is determined to be build. This optimization # avoids checking packages that already will be built. diff --git a/integration_test/edk2_stuart_pr_eval.robot b/integration_test/edk2_stuart_pr_eval.robot index c0a81ae67..98c8e0360 100644 --- a/integration_test/edk2_stuart_pr_eval.robot +++ b/integration_test/edk2_stuart_pr_eval.robot @@ -314,6 +314,6 @@ Test Stuart PR for changing a file at the root of repo # Platform CI test DSC dependency on implementation file # Policy 4 ${pkgs}= Stuart pr evaluation ${platform_ci_file} OvmfPkg ${default_branch} ${EMPTY} ${ws_root} - Should Be Empty ${pkgs} + Confirm same contents ${pkgs} OvmfPkg [Teardown] Delete branch ${branch_name} ${default_branch} ${ws_root}