• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

IGNF / validator-api / 22135658047

18 Feb 2026 10:18AM UTC coverage: 53.81% (+0.2%) from 53.594%
22135658047

push

github

web-flow
fix: adding new ways to archive (#83)

* archive 5 days

* fix(test): updateArguments

* fix(test): deleteDataArgument

54 of 113 new or added lines in 16 files covered. (47.79%)

8 existing lines in 4 files now uncovered.

346 of 643 relevant lines covered (53.81%)

2.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Controller/Api/HealthController.php
1
<?php
2

3
namespace App\Controller\Api;
4

5
use App\Storage\ValidationsStorage;
6
use Doctrine\ORM\EntityManagerInterface;
7
use Psr\Log\LoggerInterface;
8
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
9
use Symfony\Component\HttpFoundation\JsonResponse;
10
use Symfony\Component\HttpFoundation\Response;
11
use Symfony\Component\Routing\Annotation\Route;
12

13
/**
14
 * @Route("/health")
15
 */
16
class HealthController extends AbstractController
17
{
18
    public function __construct(
19
        private LoggerInterface $logger,
20
        private ValidationsStorage $storage)
21
    {
UNCOV
22
    }
×
23

24
    /**
25
     * Checks for Database connection.
26
     *
27
     * @Route("/db", name="health_db")
28
     */
29
    public function healthDB(EntityManagerInterface $entityManager)
30
    {
NEW
31
        $sql = 'SELECT postgis_version() as postgis_version';
×
NEW
32
        $this->logger->info('get postgis version', [
×
NEW
33
            'sql' => $sql,
×
UNCOV
34
        ]);
×
35
        try {
36
            $stmt = $entityManager->getConnection()->prepare($sql);
×
37
            $result = $stmt->executeQuery();
×
38

39
            return new JsonResponse($result->fetchOne(), Response::HTTP_OK);
×
NEW
40
        } catch (\Exception $e) {
×
41
            $this->logger->error((string) $e);
×
42

UNCOV
43
            return new JsonResponse($e->getMessage(), Response::HTTP_INTERNAL_SERVER_ERROR);
×
44
        }
45
    }
46

47
    /**
48
     * Checks for S3 connection.
49
     *
50
     * @Route("/s3", name="health_s3")
51
     */
52
    public function healthS3()
53
    {
54
        $this->logger->info('list files from S3 bucket...');
×
55
        try {
56
            $files = $this->storage->getStorage()->listContents('.', false);
×
57
            $numFiles = count($files->toArray());
×
58

59
            return new JsonResponse('found '.$numFiles.' files', Response::HTTP_OK);
×
NEW
60
        } catch (\Exception $e) {
×
61
            $this->logger->error((string) $e);
×
62

NEW
63
            return new JsonResponse('fail to list files from S3 bucket', Response::HTTP_INTERNAL_SERVER_ERROR);
×
64
        }
65
    }
66
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc