Add template-level CHANGELOG.md (CalVer)#15
Conversation
…ception
- tests/Help.tests.ps1: rename undefined $parameterNames to $commandParameterNames
in the help-vs-code parameter existence check. The variable was never assigned
in scope, silently making the assertion always evaluate against $null.
- {{ModuleName}}/{{ModuleName}}.psm1: re-throw original exception object in the
dot-source catch block instead of throwing a new string, preserving stack
traces and inner-exception details for debugging.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace the single-shape Manifest.tests.ps1 dependency check with constraint- specific assertions and a SemVer comparison helper module. - tests/ManifestHelpers.psm1: new module exporting Test-VersionConstraint, with SemVer 2.0.0 prerelease ordering, .NET Version normalization, and Equal / GreaterOrEqual / LessOrEqual constraint modes. - tests/Manifest.tests.ps1: differentiate ModuleVersion (minimum), RequiredVersion (exact), and MaximumVersion (maximum) checks; accept both string and hashtable shapes for entries in requirements.psd1; detect duplicate RequiredModules entries; skip with a reason for plain-string dependencies. Preserves the existing BHBuildOutput override that points at Output/<Module>/<Version>/. Validated end-to-end against an initialized SmokeTest module: 30 passed, 0 failed, 2 -Skip'd. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- .gitattributes: mark docs/en-US/* as linguist-generated so platyPS-generated
help files don't skew GitHub language stats.
- .markdownlint-cli2.jsonc: relax MD013 in tables and code blocks, allow MD024
duplicate headings under different parents, and ignore AGENTS.md, the
generated docs/en-US/**, and the instructions/** AI-agent guides.
- docs/en-US/about_{{ModuleName}}.help.md: stub for Get-Help about_<Module>.
Initialize-Template.ps1 already renames {{ModuleName}} files in docs/en-US.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- PSScriptAnalyzerSettings.psd1: replace the single-line @{ IncludeRules = @('*') }
with the standard structured form (IncludeDefaultRules + Include/Exclude/Rules
blocks). Includes a commented-out PSUseCompatibleSyntax/PSUseCompatibleCmdlets
scaffold for projects that want cross-version compatibility checks.
- build.depend.psd1: bump PSScriptAnalyzer from 1.24.0 to 1.25.0 to pick up
newer rule fixes.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The repo's README.md was a placeholder-laden module README, which made it look
like docs for a hypothetical {{ModuleName}} when viewed on GitHub. Split into
two files so the GitHub template page sells the template itself.
- README.md: rewritten as template documentation — what's included (build,
CI, devcontainer, instructions, test infra), quick-start with Initialize-
Template.ps1, placeholder reference table, and post-init project structure.
- README.template.md: holds the original placeholder-based module README. The
file-processing loop in Initialize-Template.ps1 still substitutes its
placeholders, then the script moves it over README.md as the final step.
- Initialize-Template.ps1:
- Rename files in docs/en-US/ that contain {{ModuleName}} (e.g.,
about_{{ModuleName}}.help.md), parallel to the Public/Private/test
Prefix-rename loop.
- After renames, replace template-facing README.md with the now-substituted
README.template.md.
- Adjust the "Next steps" message to match the new flow.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- ManifestHelpers: strip SemVer build metadata in Split-SemVerString;
use [bigint] (not [long]) for numeric prerelease comparison so large
identifiers don't overflow.
- Initialize-Template: replace 'docs\en-US' and 'tests\Unit\{Public,Private}'
with forward-slash child paths so docs/test renaming works on PS7+
Linux/macOS.
- Manifest.tests: skip with a clear reason when requirements.psd1 has an
empty/whitespace Version, instead of throwing inside Test-VersionConstraint.
- {{ModuleName}}.psm1: bare 'throw' in the dot-source catch to preserve
the original ErrorRecord (was 'throw $_').
- about_{{ModuleName}}.help.md: drop trailing lone '-' that rendered as
an empty bullet under KEYWORDS.
- README.md / README.template.md: label project-tree fence as 'text'
(markdownlint MD040).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The existing CHANGELOG.md is the downstream-module starter (contains
{{Date}} and {{Prefix}}Example placeholders). Rename it to follow the
README.template.md convention so a separate CHANGELOG.md can hold the
template's own version history. Initialize-Template.ps1 will swap
CHANGELOG.template.md over CHANGELOG.md during init in a follow-up
commit.
Pure rename — no content change — so git log --follow stays clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Track changes to the PowerShell module template itself with its own
changelog, separate from the downstream-module starter changelog.
CHANGELOG.md (new) — template's own history. Uses Calendar Versioning
(YYYY.MM.DD) since the template has no API contract for SemVer to
describe; date-based answers the question downstream consumers actually
ask ("how stale is my init?"). First entry [2026.04.29] captures the
five chunks landed in the chore/template-sync branch.
Initialize-Template.ps1:
- Add CHANGELOG.md to the substitution-loop exclusion list. Without
this, init would rewrite literal {{ModuleName}} mentions in the
template's history to the user's chosen module name.
- After the README.template.md → README.md swap, add a parallel
CHANGELOG.template.md → CHANGELOG.md swap so downstream modules
receive the placeholder-laden starter changelog (the existing
CHANGELOG.template.md, formerly CHANGELOG.md), not the template's
own history.
tests/Manifest.tests.ps1:
- Skip the "Changelog and manifest versions are the same" assertion
when running on the un-initialized template, where CHANGELOG.md
holds the template's CalVer version which intentionally diverges
from the {{ModuleName}}.psd1 ModuleVersion. Marker: presence of
CHANGELOG.template.md (exists only pre-init; survives init's
substitution loop because nothing in the path matches a placeholder
token). The "valid version in changelog" assertion stays — PowerShell
parses [Version]'2026.4.29' fine.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add a Changelog section to the template-facing README so visitors of the template repo on GitHub can discover the version history. Inserted between Requirements and License, with a one-line note that the template uses CalVer rather than SemVer (so reviewers don't read date-shaped numbers as broken SemVer). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (14)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 17 minutes and 6 seconds.Comment |
There was a problem hiding this comment.
Pull request overview
This PR introduces a template-level changelog (CalVer) so changes to the template itself are tracked separately from the downstream module’s starter changelog, and wires the init script/tests/docs to support the new split.
Changes:
- Adds a template
CHANGELOG.md(CalVer) and introducesCHANGELOG.template.mdas the downstream-module starter changelog swapped in during initialization. - Updates
Initialize-Template.ps1to generate the downstream moduleCHANGELOG.mdfromCHANGELOG.template.mdand to avoid placeholder substitution in the template changelog. - Updates manifest tests to skip changelog-vs-manifest version equality on the uninitialized template, and adds SemVer helper logic for dependency constraint checks.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
CHANGELOG.md |
Adds template-level CalVer changelog and release links. |
CHANGELOG.template.md |
Adds downstream-module starter changelog template used post-init. |
Initialize-Template.ps1 |
Excludes template changelog from substitution and swaps in module changelog template during init. |
tests/Manifest.tests.ps1 |
Skips changelog/manifest equality for template; expands dependency version constraint assertions. |
tests/ManifestHelpers.psm1 |
Introduces SemVer parsing/comparison helper exported for manifest tests. |
README.md |
Updates template-facing README and links to template changelog. |
README.template.md |
Adds module-facing README template including changelog link. |
{{ModuleName}}/{{ModuleName}}.psm1 |
Adjusts dot-sourcing error handling to rethrow the original exception. |
tests/Help.tests.ps1 |
Fixes parameter list variable used in help-vs-code assertions. |
docs/en-US/about_{{ModuleName}}.help.md |
Adds about-help stub for initialized modules. |
PSScriptAnalyzerSettings.psd1 |
Switches to structured analyzer settings layout. |
build.depend.psd1 |
Bumps PSScriptAnalyzer dependency version. |
.markdownlint-cli2.jsonc |
Adds markdownlint-cli2 configuration and ignore patterns. |
.gitattributes |
Marks docs/en-US/* as generated for linguist. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The Fixed entry described the change as `throw $_` → bare `throw`, but `throw $_` was an intermediate state inside PR #14's review iterations. The actual user-visible change from main was: a string `throw` (which wrapped the original error in a fresh ErrorRecord) → bare `throw` (which preserves the original ErrorRecord and stack trace). Addresses Copilot inline review comment on PR #15. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
Summary
Adds a template-level changelog so changes to this PowerShell module template (init script, tests, scaffolding) have a tracked place to land — separate from the downstream-module starter changelog that ships to initialized modules.
CHANGELOG.md→CHANGELOG.template.md(downstream-module starter; unchanged content, parallel to the existingREADME.template.mdpattern).CHANGELOG.md— the template's own history. Uses Calendar Versioning (YYYY.MM.DD) since the template has no API contract for SemVer. First entry[2026.04.29]captures the contents ofchore/template-sync(PR Template polish: SemVer manifest tests, init refactor, analyzer config, README split #14).Initialize-Template.ps1— adds aMove-Item CHANGELOG.template.md → CHANGELOG.md -Forceswap (parallel to the existing README swap), plus excludesCHANGELOG.mdfrom the placeholder substitution loop so the template's history references aren't munged.tests/Manifest.tests.ps1— adds-Skip:$isTemplateto the "Changelog and manifest versions are the same" assertion. Marker =Test-Path CHANGELOG.template.md, which only exists pre-init (init moves it to CHANGELOG.md). The marker survives init's substitution loop because no token in the path matches a{{Placeholder}}.README.md(template-facing) — adds a## Changelogsection linking toCHANGELOG.md.Why CalVer
Templates don't have an API surface that SemVer's contract maps to (cookiecutter-django's maintainer reached the same conclusion). CalVer cleanly answers the question downstream consumers actually ask — "how stale is my init?" — without requiring major/minor/patch judgment calls. Same pattern as cookiecutter-django (
2026.04.24), Black, certifi.Note on base branch
This branch is based on
chore/template-sync(PR #14) because the[2026.04.29]entry documents PR #14's contents. Until PR #14 merges, the squashed diff againstmainwill include PR #14's commits and look noisy — review the three commits on this branch individually instead. After PR #14 merges, the diff will auto-clean to only the changelog work.Test plan
$isTemplate = True(CHANGELOG.template.mdexists at repo root).Move-Item CHANGELOG.template.md → CHANGELOG.mdsucceeds; downstreamCHANGELOG.mdcontains substituted starter ([0.1.0] - 2026-04-29,Get-StExample); no template-only content (CalVer,2026.04.29,Calendar Versioning) leaks into the downstream changelog.Describe 'Git tagging' -Skipblock, unrelated). The "Changelog and manifest versions are the same" test ran un-skipped post-init, comparing0.1.0against0.1.0.🤖 Generated with Claude Code