Conversation
Merged the user-provided class and 'dropdown-toggle' class into a single class attribute on the anchor tag generated by the bs_dropdown shortcode. Updated related PHPUnit tests to assert the valid HTML structure. Possible side effects: - Any custom JavaScript parsing the raw HTML output of this shortcode and expecting a specific invalid structure (two class attributes) will need to be updated. - CSS selectors targeting the 'dropdown-toggle' class will now correctly apply alongside any custom classes provided by the user.
Changed the bs_well shortcode default size from 'unknown' to an empty string. When no size parameter is provided, the shortcode now correctly generates a single 'well' class instead of 'well well-unknown'. Updated the PHPUnit tests to reflect this correct markup structure. Possible side effects: - Any custom CSS logic incorrectly targeting the non-standard 'well-unknown' class will stop working. CSS targeting the base 'well' class will continue functioning as expected. - Any manual script parsing evaluating the default markup for 'well-unknown' must be updated.
Changed the default size in bs_button to an empty string to avoid emitting identical generic classes (e.g. 'btn-default btn-default'). Added logic to only append a size class if it's explicitly non-empty and differs from the type parameter. Updated the matching PHPUnit test assertion. Possible side effects: - Any custom tools or visual parsing strictly depending on multiple instances of the 'btn-default' class to be present simultaneously in the same element will need to be updated.
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
WalkthroughAdds release automation (.release-it.json and package.json updates) and bumps version to 3.4.3. Refactors shortcode defaults and class-construction logic in button, tab, and well shortcodes. Updates unit tests, changelog, plugin/readme stable tags, and CodeRabbit settings accordingly. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
readme.txt (1)
6-6: Consider adding a changelog entry for version 3.4.3.The version has been bumped but there's no corresponding changelog entry documenting the bug fixes (duplicate class attributes in bs_dropdown, bs_button, bs_well). Users reviewing the changelog won't see what changed in this release.
📝 Suggested changelog addition
== Changelog == += 3.4.3 = +* Fixed duplicate class attributes in dropdown, button, and well shortcodes + = 3.4.2 = * Fix remaining XSS vulnerabilities (e.g. tooltip title escaping)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@readme.txt` at line 6, Add a changelog entry for version 3.4.3 that documents the bug fixes addressing duplicate class attributes in bs_dropdown, bs_button, and bs_well; update the project's changelog file with a short header "3.4.3" (or matching the project's entry format) and list the fixes (e.g. "Fix duplicate class attributes in bs_dropdown, bs_button, bs_well") so users can see what changed in this release.tests/phpunit/ShortcodeTabsTest.php (1)
30-30: Avoid coupling this test to HTML attribute order.Line 30 verifies the merged classes, but the exact string also requires a specific serialization order for
class,id, anddata-toggle. Prefer asserting the anchor’s attributes separately, or with an order-independent pattern, so the test stays focused on the single-classregression.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/phpunit/ShortcodeTabsTest.php` at line 30, The test ShortcodeTabsTest currently asserts the full anchor HTML string (in the assertStringContainsString call comparing to $output), which couples the test to attribute ordering; change the test to assert the class merge independently and check other attributes separately — e.g., use an order-independent check such as assertStringContainsString for the class fragment (e.g., 'class="my-drop dropdown-toggle"') and either assertStringContainsString for id and data-toggle fragments or parse $output with DOMDocument/XPath and assert the <a> element has the expected class list and attributes; update the assertion that currently references the exact anchor string so it only verifies class merging and separately verifies id and data-toggle presence.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@readme.txt`:
- Line 6: Add a changelog entry for version 3.4.3 that documents the bug fixes
addressing duplicate class attributes in bs_dropdown, bs_button, and bs_well;
update the project's changelog file with a short header "3.4.3" (or matching the
project's entry format) and list the fixes (e.g. "Fix duplicate class attributes
in bs_dropdown, bs_button, bs_well") so users can see what changed in this
release.
In `@tests/phpunit/ShortcodeTabsTest.php`:
- Line 30: The test ShortcodeTabsTest currently asserts the full anchor HTML
string (in the assertStringContainsString call comparing to $output), which
couples the test to attribute ordering; change the test to assert the class
merge independently and check other attributes separately — e.g., use an
order-independent check such as assertStringContainsString for the class
fragment (e.g., 'class="my-drop dropdown-toggle"') and either
assertStringContainsString for id and data-toggle fragments or parse $output
with DOMDocument/XPath and assert the <a> element has the expected class list
and attributes; update the assertion that currently references the exact anchor
string so it only verifies class merging and separately verifies id and
data-toggle presence.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: ad12b323-54c0-4b9a-8a63-32fc665799c3
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (11)
.github/workflows/deploy.yml.disabled.release-it.jsonbootstrap-shortcodes.phpinc/bs_buttons.phpinc/bs_tabs.phpinc/bs_well.phppackage.jsonreadme.txttests/phpunit/ShortcodeButtonsTest.phptests/phpunit/ShortcodeTabsTest.phptests/phpunit/ShortcodeWellsTest.php
b6b5769 to
1923d7e
Compare
Updated the assertion in test_dropdown_item to check for HTML attributes (class, id, data-toggle) separately using multiple assertStringContainsString calls. This avoids coupling the test strictly to the exact ordering of strings generated by an anchor tag, making the test suite less brittle when markup generation mechanisms change.
81cd264 to
2af9c34
Compare
Description
This PR introduces necessary bug fixes for a few shortcode rendering issues and establishes a robust, local release process using
release-itto prepare the plugin for a new patch version.Bug Fixes
bs_dropdownshortcode was outputting duplicateclassattributes, resulting in invalid HTML markup.bs_buttoncould output duplicate classes.bs_wellshortcode outputting an unintendedwell-unknownclass by default.Release Tooling & DX Improvements
release-itIntegration: Addedrelease-itfor interactive, local changelog generation and version management..release-it.jsonto bump theVersioninbootstrap-shortcodes.phpand theStable taginreadme.txtnatively when a patch/minor/major version is cut..github/workflows/deploy.yml.disabled) in favor of manual, locally-confirmed releases to ensure better quality control and review before releasing to the SVN repository.How to Test
npm installto ensurerelease-itis available.[bs_dropdown],[bs_button],[bs_well]) to ensure the correct HTML is output without any duplicate or unknown classes.npm run release -- --dry-runto see the proposed version bumps and changelog.