refactor+test: committed-only per-project storage + real-DB coverage & CI Postgres#100
Merged
Merged
Conversation
ravirajsinh45
added a commit
that referenced
this pull request
Jul 7, 2026
ravirajsinh45
force-pushed
the
fix/media-filesize-bigint
branch
from
July 7, 2026 04:28
7a3dd00 to
c90ba4c
Compare
ravirajsinh45
added a commit
that referenced
this pull request
Jul 7, 2026
ravirajsinh45
force-pushed
the
chore/storage-usage-tests-and-alignment
branch
from
July 7, 2026 04:28
9fac2a6 to
ee28017
Compare
ravirajsinh45
force-pushed
the
fix/media-filesize-bigint
branch
from
July 7, 2026 05:26
c90ba4c to
97e9a38
Compare
ravirajsinh45
added a commit
that referenced
this pull request
Jul 7, 2026
ravirajsinh45
force-pushed
the
chore/storage-usage-tests-and-alignment
branch
from
July 7, 2026 05:26
ee28017 to
f5e87a5
Compare
ravirajsinh45
force-pushed
the
fix/media-filesize-bigint
branch
from
July 7, 2026 05:39
97e9a38 to
b0e99df
Compare
routers/projects.py per-project storage_bytes (batch + detail) now excludes uploading/failed and soft-deleted versions, matching services.storage.instance_storage_used_bytes so per-project and instance-wide storage figures share the same semantics.
… + CI Postgres - Extract shared _committed_media_sum; instance_storage_used_bytes and new project_storage_used_bytes derive from it (one committed-only definition). - routers/projects.py detail sum now calls project_storage_used_bytes. - Real-DB integration test (transaction-rollback fixture): ready/processing counted, uploading/failed/deleted excluded; a 9GB insert cross-validates the BigInteger column. - CI: add postgres:15 service + 'alembic upgrade head' step so the integration test runs in CI (the fully-mocked harness cannot execute the query).
ravirajsinh45
force-pushed
the
chore/storage-usage-tests-and-alignment
branch
from
July 7, 2026 05:46
f5e87a5 to
43e578c
Compare
Everillangel
pushed a commit
to Everillangel/freeframe
that referenced
this pull request
Jul 14, 2026
…& CI Postgres (Techiebutler#100) * refactor: align projects.py per-project storage sum to committed-only routers/projects.py per-project storage_bytes (batch + detail) now excludes uploading/failed and soft-deleted versions, matching services.storage.instance_storage_used_bytes so per-project and instance-wide storage figures share the same semantics. * test: real-Postgres integration test for committed-only storage usage + CI Postgres - Extract shared _committed_media_sum; instance_storage_used_bytes and new project_storage_used_bytes derive from it (one committed-only definition). - routers/projects.py detail sum now calls project_storage_used_bytes. - Real-DB integration test (transaction-rollback fixture): ready/processing counted, uploading/failed/deleted excluded; a 9GB insert cross-validates the BigInteger column. - CI: add postgres:15 service + 'alembic upgrade head' step so the integration test runs in CI (the fully-mocked harness cannot execute the query). * docs(changelog): committed-only per-project storage under [Unreleased] (Techiebutler#100)
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.
Summary
Stacked on #99. Two related storage-consistency improvements.
Committed-only per-project storage
routers/projects.pyper-projectstorage_bytes(batch + detail) now excludesuploading/failedand soft-deleted versions, matching
services.storage.instance_storage_used_bytes. Extracts a shared_committed_media_sumhelper and addsproject_storage_used_bytes(db, project_id), so per-project andinstance-wide figures use one definition. (The displayed per-project storage number may drop slightly —
it no longer counts in-progress/failed/deleted media.)
Real-DB coverage + CI Postgres
The mock test harness can't execute the usage SUM/join/filter. Adds a
real_dbtransaction-rollbackfixture and an integration test asserting committed-only totals (ready/processing counted;
uploading/failed/deleted excluded), and wires a
postgres:15service +alembic upgrade headinto thebackend-test CI job so the integration test actually runs in CI.
Testing
Stacked on
fix/media-filesize-bigint(#99); retarget tomainas the stack merges bottom-up.