Skip to content

Health route#242

Open
maxim-v4s wants to merge 10 commits into
mainfrom
feat/healt_route
Open

Health route#242
maxim-v4s wants to merge 10 commits into
mainfrom
feat/healt_route

Conversation

@maxim-v4s

@maxim-v4s maxim-v4s commented Aug 20, 2025

Copy link
Copy Markdown
Collaborator

QUAL-1507

Response:

Schema

image

Example:

{
  "frontend_version": "0.4.0",
  "backend_version": "0.4.0",
  "is_valid": true,
  "runners_status": {
    "url": "http://localhost:8001/execution/",
    "version": "0.4.0",
    "is_valid": true
  }
}

@maxim-v4s maxim-v4s self-assigned this Aug 20, 2025

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a health check endpoint for the Qualibrate application to monitor system health and version compatibility between frontend, backend, and runner components.

  • Adds a new /health endpoint that returns version information and runner status validation
  • Creates utility functions for validating runner version compatibility against the app version
  • Restructures the root ping endpoint by moving it to a dedicated "other" routes module

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
backend/qualibrate_app/api/routes/other.py New module containing ping and health endpoints with version validation logic
backend/qualibrate_app/api/routes/init.py Exports the new other_router and updates all list
backend/qualibrate_app/api/core/utils/runner.py New utility module for runner version validation and status checking
backend/qualibrate_app/api/core/schemas/state_updates.py Adds Pydantic models for health check response and runner status
backend/qualibrate_app/api/main.py Moves ping endpoint to other_router and includes the new router

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread backend/qualibrate_app/api/routes/other.py
Comment thread backend/qualibrate_app/api/core/utils/runner.py Outdated
Comment thread backend/qualibrate_app/api/core/utils/runner.py Outdated
Comment on lines +12 to +15
APP2RUNNER_VERSIONS: dict[Version, tuple[Version, Version]] = {
Version("0.3.6"): (Version("0.3.6"), Version("0.4.0")),
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why add it here? Let's at least add it somewhere top-level. I don't want to have to change it here every time

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or are there smarter ways to do this automatically?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I described you this way. And you approved.
There is no way to do it automatically. You must define dependency matching manually.

What do you mean with Let's at least add it somewhere top-level. What is top-level in your meaning?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As in, currently, whenever I release a new version, I have to navigate to backend/qualibrate_app/api/core/utils/runner.py just to change the versions. We should think about any improved ways of doing this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example, we can add custom fields to pyproject.toml

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got you. We can't use pyproject.toml because distribution versions won't have it.
But we can add top-level python (or other type if we want) file that defines ranges. Preferences?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved to backend/qualibrate_app/versions_matching.py

class HealthCheck(BaseModel):
frontend_version: str
backend_version: str
runners_status: list[RunnerVersionValid]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why multiple runners?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because you described possibility in future

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should clarify: QUAlibrate-app can connect to multiple runners, but this is w.r.t. different projects. For a given project, there will be a single runner

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@nulinspiratie

Copy link
Copy Markdown
Contributor

@maxim Dobrokhvalov can you add schema to the top description?

@maxim-v4s

Copy link
Copy Markdown
Collaborator Author

@maxim Dobrokhvalov can you add schema to the top description?

Added response schema and example.

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.

3 participants