Improve verify-tests-fail-without-fix Skill#33513
Merged
PureWeen merged 9 commits intodotnet:mainfrom Jan 15, 2026
Merged
Conversation
Contributor
|
Hey there @@kubaflo! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR modifies the verify-tests-fail-without-fix skill to simplify its behavior and improve fork repository detection. The main changes include:
Changes:
- Removed the "verify failure only" mode (when only test files changed)
- Added
git fetch originto ensure base branch is up-to-date before computing diffs - Added
-RequireFullVerificationparameter to enforce full verification mode - Simplified documentation to focus on single-mode behavior (full verification only)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
.github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1 |
Removed ~100 lines of "verify failure only" mode logic, added git fetch for base branch, added RequireFullVerification parameter and error handling |
.github/skills/verify-tests-fail-without-fix/SKILL.md |
Updated documentation to remove references to dual-mode behavior and auto-detection table, simplified to describe only full verification mode |
.github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1
Outdated
Show resolved
Hide resolved
.github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1
Outdated
Show resolved
Hide resolved
.github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1
Outdated
Show resolved
Hide resolved
Member
|
/rebase |
…re full verification
Enhanced verify-tests-fail.ps1 to support a mode where, if no fix files are detected, it auto-detects changed test files, runs only the relevant tests, and expects them to fail. This mode helps validate that new or updated tests correctly reproduce a bug before a fix is implemented, providing detailed output and guidance for users.
Introduces $BaseBranchRef to consistently reference the latest base branch, whether local or origin, for all git diff, ls-tree, and checkout operations. This improves reliability when the local branch is stale or fetch operations fail, and simplifies the logic for detecting changed files and reverting fixes.
Expanded documentation to describe two workflow modes: 'Verify Failure Only' for test creation and 'Full Verification' for validating both tests and fixes. Added usage examples, clarified requirements, and detailed expected outputs for each mode to improve clarity for contributors.
Added the -RequireFullVerification flag to all usage examples for consistency and clarified its purpose in the documentation.
Enhanced the verify-tests-fail.ps1 script to support two modes: verify failure only (when no fix files are detected) and full verification (when fix files are present). Updated documentation to clarify usage, parameters, and examples for both modes, improving usability and clarity.
Adds the -RequireFullVerification flag to the PowerShell test verification command in the PR documentation to ensure full verification mode is used.
ed832e5 to
a68132c
Compare
- Fix corrupted ASCII box output in Full Verification Mode section - Add complete 'What It Does' section with both mode workflows - Remove duplicate section that was after Troubleshooting
- Add Find-MergeBase function using git merge-base for robust base detection - Fetch directly from PR target repo URL (parsed from PR URL) - Works even if developer's fork main is out of sync - No need for upstream remote configuration - Extract duplicated test filter detection into Get-AutoDetectedTestFilter - Extract test result parsing into Get-TestResultFromLog - Fix 'Failed: 0' edge case in test result parsing - Use single MergeBase SHA instead of tracking branch names/refs
PureWeen
approved these changes
Jan 15, 2026
kubaflo
added a commit
to kubaflo/maui
that referenced
this pull request
Jan 16, 2026
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Description This PR improves the `verify-tests-fail-without-fix` skill by fixing fork repository detection, improving error handling, and making full verification the recommended/default behavior. ## Changes ### 1. **Added `git fetch origin` for Accurate Diffs** - Fetches the base branch from origin before computing git diff - Ensures accurate fix file detection even in fork repositories - Prevents false negatives when base branch is stale locally ### 2. **Improved Verification Mode Behavior** - **Made full verification the primary/default mode** - tests must FAIL without fix and PASS with fix - **Added `-RequireFullVerification` parameter** - prevents silent fallback to verify-only mode - **Improved error handling** - script now warns/errors if no fix files detected (instead of silently switching modes) - **Verify-only mode still available** - runs when no fix files detected AND `-RequireFullVerification` not set - **Clearer expectations** - user explicitly controls whether verify-only fallback is allowed ### 3. **Improved Documentation** - Updated SKILL.md to reflect improved mode behavior - Clarified requirements (fix files + test files for full verification) - Updated mode selection table to show both modes clearly - Added troubleshooting guidance for "no fix files detected" scenario ### 4. **Better Error Handling** - Script exits early with actionable error if no fix files found AND `-RequireFullVerification` set - Provides explicit solutions (use `-FixFiles` or `-BaseBranch` explicitly) - Reduced ambiguity - user knows exactly what mode is running ## Why These Changes? ### Problem 1: Fork Repository Detection When working in a fork, the base branch might not be up-to-date locally, causing `git diff` to produce inaccurate results. This led to: - Missing fix files in the diff - False "only test files" mode activation - Incorrect verification results **Solution**: Always fetch the base branch from origin before computing diff. ### Problem 2: Confusing Auto-Detection The previous auto-detection system was unclear: - Silent fallback to "verify failure only" when no fix files detected - Users didn't know which mode was running - Made debugging harder **Solution**: - Add `-RequireFullVerification` parameter to make expectations explicit - Error immediately if user expects full verification but no fix files found - Maintain verify-only mode for legitimate test-first workflows ### Problem 3: Silent Failures When no fix files were detected (due to stale base branch or wrong base detection), the script would silently fall back to "verify failure only" mode, which wasn't the intended behavior. **Solution**: Fail fast with clear error message and troubleshooting steps when `-RequireFullVerification` is set. ## Testing Verified the changes work correctly with: - ✅ Fork repositories (fetch ensures accurate base branch) - ✅ PRs with fix files + test files (full verification runs) - ✅ Clear error when no fix files detected with `-RequireFullVerification` - ✅ Verify-only mode still works when appropriate (without the flag) - ✅ `-RequireFullVerification` parameter enforces strict mode ## Example Usage ```bash # Recommended for PR validation - ensures full verification pwsh .github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1 -Platform android -RequireFullVerification # With explicit test filter pwsh .github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1 -Platform ios -TestFilter "Issue33356" -RequireFullVerification # Override fix files or base branch if auto-detection fails pwsh .github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1 -Platform android -FixFiles @("src/Core/File.cs") -BaseBranch "main" # Test-first workflow (verify tests fail before writing fix) pwsh .github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1 -Platform ios ``` ## Breaking Changes⚠️ **Behavior Change**: The skill now requires explicit intent when fix files are not detected: - **Without `-RequireFullVerification`**: Falls back to verify-only mode (tests only need to FAIL) - **With `-RequireFullVerification`**: Errors immediately if no fix files found **Recommended usage**: Always use `-RequireFullVerification` when validating PRs to ensure full verification (tests FAIL without fix, PASS with fix). **Migration**: Update any automated scripts that call this skill to add `-RequireFullVerification` for PR validation workflows. ## Related - Part of improving PR verification workflows - Complements the `pr` custom agent for better PR validation - Ensures consistent behavior across fork and non-fork repositories ``` --- ## Key Changes from Current Description ### Change 1: Section 2 Title and Content **Current (inaccurate):** ```markdown ### 2. **Simplified Verification Mode** - **Removed** "verify failure only" mode (when only test files exist) ``` **Corrected:** ```markdown ### 2. **Improved Verification Mode Behavior** - **Made full verification the primary/default mode** - tests must FAIL without fix and PASS with fix - **Verify-only mode still available** - runs when no fix files detected AND `-RequireFullVerification` not set ``` ### Change 2: Breaking Changes Section **Current (inaccurate):** ```markdown⚠️ **Behavior Change**: The skill no longer supports "verify failure only" mode. ``` **Corrected:** ```markdown⚠️ **Behavior Change**: The skill now requires explicit intent when fix files are not detected: - **Without `-RequireFullVerification`**: Falls back to verify-only mode (tests only need to FAIL) - **With `-RequireFullVerification`**: Errors immediately if no fix files found ``` ### Change 3: Added Test-First Workflow Example **Added:** ```bash # Test-first workflow (verify tests fail before writing fix) pwsh .github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1 -Platform ios ``` This clarifies that verify-only mode is still useful for legitimate workflows. --- ## Why This Correction Matters **Code Reality**: The implementation shows verify-only mode still exists at lines 173-193: ```powershell if ($DetectedFixFiles.Count -eq 0) { Write-Host "║ VERIFY FAILURE ONLY MODE ║" # ... mode implementation } ``` **Impact of Inaccuracy**: - Future maintainers reading "removed" will be confused when they see the mode in code - Users might think they can't use verify-only mode for test-first workflows - Documentation doesn't match reality **Correction Approach**: - Acknowledge mode still exists - Explain it's no longer the silent fallback (key improvement) - Show it's still useful for test-first development - Emphasize full verification is now recommended/default --- --------- Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
simonrozsival
pushed a commit
that referenced
this pull request
Jan 20, 2026
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Description This PR improves the `verify-tests-fail-without-fix` skill by fixing fork repository detection, improving error handling, and making full verification the recommended/default behavior. ## Changes ### 1. **Added `git fetch origin` for Accurate Diffs** - Fetches the base branch from origin before computing git diff - Ensures accurate fix file detection even in fork repositories - Prevents false negatives when base branch is stale locally ### 2. **Improved Verification Mode Behavior** - **Made full verification the primary/default mode** - tests must FAIL without fix and PASS with fix - **Added `-RequireFullVerification` parameter** - prevents silent fallback to verify-only mode - **Improved error handling** - script now warns/errors if no fix files detected (instead of silently switching modes) - **Verify-only mode still available** - runs when no fix files detected AND `-RequireFullVerification` not set - **Clearer expectations** - user explicitly controls whether verify-only fallback is allowed ### 3. **Improved Documentation** - Updated SKILL.md to reflect improved mode behavior - Clarified requirements (fix files + test files for full verification) - Updated mode selection table to show both modes clearly - Added troubleshooting guidance for "no fix files detected" scenario ### 4. **Better Error Handling** - Script exits early with actionable error if no fix files found AND `-RequireFullVerification` set - Provides explicit solutions (use `-FixFiles` or `-BaseBranch` explicitly) - Reduced ambiguity - user knows exactly what mode is running ## Why These Changes? ### Problem 1: Fork Repository Detection When working in a fork, the base branch might not be up-to-date locally, causing `git diff` to produce inaccurate results. This led to: - Missing fix files in the diff - False "only test files" mode activation - Incorrect verification results **Solution**: Always fetch the base branch from origin before computing diff. ### Problem 2: Confusing Auto-Detection The previous auto-detection system was unclear: - Silent fallback to "verify failure only" when no fix files detected - Users didn't know which mode was running - Made debugging harder **Solution**: - Add `-RequireFullVerification` parameter to make expectations explicit - Error immediately if user expects full verification but no fix files found - Maintain verify-only mode for legitimate test-first workflows ### Problem 3: Silent Failures When no fix files were detected (due to stale base branch or wrong base detection), the script would silently fall back to "verify failure only" mode, which wasn't the intended behavior. **Solution**: Fail fast with clear error message and troubleshooting steps when `-RequireFullVerification` is set. ## Testing Verified the changes work correctly with: - ✅ Fork repositories (fetch ensures accurate base branch) - ✅ PRs with fix files + test files (full verification runs) - ✅ Clear error when no fix files detected with `-RequireFullVerification` - ✅ Verify-only mode still works when appropriate (without the flag) - ✅ `-RequireFullVerification` parameter enforces strict mode ## Example Usage ```bash # Recommended for PR validation - ensures full verification pwsh .github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1 -Platform android -RequireFullVerification # With explicit test filter pwsh .github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1 -Platform ios -TestFilter "Issue33356" -RequireFullVerification # Override fix files or base branch if auto-detection fails pwsh .github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1 -Platform android -FixFiles @("src/Core/File.cs") -BaseBranch "main" # Test-first workflow (verify tests fail before writing fix) pwsh .github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1 -Platform ios ``` ## Breaking Changes⚠️ **Behavior Change**: The skill now requires explicit intent when fix files are not detected: - **Without `-RequireFullVerification`**: Falls back to verify-only mode (tests only need to FAIL) - **With `-RequireFullVerification`**: Errors immediately if no fix files found **Recommended usage**: Always use `-RequireFullVerification` when validating PRs to ensure full verification (tests FAIL without fix, PASS with fix). **Migration**: Update any automated scripts that call this skill to add `-RequireFullVerification` for PR validation workflows. ## Related - Part of improving PR verification workflows - Complements the `pr` custom agent for better PR validation - Ensures consistent behavior across fork and non-fork repositories ``` --- ## Key Changes from Current Description ### Change 1: Section 2 Title and Content **Current (inaccurate):** ```markdown ### 2. **Simplified Verification Mode** - **Removed** "verify failure only" mode (when only test files exist) ``` **Corrected:** ```markdown ### 2. **Improved Verification Mode Behavior** - **Made full verification the primary/default mode** - tests must FAIL without fix and PASS with fix - **Verify-only mode still available** - runs when no fix files detected AND `-RequireFullVerification` not set ``` ### Change 2: Breaking Changes Section **Current (inaccurate):** ```markdown⚠️ **Behavior Change**: The skill no longer supports "verify failure only" mode. ``` **Corrected:** ```markdown⚠️ **Behavior Change**: The skill now requires explicit intent when fix files are not detected: - **Without `-RequireFullVerification`**: Falls back to verify-only mode (tests only need to FAIL) - **With `-RequireFullVerification`**: Errors immediately if no fix files found ``` ### Change 3: Added Test-First Workflow Example **Added:** ```bash # Test-first workflow (verify tests fail before writing fix) pwsh .github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1 -Platform ios ``` This clarifies that verify-only mode is still useful for legitimate workflows. --- ## Why This Correction Matters **Code Reality**: The implementation shows verify-only mode still exists at lines 173-193: ```powershell if ($DetectedFixFiles.Count -eq 0) { Write-Host "║ VERIFY FAILURE ONLY MODE ║" # ... mode implementation } ``` **Impact of Inaccuracy**: - Future maintainers reading "removed" will be confused when they see the mode in code - Users might think they can't use verify-only mode for test-first workflows - Documentation doesn't match reality **Correction Approach**: - Acknowledge mode still exists - Explain it's no longer the silent fallback (key improvement) - Show it's still useful for test-first development - Emphasize full verification is now recommended/default --- --------- Co-authored-by: Shane Neuville <shneuvil@microsoft.com>
This was referenced Feb 12, 2026
Merged
This was referenced Feb 13, 2026
Closed
Merged
Merged
Open
Open
Open
Closed
Open
Merged
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.
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description
This PR improves the
verify-tests-fail-without-fixskill by fixing fork repository detection, improving error handling, and making full verification the recommended/default behavior.Changes
1. Added
git fetch originfor Accurate Diffs2. Improved Verification Mode Behavior
-RequireFullVerificationparameter - prevents silent fallback to verify-only mode-RequireFullVerificationnot set3. Improved Documentation
4. Better Error Handling
-RequireFullVerificationset-FixFilesor-BaseBranchexplicitly)Why These Changes?
Problem 1: Fork Repository Detection
When working in a fork, the base branch might not be up-to-date locally, causing
git diffto produce inaccurate results. This led to:Solution: Always fetch the base branch from origin before computing diff.
Problem 2: Confusing Auto-Detection
The previous auto-detection system was unclear:
Solution:
-RequireFullVerificationparameter to make expectations explicitProblem 3: Silent Failures
When no fix files were detected (due to stale base branch or wrong base detection), the script would silently fall back to "verify failure only" mode, which wasn't the intended behavior.
Solution: Fail fast with clear error message and troubleshooting steps when
-RequireFullVerificationis set.Testing
Verified the changes work correctly with:
-RequireFullVerification-RequireFullVerificationparameter enforces strict modeExample Usage
Breaking Changes
-RequireFullVerification: Falls back to verify-only mode (tests only need to FAIL)-RequireFullVerification: Errors immediately if no fix files foundRecommended usage: Always use
-RequireFullVerificationwhen validating PRs to ensure full verification (tests FAIL without fix, PASS with fix).Migration: Update any automated scripts that call this skill to add
-RequireFullVerificationfor PR validation workflows.Related
prcustom agent for better PR validationCorrected:
Change 2: Breaking Changes Section
Current (inaccurate):
Corrected:
Change 3: Added Test-First Workflow Example
Added:
# Test-first workflow (verify tests fail before writing fix) pwsh .github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1 -Platform iosThis clarifies that verify-only mode is still useful for legitimate workflows.
Why This Correction Matters
Code Reality: The implementation shows verify-only mode still exists at lines 173-193:
Impact of Inaccuracy:
Correction Approach: