-
Notifications
You must be signed in to change notification settings - Fork 4.2k
fix: normalize version number using semver.coerce in admin panel version info #13348
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
Conversation
There was a problem hiding this 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
- This PR is very safe to merge as it only affects version string formatting without any functional changes
- The change is well-contained within the getVersionInfo method and follows established semver practices
- Files needing attention:
- packages/twenty-server/src/engine/core-modules/admin-panel/admin-panel.service.ts
1 file reviewed, no comments
🚀 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. |
There was a problem hiding this 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
Ok understood! @prastoin My point wasn't to remove the So you're suggesting that instead of applying In this case, I can do it this afternoon |
@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! ![]() |
There was a problem hiding this 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
Thanks @jbronssin for your contribution! |
…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.  ### 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>
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 theAPP_VERSION
configuration variable, which includes the "v" prefix.latestVersion
was fetched from the Docker Hub API, and thesemver.coerce()
function was used to parse it, which strips the "v" prefix.Solution
The fix addresses the root cause in the [AdminPanelService] on the backend. The
semver.coerce()
function is now also applied to thecurrentVersion
.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:
v1.1.1
1.1.1
After:
1.1.1
1.1.1