asset details (WIP)

This commit is contained in:
2026-03-24 13:42:53 +00:00
parent fb56b0eb72
commit b07642f35c
160 changed files with 701 additions and 1109 deletions
@@ -153,7 +153,7 @@ final class PackerAbstractBankWalkerTest {
}
@Override
protected PackerProbeResult processFileProbe(PackerFileProbe fileProbe, String requirements) {
protected PackerProbeResult processFileProbe(PackerFileProbe fileProbe, java.nio.file.Path assetRoot, String requirements) {
processCount += 1;
return new PackerProbeResult(
fileProbe,
@@ -247,6 +247,32 @@ final class FileSystemPackerWorkspaceServiceTest {
assertEquals(1, loader.loadCount());
}
@Test
void updateAssetBuildParticipationPatchesRegistryAndLoadedSnapshotWithoutWholeProjectReload() throws Exception {
final Path projectRoot = copyFixture("workspaces/managed-basic", tempDir.resolve("update-build-participation"));
final CountingLoader loader = countingLoader();
final FileSystemPackerWorkspaceService service = service(ignored -> { }, loader);
service.listAssets(new ListAssetsRequest(project(projectRoot)));
assertEquals(1, loader.loadCount());
final var result = service.updateAssetBuildParticipation(new UpdateAssetBuildParticipationRequest(
project(projectRoot),
AssetReference.forAssetId(1),
false));
assertEquals(PackerOperationStatus.SUCCESS, result.status());
assertEquals(1, loader.loadCount());
final var detailsResult = service.getAssetDetails(new GetAssetDetailsRequest(
project(projectRoot),
AssetReference.forAssetId(1)));
assertEquals(PackerBuildParticipation.EXCLUDED, detailsResult.details().summary().buildParticipation());
final var registry = MAPPER.readTree(projectRoot.resolve("assets/.prometeu/index.json").toFile());
assertFalse(registry.path("assets").get(0).path("included_in_build").asBoolean(true));
}
@Test
void updateAssetContractDropsPersistedBankCompositionWhenContractFingerprintChanges() throws Exception {
final Path projectRoot = copyFixture("workspaces/managed-basic", tempDir.resolve("update-contract-drops-bank"));
@@ -78,6 +78,10 @@ final class PackerAssetDetailsServiceTest {
.anyMatch(file -> file.path().equals("confirm.png")));
assertTrue(result.details().bankComposition().availableFiles().stream()
.allMatch(file -> !file.displayName().isBlank()));
assertFalse(Files.exists(projectRoot.resolve("assets/ui/atlas/confirm.tile.json")));
assertFalse(Files.exists(projectRoot.resolve("assets/ui/atlas/confirm.palette.json")));
assertFalse(Files.exists(projectRoot.resolve("assets/.prometeu/ui/atlas/confirm.tile.json")));
assertFalse(Files.exists(projectRoot.resolve("assets/.prometeu/ui/atlas/confirm.palette.json")));
}
@Test