Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into staging
Browse files Browse the repository at this point in the history
Signed-off-by: Andrey Sobolev <[email protected]>
  • Loading branch information
haiodo committed Sep 16, 2024
2 parents 8fb7974 + ec6b6fb commit 3febe43
Show file tree
Hide file tree
Showing 48 changed files with 381 additions and 1,030 deletions.
73 changes: 0 additions & 73 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -472,79 +472,6 @@ jobs:
with:
name: docker-logs-qms
path: ./qms-tests/sanity/logs
uitest-uweb:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
filter: tree:0
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-platform
with:
path: |
common/temp
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Checking for mis-matching dependencies...
run: node common/scripts/install-run-rush.js check

- name: Installing...
run: node common/scripts/install-run-rush.js install

- name: Docker Build
run: node common/scripts/install-run-rush.js docker:build -p 20
env:
DOCKER_CLI_HINTS: false
- name: Prepare server
env:
SERVER_PROVIDER: uweb
run: |
cd ./tests
./prepare.sh
- name: Install Playwright
run: |
cd ./tests/sanity
node ../../common/scripts/install-run-rushx.js ci
- name: Run UI tests
run: |
cd ./tests/sanity
node ../../common/scripts/install-run-rushx.js uitest
- name: 'Store docker logs'
if: always()
run: |
cd ./tests/sanity
mkdir logs
docker logs $(docker ps | grep transactor | cut -f 1 -d ' ') > logs/uweb-transactor.log
docker logs $(docker ps | grep account | cut -f 1 -d ' ') > logs/uweb-account.log
docker logs $(docker ps | grep front | cut -f 1 -d ' ') > logs/uweb-front.log
docker logs $(docker ps | grep collaborator | cut -f 1 -d ' ') > logs/uweb-collaborator.log
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-results-uweb
path: ./tests/sanity/playwright-report/
- name: Upload Logs
if: always()
uses: actions/upload-artifact@v4
with:
name: docker-logs-uweb
path: ./tests/sanity/logs
# - name: Upload DB snapshot
# if: always()
# uses: actions/upload-artifact@v3
# with:
# name: db-snapshot
# path: ./tests/db_dump
docker-build:
needs: [build, test, svelte-check, uitest]
runs-on: ubuntu-latest
Expand Down
6 changes: 0 additions & 6 deletions common/config/rush/experiments.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@
*/
"buildCacheWithAllowWarningsInSuccessfulBuild": true,

/**
* If true, the phased commands feature is enabled. To use this feature, create a "phased" command
* in common/config/rush/command-line.json.
*/
"phasedCommands": true,

/**
* If true, perform a clean install after when running `rush install` or `rush update` if the
* `.npmrc` file has changed since the last install.
Expand Down
13 changes: 2 additions & 11 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions dev/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ services:
memory: 1024M
print:
image: hardcoreeng/print
extra_hosts:
- "host.docker.internal:host-gateway"
restart: unless-stopped
ports:
- 4005:4005
Expand Down
52 changes: 1 addition & 51 deletions models/core/src/migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

import { saveCollaborativeDoc } from '@hcengineering/collaboration'
import core, {
DOMAIN_BLOB,
DOMAIN_DOC_INDEX_STATE,
DOMAIN_SPACE,
DOMAIN_STATUS,
Expand All @@ -28,11 +27,9 @@ import core, {
isClassIndexable,
makeCollaborativeDoc,
type AnyAttribute,
type Blob,
type Doc,
type Domain,
type MeasureContext,
type Ref,
type Space,
type Status,
type TxCreateDoc
Expand All @@ -48,7 +45,7 @@ import {
type MigrationIterator,
type MigrationUpgradeClient
} from '@hcengineering/model'
import { type StorageAdapter, type StorageAdapterEx } from '@hcengineering/storage'
import { type StorageAdapter } from '@hcengineering/storage'
import { markupToYDoc } from '@hcengineering/text'

async function migrateStatusesToModel (client: MigrationClient): Promise<void> {
Expand Down Expand Up @@ -278,7 +275,6 @@ export const coreOperation: MigrateOperation = {
}
}
)
const exAdapter: StorageAdapterEx = client.storageAdapter as StorageAdapterEx
await tryMigrate(client, coreId, [
{
state: 'statuses-to-model',
Expand All @@ -292,12 +288,6 @@ export const coreOperation: MigrateOperation = {
state: 'add-spaces-owner',
func: migrateSpacesOwner
},
{
state: 'storage_blobs_v1',
func: async (client: MigrationClient) => {
await migrateBlobData(exAdapter, client)
}
},
{
state: 'old-statuses-transactions',
func: migrateStatusTransactions
Expand Down Expand Up @@ -340,43 +330,3 @@ export const coreOperation: MigrateOperation = {
])
}
}
async function migrateBlobData (exAdapter: StorageAdapterEx, client: MigrationClient): Promise<void> {
const ctx = new MeasureMetricsContext('storage_upgrade', {})

for (const [provider, adapter] of exAdapter.adapters?.entries() ?? []) {
if (!(await adapter.exists(ctx, client.workspaceId))) {
continue
}
const blobs = await adapter.listStream(ctx, client.workspaceId)
const bulk = new Map<Ref<Blob>, Blob>()
try {
const push = async (force: boolean): Promise<void> => {
if (bulk.size > 1000 || force) {
await client.deleteMany(DOMAIN_BLOB, { _id: { $in: Array.from(bulk.keys()) } })
await client.create(DOMAIN_BLOB, Array.from(bulk.values()))
bulk.clear()
}
}
while (true) {
const blob = await blobs.next()
if (blob === undefined) {
break
}
// We need to state details for blob.
const blobData = await adapter.stat(ctx, client.workspaceId, blob._id)
if (blobData !== undefined) {
bulk.set(blobData._id, {
...blobData,
provider
})
}
await push(false)
}
await push(true)
} catch (err: any) {
ctx.error('Error during blob migration', { error: err.message })
} finally {
await blobs.close()
}
}
}
25 changes: 9 additions & 16 deletions packages/core/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ async function tryLoadModel (
reload: boolean,
persistence?: TxPersistenceStore
): Promise<LoadModelResponse> {
const current = (await ctx.with('persistence-load', {}, async () => await persistence?.load())) ?? {
const current = (await ctx.with('persistence-load', {}, () => persistence?.load())) ?? {
full: true,
transactions: [],
hash: ''
Expand All @@ -365,14 +365,11 @@ async function tryLoadModel (
}

// Save concatenated
void (await ctx.with(
'persistence-store',
{},
async (ctx) =>
await persistence?.store({
...result,
transactions: !result.full ? current.transactions.concat(result.transactions) : result.transactions
})
void (await ctx.with('persistence-store', {}, (ctx) =>
persistence?.store({
...result,
transactions: !result.full ? current.transactions.concat(result.transactions) : result.transactions
})
))

if (!result.full && !reload) {
Expand Down Expand Up @@ -405,10 +402,8 @@ async function loadModel (
): Promise<LoadModelResponse> {
const t = Date.now()

const modelResponse = await ctx.with(
'try-load-model',
{ reload },
async (ctx) => await tryLoadModel(ctx, conn, reload, persistence)
const modelResponse = await ctx.with('try-load-model', { reload }, (ctx) =>
tryLoadModel(ctx, conn, reload, persistence)
)

if (reload && modelResponse.full) {
Expand All @@ -423,9 +418,7 @@ async function loadModel (
)
}

await ctx.with('build-model', {}, async (ctx) => {
await buildModel(ctx, modelResponse, allowedPlugins, configs, hierarchy, model)
})
await ctx.with('build-model', {}, (ctx) => buildModel(ctx, modelResponse, allowedPlugins, configs, hierarchy, model))
return modelResponse
}

Expand Down
3 changes: 3 additions & 0 deletions packages/presentation/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import { Analytics } from '@hcengineering/analytics'
import core, {
MeasureMetricsContext,
TxOperations,
TxProcessor,
getCurrentAccount,
Expand Down Expand Up @@ -90,6 +91,8 @@ export interface OptimisticTxes {
pendingCreatedDocs: Writable<Record<Ref<Doc>, boolean>>
}

export const uiContext = new MeasureMetricsContext('client-ui', {})

class UIClient extends TxOperations implements Client, OptimisticTxes {
hook = getMetadata(plugin.metadata.ClientHook)
constructor (
Expand Down
7 changes: 5 additions & 2 deletions packages/theme/styles/_text-editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
.text-editor-view {
// overflow-y: auto;
color: var(--theme-text-primary-color);
margin: 0.25rem 0;

.suggestion {
padding-left: 0.25rem;
Expand Down Expand Up @@ -63,6 +64,7 @@

p {
margin-block-start: 0.5rem;
margin-block-end: 0.5rem;
}

>*+* {
Expand All @@ -72,6 +74,8 @@

ul,
ol {
margin-top: 0.5rem;
margin-bottom: 0.5rem;
margin-right: .25rem;
margin-left: .75rem;
padding: 0;
Expand All @@ -88,8 +92,7 @@

ul[data-type="todoList"] {
list-style: none;
margin: 0;
padding: 0;
margin-left: 0;

li {
margin: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,13 @@
<Label label={isDiffShown ? ui.string.ShowLess : ui.string.ShowMore} />
</div>
{#if isDiffShown}
<svelte:component this={attributeModel.presenter} value={values[0]} {prevValue} showOnlyDiff />
<svelte:component
this={attributeModel.presenter}
attribute={attributeModel.attribute}
value={values[0]}
{prevValue}
showOnlyDiff
/>
{/if}
{/if}
{:else}
Expand Down
Loading

0 comments on commit 3febe43

Please sign in to comment.