From 2377841d2d8f728bb21a9549d681f526ecb9844b Mon Sep 17 00:00:00 2001 From: chyoo Date: Thu, 9 Jul 2026 15:43:50 +0900 Subject: [PATCH] refine release artifact display and chat avatars --- src/pages/applications/ReleaseManagementPage.tsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/pages/applications/ReleaseManagementPage.tsx b/src/pages/applications/ReleaseManagementPage.tsx index 185b193..cbbc2cf 100644 --- a/src/pages/applications/ReleaseManagementPage.tsx +++ b/src/pages/applications/ReleaseManagementPage.tsx @@ -47,9 +47,13 @@ function releaseBuildComponentTypes(imageTags: ImageTags | null | undefined) { return map; } -function isReleaseArtifactVisible(componentName: string, componentTypes: Map) { +function isRuntimeOnlyImage(value: string) { + return /^(postgres|redis|mysql|mariadb|mongo|nginx|rabbitmq)(:|@)/i.test(value.trim()); +} + +function isReleaseArtifactVisible(componentName: string, value: string, componentTypes: Map) { const type = componentTypes.get(componentName); - return type !== 'DATABASE' && type !== 'MIGRATION'; + return type !== 'DATABASE' && type !== 'MIGRATION' && !isRuntimeOnlyImage(value); } function releaseArtifacts(release: AppRelease) { @@ -57,10 +61,10 @@ function releaseArtifacts(release: AppRelease) { const componentTypes = releaseBuildComponentTypes(imageTags); const values = [ ...Object.entries(imageTags?.images ?? {}) - .filter(([componentName]) => isReleaseArtifactVisible(componentName, componentTypes)) + .filter(([componentName, value]) => isReleaseArtifactVisible(componentName, value, componentTypes)) .map(([, value]) => value), ...Object.entries(imageTags?.artifacts ?? {}) - .filter(([componentName]) => isReleaseArtifactVisible(componentName, componentTypes)) + .filter(([componentName, value]) => isReleaseArtifactVisible(componentName, value, componentTypes)) .map(([, value]) => value) ].filter(Boolean); @@ -160,8 +164,8 @@ function nextReleaseVersion(releases: AppRelease[], appId: string, builds: Build function buildCount(release: AppRelease) { const imageTags = release.imageTags as ImageTags | null | undefined; const componentTypes = releaseBuildComponentTypes(imageTags); - const count = Object.keys(imageTags?.images ?? {}).filter((componentName) => isReleaseArtifactVisible(componentName, componentTypes)).length - + Object.keys(imageTags?.artifacts ?? {}).filter((componentName) => isReleaseArtifactVisible(componentName, componentTypes)).length; + const count = Object.entries(imageTags?.images ?? {}).filter(([componentName, value]) => isReleaseArtifactVisible(componentName, value, componentTypes)).length + + Object.entries(imageTags?.artifacts ?? {}).filter(([componentName, value]) => isReleaseArtifactVisible(componentName, value, componentTypes)).length; return count || (release.artifact ? 1 : 0); }