fix(scripts): standardize timestamp in Markdown-Link-Check.ps1 to use Get-StandardTimestamp#1283
fix(scripts): standardize timestamp in Markdown-Link-Check.ps1 to use Get-StandardTimestamp#1283chaosdinosaur wants to merge 3 commits intomainfrom
Conversation
… Get-StandardTimestamp
Replace (Get-Date).ToUniversalTime().ToString("o") with
Get-StandardTimestamp from CIHelpers.psm1 for centralized timestamp
management. Add Pester test verifying the standardized call.
Fixes #999
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1283 +/- ##
==========================================
- Coverage 87.72% 87.61% -0.11%
==========================================
Files 61 61
Lines 9320 9320
==========================================
- Hits 8176 8166 -10
- Misses 1144 1154 +10
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
PR Review Summary
This is a small, focused PR that correctly addresses issue #999. All checks pass — no blocking issues found.
✅ Issue Alignment
The changes directly implement what issue #999 requests:
scripts/linting/Markdown-Link-Check.ps1line 322:(Get-Date).ToUniversalTime().ToString('o')→Get-StandardTimestamp✅CIHelpers.psm1was already imported at line 51 — no additional import needed ✅- A Pester test was added to guard against regression ✅
- No scope creep; all issue requirements covered ✅
✅ PR Template Compliance
| Section | Status |
|---|---|
| Description | ✅ Clear and accurate |
| Related Issue | ✅ Fixes #999 |
| Type of Change | ✅ Bug fix + Script/automation — both correct for .ps1 changes |
| AI Artifact section | ✅ Correctly omitted (no AI artifact files changed) |
| Testing | ✅ Describes manual verification + automated test results |
| Checklist | ✅ All items addressed with appropriate N/A annotations |
| Security | ✅ First item checked; others correctly marked N/A |
✅ Coding Standards
Markdown-Link-Check.ps1 — follows powershell-script.instructions.md:
- Single-expression substitution using the centralized shared utility ✅
- Module already imported; no import changes required ✅
Markdown-Link-Check.Tests.ps1 — follows pester-testing.instructions.md:
- New
Context 'Timestamp standardization'added inside the existingDescribe 'Invoke-MarkdownLinkCheck' -Tag 'Unit'block ✅ Itname is descriptive and behavior-oriented ✅- Two assertions are complementary (positive existence check + negative absence check for the same behavioral property) — explicitly permitted by Pester conventions ✅
$PSScriptRootused for path resolution, consistent with the mirror directory pattern ✅
💡 Informational note on test approach: The test inspects source code text rather than exercising runtime behavior. This is intentional and consistent with the timestamp-standardization series (#994–#1002) — it functions as a regression guard to ensure the raw
ToUniversalTime()expression is never reintroduced. No change requested; just noting the pattern for reviewer awareness.
✅ Code Quality and Security
- Change is minimal and isolated to the timestamp expression ✅
Get-StandardTimestamp(from merged #993) produces the same ISO 8601 UTC format ✅- No security implications ✅
- No breaking changes — callers receive the same timestamp format ✅
- No performance concerns ✅
This PR meets initial quality standards. ✅
Pull Request
Description
Replaced
(Get-Date).ToUniversalTime().ToString('o')(duplicated UTC expression) inMarkdown-Link-Check.ps1withGet-StandardTimestampfromCIHelpers.psm1. The script already importsCIHelpers.psm1at line 51, so no additional import was needed. This centralizes timestamp generation through the shared utility.Added a Pester test that verifies the script source uses
Get-StandardTimestampand no longer contains the rawToUniversalTime()expression.Related Issue(s)
Fixes #999
Type of Change
Select all that apply:
Code & Documentation:
Infrastructure & Configuration:
AI Artifacts:
prompt-builderagent and addressed all feedback.github/instructions/*.instructions.md).github/prompts/*.prompt.md).github/agents/*.agent.md).github/skills/*/SKILL.md)Other:
.ps1,.sh,.py)Testing
(Get-Date).ToUniversalTime().ToString('o')replaced withGet-StandardTimestampat line 322.Get-StandardTimestampand noToUniversalTimeexpressions remain.npm run lint:pspassed.npm run test:pspassed (18 tests for this file).Checklist
Required Checks
Required Automated Checks
The following validation commands must pass before merging:
npm run lint:mdnpm run spell-checknpm run lint:frontmatternpm run validate:skillsnpm run lint:md-linksnpm run lint:psnpm run plugin:generateSecurity Considerations
Additional Notes
This is part of the timestamp standardization series (issues #994-#1002). The prerequisite
Get-StandardTimestampfunction was merged in #993.CIHelpers.psm1was already imported by this script, so the change is a direct expression swap with no import changes required.