Conversation
| # there is a custom function to get dependent packages from a changed package set and diff | ||
| if ($DependentPackagesFromPackageSetFn -and (Test-Path "Function:$DependentPackagesFromPackageSetFn")) | ||
| { | ||
| $packagesWithChanges += &$DependentPackagesFromPackageSetFn $packagesWithChanges $diff |
There was a problem hiding this comment.
This function should be implemented in Language-Settings.ps1. It accepts the pkgProps list for the detected packages that were included in the change, and the pscustomobject representation of the diff.json.
There was a problem hiding this comment.
Do you need to work with $dependentPackagesForInclusion and $pkg.CanaryPackages above if the language overrides "Get-${Language}-DependentPackagesFromPackageSet"
There was a problem hiding this comment.
I don't understand what you're asking. We're giving the function A) the packages props that were changed (first arg) and B) we're handing you the package diff itself. I'm doing that for additional customization if you want it.
There was a problem hiding this comment.
I see. You're saying
why not offer an override for this entire function
Because Wes didn't want me to, I started with a per language function for Get-PrPkgProperties stored in Language-Settings at the very beginning of this process.
There was a problem hiding this comment.
Aha. You're asking if we want to interact with the canary packages at all if the function is defined. The answer is NO. I'll remove the add from the function above if the function is defined.
| $packagesWithChanges += &$DependentPackagesFromPackageSetFn $packagesWithChanges $diff | ||
| } | ||
| else { | ||
| foreach ($addition in $dependentPackagesForInclusion) { |
There was a problem hiding this comment.
You could remove the variable $dependentPackagesForInclusion and pull directly from packages with changes here:
foreach ($addition in $packagesWithChanges.CanaryPackages) {There was a problem hiding this comment.
We'd still need two.
foreach ($packageWithChanges in $pkgProps)
foreach($addition in $packageWithChanges.CanaryPackages)
Cause we try to check to see if it's real. I see where you're coming from where we could just add them as a path without looking up, but why? You're going to be able to override the function anyway so this won't matter to you as much.
re-add some trailing whitespace so the diff handles better
1d05d3f to
cabd8bc
Compare
| $GetDirectoriesForGenerationFn = "Get-${Language}-DirectoriesForGeneration" | ||
| $UpdateGeneratedSdksFn = "Update-${Language}-GeneratedSdks" | ||
| $IsApiviewStatusCheckRequiredFn = "Get-${Language}-ApiviewStatusCheckRequirement" | ||
| $DependentPackagesFromPackageSetFn = "Get-${Language}-DependentPackagesFromPackageSet" |
There was a problem hiding this comment.
Ok I've re-added trailing whitespace in a rebase so this should actually push out now.
There was a problem hiding this comment.
Frustration. Still breaks on patch apply.
|
Closing in favor of #8878 trying to get this automation to work properly. |
Also allow a custom
dependentPackagesfunction so that @hallipr can easily override.