diff --git a/app/core/service/PackageSyncerService.ts b/app/core/service/PackageSyncerService.ts index 1affb746..a10e4e98 100644 --- a/app/core/service/PackageSyncerService.ts +++ b/app/core/service/PackageSyncerService.ts @@ -203,8 +203,8 @@ export class PackageSyncerService extends AbstractService { const log = data && data.log || ''; offset += log.length; if (data && data.syncDone) { - logs.push(`[${isoNow()}][UP] 🟢 Sync ${fullname} success [${useTime}ms], log: ${logUrl}, offset: ${offset}`); - logs.push(`[${isoNow()}][UP] 🟢🟢🟢🟢🟢 ${registry}/${fullname} 🟢🟢🟢🟢🟢`); + logs.push(`[${isoNow()}][UP] 🎉 Sync ${fullname} success [${useTime}ms], log: ${logUrl}, offset: ${offset}`); + logs.push(`[${isoNow()}][UP] 🔗 ${registry}/${fullname}`); await this.taskService.appendTaskLog(task, logs.join('\n')); return; } @@ -298,8 +298,8 @@ export class PackageSyncerService extends AbstractService { } // update log - logs.push(`[${isoNow()}] 🟢 log: ${logUrl}`); - logs.push(`[${isoNow()}] 🟢🟢🟢🟢🟢 ${url} 🟢🟢🟢🟢🟢`); + logs.push(`[${isoNow()}] 📝 Log URL: ${logUrl}`); + logs.push(`[${isoNow()}] 🔗 ${url}`); await this.taskService.finishTask(task, TaskState.Success, logs.join('\n')); this.logger.info('[PackageSyncerService.executeTask:remove-package] taskId: %s, targetName: %s', task.taskId, task.targetName); @@ -690,7 +690,7 @@ export class PackageSyncerService extends AbstractService { const publisher = users.find(user => user.displayName === item._npmUser?.name) || users[0]; const pkgVersion = await this.packageManagerService.publish(publishCmd, publisher); updateVersions.push(pkgVersion.version); - logs.push(`[${isoNow()}] 🟢 [${syncIndex}] Synced version ${version} success, packageVersionId: ${pkgVersion.packageVersionId}, db id: ${pkgVersion.id}`); + logs.push(`[${isoNow()}] 🎉 [${syncIndex}] Synced version ${version} success, packageVersionId: ${pkgVersion.packageVersionId}, db id: ${pkgVersion.id}`); } catch (err: any) { if (err.name === 'ForbiddenError') { logs.push(`[${isoNow()}] 🐛 [${syncIndex}] Synced version ${version} already exists, skip publish, try to set in local manifest`); @@ -885,9 +885,9 @@ export class PackageSyncerService extends AbstractService { // clean cache await this.cacheService.removeCache(fullname); - logs.push(`[${isoNow()}] 🟢 Clean cache`); - logs.push(`[${isoNow()}] 🟢 log: ${logUrl}`); - logs.push(`[${isoNow()}] 🟢🟢🟢🟢🟢 ${url} 🟢🟢🟢🟢🟢`); + logs.push(`[${isoNow()}] 🗑️ Clean cache`); + logs.push(`[${isoNow()}] 📝 Log URL: ${logUrl}`); + logs.push(`[${isoNow()}] 🔗 ${url}`); task.error = lastErrorMessage; await this.taskService.finishTask(task, TaskState.Success, logs.join('\n')); this.logger.info('[PackageSyncerService.executeTask:success] taskId: %s, targetName: %s', diff --git a/test/core/service/PackageSyncerService/executeTask.test.ts b/test/core/service/PackageSyncerService/executeTask.test.ts index 98790679..ab08dc62 100644 --- a/test/core/service/PackageSyncerService/executeTask.test.ts +++ b/test/core/service/PackageSyncerService/executeTask.test.ts @@ -304,7 +304,7 @@ describe('test/core/service/PackageSyncerService/executeTask.test.ts', () => { assert(stream); const log = await TestUtil.readStreamToLog(stream); // console.log(log); - assert(log.includes('] 🟢🟢🟢🟢🟢')); + assert(log.includes('] 🔗')); app.mockAgent().assertNoPendingInterceptors(); }); @@ -333,7 +333,7 @@ describe('test/core/service/PackageSyncerService/executeTask.test.ts', () => { assert(stream); const log = await TestUtil.readStreamToLog(stream); // console.log(log); - assert(log.includes('] 🟢🟢🟢🟢🟢')); + assert(log.includes('] 🔗')); app.mockAgent().assertNoPendingInterceptors(); }); @@ -1161,7 +1161,7 @@ describe('test/core/service/PackageSyncerService/executeTask.test.ts', () => { assert(stream); const log = await TestUtil.readStreamToLog(stream); // console.log(log); - assert(log.includes('] 🟢🟢🟢🟢🟢 https://registry.npmjs.org/cnpmcore-test-sync-deprecated')); + assert(log.includes('] 🔗 https://registry.npmjs.org/cnpmcore-test-sync-deprecated')); const { data } = await packageManagerService.listPackageFullManifests('', name); assert(data!.readme === 'mock readme content'); assert(data!.versions['0.0.0']!.readme === undefined); @@ -1633,7 +1633,7 @@ describe('test/core/service/PackageSyncerService/executeTask.test.ts', () => { const log = await TestUtil.readStreamToLog(stream); // console.log(log); assert(log.includes('📖 Use the latest version(0.0.0) maintainers instead')); - assert(log.includes('] 🟢🟢🟢🟢🟢 ')); + assert(log.includes('] 🔗')); app.mockAgent().assertNoPendingInterceptors(); }); @@ -1716,7 +1716,7 @@ describe('test/core/service/PackageSyncerService/executeTask.test.ts', () => { const log = await TestUtil.readStreamToLog(stream); // console.log(log); assert(log.includes('🚧🚧🚧🚧🚧 Syncing from https://registry.npmjs.org/D, ')); - assert(log.includes('🟢🟢🟢🟢🟢')); + assert(log.includes('🔗')); const res = await app.httpRequest() .get(`/${name}`) .expect(200) @@ -1748,7 +1748,7 @@ describe('test/core/service/PackageSyncerService/executeTask.test.ts', () => { const log = await TestUtil.readStreamToLog(stream); // console.log(log); assert(log.includes('🚧🚧🚧🚧🚧 Syncing from https://registry.npmjs.org/Buffer, ')); - assert(log.includes('🟢🟢🟢🟢🟢')); + assert(log.includes('🔗')); const res = await app.httpRequest() .get(`/${name}`) .expect(200) diff --git a/test/port/controller/PackageSyncController/showSyncTask.test.ts b/test/port/controller/PackageSyncController/showSyncTask.test.ts index 7c9a96e7..a011daf5 100644 --- a/test/port/controller/PackageSyncController/showSyncTask.test.ts +++ b/test/port/controller/PackageSyncController/showSyncTask.test.ts @@ -103,7 +103,7 @@ describe('test/port/controller/PackageSyncController/showSyncTask.test.ts', () = assert.equal(res.status, 302); log = await TestUtil.readStreamToLog(res.headers.location); } - assert.match(log, /🟢🟢🟢🟢🟢/); + assert.match(log, /🔗/); // check hasInstallScript res = await app.httpRequest()