Skip to content

fix(scripts): Exclude plugins/ from ms.date freshness check to prevent duplicate stale reports#1586

Merged
bindsi merged 3 commits into
mainfrom
fix/1585-msdate-fresh
May 14, 2026
Merged

fix(scripts): Exclude plugins/ from ms.date freshness check to prevent duplicate stale reports#1586
bindsi merged 3 commits into
mainfrom
fix/1585-msdate-fresh

Conversation

@katriendg
Copy link
Copy Markdown
Contributor

Description

The Invoke-MsDateFreshnessCheck.ps1 script was scanning symlinked markdown files in the plugins/ directory, causing duplicate stale documentation reports. This happened because Get-ChildItem -Recurse follows symlinks on Linux, and all 532 markdown files under plugins/ are symlinked mirrors of collection-generated content from source locations elsewhere in the repository.

This fix adds plugins to the exclusion patterns in the freshness check script, following the same pattern already established in Validate-MarkdownFrontmatter.ps1. The change eliminates the duplicate scanning and prevents downstream workflows from creating multiple GitHub issues for the same underlying stale documentation source.

Impact of the fix:

  • Resolves 177 of 346 duplicate scanned files from plugins/
  • Eliminates 41 of 54 duplicate stale entries in weekly validation reports
  • Prevents creation of up to 14 duplicate GitHub issues per unique stale source file

Related Issue(s)

Fixes #1585

Type of Change

Select all that apply:

Code & Documentation:

  • Bug fix (non-breaking change fixing an issue)
  • New feature (non-breaking change adding functionality)
  • Breaking change (fix or feature causing existing functionality to change)
  • Documentation update

Infrastructure & Configuration:

  • GitHub Actions workflow
  • Linting configuration (markdown, PowerShell, etc.)
  • Security configuration
  • DevContainer configuration
  • Dependency update

AI Artifacts:

  • Reviewed contribution with prompt-builder agent and addressed all feedback
  • Copilot instructions (.github/instructions/*.instructions.md)
  • Copilot prompt (.github/prompts/*.prompt.md)
  • Copilot agent (.github/agents/*.agent.md)
  • Copilot skill (.github/skills/*/SKILL.md)

Other:

  • Script/automation (.ps1, .sh, .py)
  • Other (please describe):

Testing

Added comprehensive test coverage in scripts/tests/linting/Invoke-MsDateFreshnessCheck.Tests.ps1:

  • Created test fixtures for the plugins/ directory structure
  • Added new test case: "Excludes plugins directory" that validates the exclusion works correctly
  • Test follows the same pattern as existing exclusion tests for .copilot-tracking, logs, and other directories
  • Verified that Get-MarkdownFiles properly filters out files in the plugins path

Run tests locally:

npm run test:ps -- -TestPath "scripts/tests/linting/Invoke-MsDateFreshnessCheck.Tests.ps1"

Checklist

Required Checks

  • Documentation is updated (if applicable)
  • Files follow existing naming conventions
  • Changes are backwards compatible (if applicable)
  • Tests added for new functionality (if applicable)

AI Artifact Contributions

  • Used /prompt-analyze to review contribution
  • Addressed all feedback from prompt-builder review
  • Verified contribution follows common standards and type-specific requirements

Required Automated Checks

The following validation commands must pass before merging:

  • Markdown linting: npm run lint:md
  • Spell checking: npm run spell-check
  • Frontmatter validation: npm run lint:frontmatter
  • Skill structure validation: npm run validate:skills
  • Link validation: npm run lint:md-links
  • PowerShell analysis: npm run lint:ps
  • Plugin freshness: npm run plugin:generate
  • Docusaurus tests: npm run docs:test

Security Considerations

  • This PR does not contain any sensitive or NDA information
  • Any new dependencies have been reviewed for security issues
  • Security-related scripts follow the principle of least privilege

Additional Notes

  • The root cause analysis identified that Get-ChildItem -Recurse on Linux follows symlinks, causing all files under plugins/ to be scanned despite their symlinked nature
  • This fix aligns the Invoke-MsDateFreshnessCheck.ps1 behavior with Validate-MarkdownFrontmatter.ps1, which already excludes plugins/**
  • The change is minimal and localized, introducing no breaking changes or backwards compatibility concerns

@katriendg katriendg requested a review from a team as a code owner May 13, 2026 12:28
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.49%. Comparing base (940773c) to head (cf5da89).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1586      +/-   ##
==========================================
- Coverage   85.50%   85.49%   -0.01%     
==========================================
  Files          82       82              
  Lines       11805    11805              
==========================================
- Hits        10094    10093       -1     
- Misses       1711     1712       +1     
Flag Coverage Δ
pester 83.65% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
scripts/linting/Invoke-MsDateFreshnessCheck.ps1 91.96% <100.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bindsi bindsi merged commit 0b617ce into main May 14, 2026
49 checks passed
@github-actions github-actions Bot mentioned this pull request May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(scripts): Exclude plugins/ from ms.date freshness check to prevent duplicate stale reports

4 participants