Repository navigation
Conversation
POST /api/builds asks for one hosted generic file. The proxy passes the request to a configured builder with an upload URL signed for that build, and stores what the builder PUTs there as a hosted file. The builder holds no token. The package page lists a package's open and failed builds. Builds are kept in memory only. Not documented, no swagger.
A build's status now outlasts a restart: the builder can upload to the proxy that replaced the one that asked, and a failed build keeps its reason. A build ends once, through one conditional update. Builds past their time are failed before every read instead of on a timer, so it doesn't matter whether the instance that asked is still running. Finished builds are deleted after 30 days.
internal/builder holds the Builder interface and HTTPBuilder, its one implementation, as internal/scanner does for scanners. A builder can have a body template and a content type, so the request can take the shape of another system's API, such as a GitHub workflow dispatch or a GitLab pipeline trigger. A template that doesn't parse, or leaves a value unescaped in a JSON body, is refused when the configuration is loaded. The builder contract is documented in docs/configuration.md.
…out writing The /api/builds endpoints are in the OpenAPI document, the four scalar building settings can be set from the environment, and the example config has a building section. A read no longer updates the database: an open build past its time is shown as failed, and the next build request records it.
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait...
|
simonchrz
marked this pull request as ready for review
December 4, 2026 09:07
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.

The proxy can scan what it stores through external scanners. This adds the counterpart for building: the proxy asks an external builder for a file and hosts what the builder uploads. The proxy itself builds nothing.
It is off by default and needs
hosted.enabled.How it works
POST /api/builds(hosted token) names a builder, a package name, a version and a filename.upload_urlandfailure_url.upload_url.PushLocalArtifact), so it is scanned, immutable and never evicted, and is served at/generic/hosted/{name}/{version}/{filename}.GET /api/builds/{id}returns the status (requested,building,done,failed). The package page lists builds that are open or failed.What is in here
internal/builder: aBuilderinterface andHTTPBuilder, its one implementation, laid out likeinternal/scanner.building.builders[].body: an optional body template, so the request can take the shape of another system's API.docs/configuration.mdhas examples for a GitHubworkflow_dispatchand a GitLab pipeline trigger. A template that doesn't parse, or leaves a value unescaped in a JSON body, is refused when the configuration is loaded.buildstable (migration027_add_builds), so a build's status outlasts a restart and the builder can upload to the instance that replaced the one that asked.config.example.yaml.Open questions
envin templates. A template can read any environment variable of the proxy. It is needed where a token goes in the body (GitLab trigger), and only whoever writes the configuration can use it.Testing
Unit tests for the builder package, the config validation, the database queries and the API, including restarts on the same database. I ran it end to end against a small build service of my own, with two real builds (ffmpeg and hashcat for linux/arm64). I have not run the GitHub or GitLab examples against the real services, and the new table has only run on SQLite locally.
Refs #888
Summary by CodeRabbit