diff --git a/.github/workflows/robot.yml b/.github/workflows/robot.yml index 2325197a..547fa466 100644 --- a/.github/workflows/robot.yml +++ b/.github/workflows/robot.yml @@ -30,7 +30,12 @@ jobs: - name: Start the service run: | - docker-compose up -d --wait + docker-compose up -d # --wait Wait is not available on gha + + - name: Perform healthchecks + run: | + docker-compose ps -a + wget --retry-connrefused --retry-on-http-error=502 http://localhost:8901/api/health - name: Run robot tests run: | diff --git a/back/src/Kyoo.Core/Views/Health.cs b/back/src/Kyoo.Core/Views/Health.cs index 1ee3aa26..248d7ebf 100644 --- a/back/src/Kyoo.Core/Views/Health.cs +++ b/back/src/Kyoo.Core/Views/Health.cs @@ -48,7 +48,7 @@ namespace Kyoo.Core.Api /// /// A status indicating the health of the api. [HttpGet] - [ProducesResponseType(StatusCodes.Status204NoContent)] + [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status503ServiceUnavailable)] public async Task CheckHealth() { @@ -60,11 +60,16 @@ namespace Kyoo.Core.Api HealthReport result = await _healthCheckService.CheckHealthAsync(); return result.Status switch { - HealthStatus.Healthy => NoContent(), - HealthStatus.Unhealthy => NoContent(), + HealthStatus.Healthy => Ok(new HealthResult("Healthy")), + HealthStatus.Unhealthy => Ok(new HealthResult("Unstable")), HealthStatus.Degraded => StatusCode(StatusCodes.Status503ServiceUnavailable), _ => StatusCode(StatusCodes.Status500InternalServerError), }; } + + /// + /// The result of a health operation. + /// + public record HealthResult(string Status); } } diff --git a/scanner/providers/types/genre.py b/scanner/providers/types/genre.py index 6eda0b51..22dedd6a 100644 --- a/scanner/providers/types/genre.py +++ b/scanner/providers/types/genre.py @@ -2,24 +2,24 @@ from enum import Enum class Genre(str, Enum): - ACTION = "action" - ADVENTURE = "adventure" - ANIMATION = "animation" - COMEDY = "comedy" - CRIME = "crime" - DOCUMENTARY = "documentary" - DRAMA = "drama" - FAMILY = "family" - FANTASY = "fantasy" - HISTORY = "history" - HORROR = "horror" - MUSIC = "music" - MYSTERY = "mystery" - ROMANCE = "romance" - SCIENCE_FICTION = "scienceFiction" - THRILLER = "thriller" - WAR = "war" - WESTERN = "western" + ACTION = "Action" + ADVENTURE = "Adventure" + ANIMATION = "Animation" + COMEDY = "Comedy" + CRIME = "Crime" + DOCUMENTARY = "Documentary" + DRAMA = "Drama" + FAMILY = "Family" + FANTASY = "Fantasy" + HISTORY = "History" + HORROR = "Horror" + MUSIC = "Music" + MYSTERY = "Mystery" + ROMANCE = "Romance" + SCIENCE_FICTION = "Science Fiction" + THRILLER = "Thriller" + WAR = "War" + WESTERN = "Western" def to_kyoo(self): - return {"name": self} + return {"name": f"{self}"}