Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate_Conceptual_Help: Using wrong property for the parameter $ModuleVersion default value #17

Closed
johlju opened this issue Feb 16, 2020 · 1 comment · Fixed by #18
Labels
bug The issue is a bug.

Comments

@johlju
Copy link
Member

johlju commented Feb 16, 2020

Details of the scenario you tried and the problem that is occurring

Running the build task generates an issue when gitversion is installed.

===============================================================================
                        GENERATE CONCEPTUAL HELP
This task generates conceptual help for DSC resources.
-------------------------------------------------------------------------------
  /build/Generate_Conceptual_Help
  C:\source\FileSystemDsc\output\RequiredModules\DscResource.DocGenerator\0.3.0\tasks\Generate_Conceptual_Help.build.ps1:103

        Project Path            = C:\source\FileSystemDsc
        Project Name            = FileSystemDsc
        Module Version          = 1.0.0-add-resource0001+Sha.a60d7ff1210a7eea658d3d3e02fea70a5a2c78c7.Date.2020-02-14
        Source Path             = C:\source\FileSystemDsc\source
        Built Module Path       = C:\source\FileSystemDsc\output\FileSystemDsc\1.0.0-add-resource0001+Sha.a60d7ff1210a7eea658d3d3e02fea70a5a2c78c7.Date.2020-02-14
Generating conceptual help for all DSC resources based on source.
ERROR: Could not find a part of the path 'C:\source\FileSystemDsc\output\FileSystemDsc\1.0.0-add-resource0001+Sha.a60d7ff1210a7eea658d3d3e02fea70a5a2c78c7.Date.2020-02-14\DSCResources\DSC_FileSystemAccessRule\en-US\about_FileSystemAccessRule.help.txt'.
At C:\source\FileSystemDsc\output\RequiredModules\DscResource.DocGenerator\0.3.0\DscResource.DocGenerator.psm1:509 char:23
+ ...       $output | Out-File -FilePath $savePath -Encoding 'ascii' -Force
+                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At C:\source\FileSystemDsc\output\RequiredModules\DscResource.DocGenerator\0.3.0\tasks\Generate_Conceptual_Help.build.ps1:103 char:1
+ task Generate_Conceptual_Help {
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At C:\source\FileSystemDsc\build.ps1:211 char:13
+             task $Workflow $WorkflowItem
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Build FAILED. 6 tasks, 1 errors, 0 warnings 00:00:03.4087934
Out-File : Could not find a part of the path 'C:\source\FileSystemDsc\output\FileSystemDsc\1.0.0-add-resource0001+Sha.a60d7ff1210a7eea658d3d3e02fea70a5a2c78c7.Date.2020-02-14\DSCResources\DSC_FileSys
temAccessRule\en-US\about_FileSystemAccessRule.help.txt'.
At C:\source\FileSystemDsc\output\RequiredModules\DscResource.DocGenerator\0.3.0\DscResource.DocGenerator.psm1:509 char:23
+ ...       $output | Out-File -FilePath $savePath -Encoding 'ascii' -Force
+                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (:) [Out-File], DirectoryNotFoundException
    + FullyQualifiedErrorId : FileOpenFailure,Microsoft.PowerShell.Commands.OutFileCommand

Steps to reproduce the problem

Running the build step with gitversion installed.

Expected behavior

Should build the path with the correct module version.

Current behavior

Instead of building the path with the module version 1.0.0 it building the path using the informational version outputted from gitversion, e.g.
1.0.0-add-resource0001+Sha.a60d7ff1210a7eea658d3d3e02fea70a5a2c78c7.Date.2020-02-14.

Suggested solution to the issue

Change the following row to replace the property InformationalVersion with the property MajorMinorPatch.

(gitversion | ConvertFrom-Json -ErrorAction Stop).InformationalVersion

For reference, the output from GitVersion:

{
  "Major":1,
  "Minor":0,
  "Patch":0,
  "PreReleaseTag":"add-resource.1",
  "PreReleaseTagWithDash":"-add-resource.1",
  "PreReleaseLabel":"add-resource",
  "PreReleaseNumber":1,
  "WeightedPreReleaseNumber":30001,
  "BuildMetaData":1,
  "BuildMetaDataPadded":"0001",
  "FullBuildMetaData":"1.Branch.f-add-resource.Sha.a60d7ff1210a7eea658d3d3e02fea70a5a2c78c7",
  "MajorMinorPatch":"1.0.0",
  "SemVer":"1.0.0-add-resource.1",
  "LegacySemVer":"1.0.0-add-resource1",
  "LegacySemVerPadded":"1.0.0-add-resource0001",
  "AssemblySemVer":"1.0.0.0",
  "AssemblySemFileVer":"1.0.0.0",
  "FullSemVer":"1.0.0-add-resource.1+1",
  "InformationalVersion":"1.0.0-add-resource0001+Sha.a60d7ff1210a7eea658d3d3e02fea70a5a2c78c7.Date.2020-02-14",
  "BranchName":"f/add-resource",
  "Sha":"a60d7ff1210a7eea658d3d3e02fea70a5a2c78c7",
  "ShortSha":"a60d7ff",
  "NuGetVersionV2":"1.0.0-add-resource0001",
  "NuGetVersion":"1.0.0-add-resource0001",
  "NuGetPreReleaseTagV2":"add-resource0001",
  "NuGetPreReleaseTag":"add-resource0001",
  "VersionSourceSha":"694d615028f1031888871289554c2327b49ce54d",
  "CommitsSinceVersionSource":1,
  "CommitsSinceVersionSourcePadded":"0001",
  "CommitDate":"2020-02-14"
}

The operating system the target node is running

Windows 10

Version and build of PowerShell the target node is running

Name                           Value
----                           -----
PSVersion                      5.1.19041.1
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.1
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Version of the module that was used

Name                     Version Path
----                     ------- ----
DscResource.DocGenerator 0.3.0   C:\source\FileSystemDsc\output\RequiredModules\DscResource.DocGenerator\0.3.0\DscResource.DocGenerator.psd1
@johlju johlju changed the title Generate_Conceptual_Help: Using wrong property for the $ModuleVersion default value Generate_Conceptual_Help: Using wrong property for the parameter $ModuleVersion default value Feb 16, 2020
@johlju
Copy link
Member Author

johlju commented Feb 16, 2020

The parameter ModuleVersion seems to be set to the wrong value in a prior build step that sets the environment variable ModuleVersion to the value of the property InformationalVersion. This need to be resolved in that module as well.

Submitted issue gaelcolas/Sampler#130.

@johlju johlju added bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community. in progress The issue is being actively worked on by someone. and removed help wanted The issue is up for grabs for anyone in the community. labels Feb 16, 2020
johlju added a commit that referenced this issue Feb 25, 2020
- Fixes the build task `Generate_Conceptual_Help` to use the correct
  module version folder name for the built module path (issue #17).
@johlju johlju removed the in progress The issue is being actively worked on by someone. label Jul 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant