Move source Files out of store into files and filepg - #318
Merged
Merged
Conversation
Artifact capture and source Files both stream content into a new large object in bounded chunks and record its size and SHA-256 digest. pgunit now owns that writer, and artifact capture uses it.
The files domain owns the File vocabulary, the upload envelope and 512 MiB content bound, the list rules and the create and delete use cases. filepg stores metadata in source_files and content in large objects on pgunit, records the write audit in the same transaction and reads a page's cursor and rows from one snapshot. api takes the Files use cases and the FilesReader separately, maps their errors in errors_files.go and tests the handlers with strict fakes. cmd/server and the store router fixture wire the real domain. Store keeps only the Session-creation copy of an initial File, which reads source_files inside its own transaction until Sessions move.
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.
Part of #1 (store layering), PR 7: source Files move out of
store.filesdomain package: theFile/Upload/ListQueryvocabulary with its rules, aServicefor create/delete (bounded upload writer, envelope validation),Storage/Readerports, andErrNotFound/ErrInvalidInput/ErrTooLarge.persistence/postgres/filepg: the PostgreSQL adapter. Content goes into large objects, and write audits are recorded in the same transaction viaauditpg. Reads run on one snapshot, so a concurrent delete never truncates a read it admitted.pgunit.CreateLargeObject/LargeObjectWriter: replacestore/source_file_writer.go. Session artifact capture and initial files use them too.Files(service) andFilesReader(adapter) Dependencies fields, strict fakes, andwriteFilesError. Public responses are unchanged.cmd/server: wiresfilepg.New(units)andfiles.NewService.store:source_files.go,source_file_writer.goand their tests. The tests moved tofiles/filepg.Checks on the final head (rebased onto 417bc36):
go build ./...andgo vet ./services/core/...across the whole modulefiles,filepg,pgunit,api,cmd/...andsandbox/providersstore, by-runonly: the Files, initial-file, artifact-capture and audit tests in the changed and conflicted filesscripts/check-names.pyNeed help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.