fix(profile): expose volume_size_gb on Profile model#84
Merged
Conversation
Prerequisite for web-terminal#20 (Subscription card pricing display). The Subscribe button label needs disk size to compute the monthly price via the pricing formula in landing-page/Pricing.astro. Without this, the trial-state CTA can only show a placeholder. ShardBase already carries volume_size_gb; Profile.from_shard now propagates it (via getattr for safety against subclassed shard models). Follows up on PR#83 / issue#77 subscription work.
This was referenced May 16, 2026
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
volume_size_gb: int | Noneto theProfilemodel and propagate it fromShardBaseinProfile.from_shard.tests/test_profile.pywith a case asserting the field round-trips throughGET /protected/management/profile.Why this matters
This is a prerequisite for web-terminal#20 (Subscription card on the Settings page). The Trial-state "Subscribe — €X/month" button label needs
volume_size_gbto apply the pricing formula fromlanding-page/src/components/Pricing.astro(disk price per GB × volume size). Without this field, the web terminal can only render a placeholder for the price, producing a degraded UX during the initial billing rollout.ShardBasealready carries the field, so this is purely a model-surface fix on the shard side.Recommended reading order
shard_core/data_model/profile.py— the model +from_shardchange.tests/conftest.py—mock_shardgainsvolume_size_gb=30so the propagation has something to assert against.tests/test_profile.py— newtest_profile_includes_volume_size_gb.Test plan
test_profilestill passes (existing model-equality assertion).test_profile_includes_subscriptionstill passes.test_profile_includes_volume_size_gb— new: assertsProfile.volume_size_gb == mock_shard.volume_size_gb == 30.test_signed_call(usesProfile.from_shard) still passes.just cleanup(ruff + black onshard_coreandtests) clean.$store.state.profile.volume_size_gband renders the Subscribe price label.Notes
from_shardusesgetattr(shard, "volume_size_gb", None)for safety against runtime subclasses, mirroring the existingsubscriptionfield.Profileis stored as JSON viaset_valueinkv_store, and the field defaults toNone.🤖 Generated with Claude Code