Skip to content

Conversation

jbronssin
Copy link
Contributor

Summary

This PR fixes an inconsistency in the display of application versions in the Admin Panel. Previously, the "Current version" was displayed with a "v" prefix (e.g., v1.1.1), while the "Latest version" was displayed without it (e.g., 1.1.1).

Problem

The inconsistency originated from two different data sources being handled differently in the backend:

  • currentVersion was read directly from the APP_VERSION configuration variable, which includes the "v" prefix.
  • latestVersion was fetched from the Docker Hub API, and the semver.coerce() function was used to parse it, which strips the "v" prefix.

Jb ScreenShot 2025-07-22 at 16 47 05@2x

Solution

The fix addresses the root cause in the [AdminPanelService] on the backend. The semver.coerce() function is now also applied to the currentVersion.

This ensures that both version numbers are normalized at the data source, providing a consistent format before being sent to the frontend. This is a cleaner approach than manipulating the data on the client side.

Before:

  • Current version: v1.1.1
  • Latest version: 1.1.1

After:

  • Current version: 1.1.1
  • Latest version: 1.1.1

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This change normalizes version number display in the Admin Panel by applying semver.coerce() to both the current version (from APP_VERSION) and latest version (from Docker Hub API). The modification ensures consistent version number formatting by removing the 'v' prefix from version strings, resulting in a uniform display format (e.g., '1.1.1' instead of 'v1.1.1').

Confidence score: 5/5

  1. This PR is very safe to merge as it only affects version string formatting without any functional changes
  2. The change is well-contained within the getVersionInfo method and follows established semver practices
  3. Files needing attention:
    • packages/twenty-server/src/engine/core-modules/admin-panel/admin-panel.service.ts

1 file reviewed, no comments

Edit Code Review Bot Settings | Greptile

Copy link
Contributor

github-actions bot commented Jul 22, 2025

🚀 Preview Environment Ready!

Your preview environment is available at: http://bore.pub:22897

This environment will automatically shut down when the PR is closed or after 5 hours.

Copy link
Contributor

@prastoin prastoin left a comment

Choose a reason for hiding this comment

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

Hello there, thanks for your contribution
I would prefer keeping the v prefix versioning as this is our standard, every version published on GitHub, DockerHub and across container env variables are prefixed with the v
I would rather not only consume the version result from the DockerHub fetched version coercion but add the prefix or directly the complete version as nothing says we won't publish a complexier version at some point v1.1.2-rc-beta and so on

@jbronssin
Copy link
Contributor Author

jbronssin commented Jul 23, 2025

Hello there, thanks for your contribution I would prefer keeping the v prefix versioning as this is our standard, every version published on GitHub, DockerHub and across container env variables are prefixed with the v I would rather not only consume the version result from the DockerHub fetched version coercion but add the prefix or directly the complete version as nothing says we won't publish a complexier version at some point v1.1.2-rc-beta and so on

Ok understood! @prastoin

My point wasn't to remove the v but rather to have the remote and local versions displayed consistently. Currently, only one of them is modified by semver.coerce() (that's what I corrected).

So you're suggesting that instead of applying semver.coerce() to both versions, we should remove it from the remote version?

In this case, I can do it this afternoon

@jbronssin
Copy link
Contributor Author

jbronssin commented Jul 23, 2025

@prastoin nevermind, just tested my idea based on your feedback (I think).

it'll look like this.

Feel free to close this PR if it's not what you were looking for!

image

Copy link
Contributor

@prastoin prastoin left a comment

Choose a reason for hiding this comment

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

LGTM
Refactored to avoid implicit any

@prastoin prastoin merged commit f439a6c into twentyhq:main Jul 23, 2025
39 checks passed
Copy link
Contributor

Thanks @jbronssin for your contribution!
This marks your 4th PR on the repo. You're top 8% of all our contributors 🎉
See contributor page - Share on LinkedIn - Share on Twitter

Contributions

prastoin added a commit that referenced this pull request Jul 24, 2025
…ion info (#13348)

### Summary

This PR fixes an inconsistency in the display of application versions in
the Admin Panel. Previously, the "Current version" was displayed with a
"v" prefix (e.g., `v1.1.1`), while the "Latest version" was displayed
without it (e.g., `1.1.1`).

### Problem

The inconsistency originated from two different data sources being
handled differently in the backend:
- `currentVersion` was read directly from the `APP_VERSION`
configuration variable, which includes the "v" prefix.
- `latestVersion` was fetched from the Docker Hub API, and the
`semver.coerce()` function was used to parse it, which strips the "v"
prefix.

![Jb ScreenShot 2025-07-22 at 16 47
05@2x](https://github.com/user-attachments/assets/b6243d03-2730-4958-8ad9-68f7e461bbe2)


### Solution

The fix addresses the root cause in the [AdminPanelService] on the
backend. The `semver.coerce()` function is now also applied to the
`currentVersion`.

This ensures that both version numbers are normalized at the data
source, providing a consistent format before being sent to the frontend.
This is a cleaner approach than manipulating the data on the client
side.

**Before:**
- Current version: `v1.1.1`
- Latest version: `1.1.1`

**After:**
- Current version: `1.1.1`
- Latest version: `1.1.1`

---------

Co-authored-by: prastoin <paul@twenty.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants