Skip to content

Commit

Permalink
Merge pull request #72 from techthoughts2/Enhancements
Browse files Browse the repository at this point in the history
Enhancements
  • Loading branch information
techthoughts2 committed Jan 19, 2024
2 parents be01063 + cc64817 commit 4b32697
Show file tree
Hide file tree
Showing 28 changed files with 456 additions and 103 deletions.
22 changes: 11 additions & 11 deletions actions_bootstrap.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,30 @@ Get-PackageProvider -Name Nuget -ForceBootstrap | Out-Null
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted

# List of PowerShell Modules required for the build
$modulesToInstall = [System.Collections.ArrayList]::new()
$modulesToInstall = New-Object System.Collections.Generic.List[object]
# https://github.com/PowerShell/Plaster
$null = $modulesToInstall.Add(([PSCustomObject]@{
ModuleName = 'Plaster'
ModuleVersion = '1.1.3'
}))
[void]$modulesToInstall.Add(([PSCustomObject]@{
ModuleName = 'Plaster'
ModuleVersion = '1.1.4'
}))
# https://github.com/pester/Pester
$null = $modulesToInstall.Add(([PSCustomObject]@{
[void]$modulesToInstall.Add(([PSCustomObject]@{
ModuleName = 'Pester'
ModuleVersion = '5.4.0'
ModuleVersion = '5.5.0'
}))
# https://github.com/nightroman/Invoke-Build
$null = $modulesToInstall.Add(([PSCustomObject]@{
[void]$modulesToInstall.Add(([PSCustomObject]@{
ModuleName = 'InvokeBuild'
ModuleVersion = '5.10.2'
ModuleVersion = '5.10.5'
}))
# https://github.com/PowerShell/PSScriptAnalyzer
$null = $modulesToInstall.Add(([PSCustomObject]@{
[void]$modulesToInstall.Add(([PSCustomObject]@{
ModuleName = 'PSScriptAnalyzer'
ModuleVersion = '1.21.0'
}))
# https://github.com/PowerShell/platyPS
# older version used due to: https://github.com/PowerShell/platyPS/issues/457
$null = $modulesToInstall.Add(([PSCustomObject]@{
[void]$modulesToInstall.Add(([PSCustomObject]@{
ModuleName = 'platyPS'
ModuleVersion = '0.12.0'
}))
Expand Down
28 changes: 27 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,32 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.2.0]

- Catesta template module changes
- Added `MarkdownRepair.ps1` and added Markdown repair logic to InvokeBuild script. This is to account for an issue in PowerShell `7.4.0`+ where a new parameter was introduced that platyPS can not handle during help creation. Ref: [platyPS issue]([text](https://github.com/PowerShell/platyPS/issues/595)).
- If a build is run and the build environment is `7.4.0`+ the Markdown repair will run to account for the new parameter and repair markdown for help creation.
- Replaced uses of `System.Collections.ArrayList` with `System.Collections.Generic.List` throughout.
- CI/CD Changes:
- Azure:
- Updated `testRunner` alias reference to `testResultsFormat`
- AWS CodeBuild CI/CD changes:
- `PowerShellCodeBuildCC.yml`
- `aws/codebuild/standard:6.0` to `aws/codebuild/standard:7.0`
- `PowerShellCodeBuildGit.yml`
- `aws/codebuild/standard:6.0` to `aws/codebuild/standard:7.0`
- Plaster bumped from `1.1.3` to `1.1.4`
- Pester bumped from `5.4.0` to `5.5.0`
- InvokeBuild bumped from `5.10.2` to `5.10.5`
- Catesta primary module changes
- Added `MarkdownRepair.ps1` and added Markdown repair logic to InvokeBuild script.
- Updated `LicenseUri` and `IconUri` link in `psd1` manifest.
- Updated link references in inline help for both public functions
- Replaced uses of `System.Collections.ArrayList` with `System.Collections.Generic.List` throughout.
- Plaster bumped from `1.1.3` to `1.1.4`
- Pester bumped from `5.4.0` to `5.5.0`
- InvokeBuild bumped from `5.10.2` to `5.10.5`

## [2.0.0] - *breaking changes introduced*

- Catesta template module changes
Expand Down Expand Up @@ -107,7 +133,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- InvokeBuild bumped from `5.8.8` to `5.9.11`
- Microsoft.PowerShell.SecretManagement bumped from `1.1.1` to `1.1.2`
- AWS CodeBuild CI/CD changes:
- `PowerShellCodeBuildGit.yml`
- `PowerShellCodeBuildCC.yml`
- `aws/codebuild/windows-base:2019-1.0` to `aws/codebuild/windows-base:2019-2.0`
- `aws/codebuild/standard:5.0` to `aws/codebuild/standard:6.0`
- All Lambdas updated from `Runtime: python3.6` to `Runtime: python3.9`
Expand Down
20 changes: 18 additions & 2 deletions docs/Catesta-FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ Badge examples:
![AWS CodeBuild Status](https://codebuild.us-west-2.amazonaws.com/badges?uuid=eyJlbmNyeXB0ZWREYXRhIjoiL2FvTzZsNGFoL1VTTk1UOGE3WXlwSVFRT3BTWngzc1czdVZLTEpNYWJld2xSbS9Ea3R0b3ZETm96Zk5md2ZXMVUwNXZnSnlaRlpuWUJldzdGMENpemRjPSIsIml2UGFyYW1ldGVyU3BlYyI6Ikl3T3VwdU43UUxya0J1SVciLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D&branch=master)
```

- **GitHub Actions**: [![GitHub Actions Build Status Windows pwsh Master](https://github.com/techthoughts2/Catesta/workflows/Catesta-Windows-pwsh/badge.svg?branch=master)](https://github.com/techthoughts2/Catesta/actions)
- **GitHub Actions**: [![GitHub Actions Build Status Windows pwsh Main](https://github.com/techthoughts2/Catesta/workflows/Catesta-Windows-pwsh/badge.svg?branch=main)](https://github.com/techthoughts2/Catesta/actions)
- *Just replace the link with your repo*

```plain
[![GitHub Actions Build Status Windows pwsh Master](https://github.com/techthoughts2/Catesta/workflows/Catesta-Windows-pwsh/badge.svg?branch=master)](https://github.com/techthoughts2/Catesta/actions)
[![GitHub Actions Build Status Windows pwsh Main](https://github.com/techthoughts2/Catesta/workflows/Catesta-Windows-pwsh/badge.svg?branch=main)](https://github.com/techthoughts2/Catesta/actions)
```

- **Appveyor**: [![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/kech4dkqsrb9xuet/branch/master?svg=true)](https://ci.appveyor.com/project/techthoughts2/appveyortest/branch/master)
Expand Down Expand Up @@ -121,6 +121,22 @@ By default a freshly created vault extension module already violates several PSS

This is normal, and the build / test validation process is doing it's job. You'll need to correct your manifest to not use wildcards. You will also need to add content to your extension psm1 to actually engage the variables.

## ProgressAction Error During Build Issue When Creating Help

### Issue Overview

In Catesta versions prior to `v2.2.0`, you might encounter an issue during the `CreateMarkDownHelp` step if you're running PowerShell `7.4.0` or higher. This is due to a new parameter, `ProgressAction`, [introduced in PowerShell 7.4.0(https://learn.microsoft.com/en-us/powershell/scripting/whats-new/what-s-new-in-powershell-74?view=powershell-7.4), which platyPS cannot handle during help creation. The error typically displays missing sections in the generated Markdown, prompting you to fill out information in your comment-based help.

platyPS GitHub Issue: [PlatyPS needs to support the new ProgressAction common parameter #595](https://github.com/PowerShell/platyPS/issues/595)

### Resolution

This issue has been addressed in [Catesta v2.2.0](https://github.com/techthoughts2/Catesta/issues/71). To resolve the error, upgrade your Catesta to version `v2.2.0` or later. The fix includes the addition of `MarkdownRepair.ps1` and an update to the `InvokeBuild` script to include markdown repair logic. This repair step accounts for the new parameter and corrects the markdown for help creation.

#### For Existing Projects

If you have an existing module built with an older version of Catesta and are experiencing this issue, you can manually apply the fix. You can either create a new module with Catesta `v2.2.0` or later and copy the generated `MarkdownRepair.ps1` and updated `InvokeBuild` logic, or directly incorporate these changes from the Catesta GitHub repository.

## Why is it called Catesta

It's a unique and meaningful name, combining two Latin words - "catasta" meaning scaffold, and "testa" meaning shell. This combination perfectly represents the purpose of Catesta, which is to provide a scaffold for PowerShell projects.
1 change: 0 additions & 1 deletion docs/Catesta-ModuleSchema.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ Help = 'Yes'
Pester = '5'
}
New-ModuleProject -ModuleParameters $moduleParameters -DestinationPath .
```
1 change: 0 additions & 1 deletion docs/Catesta-VaultSchema.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ CodingStyle = 'Stroustrup'
Pester = '5'
}
New-ModuleProject -ModuleParameters $vaultParameters -DestinationPath .
```
2 changes: 1 addition & 1 deletion docs/Catesta.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Module Name: Catesta
Module Guid: 6796b193-9013-468a-b022-837749af2d06
Download Help Link: NA
Help Version: 2.0.0
Help Version: 2.2.0
Locale: en-US
---

Expand Down
7 changes: 2 additions & 5 deletions docs/New-ModuleProject.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
external help file: Catesta-help.xml
Module Name: Catesta
online version: https://www.catesta.dev
online version: https://www.catesta.dev/en/latest/New-ModuleProject/
schema: 2.0.0
---

Expand Down Expand Up @@ -357,7 +357,7 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -Verbose, -WarningAction, -WarningVariable, and -ProgressAction.
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
Expand All @@ -377,9 +377,6 @@ Read the manifest schemas to understand how to properly craft a ModuleParameters
## RELATED LINKS
[https://www.catesta.dev](https://www.catesta.dev)
[https://www.catesta.dev/en/latest/New-ModuleProject/](https://www.catesta.dev/en/latest/New-ModuleProject/)
[https://docs.microsoft.com/powershell/scripting/developer/module/writing-a-windows-powershell-module](https://docs.microsoft.com/powershell/scripting/developer/module/writing-a-windows-powershell-module)
7 changes: 2 additions & 5 deletions docs/New-VaultProject.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
external help file: Catesta-help.xml
Module Name: Catesta
online version: https://www.catesta.dev
online version: https://www.catesta.dev/en/latest/New-VaultProject/
schema: 2.0.0
---

Expand Down Expand Up @@ -349,7 +349,7 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -Verbose, -WarningAction, -WarningVariable, and -ProgressAction.
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
Expand All @@ -362,11 +362,8 @@ Author: Jake Morrison - @jakemorrison - https://www.techthoughts.info/
## RELATED LINKS
[https://www.catesta.dev](https://www.catesta.dev)
[https://www.catesta.dev/en/latest/New-VaultProject/](https://www.catesta.dev/en/latest/New-VaultProject/)
[https://www.catesta.dev/en/latest/Catesta-Vault-Extension/](https://www.catesta.dev/en/latest/Catesta-Vault-Extension/)
[https://github.com/PowerShell/SecretManagement](https://github.com/PowerShell/SecretManagement)
11 changes: 11 additions & 0 deletions src/Catesta.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,17 @@ Add-BuildTask CreateMarkdownHelp -After CreateHelpStart {
throw 'Missing GUID. Please review and rebuild.'
}

Write-Build Gray ' Evaluating if running 7.4.0 or higher...'
# https://github.com/PowerShell/platyPS/issues/595
if ($PSVersionTable.PSVersion -ge [version]'7.4.0') {
Write-Build Gray ' Performing Markdown repair'
# dot source markdown repair
. $BuildRoot\MarkdownRepair.ps1
$OutputDir | Get-ChildItem -File | ForEach-Object {
Repair-PlatyPSMarkdown -Path $_.FullName
}
}

Write-Build Gray ' Checking for missing documentation in md files...'
$MissingDocumentation = Select-String -Path "$script:ArtifactsPath\docs\*.md" -Pattern "({{.*}})"
if ($MissingDocumentation.Count -gt 0) {
Expand Down
10 changes: 5 additions & 5 deletions src/Catesta/Catesta.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'Catesta.psm1'

# Version number of this module.
ModuleVersion = '2.0.0'
ModuleVersion = '2.2.0'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -54,7 +54,7 @@
RequiredModules = @(
@{
ModuleName = 'Plaster'
ModuleVersion = '1.1.3'
ModuleVersion = '1.1.4'
},
@{
ModuleName = 'Pester'
Expand Down Expand Up @@ -166,13 +166,13 @@
)

# A URL to the license for this module.
# LicenseUri = 'https://github.com/techthoughts2/Catesta/blob/main/LICENSE'
LicenseUri = 'https://github.com/techthoughts2/Catesta/blob/main/LICENSE'

# A URL to the main website for this project.
ProjectUri = 'https://github.com/techthoughts2/Catesta'

# A URL to an icon representing this module.
IconUri = 'https://github.com/techthoughts2/Catesta/raw/main/media/CatestaIcon.png'
IconUri = 'https://github.com/techthoughts2/Catesta/raw/main/docs/assets/CatestaIcon.png'

# ReleaseNotes of this module
ReleaseNotes = 'https://github.com/techthoughts2/Catesta/blob/main/docs/CHANGELOG.md'
Expand All @@ -190,7 +190,7 @@
Extensions = @(
@{
Module = 'Plaster'
MinimumVersion = '1.1.3'
MinimumVersion = '1.1.4'
Details = @{
TemplatePaths = @(
'Resources\Module',
Expand Down
2 changes: 0 additions & 2 deletions src/Catesta/Public/New-ModuleProject.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,6 @@
This requires an understanding of the template manifest schema which is provided in the Catesta docs.
Due to the nature of the lower level Plaster engagement, this means it is possible to pass hashtable choices
in ModuleParameters that are not supported. Read the manifest schemas to understand how to properly craft a ModuleParameters table.
.LINK
https://www.catesta.dev
.LINK
https://www.catesta.dev/en/latest/New-ModuleProject/
.LINK
Expand Down
2 changes: 0 additions & 2 deletions src/Catesta/Public/New-VaultProject.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,6 @@
System.Management.Automation.PSCustomObject
.NOTES
Author: Jake Morrison - @jakemorrison - https://www.techthoughts.info/
.LINK
https://www.catesta.dev
.LINK
https://www.catesta.dev/en/latest/New-VaultProject/
.LINK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ Resources:
Description: !Ref CodeCommitRepositoryDescription
Environment:
ComputeType: BUILD_GENERAL1_SMALL
Image: aws/codebuild/standard:6.0
Image: aws/codebuild/standard:7.0
Type: LINUX_CONTAINER
EnvironmentVariables:
- Name: main_bucket
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ Resources:
Environment:
#ComputeType: !Ref CodeBuildComputeType
ComputeType: BUILD_GENERAL1_SMALL
Image: aws/codebuild/standard:6.0
Image: aws/codebuild/standard:7.0
#Type: !Ref CodeBuildEnvironment
Type: LINUX_CONTAINER
Name: !Join
Expand Down
Loading

0 comments on commit 4b32697

Please sign in to comment.