Edk2 pr eval
edk2_pr_eval ¶
Invocable that checks the diff between a branch and head.
Identifies any packages that needs to be build.
Contains a PrEvalSettingsManager that must be subclassed in a build settings file. This provides platform specific information to Edk2PrEval invocable while allowing the invocable itself to remain platform agnostic.
PrEvalSettingsManager ¶
Platform specific Settings for Edk2PrEval.
provide information necessary for stuart_pr_eval.exe
or
edk2_pr_eval.py
to successfully execute.
Example of Overriding PrEvalSettingsManager
from edk2toolext.invocables.edk2_pr_eval import PrEvalSettingsManager
class PrEvalManager(PrEvalSettingsManager):
def FilterPackagesToTest(self, changedFilesList: list, potentialPackagesList: list) -> list:
filtered_packages = []
for file in changedFilesList:
for package in potentialPackagesList:
if package.startswith(potentialPackagesList):
filtered_packages.append(package)
return list(set(filtered_packages))
def GetPlatformDscAndConfig(self) -> tuple:
return None
FilterPackagesToTest ¶
FilterPackagesToTest(
changedFilesList: list, potentialPackagesList: list
) -> list
Filter potential packages to test based on changed files.
Tip
Optional Override in a subclass
Parameters:
Name | Type | Description | Default |
---|---|---|---|
changedFilesList |
list
|
files changed in this PR |
required |
potentialPackagesList |
list
|
packages from |
required |
Returns:
Type | Description |
---|---|
list
|
filtered packages to test |
Note
Default implementation does zero filtering
GetPlatformDscAndConfig ¶
GetPlatformDscAndConfig() -> tuple
Provide a platform DSC and build variable configuration.
If a platform provides the workspace relative path for its DSC file to this function, then Policy 4 will be evaluated. This is used to determine if a change occurred in a module that is used in the DSC file.
Returning the dictionary of build key value pairs is optional but allows those variables to be considered when evaluating the DSC file. These variable values will override any values set directly in build files such as the DSC files. These variable values will be overridden by any values set on the command line for the current target.
Tip
Optional override in a subclass
Returns:
Type | Description |
---|---|
tuple
|
(workspace relative path to DSC file, input dictionary of build variable key value pairs) |
Edk2PrEval ¶
Invocable to determine what packages should be tested.
Evaluate the changes and determine what packages of the supplied packages should be tested based on impact from the changes
AddCommandLineOptions ¶
AddCommandLineOptions(
parserObj: argparse.ArgumentParser,
) -> None
Adds command line options to the argparser.
RetrieveCommandLineOptions ¶
RetrieveCommandLineOptions(
args: argparse.Namespace,
) -> None
Retrieve command line options from the argparser.
GetVerifyCheckRequired ¶
GetVerifyCheckRequired() -> bool
Will not call self_describing_environment.VerifyEnvironment because it might not be set up yet.
GetSettingsClass ¶
GetSettingsClass() -> type
Returns the PrEvalSettingsManager class.
Warning
PrEvalSettingsManager must be subclassed in your platform settings file.
GetLoggingFileName ¶
GetLoggingFileName(loggerType: str) -> str
Returns the filename (PREVALLOG) of where the logs for the Edk2CiBuild invocable are stored in.
get_packages_to_build ¶
get_packages_to_build(possible_packages: list) -> dict
Returns a dictionary of packages to build.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
possible_packages |
list
|
list of possible packages |
required |
Returns:
Type | Description |
---|---|
dict
|
filtered packages to build |