[REFACTOR] Workspace version only x.y.z (#10910)

# Introduction
We want the APP_VERSION to be able to contains pre-release options, in a
nutshell to be semVer compatible.
But we want to have workspace, at least for the moment, that only store
`x.y.z` and not `vx.y.z` or `x.y.z-alpha` version in database

Explaining this refactor

Related https://github.com/twentyhq/twenty/pull/10907
This commit is contained in:
Paul Rastoin
2025-03-14 19:21:44 +01:00
committed by GitHub
parent 1aeef2b68e
commit 23b4605987
6 changed files with 149 additions and 21 deletions

View File

@ -43,6 +43,7 @@ import { PermissionsService } from 'src/engine/metadata-modules/permissions/perm
import { WorkspaceCacheStorageService } from 'src/engine/workspace-cache-storage/workspace-cache-storage.service';
import { WorkspaceManagerService } from 'src/engine/workspace-manager/workspace-manager.service';
import { DEFAULT_FEATURE_FLAGS } from 'src/engine/workspace-manager/workspace-sync-metadata/constants/default-feature-flags';
import { extractVersionMajorMinorPatch } from 'src/utils/version/extract-version-major-minor-patch';
@Injectable()
// eslint-disable-next-line @nx/workspace-inject-workspace-repository
@ -271,12 +272,12 @@ export class WorkspaceService extends TypeOrmQueryService<Workspace> {
});
await this.userWorkspaceService.createWorkspaceMember(workspace.id, user);
const appVersion = this.environmentService.get('APP_VERSION') ?? null;
const appVersion = this.environmentService.get('APP_VERSION');
await this.workspaceRepository.update(workspace.id, {
displayName: data.displayName,
activationStatus: WorkspaceActivationStatus.ACTIVE,
version: appVersion,
version: extractVersionMajorMinorPatch(appVersion),
});
return await this.workspaceRepository.findOneBy({