-
Notifications
You must be signed in to change notification settings - Fork 1
v1.10.0 #695
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
Open
aristath
wants to merge
368
commits into
main
Choose a base branch
from
develop
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+22,219
−5,746
Conversation
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
Contributor
|
Test on Playground |
The --exclude command line flag didn't work because it's for excluding groups, not files. Instead, added <exclude> element to the testsuite configuration in phpunit.xml.dist to properly exclude the security test file from test execution. This ensures: - test-class-security.php is excluded from ALL phpunit runs using this config - No need for command-line flags - Consistent behavior across coverage generation steps 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Improved the code coverage report comment to show detailed information about coverage changes at the file/class level: **New Features:** - Shows new files added with their coverage percentages - Lists files with improved coverage (sorted by improvement amount) - Lists files with decreased coverage (sorted by severity) - Color-coded indicators for coverage levels (🟢 high, 🟡 medium, 🔴 low) - Limits each section to top 10 items for readability - Includes expandable "About this report" section **Technical Changes:** - Generate detailed text coverage reports for both current and base branches - Parse PHPUnit text output to extract per-file coverage data - Python script compares coverage data and generates JSON diff - JavaScript in GitHub Action formats the diff into markdown tables - Proper handling of new files vs existing files vs removed files **Benefits:** - Developers can immediately see which files had coverage changes - Easier to identify areas that need more testing - More actionable feedback than just overall coverage percentage - Helps track coverage improvements over time 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Fixed issue where grep was matching per-class "Lines:" entries instead of the overall summary line, causing GitHub Actions to fail with "Invalid format" error when trying to parse percentage values from detail lines. Changes: - Use grep "^ Lines:" to match only the summary line (starts with 2 spaces) - Add tail -1 to ensure we get the last (summary) line - Apply fix to both current and base coverage extraction This prevents the workflow from trying to parse values like "55.56%" from per-class detail lines, which were being incorrectly extracted as the overall coverage percentage. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The file-level coverage changes (new files, improved, degraded) are now wrapped in a <details> element to keep the PR comment concise by default. The summary shows the total number of files with changes, and users can expand to see the full breakdown. Example: "📊 File-level Coverage Changes (42 files)" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
PHPUnit outputs class names and coverage stats on separate lines: - Line 1: "Progress_Planner\Activity" - Line 2: " Methods: 55.56% ( 5/ 9) Lines: 91.92% ( 91/ 99)" The previous grep approach was only capturing the stats line without the class name, resulting in empty coverage comparisons. The fix uses awk to: 1. Capture lines starting with class names (^[A-Za-z_]) 2. Look for the following stats line 3. Combine them into a single line for parsing 4. Strip ANSI color codes from both parts This enables the Python comparison script to properly parse class names and show file-level coverage changes in the collapsible details section. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The Python regex was expecting leading whitespace before class names, but the AWK script outputs class names at the start of lines without leading whitespace. Changed regex from: r'^\s+([\w\\]+)\s+Methods:...' To: r'^([\w\\]+)\s+Methods:...' This allows the parser to correctly extract coverage data from lines like: "Progress_Planner\Activity Methods: 55.56% ( 5/ 9) Lines: 91.92% ( 91/ 99)" With base coverage at 0%, all files with coverage should now appear as "new files" in the collapsible details section of the PR comment. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The regex was incorrectly trying to match the Methods percentage without capturing it. Since the match groups were off by one, line_percent was getting the wrong value. Changed from: r'^([\w\\]+)\s+Methods:\s+[\d.]+%.*Lines:\s+([\d.]+)%...' To: r'^([\w\\]+)\s+Methods:\s+([\d.]+)%.*Lines:\s+([\d.]+)%...' Now the groups are: - Group 1: Class name - Group 2: Methods percentage (unused but captured) - Group 3: Lines percentage - Groups 4-5: Covered/total lines 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The regex now captures Methods percentage in group 2, which shifted all subsequent group numbers: - Group 1: Class name - Group 2: Methods percentage (captured but not used) - Group 3: Lines percentage - Group 4: Covered lines count - Group 5: Total lines count Updated the Python code to use the correct group numbers (3, 4, 5) instead of the old numbers (2, 3, 4). This fixes the ValueError: invalid literal for int() with base 10: '91.92' 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The coverage changes JSON was being corrupted when passed through
GitHub Actions expression syntax ${{ }}. The expression parser was
mangling the multiline JSON with curly braces.
Solution: Pass the JSON through an environment variable instead.
This avoids the expression parser and preserves the JSON intact.
Before: const changesStr = `${{ steps.coverage_diff.outputs.coverage_changes }}`;
After: const changesStr = process.env.COVERAGE_CHANGES || '{}';
This should now properly display the file-level coverage changes
in the collapsible <details> section of the PR comment.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Show all files in the file-level coverage changes section instead of limiting to 10 files per category. This provides complete visibility into coverage changes across the entire codebase. Changes: - Removed .slice(0, 10) limits from new_files, improved, and degraded loops - Removed "... and X more" messages - All 146 files will now be shown in the details table 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…251031 Add PHPUnit Coverage workflow
Contributor
Composer package changes
|
Contributor
✅ Code Coverage Report
🎉 Great job maintaining/improving code coverage! 📊 File-level Coverage Changes (156 files)🆕 New Files
ℹ️ About this report
|
Fixed 4 test failures identified in GitHub Actions CI: 1. Ajax_Security_AIOSEO_Test::test_uses_base_trait - Changed from getTraitNames() to hasMethod() checks - getTraitNames() only returns direct traits, not nested traits - Now verifies base trait methods are available 2. Ajax_Security_Yoast_Test::test_uses_base_trait - Same fix as AIOSEO test - Checks for verify_nonce_or_fail, verify_capability_or_fail, verify_ajax_security 3. Input_Sanitizer_Test::test_get_sanitized_post_sanitization (special_chars) - Fixed expected value for ampersand test - sanitize_text_field() does not encode ampersands - Changed expectation from 'Test & Value' to 'Test & Value' 4. Input_Sanitizer_Test::test_get_sanitized_get_sanitization (special_chars) - Same fix as above for GET method All tests now properly reflect WordPress function behavior. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
The tests were catching WPAjaxDieStopException but wp_send_json_error() actually throws WPAjaxDieContinueException. Fixed in: - test-class-ajax-security-base.php (2 occurrences) - test-class-ajax-security-aioseo.php (1 occurrence) - test-class-ajax-security-yoast.php (1 occurrence) This fixes the 4 test errors: - Ajax_Security_Base_Test::test_verify_nonce_or_fail_invalid - Ajax_Security_Base_Test::test_verify_capability_or_fail_non_admin - Ajax_Security_AIOSEO_Test::test_verify_aioseo_active_or_fail_not_active - Ajax_Security_Yoast_Test::test_verify_yoast_active_or_fail_not_active 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…ion-with-traits Reduce code duplication using traits
…ctive-task-load Dont enqueue assets or add popover if interactive task is not published
Fix WP CLI get task command & add tests
Delete user meta, which redirects to PP dashboard page
New user onboarding
New onboarding tweaks
Reverse logic for "Show Onboarding" filter
Delay onboarding init a bit
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.
No description provided.