mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-31 20:57:31 +00:00
Few more fixes (#7161)
Some checks are pending
CI / build (push) Waiting to run
CI / svelte-check (push) Blocked by required conditions
CI / formatting (push) Blocked by required conditions
CI / test (push) Blocked by required conditions
CI / uitest (push) Waiting to run
CI / uitest-pg (push) Waiting to run
CI / uitest-qms (push) Waiting to run
CI / docker-build (push) Blocked by required conditions
CI / dist-build (push) Blocked by required conditions
Some checks are pending
CI / build (push) Waiting to run
CI / svelte-check (push) Blocked by required conditions
CI / formatting (push) Blocked by required conditions
CI / test (push) Blocked by required conditions
CI / uitest (push) Waiting to run
CI / uitest-pg (push) Waiting to run
CI / uitest-qms (push) Waiting to run
CI / docker-build (push) Blocked by required conditions
CI / dist-build (push) Blocked by required conditions
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
76bcd3c52c
commit
8e511653cc
@ -55,8 +55,12 @@ export async function onTagReference (txes: Tx[], control: TriggerControl): Prom
|
|||||||
const actualTx = TxProcessor.extractTx(tx)
|
const actualTx = TxProcessor.extractTx(tx)
|
||||||
const isCreate = control.hierarchy.isDerived(actualTx._class, core.class.TxCreateDoc)
|
const isCreate = control.hierarchy.isDerived(actualTx._class, core.class.TxCreateDoc)
|
||||||
const isRemove = control.hierarchy.isDerived(actualTx._class, core.class.TxRemoveDoc)
|
const isRemove = control.hierarchy.isDerived(actualTx._class, core.class.TxRemoveDoc)
|
||||||
if (!isCreate && !isRemove) return []
|
if (!isCreate && !isRemove) {
|
||||||
if (!control.hierarchy.isDerived((actualTx as TxCUD<Doc>).objectClass, tags.class.TagReference)) return []
|
continue
|
||||||
|
}
|
||||||
|
if (!control.hierarchy.isDerived((actualTx as TxCUD<Doc>).objectClass, tags.class.TagReference)) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if (isCreate) {
|
if (isCreate) {
|
||||||
const doc = TxProcessor.createDoc2Doc(actualTx as TxCreateDoc<TagReference>)
|
const doc = TxProcessor.createDoc2Doc(actualTx as TxCreateDoc<TagReference>)
|
||||||
result.push(
|
result.push(
|
||||||
|
@ -24,7 +24,9 @@ export async function OnStateUpdate (txes: Tx[], control: TriggerControl): Promi
|
|||||||
const result: Tx[] = []
|
const result: Tx[] = []
|
||||||
for (const tx of txes) {
|
for (const tx of txes) {
|
||||||
const actualTx = TxProcessor.extractTx(tx) as TxCUD<Doc>
|
const actualTx = TxProcessor.extractTx(tx) as TxCUD<Doc>
|
||||||
if (!control.hierarchy.isDerived(actualTx.objectClass, task.class.Task)) return []
|
if (!control.hierarchy.isDerived(actualTx.objectClass, task.class.Task)) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if (actualTx._class === core.class.TxCreateDoc) {
|
if (actualTx._class === core.class.TxCreateDoc) {
|
||||||
const doc = TxProcessor.createDoc2Doc(actualTx as TxCreateDoc<Task>)
|
const doc = TxProcessor.createDoc2Doc(actualTx as TxCreateDoc<Task>)
|
||||||
const status = control.modelDb.findAllSync(core.class.Status, { _id: doc.status })[0]
|
const status = control.modelDb.findAllSync(core.class.Status, { _id: doc.status })[0]
|
||||||
|
@ -102,31 +102,34 @@ export function initStatisticsContext (
|
|||||||
const serviceId = encodeURIComponent(os.hostname() + '-' + serviceName)
|
const serviceId = encodeURIComponent(os.hostname() + '-' + serviceName)
|
||||||
|
|
||||||
const intTimer = setInterval(() => {
|
const intTimer = setInterval(() => {
|
||||||
if (metricsFile !== undefined || ops?.logConsole === true) {
|
try {
|
||||||
const val = metricsToString(metricsContext.metrics, serviceName, 140)
|
if (metricsFile !== undefined || ops?.logConsole === true) {
|
||||||
if (val !== oldMetricsValue) {
|
const val = metricsToString(metricsContext.metrics, serviceName, 140)
|
||||||
oldMetricsValue = val
|
if (val !== oldMetricsValue) {
|
||||||
if (metricsFile !== undefined) {
|
oldMetricsValue = val
|
||||||
writeFile(metricsFile, val).catch((err) => {
|
if (metricsFile !== undefined) {
|
||||||
console.error(err)
|
void writeFile(metricsFile, val).catch((err) => {
|
||||||
})
|
console.error(err)
|
||||||
}
|
})
|
||||||
if (ops?.logConsole === true) {
|
}
|
||||||
console.info('METRICS:', val)
|
if (ops?.logConsole === true) {
|
||||||
|
console.info('METRICS:', val)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if (statsUrl !== undefined) {
|
||||||
if (statsUrl !== undefined) {
|
const token = generateToken(systemAccountEmail, { name: '' }, { service: 'true' })
|
||||||
const token = generateToken(systemAccountEmail, { name: '' }, { service: 'true' })
|
const data: ServiceStatistics = {
|
||||||
const data: ServiceStatistics = {
|
serviceName,
|
||||||
serviceName,
|
cpu: getCPUInfo(),
|
||||||
cpu: getCPUInfo(),
|
memory: getMemoryInfo(),
|
||||||
memory: getMemoryInfo(),
|
stats: metricsContext.metrics,
|
||||||
stats: metricsContext.metrics,
|
workspaces: ops?.getUsers?.()
|
||||||
workspaces: ops?.getUsers?.()
|
}
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
const statData = JSON.stringify(data)
|
||||||
|
|
||||||
|
metricsContext.info('send stats:', { size: statData.length })
|
||||||
void fetch(
|
void fetch(
|
||||||
concatLink(statsUrl, '/api/v1/statistics') + `/?token=${encodeURIComponent(token)}&name=${serviceId}`,
|
concatLink(statsUrl, '/api/v1/statistics') + `/?token=${encodeURIComponent(token)}&name=${serviceId}`,
|
||||||
{
|
{
|
||||||
@ -134,19 +137,19 @@ export function initStatisticsContext (
|
|||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
},
|
},
|
||||||
body: JSON.stringify(data)
|
body: statData
|
||||||
}
|
}
|
||||||
).catch((err) => {
|
).catch((err) => {
|
||||||
errorToSend++
|
errorToSend++
|
||||||
if (errorToSend % 20 === 0) {
|
if (errorToSend % 2 === 0) {
|
||||||
console.error(err)
|
console.error(err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} catch (err: any) {
|
}
|
||||||
errorToSend++
|
} catch (err: any) {
|
||||||
if (errorToSend % 20 === 0) {
|
errorToSend++
|
||||||
console.error(err)
|
if (errorToSend % 20 === 0) {
|
||||||
}
|
console.error(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, METRICS_UPDATE_INTERVAL)
|
}, METRICS_UPDATE_INTERVAL)
|
||||||
|
@ -121,6 +121,11 @@ export class IssuesPage extends CommonTrackerPage {
|
|||||||
.locator('button')
|
.locator('button')
|
||||||
|
|
||||||
selectPopup = (): Locator => this.page.locator('.selectPopup >> button:has-text("Appleseed John")')
|
selectPopup = (): Locator => this.page.locator('.selectPopup >> button:has-text("Appleseed John")')
|
||||||
|
|
||||||
|
closePopup = async (): Promise<void> => {
|
||||||
|
await this.page.locator('.selectPopup').press('Escape')
|
||||||
|
}
|
||||||
|
|
||||||
notificationTimeoutSetting = (timeout: string): Promise<void> => {
|
notificationTimeoutSetting = (timeout: string): Promise<void> => {
|
||||||
return this.page.evaluate((timeout) => {
|
return this.page.evaluate((timeout) => {
|
||||||
localStorage.setItem('#platform.notification.timeout', timeout)
|
localStorage.setItem('#platform.notification.timeout', timeout)
|
||||||
|
@ -392,7 +392,7 @@ test.describe('Tracker filters tests', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
test('Label filter', async () => {
|
test('Label filter', async () => {
|
||||||
const filterLabel = 'Filter Label'
|
const filterLabel = `Filter Label-${generateId(4)}`
|
||||||
const labelIssue: NewIssue = {
|
const labelIssue: NewIssue = {
|
||||||
title: `Issue for the Label filter-${generateId()}`,
|
title: `Issue for the Label filter-${generateId()}`,
|
||||||
description: 'Issue for the Label filter',
|
description: 'Issue for the Label filter',
|
||||||
@ -406,7 +406,7 @@ test.describe('Tracker filters tests', () => {
|
|||||||
|
|
||||||
await test.step('Check Label filter for exist Label', async () => {
|
await test.step('Check Label filter for exist Label', async () => {
|
||||||
await issuesPage.selectFilter('Labels', filterLabel)
|
await issuesPage.selectFilter('Labels', filterLabel)
|
||||||
await issuesPage.inputSearch().press('Escape')
|
await issuesPage.closePopup()
|
||||||
await issuesPage.checkFilter('Labels', 'is', filterLabel)
|
await issuesPage.checkFilter('Labels', 'is', filterLabel)
|
||||||
for await (const issue of iterateLocator(issuesPage.issuesList())) {
|
for await (const issue of iterateLocator(issuesPage.issuesList())) {
|
||||||
await expect(issue.locator('div.compression-bar > div.label-box span.label')).toContainText(filterLabel)
|
await expect(issue.locator('div.compression-bar > div.label-box span.label')).toContainText(filterLabel)
|
||||||
|
Loading…
Reference in New Issue
Block a user