Skip to content

fix(scripts): add dot-source guard to Invoke-MsDateFreshnessCheck.ps1#397

Merged
WilliamBerryiii merged 1 commit into
mainfrom
fix/msdate-freshness-test-hang
Apr 7, 2026
Merged

fix(scripts): add dot-source guard to Invoke-MsDateFreshnessCheck.ps1#397
WilliamBerryiii merged 1 commit into
mainfrom
fix/msdate-freshness-test-hang

Conversation

@WilliamBerryiii
Copy link
Copy Markdown
Member

Pull Request

Description

Add the standard if ($MyInvocation.InvocationName -ne '.') { ... } dot-source guard around the #region Main Logic block in Invoke-MsDateFreshnessCheck.ps1. This was the only script in the codebase missing the guard — all 18 other scripts already had it.

Without the guard, Pester's BeforeAll dot-source triggered the script's main logic (recursive file scan + exit call), hanging the test run indefinitely.

Closes #396

Type of Change

  • 🐛 Bug fix (non-breaking change fixing an issue)

Component(s) Affected

  • scripts/linting/ - Linting and validation scripts

Testing Performed

  • All 1,038 Pester tests pass (deploy: 52, lib: 169, security: 232, linting: 585)
  • The 37 tests in Invoke-MsDateFreshnessCheck.Tests.ps1 that previously hung now complete successfully
  • No regressions across any test folder

Documentation Impact

  • No documentation changes needed

Bug Fix Checklist

  • Linked to issue being fixed
  • Justification for no regression test: The 37 existing tests in Invoke-MsDateFreshnessCheck.Tests.ps1 serve as the regression tests — they now execute correctly instead of hanging

Checklist

- Wrap #region Main Logic in standard MyInvocation guard to prevent
  execution when dot-sourced by Pester tests
- Matches the pattern used by all other scripts in the codebase

Closes #396

🤖 - Generated by Copilot
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 7, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA c916771.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 7, 2026

Codecov Report

❌ Patch coverage is 2.22222% with 44 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.27%. Comparing base (acfe20d) to head (c916771).

Files with missing lines Patch % Lines
scripts/linting/Invoke-MsDateFreshnessCheck.ps1 2.22% 44 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #397      +/-   ##
==========================================
- Coverage   50.46%   50.27%   -0.20%     
==========================================
  Files         267      267              
  Lines       18098    18099       +1     
  Branches     1855     1903      +48     
==========================================
- Hits         9134     9100      -34     
- Misses       8674     8709      +35     
  Partials      290      290              
Flag Coverage Δ *Carryforward flag
pester 80.92% <2.22%> (-1.04%) ⬇️
pytest 6.89% <ø> (ø) Carriedforward from acfe20d
pytest-dataviewer 61.97% <ø> (ø)
vitest 50.72% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
scripts/linting/Invoke-MsDateFreshnessCheck.ps1 60.00% <2.22%> (-30.36%) ⬇️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@WilliamBerryiii WilliamBerryiii merged commit f6f22c3 into main Apr 7, 2026
30 checks passed
@WilliamBerryiii WilliamBerryiii deleted the fix/msdate-freshness-test-hang branch April 7, 2026 17:04
WilliamBerryiii pushed a commit that referenced this pull request Apr 8, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.6.0](v0.5.0...v0.6.0)
(2026-04-08)


### ✨ Features

* **build:** add terraform-docs generation pipeline
([#378](#378))
([78e90d0](78e90d0))
* **infrastructure:** enable optional AML diagnostic logs
([#400](#400))
([58dd8db](58dd8db))
* **scripts:** consolidate scripts library paths and enhance dataviewer
([#383](#383))
([176d9c9](176d9c9))


### 🐛 Bug Fixes

* **build:** remediate CVEs, enforce equality pinning, repair Dependabot
config
([#391](#391))
([0c29148](0c29148))
* **infrastructure:** add Storage File Data Privileged Contributor role
for ML identity
([#380](#380))
([378f7ed](378f7ed))
* **infrastructure:** replace hardcoded NAT Gateway availability zones
with variable
([#356](#356))
([a1397bd](a1397bd))
* **infrastructure:** resolve TFLint violations and enable hard-fail
([#376](#376))
([dfb55cd](dfb55cd))
* **scripts:** add dot-source guard to Invoke-MsDateFreshnessCheck.ps1
([#397](#397))
([f6f22c3](f6f22c3))
* **training:** validate AzureML and OSMO RL submissions end to end
([#372](#372))
([49904d3](49904d3))


### 📚 Documentation

* **infrastructure:** add terraform-docs tooling and improve developer
experience
([#365](#365))
([a0fb03a](a0fb03a))
* **reference:** centralize workflow template docs and convert workflow
READMEs to pointer index
([#379](#379))
([68097e4](68097e4))


### 🔧 Miscellaneous

* **deps-dev:** bump the npm_and_yarn group across 1 directory with 2
updates
([#374](#374))
([d848c8b](d848c8b))
* **deps-dev:** bump vite from 6.4.1 to 6.4.2 in
/data-management/viewer/frontend in the npm_and_yarn group across 1
directory
([#395](#395))
([6ec7f19](6ec7f19))
* **deps:** bump the github-actions group across 1 directory with 7
updates
([#370](#370))
([4d1b951](4d1b951))
* **deps:** bump the uv group across 2 directories with 1 update
([#373](#373))
([ba66ed9](ba66ed9))


### 🔒 Security

* **deps-dev:** bump brace-expansion from 1.1.12 to 1.1.13 in
/docs/docusaurus in the npm_and_yarn group across 1 directory
([#389](#389))
([27129d9](27129d9))
* **deps-dev:** bump the npm_and_yarn group across 2 directories with 2
updates
([#363](#363))
([aeae624](aeae624))
* **deps-dev:** bump the python-dependencies group with 5 updates
([#403](#403))
([bb85560](bb85560))
* **deps:** bump cryptography from 46.0.5 to 46.0.6 in /training/rl
([#367](#367))
([a82dd68](a82dd68))
* **deps:** bump the inference-dependencies group in /evaluation with 2
updates
([#401](#401))
([c88d253](c88d253))
* **deps:** bump the pip group across 4 directories with 2 updates
([#411](#411))
([1230fe0](1230fe0))
* **deps:** bump the training-dependencies group across 1 directory with
67 updates
([#375](#375))
([8e05172](8e05172))
* **deps:** bump the uv group across 2 directories with 1 update
([#382](#382))
([b6c7aea](b6c7aea))
* **deps:** update marshmallow requirement from &lt;4.3.0,&gt;=3.5 to
&gt;=3.5,&lt;4.4.0 in /evaluation in the inference-dependencies group
([#393](#393))
([599c7eb](599c7eb))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: physical-ai-toolchain-release[bot] <267194360+physical-ai-toolchain-release[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

Invoke-MsDateFreshnessCheck.Tests.ps1 hangs indefinitely during local Pester run

3 participants