Skip to content

Standardize Evergreen release dates as invariant date strings - #949

Merged
aaronparker merged 13 commits into
mainfrom
date-format
Nov 6, 2026
Merged

aaronparker merged 13 commits into
mainfrom
date-format

Conversation

@aaronparker

@aaronparker aaronparker commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This change makes release Date values consistent across Evergreen by returning invariant yyyy-MM-dd strings instead of culture-dependent DateTime objects. This change is intended to make the Date property output more consistent across applications. See #942

Warning

ConvertTo-DateTime now returns a string rather than a DateTime object. Users relying on the previous return type should account for this change.

Changes

  • Update ConvertTo-DateTime to return an invariant yyyy-MM-dd string, add the Date parameter alias, and support additional 12- and 24-hour time formats.
  • Standardize date conversion in Get-CodebergRepoRelease, Get-GitLabRepoRelease, Get-JetBrainsApp, and Get-OracleJava by using the shared auto-detection behavior.
  • Add coverage to verify date type and format in Get-EvergreenApp and shared-function tests, including Microsoft fwlink dates.
  • Update PSScriptAnalyzer compatibility profiles to PowerShell 7.4 and Ubuntu 22.04; make related test and boolean-literal cleanup.

Change ConvertTo-DateTime to return yyyy-MM-dd strings instead of DateTime objects, omitting time components. Update help, output metadata, and tests to reflect the culture-independent output.
Adds a Pester test to Get-EvergreenApp.Tests.ps1 asserting that any optional Date property in app output is a string in yyyy-MM-dd format. The test is skipped when retrieval fails, no output is returned, or the app does not emit a Date property. Also suppresses PSAvoidUsingConvertToSecureStringWithPlainText for the test file.
Target PowerShell 7.4 and .NET 8 on Windows and Ubuntu 22.04, retaining Windows PowerShell 5.1 compatibility checks.
Add test-only PSScriptAnalyzer suppressions for PSAvoidUsingConvertToSecureStringWithPlainText across seven test files.
Use lowercase `$true` and `$false` literals in the export script and tests for consistent PowerShell style.
Add dd/MM/yyyy HH:mm parsing to ConvertTo-DateTime with a matching test case.
Remove explicit date patterns from Codeberg, GitLab, JetBrains, and Oracle Java helpers. Normalize Microsoft fwlink dates through ConvertTo-DateTime.
Verify Date values are yyyy-MM-dd strings across shared helpers, accounting for local timezone conversion where applicable. Update GitLab mocks and assert source timestamp conversion.
Add a Date alias and a two-digit 12-hour time format to ConvertTo-DateTime, with midnight test coverage. Return the resolved fwlink date directly instead of converting it.
@aaronparker aaronparker self-assigned this Nov 6, 2026
@aaronparker aaronparker added the enhancement New feature or request label Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Test Results

    6 files  ± 0  2 374 suites  ±0   6m 47s ⏱️ - 2m 24s
2 593 tests +34  2 552 ✅ +24   41 💤 +10  0 ❌ ±0 
9 867 runs  +42  9 661 ✅ +34  206 💤 + 8  0 ❌ ±0 

Results for commit 11f6223. ± Comparison against base commit eb45080.

This pull request removes 188 and adds 215 tests. Note that renamed tests count towards both.


ConvertTo-DateTime.Convert a date/time string to a DateTime object.Automatically parses dates by default
ConvertTo-DateTime.Convert a date/time string to a DateTime object.Parses the specified US format independently of local culture
ConvertTo-DateTime.Convert a date/time string to a DateTime object.Preserves the date and time from the provided format
ConvertTo-DateTime.Convert a date/time string to a DateTime object.Throws when automatic parsing and the fallback pattern both fail
Get-EvergreenApp works with supported application: AdoptiumTemurin19.Application function AdoptiumTemurin19 should return something.Get-EvergreenApp -Name AdoptiumTemurin19 should return a count of 1 or more
Get-EvergreenApp works with supported application: AdoptiumTemurin19.Application function AdoptiumTemurin19 should return something.Get-EvergreenApp -Name AdoptiumTemurin19 should return non-empty output
Get-EvergreenApp works with supported application: AdoptiumTemurin19.Application function AdoptiumTemurin19 should return something.Output from AdoptiumTemurin19 should return the expected output type
Get-EvergreenApp works with supported application: AdoptiumTemurin19.Output from application function AdoptiumTemurin19 returns expected properties.Output for AdoptiumTemurin19 should have a URI property that is a string
…
ConvertTo-DateTime.Convert a date/time string to a formatted date string.Automatically parses dates by default
ConvertTo-DateTime.Convert a date/time string to a formatted date string.Formats the parsed date as yyyy-MM-dd
ConvertTo-DateTime.Convert a date/time string to a formatted date string.Parses the specified US format independently of local culture
ConvertTo-DateTime.Convert a date/time string to a formatted date string.Throws when automatic parsing and the fallback pattern both fail
ConvertTo-DateTime.Default automatic parsing.Parses the known vendor format in 31/12/2024 23:45
ConvertTo-DateTime.Default automatic parsing.Parses the known vendor format in 6/10/2026 12:00:00 AM
Expand-CabArchive.Validate Shell extraction and expand.exe fallback.Should retry with expand.exe when Shell returns <Case> items("empty",)
Expand-CabArchive.Validate Shell extraction and expand.exe fallback.Should retry with expand.exe when Shell returns <Case> items("null",null)
Get-EvergreenApp works with supported application: ACLAPVideoDownloadHelperCoApp.Application function ACLAPVideoDownloadHelperCoApp should return something.Get-EvergreenApp -Name ACLAPVideoDownloadHelperCoApp should return a count of 1 or more
Get-EvergreenApp works with supported application: ACLAPVideoDownloadHelperCoApp.Application function ACLAPVideoDownloadHelperCoApp should return something.Get-EvergreenApp -Name ACLAPVideoDownloadHelperCoApp should return non-empty output
…

♻️ This comment has been updated with latest results.

Co-authored-by: aaronparker <8227455+aaronparker@users.noreply.github.com>
@aaronparker
aaronparker merged commit 3153917 into main Nov 6, 2026
12 checks passed
@aaronparker
aaronparker deleted the date-format branch November 6, 2026 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants