Skip to content

fix(integrations): preserve DirectAdmin raw responses - #1671

Merged
superdav42 merged 2 commits into
mainfrom
feature/auto-20260724-112512-gh1665
Jul 24, 2026
Merged

fix(integrations): preserve DirectAdmin raw responses#1671
superdav42 merged 2 commits into
mainfrom
feature/auto-20260724-112512-gh1665

Conversation

@superdav42

@superdav42 superdav42 commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Preserve the original DirectAdmin response body after URL-form parsing.
  • Detect HTML login pages that contain form attributes during connection tests.

Testing

  • vendor/bin/phpunit --filter DirectAdmin_Integration_Test
  • vendor/bin/phpcs changed DirectAdmin integration files

Resolves #1665


aidevops.sh v3.32.180 plugin for OpenCode v1.18.4 with gpt-5.6-terra spent 14m and 83,127 tokens on this as a headless worker.

Summary by CodeRabbit

  • Bug Fixes

    • Improved DirectAdmin connection validation to correctly identify URL-encoded login page responses as failed authentication attempts.
    • Preserved the original DirectAdmin response details when processing non-JSON responses, improving diagnostic information for connection issues.
  • Tests

    • Added coverage to verify that login page responses produce the expected connection error.

@superdav42 superdav42 added the origin:worker Auto-created by pulse labelless backfill (t2112) label Jul 24, 2026
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@superdav42, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 39 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e7c82a46-6855-4559-84e6-02f5015a5f76

📥 Commits

Reviewing files that changed from the base of the PR and between b53d228 and 499707a.

📒 Files selected for processing (2)
  • inc/integrations/providers/directadmin/class-directadmin-integration.php
  • tests/WP_Ultimo/Integrations/Providers/DirectAdmin/DirectAdmin_Integration_Test.php
📝 Walkthrough

Walkthrough

The DirectAdmin response parser now preserves raw URL-encoded response bodies. A regression test verifies that an intercepted login-page response causes test_connection() to return the expected error.

Changes

DirectAdmin response handling

Layer / File(s) Summary
Preserve raw responses and test login detection
inc/integrations/providers/directadmin/class-directadmin-integration.php, tests/WP_Ultimo/Integrations/Providers/DirectAdmin/DirectAdmin_Integration_Test.php
URL-encoded DirectAdmin responses now include the original body in raw, and a connection test verifies login-page detection returns directadmin-login-test-failed.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

  • Ultimate-Multisite/ultimate-multisite#1670 — Its objective directly matches preserving the raw DirectAdmin response for login-page detection.

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: preserving DirectAdmin raw responses.
Linked Issues check ✅ Passed The PR preserves the raw parsed DirectAdmin body and adds a regression test for login-page detection, matching #1665.
Out of Scope Changes check ✅ Passed The changes stay focused on DirectAdmin parsing and the related regression test, with no clear unrelated additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/auto-20260724-112512-gh1665

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@superdav42

superdav42 commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator Author

Completion Summary

  • What: Preserved raw DirectAdmin response bodies after URL-form parsing.
  • Issue: quality-debt: PR #1655 review feedback (medium) #1665
  • Files changed: DirectAdmin integration and regression test.
  • Testing: Focused PHPUnit test class (10 tests, 25 assertions) and PHPCS passed.
  • Key decisions: Keep parse_str fields intact and add the original body as raw.

aidevops.sh v3.32.180 plugin for OpenCode v1.18.4 with gpt-5.6-terra spent 14m and 86,869 tokens on this as a headless worker.


Merged via PR #1671 to main.
Merged by deterministic merge pass (pulse-wrapper.sh).

@superdav42
superdav42 marked this pull request as ready for review July 24, 2026 17:41
@github-actions

Copy link
Copy Markdown

🔨 Build Complete - Ready for Testing!

📦 Download Build Artifact (Recommended)

Download the zip build, upload to WordPress and test:

🌐 Test in WordPress Playground (Very Experimental)

Click the link below to instantly test this PR in your browser - no installation needed!
Playground support for multisite is very limitied, hopefully it will get better in the future.

🚀 Launch in Playground

Login credentials: admin / password

@superdav42 superdav42 added the status:in-review PR open, awaiting review/merge label Jul 24, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@inc/integrations/providers/directadmin/class-directadmin-integration.php`:
- Around line 300-301: Update the parsing logic around the $parsed['raw']
assignment so the raw response is stored under a reserved internal key that
cannot collide with fields produced by parse_str(). Preserve all existing parsed
server values, including any raw key supplied in the response, while retaining
access to the unmodified response body.

In
`@tests/WP_Ultimo/Integrations/Providers/DirectAdmin/DirectAdmin_Integration_Test.php`:
- Around line 132-152: Update the HTTP mock setup in the test_connection test to
store the pre_http_request closure in a variable, then remove only that callback
with remove_filter('pre_http_request', $callback) in the finally block. Preserve
the existing mocked response and test flow without clearing other callbacks on
the global hook.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2f84ebd6-716d-4691-b429-f85dd29e5247

📥 Commits

Reviewing files that changed from the base of the PR and between 1648580 and b53d228.

📒 Files selected for processing (2)
  • inc/integrations/providers/directadmin/class-directadmin-integration.php
  • tests/WP_Ultimo/Integrations/Providers/DirectAdmin/DirectAdmin_Integration_Test.php

Comment thread inc/integrations/providers/directadmin/class-directadmin-integration.php Outdated
@superdav42

Copy link
Copy Markdown
Collaborator Author

CLAIM_RELEASED reason=worker_complete runner=superdav42 ts=2026-07-24T17:59:51Z aidevops_version=3.32.180 opencode_version=1.18.4

@superdav42 superdav42 added status:available Task is available for claiming and removed status:in-review PR open, awaiting review/merge labels Jul 24, 2026
@github-actions

Copy link
Copy Markdown

🔨 Build Complete - Ready for Testing!

📦 Download Build Artifact (Recommended)

Download the zip build, upload to WordPress and test:

🌐 Test in WordPress Playground (Very Experimental)

Click the link below to instantly test this PR in your browser - no installation needed!
Playground support for multisite is very limitied, hopefully it will get better in the future.

🚀 Launch in Playground

Login credentials: admin / password

@superdav42
superdav42 merged commit 3701ff0 into main Jul 24, 2026
11 checks passed
@superdav42 superdav42 added the review-feedback-scanned Merged PR already scanned for quality feedback label Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

origin:worker Auto-created by pulse labelless backfill (t2112) review-feedback-scanned Merged PR already scanned for quality feedback status:available Task is available for claiming

Projects

None yet

Development

Successfully merging this pull request may close these issues.

quality-debt: PR #1655 review feedback (medium)

1 participant