PowerShell / DscResource.Tests

Common meta tests for PowerShell DSC resources repositories.
MIT License
51 stars 49 forks source link

Nuget Spec Generated by AppVeyor invalid for PS Module Repository #318

Open djwork opened 5 years ago

djwork commented 5 years ago

Details of the problem, bug, or enhancement

As part developing the fix issue ComputerManagementDsc #130 I have been running the appveyor build/unit test for my fork. When appveyor runs it generates a sample nuget file. I loaded the file into an internal repository where I store development modules and then tried to install the module via the PackageManagement cmdlets.

But PackageManagement did not recognize the nuget file as a valid PS Module, when comparing the my nuget package with the latest release ComputerManagementDsc.6.2.0.0.nupkg from PS Gallery I notice the where a lot of differences, specifically:

When I manually synced the tags from the release nuget spec into my nuget spec, PackageManagement recognized the nuget file as a valid PS Module and installed it.

When I asked about this over in ComputerManagementDsc #213, @PlagueHO said this issue belonged over on this repository and the problem\solution was probably in AppVeyor.psm1

Verbose logs showing the problem (if applicable)

Suggested solution to the issue

The nuget tags appear to be hard coded in AppVeyor\Invoke-AppveyorAfterTestTask line 1105:

$nuspecParams = @{
        packageName        = $ResourceModuleName
        destinationPath    = $MainModulePath
        version            = $env:APPVEYOR_BUILD_VERSION
        author             = $Author
        owners             = $Owners
        licenseUrl         = "https://github.com/PowerShell/DscResources/blob/master/LICENSE"
        projectUrl         = "https://github.com/$($env:APPVEYOR_REPO_NAME)"
        packageDescription = $ResourceModuleName
        tags               = "DesiredStateConfiguration DSC DSCResourceKit"
    }
    New-Nuspec @nuspecParams

Suggestions:

  1. Append 'DSCResource', 'PSModule' to the tags, from my testing this should be enough to make PackageManagement happy.
  2. Set or append the tags from the resource module's psd1 file (eg ComputerManagementDsc.psd1 PrivateData\PSData\Tags)
PlagueHO commented 5 years ago

Thanks @djwork - I'm freed up and will have some time to look into this over the weekend.