Page MenuHomekolab.org

health/status endpoint
Needs ReviewPublic

Authored by mollekopf on Mar 27 2023, 11:33 AM.

Diff Detail

Repository
rK kolab
Lint
Lint Warnings
SeverityLocationCodeMessage
Warningsrc/app/Console/Commands/Status/Health.php:25PHPCS.W.Generic.Files.LineLength.TooLongGeneric.Files.LineLength.TooLong
Unit
No Unit Test Coverage
Build Status
Buildable 42320
Build 17093: arc lint + arc unit

Event Timeline

mollekopf requested review of this revision.Mar 27 2023, 11:33 AM
mollekopf created this revision.
mollekopf added a reviewer: Restricted Project.Mar 27 2023, 11:34 AM
machniak added inline comments.
src/app/Http/Controllers/API/V4/HealthController.php
23

I would be careful here. The output may contain errors/exceptions. While services routes might be secure, I think it would be nice to have some clean and structured response, i.e. JSON?

33

200 is the default, we're not using this argument in most of other places.

mollekopf updated this revision to Diff 12185.Apr 3 2023, 10:27 AM

Only check the required dependencies for now

It's faster this way

mollekopf added inline comments.Apr 3 2023, 10:32 AM
src/app/Http/Controllers/API/V4/HealthController.php
23

It's a bit of a workaround of course to simply return the command output, but the idea is to return information to what is failing exactly, and potentially why if we can.
Ideally we'd run individual checks with individual error messages combined in a nice json return value, but that will require some refactoring.

We could decide to only return what is failing and leave the why to logging (so only ok/errpr per check), but I feel like we're making our job unnecessarily difficult if we have to go dig through logs.