Run VSUM builds asynchronously and cache artifacts per input fingerprint (#334) - #338
Merged
Merged
Conversation
Every download used to rebuild the VSUM in the setup-service inside the HTTP request: no caching since the fingerprint cache was dropped in 5e7b241, a 300 s blocking call, and the whole artifact buffered per request. Builds are now jobs: - POST /api/v1/vsums/{id}/builds starts one (202) or returns an up-to-date or in-flight build of the same inputs (200); force=true always builds. - GET .../builds, .../builds/{buildId}, .../builds/{buildId}/artifact and .../builds/{buildId}/bundle expose history, status and downloads. - Inputs are fingerprinted (SHA-256 over role, name and bytes of every ecore, genmodel and reaction file, independent of relation order). - Builds run on a bounded executor (vsum.build.pool-size/queue-capacity), one per VSUM at a time; a full queue fails the build instead of piling up. A build whose twin succeeded while it was queued adopts that artifact, so concurrent requests for the same inputs cost one setup-service call. - Artifacts are FileStorage rows of the new type VSUM_JAR, referenced from the new vsum_build table (V16). Only the newest vsum.build.retention-keep artifacts per VSUM are kept; their PostgreSQL large objects are unlinked on deletion, otherwise every dropped JAR would stay in pg_largeobject. - Builds left QUEUED/RUNNING by a shutdown are failed on startup. - The existing GET /build/check, /build/artifact and /build/bundle keep working as blocking wrappers over the same pipeline (so they are cached too) and are marked deprecated. Input collection moved from VsumService into VsumBuildInputCollector unchanged; its tests moved along. Builds are removed with their VSUM by the existing 30-day purge. Closes #334
Use hasToString for media types (S5838), chain assertions on one subject (S5853), and resolve build ids before assertThatThrownBy so each lambda holds a single call that can throw (S5778).
Add the missing Javadoc to VsumBuildMapper, VsumBuildRepository and the VsumBuildService constructor (MissingJavadocType/MissingJavadocMethod), and fix VariableDeclarationUsageDistance in two tests: declare the VSUM where it is used, and mark the arranged builds final where they must exist before the call under test.
Contributor
|
Is this PR ready to review? |
Contributor
Author
yes |
uiysg
self-requested a review
September 28, 2026 08:52
uiysg
approved these changes
Oct 1, 2026
Contributor
|
Is this Pr ready to merge? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #334
Builds are now background jobs with a fingerprint cache, so downloading the same VSUM twice no longer rebuilds it, and the request that starts a build returns immediately.
API
POST /api/v1/vsums/{id}/builds?force=falseGET /api/v1/vsums/{id}/buildspageNumber,pageSize)GET /api/v1/vsums/{id}/builds/{buildId}QUEUED/RUNNING/SUCCEEDED/FAILED, timestamps, setup-service errorGET /api/v1/vsums/{id}/builds/{buildId}/artifactGET /api/v1/vsums/{id}/builds/{buildId}/bundleAll require VSUM membership, same as
getJarfattoday. The existingGET /build/check,/build/artifactand/build/bundlestill work unchanged for the frontend — they're now blocking wrappers over the same pipeline, so they get the cache too — and are marked deprecated.FileStoragedeletion also leaves its large object behind (12 orphans in my local DB before this work). Worth its own issue — e.g. theloextension'slo_managetrigger would cover all of them.