File tree Expand file tree Collapse file tree 30 files changed +104
-54
lines changed Expand file tree Collapse file tree 30 files changed +104
-54
lines changed Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { useParams } from 'react-router-dom'
33import { getBranches } from 'api/branches/getBranches'
44import { deleteBranch } from 'api/branches/deleteBranch'
55import { getSnapshotList } from 'api/branches/getSnapshotList'
6+ import { initWS } from 'api/engine/initWS'
67
78import { PageContainer } from 'components/PageContainer'
89import { NavPath } from 'components/NavPath'
@@ -20,6 +21,7 @@ export const Branch = () => {
2021 getBranches,
2122 deleteBranch,
2223 getSnapshotList,
24+ initWS
2325 }
2426
2527 const elements = {
Original file line number Diff line number Diff line change 11import { getBranches } from 'api/branches/getBranches'
22import { createBranch } from 'api/branches/createBranch'
33import { getSnapshots } from 'api/snapshots/getSnapshots'
4+ import { initWS } from 'api/engine/initWS'
45
56import { 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 = {
Original file line number Diff line number Diff line change @@ -10,11 +10,12 @@ import { resetClone } from 'api/clones/resetClone'
1010import { destroyClone } from 'api/clones/destroyClone'
1111import { updateClone } from 'api/clones/updateClone'
1212import { createSnapshot } from 'api/snapshots/createSnapshot'
13+ import { initWS } from 'api/engine/initWS'
14+ import { destroySnapshot } from 'api/snapshots/destroySnapshot'
1315
1416import { PageContainer } from 'components/PageContainer'
1517import { NavPath } from 'components/NavPath'
1618import { ROUTES } from 'config/routes'
17- import { destroySnapshot } from 'api/snapshots/destroySnapshot'
1819
1920type Params = {
2021 cloneId : string
@@ -33,6 +34,7 @@ export const Clone = () => {
3334 destroySnapshot,
3435 updateClone,
3536 createSnapshot,
37+ initWS,
3638 }
3739
3840 const elements = {
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import { createClone } from 'api/clones/createClone'
99import { getClone } from 'api/clones/getClone'
1010import { getBranches } from 'api/branches/getBranches'
1111import { getSnapshots } from 'api/snapshots/getSnapshots'
12+ import { initWS } from 'api/engine/initWS'
1213
1314export 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 = {
Original file line number Diff line number Diff line change 11import { createSnapshot } from 'api/snapshots/createSnapshot'
22import { getInstance } from 'api/instances/getInstance'
3+ import { initWS } from 'api/engine/initWS'
34
45import { 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 = {
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import { PageContainer } from 'components/PageContainer'
99import { destroySnapshot } from 'api/snapshots/destroySnapshot'
1010import { getSnapshots } from 'api/snapshots/getSnapshots'
1111import { getBranchSnapshot } from 'api/snapshots/getBranchSnapshot'
12+ import { initWS } from 'api/engine/initWS'
1213
1314type Params = {
1415 snapshotId : string
@@ -21,6 +22,7 @@ export const Snapshot = () => {
2122 destroySnapshot,
2223 getSnapshots,
2324 getBranchSnapshot,
25+ initWS,
2426 }
2527
2628 const elements = {
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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"
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ import { Host } from './context'
4343import { DeleteBranch } from '@postgres.ai/shared/types/api/endpoints/deleteBranch'
4444import { InstanceTabs , TABS_INDEX } from "../../Instance/Tabs" ;
4545
46- type Props = Host & { isPlatform ?: boolean }
46+ type Props = Host & { isPlatform ?: boolean , hideBranchingFeatures ?: boolean }
4747
4848const 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 </ >
You can’t perform that action at this time.
0 commit comments