This repository was archived by the owner on Jun 5, 2025. It is now read-only.
This repository was archived by the owner on Jun 5, 2025. It is now read-only.
Add a simple version check to inform users of outdated versions #555
Closed
Description
Description:
Currently, there’s no built-in way for users to know if their instance of CodeGate is running an outdated version. This can cause a sub-par experience or potential security or compatibility issues.
I’d like to propose a simple version-checking system that:
- Stores the current local version (e.g., in a
VERSION
file at the repo root or an environment variable). - Fetches the latest version from GitHub (via either:
- Releases API, or
- The raw
VERSION
file on themain
branch:
``` https://raw.githubusercontent.com///main/VERSION ``` ).
- Compares the local version to the latest version.
- Notifies users (in the frontend or logs) when a newer version is available.
Why this is needed
- No current version-awareness: At present, there’s no way of knowing if a user is running an outdated version of CodeGate.
- User-friendly: A quick version check can warn users when they need to update CodeGate.
- Lightweight: Fetching a single file or release tag from GitHub is straightforward and doesn’t require infrastructure.
Proposed Steps
- Create/maintain a
VERSION
file at the root of the repository or using the existing https://github.com/stacklok/codegate/blob/main/src/codegate/__init__.py#L17, and have it updated each time we release new code (automate via GH actions when we publish a release). - Implement a
/api/version
endpoint in the FastAPI backend that returns the local (running) version. - Add a check against GitHub (e.g.,
/api/update-status
), fetching the latest release or rawVERSION
file from themain
branch. - Compare local vs. remote versions and return a response indicating whether the app is up to date (e.g.,
"is_latest": true/false
). - Notify the front end (React) whenever a mismatch is found, so users can see a banner or message like, “A new version of CodeGate is available!”