Fix ephemerals tests after blockquote prefix requirement in PR #11036#11058
Merged
Fix ephemerals tests after blockquote prefix requirement in PR #11036#11058
Conversation
- Update test bodies to include '>' blockquote prefix required by updated regex patterns - Fix invalid date test to use a truly invalid date string - Clarify test name for EXPIRATION_PATTERN without blockquote prefix - All 35 ephemerals tests now pass Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix test failures due to regex pattern changes
Fix ephemerals tests after blockquote prefix requirement in PR #11036
Jan 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR #11036 updated
EXPIRATION_PATTERNandLEGACY_EXPIRATION_PATTERNto require blockquote prefixes (>) for expiration markers, but test cases still used the old format without prefixes.Changes
>prefix in test bodies:should extract date from body with expiration markershould return null for invalid dateshould return null for invalid legacy date(also fixed to use truly invalid date string)should handle standard expiration marker formatshould match→should NOT matchfor pattern without blockquoteBefore/After
The regex requires
^>\s*-\s*\[x\]\s+expiresper the new blockquote-prefixed footer format.Original prompt
This section details on the original issue you should resolve
<issue_title>[CI Failure Doctor] Test failures after PR #11036: regex pattern changes without test updates</issue_title>
<issue_description>## Summary
The CI workflow failed after merging PR #11036 which updated expiration detection regex patterns in
ephemerals.cjs. The changes required blockquote prefixes (>) in the regex patterns but failed to update the corresponding test cases, causing 45 test failures across 3 test files.Failure Details
js(JavaScript tests)Root Cause Analysis
What Went Wrong
PR #11036 "Fix expiration detection for quoted footers and legacy format" updated regex patterns in
ephemerals.cjs:EXPIRATION_PATTERN - Changed to require blockquote prefix:
LEGACY_EXPIRATION_PATTERN - New pattern for old format:
// NEW: /^>\s*-\s*\[x\]\s+expires\s+on\s+(.+?)\s+UTC\s*$/mThe problem: Tests in
ephemerals.test.cjswere passing text without blockquote prefixes, causingextractExpirationDate()to returnnullinstead of extracting dates.Failed Jobs and Errors
Primary Failures: ephemerals.test.cjs (3 tests)
Line 47: "should extract date from body with expiration marker"
>prefix:"Some text\n- [x] expires <!-- gh-aw-expires: 2026-01-25T15:54:08.894Z --> ..."expected null to be an instance of DateLine 111: "should handle standard expiration marker format"
expected null to be an instance of DateLine 103: "should return null for invalid legacy date"
9999-01-01T00:00:00.000ZSecondary Failures: collect_ndjson_output.test.cjs (36 tests)
These failures appear unrelated to ephemerals.cjs changes:
May indicate:
Tertiary Failures: safe_outputs_mcp_server_defaults.test.cjs (2 timeouts)
Recommended Actions
Immediate Fixes (P0 - Critical)
>to test body>to test bodyInvestigation Required (P1 - High)
Investigate collect_ndjson_output.test.cjs failures (36 tests)
Investigate safe_outputs_mcp_server_defaults.test.cjs timeouts (2 tests)
Prevention Strategies
For PR Authors
cd actions/setup/js && npm testFor Code Reviewers
For CI/CD
AI Team Self-Improvement
Additional prompting instructions for AI coding agents:
When modifying regex patterns (especially in validation, parsing, or detection logic):
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.