feat: run RuntimeDetector on JAR upload and store detected runtime
After versionRepo.create(), detect the runtime type from the saved JAR via RuntimeDetector and persist the result via updateDetectedRuntime(). Log messages now include the detected runtime type (or 'unknown'). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -71,7 +71,17 @@ public class AppService {
|
||||
String checksum = HexFormat.of().formatHex(digest.digest());
|
||||
UUID versionId = versionRepo.create(appId, nextVersion, jarFile.toString(), checksum, filename, size);
|
||||
|
||||
log.info("Uploaded JAR for app {}: version={}, size={}, sha256={}", appId, nextVersion, size, checksum);
|
||||
// Detect runtime type from the saved JAR
|
||||
RuntimeDetector.DetectionResult detection = RuntimeDetector.detect(jarFile);
|
||||
if (detection.runtimeType() != null) {
|
||||
versionRepo.updateDetectedRuntime(versionId, detection.runtimeType().toConfigValue(), detection.mainClass());
|
||||
log.info("Uploaded JAR for app {}: version={}, size={}, sha256={}, detected={}",
|
||||
appId, nextVersion, size, checksum, detection.runtimeType().toConfigValue());
|
||||
} else {
|
||||
log.info("Uploaded JAR for app {}: version={}, size={}, sha256={}, detected=unknown",
|
||||
appId, nextVersion, size, checksum);
|
||||
}
|
||||
|
||||
return versionRepo.findById(versionId).orElseThrow();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user