CustomModule fixes and Copilot repo guidance#560
Conversation
Template improvements
|
Hidden auto-switch of In if ($PSBoundParameters.ContainsKey('Features') -and -not $PSBoundParameters.ContainsKey('ModuleType'))
{
$ModuleType = 'CustomModule'
}This silently overrides the documented default ( I'd prefer we nail this down in this PR rather than in a follow-up, because once it ships the auto-switch becomes a compatibility constraint: a later change that adds a warning or throws is itself a breaking change. Two options, either is fine by me:
Happy to approve once this is resolved; the remaining review items will be tracked as follow-up issues. |
|
I think you're right that the ModuleType shouldn't be changed, and I think it does not really conflicts... Let's see if the build completes. |
|
Scratch that, I forgot how Plaster works. |
c3e408b to
8d91766
Compare
|
I've implemented 2 for now because I think in the longer term we should support features WITH any template, and for that we need to change the condition logic within the template (but I'd rather do that in another PR). |
|
Tracked the remaining review items as follow-up issues:
|
johlju
left a comment
There was a problem hiding this comment.
@johlju reviewed 17 files and all commit messages, and made 3 comments.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on gaelcolas).
Sampler/Templates/Sampler/plasterManifest.xml line 119 at r1 (raw file):
prompt="Do you want to add configuration for GitVersion to handle automatic versioning for your project?" default="0" condition="$PLASTER_PARAM_UseGit -eq 'true' -and $PLASTER_PARAM_ModuleType -notin @('CustomModule')" >
Should we not allow GitVersion question in CustomModule?
Code quote:
-and $PLASTER_PARAM_ModuleType -notin @('CustomModule')Sampler/Templates/Sampler/plasterManifest.xml line 151 at r1 (raw file):
default="MyOrgName" prompt="What is the name of the GitHub owner (personal or organization account) that will publish the module?" condition="($PLASTER_PARAM_ModuleType -eq 'CustomModule' -and ($PLASTER_PARAM_Features -contains 'github' -or $PLASTER_PARAM_Features -contains 'All')) -or ($PLASTER_PARAM_UseGitHub -eq 'true' -and $PLASTER_PARAM_ModuleType -notin @('dsccommunity', 'SimpleModule_NoBuild', 'CustomModule')) -or $PLASTER_PARAM_ModuleType -in @('CompleteSample')" />
THis condition seems to exclude CustomModule if the user answered yes on using GitHub question above.
Code quote:
condition="($PLASTER_PARAM_ModuleType -eq 'CustomModule' -and ($PLASTER_PARAM_Features -contains 'github' -or $PLASTER_PARAM_Features -contains 'All')) -or ($PLASTER_PARAM_UseGitHub -eq 'true' -and $PLASTER_PARAM_ModuleType -notin @('dsccommunity', 'SimpleModule_NoBuild', 'CustomModule')) -or $PLASTER_PARAM_ModuleType -in @('CompleteSample')"Sampler/Public/New-SamplerPipeline.ps1 line 122 at r1 (raw file):
{ throw "Unable to locate Plaster's manifest-path-for-culture helper. Expected 'Get-PlasterManifestPathForCulture' (Plaster 2.x) or 'GetPlasterManifestPathForCulture' (Plaster 1.x)." }
Suggest maybe have this as a private function as it is repeated in at least two public functions. That would avoid chaning in one place and miss the other(s).
Code quote:
$manifestPathCommand = Get-Command -Name 'Get-PlasterManifestPathForCulture' -ErrorAction 'Ignore'
if (-not $manifestPathCommand)
{
$manifestPathCommand = Get-Command -Name 'GetPlasterManifestPathForCulture' -ErrorAction 'Ignore'
}
if (-not $manifestPathCommand)
{
throw "Unable to locate Plaster's manifest-path-for-culture helper. Expected 'Get-PlasterManifestPathForCulture' (Plaster 2.x) or 'GetPlasterManifestPathForCulture' (Plaster 1.x)."
}|
@gaelcolas looks good, just some comments (see above) I just skimmed the AI stuff, guessing you have run with those so didn't bother digging in - but they were a somewhat verbose so they probably can be condensed since an AI reads them. I usually add this |
|
Saw your comments @johlju and I'll address them in a subsequent PR. |
Pull Request
(Get-PlasterManifestPathForCulture) and v1.x (GetPlasterManifestPathForCulture).
features the user did not ask for, no GitHub-owner prompt when GitHub/Azure Pipelines were not selected).
contradictory Features.Count checks), gate GitVersion.yml on the gitversion feature (not git), and rewrite GitHubOwner condition.
agents/sampler-maintainer.md, and skills/validate-changes. The instructions mandate going through ./build.ps1, document cross-platform / PS5.1+PS7
support, the -ErrorAction 'Ignore' preference, how to tee long builds to a log file to avoid agent-shell hangs, and how to extract real failures
from output/testResults/NUnitXml_.xml (Pester) and output/testResults/DscTestObject_DscTest_*.xml (HQRM CliXml).
This change is