-
Notifications
You must be signed in to change notification settings - Fork 136
Fix#240/add build step to construct psm1 #242
Fix#240/add build step to construct psm1 #242
Conversation
Code to merge public and private functions into one psm1 file to address https://github.com/PowerShell/PowerShellGet/issues/240 #Closed |
tools/build.psm1
Outdated
Set-Content -Path $ModuleFile -Value $ModuleFileContent | ||
|
||
Write-Verbose -Message "Updating module manifest file" | ||
Update-ModuleManifest -Path "$ModuleRoot\PowerShellGet.psd1" -FunctionsToExport $PublicFunctions.BaseName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$PublicFunctions.BaseName [](start = 84, length = 25)
$PublicFunctions.BaseName [](start = 84, length = 25)
This adds all the provider level public functions at module level. #Closed
Tests/PSGetPublishScript.Tests.ps1
Outdated
@@ -904,11 +904,13 @@ Describe PowerShell.PSGet.PublishScriptTests -Tags 'BVT','InnerLoop' { | |||
# | |||
# Expected Result: should fail | |||
# | |||
It "InstallScriptWithExistingCommand" { | |||
# this test is skipped for now as it is failing due to the /public/Install-Package.ps1 not taking a -Name parameter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test is skipped for now as it is failing due to the /public/Install-Package.ps1 not taking a -Name parameter. [](start = 6, length = 114)
this test is skipped for now as it is failing due to the /public/Install-Package.ps1 not taking a -Name parameter. [](start = 6, length = 114)
It is not clear why this test needs to be skipped. Install-Package is a provider level public function and implements the PackageManagement provider level Install-Package functionality. #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
..but the script under test was passing a -Name parameter, something Install-Package does not have? I can reintroduce this, but I am getting different test failures with each build that are unrelated to this latest PR I think.
#Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Install-Package is a PackageManagement cmdlet. For more details, please take a look at https://github.com/PowerShell/PowerShellGet/pull/242#issuecomment-372787390. #Closed
tools/build.psm1
Outdated
function Remove-FunctionFolders { | ||
Remove-Item -Path $ModuleRoot\public -Recurse -Force | ||
Remove-Item -Path $ModuleRoot\private -Recurse -Force | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we avoid the in-place update of the module contents? like having a \bin\PowerShellGet folder then copying this folder to the AllUsers scope during the test runs? #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not really in place as it happens before any tests have been kicked off, this is what the tests should be run against (a compiled psm1 file). I don't think it should be a responsibility of the tests to rearrange or package up the artifact into it's final form the Invoke-PowerShellGetTest already seems to be doing too much, and more than just tests. #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
build.psm1 files can be used on our development machines, in that case all the local changes in the individual files will be lost due to this removal step. #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
build.psm1 is just a script module tho?, loading it won't execute the function Remove-FunctionFolders. It will just load it into memory. The function is executed specifically by the Travis, and Appveyor config. #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To reproduce the CI failures, some times we will have to use the Merge-FunctionsIntoPSMFile and Remove-FunctionFolders functions from the build.psm1 on our dev machines, in that case we will loose the local uncommitted changes, if any, right? #Closed
Please take a look at the CI test failures. In reply to: 372024549 [](ancestors = 372024549) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🕐
@bmanikm Thanks for that, are you saying there are effectively two modules here defined in the one module file? And that the ExportModuleMember -Functions in the PSM file list should actually be different to the FunctionsToExport list in the PSM1? This seems odd to me.
They should be defined in either the psm1 file or the the psd1 file. Need to understand this provider aspect more and why there are two different 'public' lists of functions at play here.
#Closed
|
@Benny1007 Please take a look at the below topics for more details. The PackageManagement provider functions, implemented in the PowerShellGet module, can't be used directly by the end-users, they can only be used with the PackageManagement cmdlets. That's they are not listed in the FunctionsToExport entry of the PowerShellGet module manifest. All the public functions under public folder need to be separated into two folders, so that it will be easier to get the list of public cmdlets to be exported at the module level and the list of provider functions to be exported at provider level.
(I am fine with other suitable names for the above proposed sub folders) All public functions from both folders need to be listed as the Export-ModuleMember in PSModule.psm1 file. |
# Create install locations for scripts if they are not already created Please move the region placeholders prior to the above line in PSModule.psm1 file. This is the reason for Test-RunningAsElevated related errors in the CI test runs. Test-RunningAsElevated : The term 'Test-RunningAsElevated' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\powershellcore\Modules\powershellget\1.6.2\PSModule.psm1:856 char:110
+ ... :ProgramFilesInstalledScriptInfosPath) -and (Test-RunningAsElevated))
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Test-RunningAsElevated:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException Expected#region private functions imported via build script
#buildScriptPrivateFunctionsGoHere
#endregion
#region public functions imported via build script
#buildScriptPublicFunctionsGoHere
#endregion
# Create install locations for scripts if they are not already created
# --- Refers to: PowerShellGet/PSModule.psm1:855 in 84e1c78. [](commit_id = 84e1c78, deletion_comment = False) #Closed |
with regard to moving the regions for the function import, I will do this. (this was actually the reason I made it place holder replacement rather than just appending to the file, however I forgot the reason I did that. |
I am still not clear about those explanations around Packagemangement vs PowerShellGet. From reading those pages it would seem that PowerShellGet is just a package manager, and PackageManagement is a common interface to work with ANY package manager so why are there Packagemanagement implementation details within the PowerShellGet? Shouldn't Packagemanagement be a separate repo, or is it a separate repo already and these functions are just used by packagemanagement? |
While merging the contents of individual files into the PSModule.psm1 file, we need to remove the below region, right? #region Load of module functions after split from main .psm1 file issue Fix#37
$PublicFunctions = @( Get-ChildItem -Path $PSScriptRoot\public\*.ps1 -ErrorAction SilentlyContinue )
$PrivateFunctions = @( Get-ChildItem -Path $PSScriptRoot\private\*.ps1 -ErrorAction SilentlyContinue )
# Load the separate function files from the private and public folders.
$AllFunctions = $PublicFunctions + $PrivateFunctions
foreach($function in $AllFunctions) {
try {
. $function.Fullname
}
catch {
Write-Error -Message "Failed to import function $($function.fullname): $_"
}
}
#endregion Proposal:
#Closed |
@@ -1,7 +1,7 @@ | |||
function Get-PSRepository | |||
{ | |||
<# | |||
.ExternalHelp ..\PSModule-help.xml | |||
.ExternalHelp PSModule-help.xml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.ExternalHelp PSModule-help.xml [](start = 4, length = 31)
Get-PSRepository is a psd1 export function, please move this file to public/psdexports folder.
tools/build.psm1
Outdated
} | ||
|
||
$psmExportFunctionNames = $psmExportFunctionNames.TrimEnd(",") | ||
$psmFunctionExportString = "Export-ModuleMember -Function $psmExportFunctionNames" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also include the $PublicPSDFunctions.BaseName, otherwise no PublicPSDFunctions names will be exported at the module level. This is the reason for CI test failures too. #Closed
Why are there Packagemanagement implementation details within the PowerShellGet? Shouldn't Packagemanagement be a separate repo, or is it a separate repo already and these functions are just used by packagemanagement? PackageManagement has its own repo --> https://github.com/oneget/oneget PackageManagment architecture can be found at https://github.com/oneget/oneget#get-started . High-level execution flow of a PowerShellGet cmdletPowerShellGet\Install-Module --> PackageManagement\Install-Package --> PowerShellGet provider Install-Package function |
tools/build.psm1
Outdated
Set-Content -Path $ModuleFile -Value $ModuleFileContent | ||
|
||
# Update the PowerShellGet.psd1 module manifest to export only /public/psmexports functions. | ||
Update-ModuleManifest -Path "$ModuleRoot\PowerShellGet.psd1" -FunctionsToExport $PublicPSGetFunctions.BaseName |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update-ModuleManifest -Path "$ModuleRoot\PowerShellGet.psd1" -FunctionsToExport $PublicPSGetFunctions.BaseName [](start = 4, length = 110)
Update-ModuleManifest -Path "$ModuleRoot\PowerShellGet.psd1" -FunctionsToExport $PublicPSGetFunctions.BaseName [](start = 4, length = 110)
This cmdlet is not available on PS v4, this impacts the AppVeyor test run on PS v4. #Closed
@Benny1007 It looks like the providerfunctions folder has the psget function files and vice-versa. |
tools/build.psm1
Outdated
if($PSVersionTable.PSVersion.Major -lt 5) { | ||
# Update the psd1 file by replacing @(#functionsToExportGoHere) in psd1 file. | ||
$ManifestFileContent = Get-Content -Path "$ModuleRoot\PowerShellGet.psd1" | ||
$ManifestFunctionExportString = "FunctionsToExport = @($($PublicPSGetFunctions.BaseName -Join ","))" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ManifestFunctionExportString = "FunctionsToExport = @($($PublicPSGetFunctions.BaseName -Join ","))" [](start = 8, length = 100)
Quotes are missing around each function name listed in the string. CI test run for PS 4 is blocked due to this issue.
Please change this line to below.
tools/build.psm1
Outdated
} else { | ||
Write-Warning -Message "Unable to restore pre-merged psm1 file, not found in $ModuleFileBackupFolder" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This additional function can be avoided when the merged files are created under different path like bin\PowerShellGet. Please let me know your thoughts on why you prefer this additional Restore-PreMergedModuleFiles function.
With this function, during the development, we need to run two functions one for merging and other for restoring the changes prior to submitting the PR, right?
I prefer the merged files location to be bin\PowerShellGet (or some other path) instead of in-place merge.
#Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's a bit strange as I have split the repo out without ever having done any development on it. How do you envisage the development workflow?
For example if you were to work on the function Update-ModuleManifest how do you go about loading it, with all it's dependencies (throwerror in private functions) and in module scope? How do you step through debug the function?
How do you see this working with the amalgamated psm1 file, the developer would have to do that merge in order to load the module and do debugging right? So the psm1 merge wouldn't just be performed in the build function.
apologies for the delay, but I am in gmt+8 timezone.
#Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries @Benny1007, here are my thoughts:
-
Split the current contents of
PSModule.psm1
file into two .ps1 files underPowerShellGet\private\init\
folder. -
Move the current contents of PSModule.psm1 into
begin.ps1
andend.ps1
files (these are just placeholder file names, I am open to suitable names). -
begin.ps1
contents- Current contents of PSModule.psm1 above (in this PR)
#region private functions imported via build script
- Current contents of PSModule.psm1 above (in this PR)
-
end.ps1
contents are- Alias related code, and
- Scripts folder creation code
-
Move the current files under
PowerShellGet\private\
folder intoPowerShellGet\private\functions\
. -
New code in PSModule.psm1
- dot source logic in below order (NOTE: this will ensure that it is not required to create the merged file during the development)
begin.ps1
- script files under
PowerShellGet\private\functions\
- script files under
PowerShellGet\public\psgetfunctions
andPowerShellGet\private\providerfunctions
end.ps1
- There won't be any placeholders for creating the single .psm1 during CI runs.
- Developer will have to add the PowerShellGet clone path at the beginning of the $env:PSModulePath, so that this path gets preference in loading the module and provider. Please note that during the development workflow, it is not required to execute the Merge-FunctionsIntoPSMFile function.
- dot source logic in below order (NOTE: this will ensure that it is not required to create the merged file during the development)
-
Single file construction logic in Merge-FunctionsIntoPSMFile function during CI test runs and release time
- Creates root\bin\PowerShellGet folder and deletes this folder contents, if there are any files from the previous merge run.
- Copies the contents of root\PowerShellGet to root\bin\PowerShellGet folder.
- Constructs the PSModule.psm1 file under root\bin\PowerShellGet
- The current contents of PSModule.psm1 file will be overwritten.
- Adds file content in the following order
begin.ps1
- script files under
PowerShellGet\private\functions\
- script files under
PowerShellGet\public\psgetfunctions
andPowerShellGet\public\providerfunctions
- Export-ModuleManifest line with all public function names under
PowerShellGet\public
folder. end.ps1
- Update-ModuleManifest logic for updating the FunctionsToExport entry.
-
As part of the CI test runs, we need to copy the contents of root\bin\PowerShellGet folder instead of root\PowerShellGet folder.
#Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep that works. standby... #Closed
…sourced in two parts, fix build
…thub.com/Benny1007/PowerShellGet into fix#240/Add-build-step-to-construct-psm1
|
||
$baseDirectory = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent | ||
Microsoft.PowerShell.Utility\Import-LocalizedData LocalizedData -filename PSGet.Resource.psd1 -BaseDirectory $baseDirectory | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change work fine with the merged singl psm1 file? #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change was necessary to load the combined psm1 file with import-module. Without the -BaseDirectory switch the module would not load. #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Benny1007 This change is not working for the merged file scenario. I am getting below error as $baseDirctory assignment assumes the current folder structure PowerShellGet/private/modulefile/
, right? To resolve this, we might have to move these partOne.ps1 and partTwo.ps1 files to the PowerShellGet folder and delete them during merge time.
C:\>Import-Module PowerShellGet -Verbose -Force
Microsoft.PowerShell.Utility\Import-LocalizedData : Cannot find the Windows PowerShell data file 'PSGet.Resource.psd1' in directory 'C:\Program Files\WindowsPowerShell\Modules\en-US\', or in any parent culture
directories.
At C:\Program Files\WindowsPowerShell\Modules\powershellget\1.6.4\PSModule.psm1:465 char:1
+ Microsoft.PowerShell.Utility\Import-LocalizedData LocalizedData -file ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\Program File...t.Resource.psd1:String) [Import-LocalizedData], PSInvalidOperationException
+ FullyQualifiedErrorId : ImportLocalizedData,Microsoft.PowerShell.Commands.ImportLocalizedData
``` #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change to the Import-LocalizedData line was because the module file PSModule.psm1 would not import due to issues dotsourcing the partone.ps1. Ultimately this was because the filename parameter of Import-LocalizedData assumes the local directory as it's source. At which point I added the -BaseDirectory parameter, and the $baseDirectory variable at line 464, and then the module loaded fine, so I am surprised that you encounter that issue:-
M:\dev\repos\PowerShellGet\powershellget [fix#240/Add-build-step-to-construct-psm1 ↑2 +0 ~1 -0 ~]> Import-Module .\PSModule.psm1
WARNING: The names of some imported commands from the module 'PSModule' include unapproved verbs that might make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved verbs, type Get-Verb.
M:\dev\repos\PowerShellGet\powershellget [fix#240/Add-build-step-to-construct-psm1 ↑2 +0 ~1 -0 ~]>
Moving the partone and parttwo files seems a bit drastic, if the above isn't working could we not revert line 465 , removing the -BaseDirectory parameter and move the Import-LocalizedData line into the PSModule.psm1 (before the dot sourcing of partone.ps1)? #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Above solution works for the developer scenario. When and where are you planning to add
Microsoft.PowerShell.Utility\Import-LocalizedData LocalizedData -filename PSGet.Resource.psd1
line for the CI or merged file scenario?
#Closed
New-Item -Path $ArtifactRoot -ItemType Directory | Out-Null | ||
|
||
# Copy the module into the dist folder | ||
Copy-Item -Path $ModuleRoot -Destination $ArtifactRoot -Recurse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the CI test runs are not validating the module created under dist/PowerShellGet, right? It is required to generate the dist/PowerShellGet folder and then copy it to the expected location in Invoke-PowerShellGetTest. Please take a look at the code starting at line # 310 or # Copy OneGet and PSGet modules to PSHOME
#Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you saying you want the Invoke-PowerShellGetTest to do more than just run tests on the /private and /public structure but to actually assemble the distributed module and install it, then perform all tests on that /dist module? How would that work for local dev testing?
#Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Benny1007 CI test runs should validate the generated module under /dist, right? otherwise, we are not sure /dist module is working fine or not. One such example is above mentioned Import-LocalizedData error.
I think, we need to move some portion of the Invoke-PowerShellGetTest function to a new function and handle additional logic for copying the generated PowerShellGet module /dist during CI test runs. During local dev testing, I am fine with executing the tests on /PowerShellGet folder instead of /dist/PowerShellGet folder. #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so something like this appveyor flow:-
install:
Import-Module .\tools\build.psm1
Install-Dependencies
Update-ModuleManifestFunctions
test_script
Publish-ModuleArtifacts
Install-PublishedModule
Invoke-PowerShellGetTest
on_finish
New-ModuleArtifactZip
Now that the install of the module would be outside of the testing (a good thing imo) we would need to update the developer docs on the flow around importing the module locally before running the tests etc?
#Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appveyor flow looks good to me.
Yes, for running the tests locally, we need to update the documentation in running-tests to prefix the clone path to $env:PSModulePath so that PowerShellGet will be loaded from the clone path.
$env:PSModulePath = "$ClonePath;$env:PSModulePath"
#Closed
tools/build.psm1
Outdated
$script:ProjectRoot = Split-Path -Path $PSScriptRoot -Parent | ||
$script:ModuleRoot = Join-Path -Path $ProjectRoot -ChildPath "PowerShellGet" | ||
$script:ModuleFile = Join-Path -Path $ModuleRoot -ChildPath "PSModule.psm1" | ||
$script:ArtifactRoot = if($script:IsWindows) { "$ProjectRoot\dist" } else { "$ProjectRoot/dist" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if($script:IsWindows) { "$ProjectRoot\dist" } else { "$ProjectRoot/dist" } [](start = 23, length = 74)
Please consider using Join-Path cmdlet here so that this if-else logic is not required. Also consider this at other places too. #Closed
Update-ModuleManifestFunctions; | ||
Publish-ModuleArtifacts; | ||
Install-PublishedModule; | ||
Invoke-PowerShellGetTest;" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-PowerShellGetTest [](start = 24, length = 18)
-IsFullTestPass is missing here. #Closed
|
||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider removing these empty lines. #Closed
Tests/PSGetPublishScript.Tests.ps1
Outdated
@@ -904,11 +904,12 @@ Describe PowerShell.PSGet.PublishScriptTests -Tags 'BVT','InnerLoop' { | |||
# | |||
# Expected Result: should fail | |||
# | |||
|
|||
It "InstallScriptWithExistingCommand" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider reverting this change in this file. #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure which change you mean (having trouble tracking the comments you are making in this PR) #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whitespace addition in Tests/PSGetPublishScript.Tests.ps1 file can be removed. Otherwise change history of that file includes this PR even though we are not making any changes. #Closed
tools/build.psm1
Outdated
<# if(($script:PowerShellEdition -eq 'Core') -and $script:IsWindows) | ||
{ | ||
$AllUsersModulesPath = Join-Path -Path $PowerShellHome -ChildPath 'Modules' | ||
} #> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this change? #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to extract the module installation from the tests, this logic is moved from the test function. I have a further question though, why does the test function call a get function which actually installs dot net core. That is concerning. A get function should not change state, and especially not install anything. #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, please remove the commented code. #Closed
(ls $zipFile) | ||
) | % { Push-AppveyorArtifact $_.FullName } | ||
$zipFile = ".\dist\PowerShellGet.zip" | ||
Push-AppveyorArtifact $zipFile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can't we retain the existing logic to zip the entire project folder including tests, results and dist, etc.,? #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of zipping the source? #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Including the source code, tests and test results along with dist folder in the artifact helps us in investigating the test failures when CI runs (PRs, Merge and Daily) are failed. Another option is to create two artifacts, one for dist and other for source & test results. #Closed
|
||
Move-Item -Path $tempZipfile -Destination $artifactZipFile -Force | ||
} | ||
function Install-PublishedModule { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PackageManagement needs to be installed prior to installing the PowerShellGet module. This is the reason for the CI test failures. The newly installed module is unable to load as PowerShellGet requires 1.1.7.0 or higher.
Please move the logic starting at line# 191 to #231 in Invoke-PowerShellGetTest function to Install-PublishedModule function.
Starting from # Install latest PackageManagement from Gallery
#Closed
@Benny1007 Please let me know if I can submit the required changes to your fork's branch. #Closed |
@bmanikm sure be my guest, bit busy this weekend ! 👍 #Closed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Benny1007 Thanks a lot for the great contributions to the PowerShellGet repository! |
@bmanikm I still have to modify artifact zip to include the source stuff. Also let me know if you'd like me to squish commits before you merge back. |
@Benny1007 Sorry, I already squashed and merged this PR :(. Could you please submit an another pull request for the artifact zip change? |
No description provided.