-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Improve verify-tests-fail-without-fix Skill #33513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Improve verify-tests-fail-without-fix Skill #33513
Conversation
…re full verification
|
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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.
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: