Closed Texernie closed 5 years ago
Edited the request to show that the issue still exists in PowershellGet 2.0.1.
@Texernie Since your repository is a self-hosted nuget gallery, please consider removing the limitation on tag limit. Another option is to update the PowerShellGet module temporarily on your machine to limit/remove tags entry. Let us know if this issue can be reproducible when you publish a module with 116 commands to the PowerShell Gallery.
I agree with you on adding an optional switch parameter to the Publish-Module cmdlet to not any additional tags for the exported commands.
I am a little hesitant to expand the tag limit on our Nuget gallery since it is so close to nuget.org's site and I am really unfamiliar with their database update scheme. We basically have the private gallery so we can use the Nuget technology without exposing our private data. It has only been modified with branding and where it stores the files. In all other respects, it is an identical copy of nuget.org.
I am attempting to work around this issue by splitting up my module into 4 smaller ones, then have one module that requires all of the sub modules.
PowershellGallery dealt with the test file I put up there fine. It had 8248 characters in the tag field (Version 1.0.0.1). I modified it to make the tags even longer and it came in at 9208 characters (Version 1.0.0.2). This package can be hard deleted as it is nothing but test files that have no content in them. I have already de-listed them.
https://www.powershellgallery.com/packages/TestPowershellPackage/1.0.0.1 https://www.powershellgallery.com/packages/TestPowershellPackage/1.0.0.2
@bmanikm I took a little time this morning and found out that disabling the 4K character limit on the NugetGallery was pretty easy and did not require database modifications. I am currently over my hurdle, although this request is still a nice request since others might hit the same issue.
I'm going to close this issue for now, we can re-open if there's any other problems associated with this or if someone else brings it up.
The code change is still a good idea. If the issue is closed, how would anyone know to pick up the issue? I simply did a work around, which not everyone may be able to do.
Pass -SkipAutomaticTags as introduced in PowerShellGet 2.1.4
disabling the 4K character limit on the NugetGallery
Could I enquire as to how you did this @Texernie ? I'm in exactly the same position. Self-Hosted gallery set up by some other guy and me with limited understanding of how he did it or how to update it hitting exactly the same problem.
disabling the 4K character limit on the NugetGallery
Could I enquire as to how you did this @Texernie ? I'm in exactly the same position. Self-Hosted gallery set up by some other guy and me with limited understanding of how he did it or how to update it hitting exactly the same problem.
In the version that I modified from 2018, there were 3 lines in the NuGetGallery/Services/PackageService.cs file that needed commenting out.
if (packageMetadata.Tags != null && packageMetadata.Tags.Length > 4000)
{
throw new EntityException(Strings.NuGetPackagePropertyTooLong, "Tags", "4000");
}
Publish-Module creates an invalid nuspec file when a large number of functions are exported in a powershell module. The problem is that down in Publish-PSArtifactUtility, it brute forces all of the exported function names into the tags. My particular case resulted in a tag field around 11000 characters, way over the 4000 limit. I am publishing to a self-hosted nuget gallery, but it is based upon the current production branch.
It would be nice if it either truncated the values at 4000 characters with a warning, or allow a total override of the tags.
Steps to reproduce
Expected behavior
Publishing of the module to succeed and a nuget package exist in the repository.
Actual behavior
Environment data