Skip to content

fix(docker): no PHP warning for a HaRP daemon without a key - #1133

Merged
oleksandr-nc merged 1 commit into
mainfrom
fix/harp-header-without-key
Oct 20, 2026
Merged

oleksandr-nc merged 1 commit into
mainfrom
fix/harp-header-without-key

Conversation

@oleksandr-nc

Copy link
Copy Markdown
Contributor

DockerActions::initGuzzleClient() took the value of the harp-shared-key header from the basic auth credentials, which are only set when the daemon has a key. For a HaRP daemon without one, every call logged two PHP warnings, Undefined array key "auth" and Trying to access array offset on null. The easiest way to get there is Check connection in the register dialog before a key is typed, which is the default state of the form now that the templates no longer prefill a key.

The header now falls back to an empty string. Guzzle already sent an empty header for the missing value, so the requests stay the same and only the warnings are gone. A unit test covers a HaRP daemon without a key.

Signed-off-by: Oleksandr Piskun <oleksandr2088@icloud.com>
@oleksandr-nc

Copy link
Copy Markdown
Contributor Author

/backport to stable35

@oleksandr-nc

Copy link
Copy Markdown
Contributor Author

/backport to stable34

@coderabbitai

coderabbitai Bot commented Oct 20, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ea54cd0b-4b4c-4200-bf32-4ba29172dc1f
📥 Commits

Reviewing files that changed from the base of the PR and between cad3966 and 8444912.

📒 Files selected for processing: 2
  • lib/DeployActions/DockerActions.php
  • tests/php/DeployActions/DockerActionsTest.php

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

📝 Walkthrough

HaRP client initialization now uses an empty string for harp-shared-key when no authentication password is configured. A new test checks that the initialized Guzzle client has null authentication and an empty shared-key header.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 84449

The change safely handles HaRP daemons without credentials, with targeted test coverage.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: preventing PHP warnings for HaRP daemons without a key.
Description check Passed The description directly explains the warning, the code change, the unchanged request behavior, and the added test.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 PHPStan (2.2.16)

PHPStan reported 1 non-file analysis error(s); analysis is incomplete

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.

@oleksandr-nc
oleksandr-nc merged commit dc49d26 into main Oct 20, 2026
54 checks passed
@oleksandr-nc
oleksandr-nc deleted the fix/harp-header-without-key branch October 20, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant