Skip to content

Remove dead is_public/public_port check from create_service() - #202

Merged
Terrence721 merged 2 commits into
mainfrom
fix/services-remove-dead-is-public-check
Aug 21, 2026
Merged

Remove dead is_public/public_port check from create_service()#202
Terrence721 merged 2 commits into
mainfrom
fix/services-remove-dead-is-public-check

Conversation

@Terrence721

Copy link
Copy Markdown
Owner

Summary

Found via a fresh /code-review pass on app/Http/Controllers/Api/ServicesController.php (issue #70).

create_service() checked $request->is_public/$request->public_port, but neither field is in $allowedFields or $validationRules for this endpoint. The earlier extraFields check (array_diff(array_keys($request->all()), $allowedFields)) already rejects a request that includes is_public with a 422 ("This field is not allowed.") before this branch is ever reached; if it's omitted, $request->is_public is null/falsy and the branch never fires either way. Leftover copy-paste from an application-style controller with no effect - dead code that misleads a reader into thinking is_public is a supported field here.

Fix

Removed the dead branch.

Verification

rejects an is_public field as not allowed proves the field really is rejected upstream (making the removed branch provably unreachable, not just apparently unused) - passes identically before and after this change, since it's testing the extraFields check, not the removed code. Full create/actions/index/envs/storages suites pass unchanged (51 tests). Pint/PHPStan clean on the changed file.

claude and others added 2 commits August 21, 2026 07:24
is_public/public_port were never in \$allowedFields or
validationRules for this endpoint, so the extraFields check (\"This
field is not allowed.\") already rejects any request that includes
is_public before this branch is reached; omitting it leaves
\$request->is_public null/falsy, so the branch never fires either way.
Leftover copy-paste from an application-style controller.
@Terrence721
Terrence721 merged commit b11c9c5 into main Aug 21, 2026
9 checks passed
@Terrence721 Terrence721 mentioned this pull request Aug 21, 2026
77 tasks
@Terrence721
Terrence721 deleted the fix/services-remove-dead-is-public-check branch August 21, 2026 12:10
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.

2 participants