Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a simple version check to inform users of outdated versions #555

Closed
lukehinds opened this issue Jan 12, 2025 · 1 comment
Closed

Add a simple version check to inform users of outdated versions #555

lukehinds opened this issue Jan 12, 2025 · 1 comment

Comments

@lukehinds
Copy link
Contributor

lukehinds commented Jan 12, 2025

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:

  1. Stores the current local version (e.g., in a VERSION file at the repo root or an environment variable).
  2. Fetches the latest version from GitHub (via either:
  3. Compares the local version to the latest version.
  4. 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

  1. 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).
  2. Implement a /api/version endpoint in the FastAPI backend that returns the local (running) version.
  3. Add a check against GitHub (e.g., /api/update-status), fetching the latest release or raw VERSION file from the main branch.
  4. Compare local vs. remote versions and return a response indicating whether the app is up to date (e.g., "is_latest": true/false).
  5. 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!”
@lukehinds lukehinds changed the title Add a Simple Version Check to Inform Users of Outdated Instances Add a simple version check to inform users of outdated versions Jan 12, 2025
@alex-mcgovern alex-mcgovern self-assigned this Jan 16, 2025
@alex-mcgovern
Copy link
Contributor

In implementing this (polling the server from the UI, which checks Github for latest release) I got myself rate limited by the Github API pretty quickly. Going to rethink the polling mechanism in the UI while I work on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants