Skip to content

Commit

Permalink
Peg the UI version to the server version (#8948)
Browse files Browse the repository at this point in the history
The only reason to display separate UI and server version (IMO) is that
sometimes they can diverge due to deployment issues, and the information
can help with diagnostics. So it seems much more useful to use the same
version numbering as for the server, since:

* This makes it much easier to see whether a divergence exists.

* We can automate updates to it, eliminating annoying busywork for
  developers.

* We don't need to show multiple versions for different UI components,
  simplifying the code and the UI.
  • Loading branch information
SpecLad authored Jan 17, 2025
1 parent 3f4de06 commit f369906
Show file tree
Hide file tree
Showing 19 changed files with 16 additions and 96 deletions.
5 changes: 0 additions & 5 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ If you're unsure about any of these, don't hesitate to ask. We're here to help!
- [ ] I have added tests to cover my changes
- [ ] I have linked related issues (see [GitHub docs](
https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword))
- [ ] I have increased versions of npm packages if it is necessary
([cvat-canvas](https://github.com/cvat-ai/cvat/tree/develop/cvat-canvas#versioning),
[cvat-core](https://github.com/cvat-ai/cvat/tree/develop/cvat-core#versioning),
[cvat-data](https://github.com/cvat-ai/cvat/tree/develop/cvat-data#versioning) and
[cvat-ui](https://github.com/cvat-ai/cvat/tree/develop/cvat-ui#versioning))

### License

Expand Down
5 changes: 5 additions & 0 deletions changelog.d/20250115_190017_roman_rm_ui_versions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Changed

- The UI only displays one version for the whole client component,
which is now aligned with the server version
(<https://github.com/cvat-ai/cvat/pull/8948>)
8 changes: 0 additions & 8 deletions cvat-canvas/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@
The CVAT module written in TypeScript language.
It presents a canvas to viewing, drawing and editing of annotations.

## Versioning

If you make changes in this package, please do following:

- After not important changes (typos, backward compatible bug fixes, refactoring) do: `yarn version --patch`
- After changing API (backward compatible new features) do: `yarn version --minor`
- After changing API (changes that break backward compatibility) do: `yarn version --major`

## Commands

- Building of the module from sources in the `dist` directory:
Expand Down
5 changes: 1 addition & 4 deletions cvat-canvas/src/typescript/canvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ import { CanvasController, CanvasControllerImpl } from './canvasController';
import { CanvasView, CanvasViewImpl } from './canvasView';

import '../scss/canvas.scss';
import pjson from '../../package.json';

const CanvasVersion = pjson.version;

interface Canvas {
html(): HTMLDivElement;
Expand Down Expand Up @@ -197,5 +194,5 @@ export type InteractionResult = _InteractionResult;
export type HighlightSeverity = _HighlightSeverity;

export {
CanvasImpl as Canvas, CanvasVersion, RectDrawingMethod, CuboidDrawingMethod, Mode as CanvasMode,
CanvasImpl as Canvas, RectDrawingMethod, CuboidDrawingMethod, Mode as CanvasMode,
};
8 changes: 0 additions & 8 deletions cvat-canvas3d/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@
The CVAT module written in TypeScript language.
It presents a canvas to viewing, drawing and editing of 3D annotations.

## Versioning

If you make changes in this package, please do following:

- After not important changes (typos, backward compatible bug fixes, refactoring) do: `yarn version --patch`
- After changing API (backward compatible new features) do: `yarn version --minor`
- After changing API (changes that break backward compatibility) do: `yarn version --major`

## Commands

- Building of the module from sources in the `dist` directory:
Expand Down
5 changes: 1 addition & 4 deletions cvat-canvas3d/src/typescript/canvas3d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
//
// SPDX-License-Identifier: MIT

import pjson from '../../package.json';
import { Canvas3dController, Canvas3dControllerImpl } from './canvas3dController';
import {
Canvas3dModel,
Expand All @@ -22,8 +21,6 @@ import {
} from './canvas3dView';
import { Master } from './master';

const Canvas3dVersion = pjson.version;

interface Canvas3d {
html(): ViewsDOM;
setup(frameData: any, objectStates: any[]): void;
Expand Down Expand Up @@ -125,7 +122,7 @@ class Canvas3dImpl implements Canvas3d {
}

export {
Canvas3dImpl as Canvas3d, Canvas3dVersion, ViewType, MouseInteraction, CameraAction, Mode as CanvasMode,
Canvas3dImpl as Canvas3d, ViewType, MouseInteraction, CameraAction, Mode as CanvasMode,
};

export type { ViewsDOM };
8 changes: 0 additions & 8 deletions cvat-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@
This CVAT module is a client-side JavaScript library for management of objects, frames, logs, etc.
It contains the core logic of the Computer Vision Annotation Tool.

## Versioning

If you make changes in this package, please do following:

- After not important changes (typos, backward compatible bug fixes, refactoring) do: `yarn version --patch`
- After changing API (backward compatible new features) do: `yarn version --minor`
- After changing API (changes that break backward compatibility) do: `yarn version --major`

### Commands

- Dependencies installation
Expand Down
5 changes: 0 additions & 5 deletions cvat-core/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import {

import { mask2Rle, rle2Mask, propagateShapes } from './object-utils';
import User from './user';
import pjson from '../package.json';
import config from './config';

import implementAPI from './api-implementation';
Expand Down Expand Up @@ -327,9 +326,6 @@ function build(): CVATCore {
config.jobMetaDataReloadPeriod = value;
},
},
client: {
version: `${pjson.version}`,
},
enums,
exceptions: {
Exception,
Expand Down Expand Up @@ -481,7 +477,6 @@ function build(): CVATCore {
cvat.lambda = Object.freeze(cvat.lambda);
// logger: todo: logger storage implemented other way
cvat.config = Object.freeze(cvat.config);
cvat.client = Object.freeze(cvat.client);
cvat.enums = Object.freeze(cvat.enums);
cvat.exceptions = Object.freeze(cvat.exceptions);
cvat.cloudStorages = Object.freeze(cvat.cloudStorages);
Expand Down
3 changes: 0 additions & 3 deletions cvat-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,6 @@ export default interface CVATCore {
requestsStatusDelay: typeof config.requestsStatusDelay;
jobMetaDataReloadPeriod: typeof config.jobMetaDataReloadPeriod;
},
client: {
version: string;
};
enums,
exceptions: {
Exception: typeof Exception,
Expand Down
8 changes: 0 additions & 8 deletions cvat-data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,3 @@ yarn run build # build with minification
yarn run build --mode=development # build without minification
yarn run server # run debug server
```

## Versioning

If you make changes in this package, please do following:

- After not important changes (typos, backward compatible bug fixes, refactoring) do: `yarn version --patch`
- After changing API (backward compatible new features) do: `yarn version --minor`
- After changing API (changes that break backward compatibility) do: `yarn version --major`
11 changes: 0 additions & 11 deletions cvat-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,6 @@

This is a client UI for Computer Vision Annotation Tool based on React, Redux and Antd

## Versioning

If you make changes in this package, please do following:

- After not important changes (typos, bug fixes, refactoring) do: `yarn version --patch`
- After adding new features do: `yarn version --minor`
- After significant UI redesign do: `yarn version --major`

Important: If you have changed versions for `cvat-core`, `cvat-canvas`, `cvat-data`,
you also need to do `yarn install` to update `package-lock.json`

## Commands

- Installing dependencies:
Expand Down
2 changes: 1 addition & 1 deletion cvat-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cvat-ui",
"version": "1.67.0",
"version": "2.25.1",
"description": "CVAT single-page application",
"main": "src/index.tsx",
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ interface OwnProps {
interface StateToProps {
job: any | null;
serverVersion: string;
coreVersion: string;
canvasVersion: string;
uiVersion: string;
}

Expand All @@ -53,8 +51,6 @@ function mapStateToProps(state: CombinedState): StateToProps {
return {
job,
serverVersion: server.version as string,
coreVersion: packageVersion.core,
canvasVersion: packageVersion.canvas,
uiVersion: packageVersion.ui,
};
}
Expand Down Expand Up @@ -109,7 +105,7 @@ class GlobalErrorBoundary extends React.PureComponent<Props, State> {

public render(): React.ReactNode {
const {
restore, job, serverVersion, coreVersion, canvasVersion, uiVersion,
restore, job, serverVersion, uiVersion,
} = this.props;

const { hasError, error } = this.state;
Expand Down Expand Up @@ -173,14 +169,6 @@ class GlobalErrorBoundary extends React.PureComponent<Props, State> {
<Text strong>Server: </Text>
{serverVersion}
</li>
<li>
<Text strong>Core: </Text>
{coreVersion}
</li>
<li>
<Text strong>Canvas: </Text>
{canvasVersion}
</li>
<li>
<Text strong>UI: </Text>
{uiVersion}
Expand Down
8 changes: 0 additions & 8 deletions cvat-ui/src/components/header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,6 @@ function HeaderComponent(props: Props): JSX.Element {
<Text strong>Server version:</Text>
<Text type='secondary'>{` ${about.server.version}`}</Text>
</p>
<p>
<Text strong>Core version:</Text>
<Text type='secondary'>{` ${about.packageVersion.core}`}</Text>
</p>
<p>
<Text strong>Canvas version:</Text>
<Text type='secondary'>{` ${about.packageVersion.canvas}`}</Text>
</p>
<p>
<Text strong>UI version:</Text>
<Text type='secondary'>{` ${about.packageVersion.ui}`}</Text>
Expand Down
3 changes: 1 addition & 2 deletions cvat-ui/src/cvat-canvas-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import {
Canvas,
CanvasMode,
CanvasVersion,
RectDrawingMethod,
CuboidDrawingMethod,
CanvasHint as _CanvasHint,
Expand Down Expand Up @@ -36,5 +35,5 @@ export type HighlightSeverity = _HighlightSeverity;
export type CanvasHint = _CanvasHint;

export {
Canvas, CanvasMode, CanvasVersion, RectDrawingMethod, CuboidDrawingMethod,
Canvas, CanvasMode, RectDrawingMethod, CuboidDrawingMethod,
};
3 changes: 1 addition & 2 deletions cvat-ui/src/cvat-canvas3d-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import {
Canvas3d,
Canvas3dVersion,
MouseInteraction,
ViewType,
CameraAction,
Expand All @@ -14,7 +13,7 @@ import {
} from 'cvat-canvas3d/src/typescript/canvas3d';

export {
Canvas3d, Canvas3dVersion, MouseInteraction, ViewType, CameraAction, CanvasMode,
Canvas3d, MouseInteraction, ViewType, CameraAction, CanvasMode,
};

export type { ViewsDOM };
4 changes: 0 additions & 4 deletions cvat-ui/src/reducers/about-reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
//
// SPDX-License-Identifier: MIT

import { getCore } from 'cvat-core-wrapper';
import { CanvasVersion } from 'cvat-canvas-wrapper';
import { BoundariesActions, BoundariesActionTypes } from 'actions/boundaries-actions';
import { AboutActions, AboutActionTypes } from 'actions/about-actions';
import { AuthActions, AuthActionTypes } from 'actions/auth-actions';
Expand All @@ -13,8 +11,6 @@ import pjson from '../../package.json';
const defaultState: AboutState = {
server: {},
packageVersion: {
core: getCore().client.version,
canvas: CanvasVersion,
ui: pjson.version,
},
fetching: false,
Expand Down
2 changes: 0 additions & 2 deletions cvat-ui/src/reducers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,6 @@ export interface PluginsState {
export interface AboutState {
server: any;
packageVersion: {
core: string;
canvas: string;
ui: string;
};
fetching: boolean;
Expand Down
5 changes: 5 additions & 0 deletions dev/update_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ def apply(self, new_version: Version, *, verify_only: bool) -> bool:
re.compile(r"^cvat-sdk==[\d.]+$", re.M),
lambda v, m: f"cvat-sdk=={v.major}.{v.minor}.{v.patch}",
),
ReplacementRule(
"cvat-ui/package.json",
re.compile(r'^ "version": "[\d.]+",$', re.M),
lambda v, m: f' "version": "{v.major}.{v.minor}.{v.patch}",',
),
]


Expand Down

0 comments on commit f369906

Please sign in to comment.