Skip to content

Commit a6aab6f

Browse files
author
Bogdan Tsechoev
committed
feat(ui): 3.5.0 backward compatibility & bump package versions to 4.0.0 & fix shared npm package build for DBLab 4.0
1 parent c85c940 commit a6aab6f

File tree

30 files changed

+104
-54
lines changed

30 files changed

+104
-54
lines changed

ui/packages/ce/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@postgres.ai/ce",
3-
"version": "3.5.0",
3+
"version": "4.0.0",
44
"private": true,
55
"dependencies": {
66
"@craco/craco": "^6.4.3",

ui/packages/ce/src/App/Instance/Branches/Branch/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { useParams } from 'react-router-dom'
33
import { getBranches } from 'api/branches/getBranches'
44
import { deleteBranch } from 'api/branches/deleteBranch'
55
import { getSnapshotList } from 'api/branches/getSnapshotList'
6+
import { initWS } from 'api/engine/initWS'
67

78
import { PageContainer } from 'components/PageContainer'
89
import { NavPath } from 'components/NavPath'
@@ -20,6 +21,7 @@ export const Branch = () => {
2021
getBranches,
2122
deleteBranch,
2223
getSnapshotList,
24+
initWS
2325
}
2426

2527
const elements = {

ui/packages/ce/src/App/Instance/Branches/CreateBranch/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { getBranches } from 'api/branches/getBranches'
22
import { createBranch } from 'api/branches/createBranch'
33
import { getSnapshots } from 'api/snapshots/getSnapshots'
4+
import { initWS } from 'api/engine/initWS'
45

56
import { CreateBranchPage } from '@postgres.ai/shared/pages/CreateBranch'
67

@@ -18,6 +19,7 @@ export const CreateBranch = () => {
1819
getBranches,
1920
createBranch,
2021
getSnapshots,
22+
initWS
2123
}
2224

2325
const elements = {

ui/packages/ce/src/App/Instance/Clones/Clone/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ import { resetClone } from 'api/clones/resetClone'
1010
import { destroyClone } from 'api/clones/destroyClone'
1111
import { updateClone } from 'api/clones/updateClone'
1212
import { createSnapshot } from 'api/snapshots/createSnapshot'
13+
import { initWS } from 'api/engine/initWS'
14+
import { destroySnapshot } from 'api/snapshots/destroySnapshot'
1315

1416
import { PageContainer } from 'components/PageContainer'
1517
import { NavPath } from 'components/NavPath'
1618
import { ROUTES } from 'config/routes'
17-
import { destroySnapshot } from 'api/snapshots/destroySnapshot'
1819

1920
type Params = {
2021
cloneId: string
@@ -33,6 +34,7 @@ export const Clone = () => {
3334
destroySnapshot,
3435
updateClone,
3536
createSnapshot,
37+
initWS,
3638
}
3739

3840
const elements = {

ui/packages/ce/src/App/Instance/Clones/CreateClone/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { createClone } from 'api/clones/createClone'
99
import { getClone } from 'api/clones/getClone'
1010
import { getBranches } from 'api/branches/getBranches'
1111
import { getSnapshots } from 'api/snapshots/getSnapshots'
12+
import { initWS } from 'api/engine/initWS'
1213

1314
export const CreateClone = () => {
1415
const routes = {
@@ -23,6 +24,7 @@ export const CreateClone = () => {
2324
getClone,
2425
getBranches,
2526
getSnapshots,
27+
initWS
2628
}
2729

2830
const elements = {

ui/packages/ce/src/App/Instance/Snapshots/CreateSnapshot/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { createSnapshot } from 'api/snapshots/createSnapshot'
22
import { getInstance } from 'api/instances/getInstance'
3+
import { initWS } from 'api/engine/initWS'
34

45
import { CreateSnapshotPage } from '@postgres.ai/shared/pages/CreateSnapshot'
56

@@ -11,6 +12,7 @@ export const CreateSnapshot = () => {
1112
const api = {
1213
createSnapshot,
1314
getInstance,
15+
initWS
1416
}
1517

1618
const elements = {

ui/packages/ce/src/App/Instance/Snapshots/Snapshot/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { PageContainer } from 'components/PageContainer'
99
import { destroySnapshot } from 'api/snapshots/destroySnapshot'
1010
import { getSnapshots } from 'api/snapshots/getSnapshots'
1111
import { getBranchSnapshot } from 'api/snapshots/getBranchSnapshot'
12+
import { initWS } from 'api/engine/initWS'
1213

1314
type Params = {
1415
snapshotId: string
@@ -21,6 +22,7 @@ export const Snapshot = () => {
2122
destroySnapshot,
2223
getSnapshots,
2324
getBranchSnapshot,
25+
initWS,
2426
}
2527

2628
const elements = {

ui/packages/shared/.gitlab-ci.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,25 @@ publish-shared-preview:
2727
- cd ui/packages/shared
2828
- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
2929

30-
# Get base version from package.json (strip any -pr or other suffix)
30+
# Get base version from package.json (strip any suffix)
3131
- BASE_VERSION=$(jq -r .version package.json)
3232
- BASE_VERSION=${BASE_VERSION%%-*}
3333
- export PREID="pr-${CI_MERGE_REQUEST_IID:-preview}"
3434

35-
# Detect next available patch for same PR
36-
- EXISTING_TAGS=$(npm view @postgres.ai/shared versions --json | jq -r '.[]' | grep "^${BASE_VERSION}-${PREID}" || true)
37-
- COUNT=$(echo "$EXISTING_TAGS" | wc -l | xargs)
38-
- if [ "$COUNT" -eq 0 ]; then VERSION="${BASE_VERSION}-${PREID}"; else VERSION="${BASE_VERSION}-${PREID}.${COUNT}"; fi
35+
# Get all existing versions
36+
- EXISTING_TAGS=$(npm view @postgres.ai/shared versions --json | jq -r '.[]' || echo "")
37+
38+
# Find next available version suffix
39+
- VERSION=""
40+
- for i in $(seq 0 20); do
41+
CANDIDATE="${BASE_VERSION}-${PREID}";
42+
[ "$i" -gt 0 ] && CANDIDATE="${CANDIDATE}.${i}";
43+
if ! echo "$EXISTING_TAGS" | grep -qx "$CANDIDATE"; then
44+
VERSION="$CANDIDATE";
45+
break;
46+
fi;
47+
done
48+
- if [ -z "$VERSION" ]; then echo "❌ Failed to determine unique preview version"; exit 1; fi
3949
- echo "Publishing version $VERSION"
4050
- npm version "$VERSION" --no-git-tag-version
4151

ui/packages/shared/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@postgres.ai/shared",
3-
"version": "3.5.0",
3+
"version": "4.0.0",
44
"scripts": {
55
"build": "tsc -p tsconfig.build.json && node scripts/copy-assets.js",
66
"pack": "node scripts/pack.js"

ui/packages/shared/pages/Branches/Branch/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import { Host } from './context'
4343
import { DeleteBranch } from '@postgres.ai/shared/types/api/endpoints/deleteBranch'
4444
import { InstanceTabs, TABS_INDEX } from "../../Instance/Tabs";
4545

46-
type Props = Host & { isPlatform?: boolean }
46+
type Props = Host & { isPlatform?: boolean, hideBranchingFeatures?: boolean }
4747

4848
const useStyles = makeStyles(
4949
() => ({
@@ -187,6 +187,8 @@ export const BranchesPage = observer((props: Props) => {
187187
tab={TABS_INDEX.BRANCHES}
188188
isPlatform={props.isPlatform}
189189
instanceId={props.instanceId}
190+
hasLogs={props.api.initWS !== undefined}
191+
hideInstanceTabs={props.hideBranchingFeatures}
190192
/>
191193
</SectionTitle>
192194
</>

0 commit comments

Comments
 (0)