feat(resources): add --object-storage option for apps#74
Open
ovv wants to merge 5 commits into
Open
Conversation
added 2 commits
May 11, 2026 13:34
Expose the new resources.disk.object field recently added on the platform side. resources:set accepts --object-storage name:value (non-negative integer GB, apps only); resources:get adds an "Object storage (GB)" column. Values are stored as MiB on the wire (1 GB = 1024 MiB) and converted on the way in and out via a shared ResourcesUtil::formatObjectStorageGB() helper. Range and step constraints are deferred to the API.
Object storage is opt-in and rarely configured, so the column was displaying "not set" or "N/A" for every row on most projects. Drop it from the default column list when no application has it configured. Users can still request it explicitly via --columns.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds first-class CLI support for configuring and displaying per-app object storage in the resources commands.
Changes:
- Add
--object-storagetoresources:setto set per-app object storage (GB input, stored as MiB in updates). - Display object storage in
resources:getvia a newobject_storagetable column. - Introduce
ResourcesUtil::formatObjectStorageGB()plus PHPUnit coverage for formatting/rounding behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| legacy/tests/Service/ResourcesUtilTest.php | Adds unit tests for object storage MiB→GB formatting. |
| legacy/src/Service/ResourcesUtil.php | Adds a helper to format object storage values for display. |
| legacy/src/Command/Resources/ResourcesSetCommand.php | Adds --object-storage parsing/validation and applies updates to deployment payload. |
| legacy/src/Command/Resources/ResourcesGetCommand.php | Adds an object_storage column and populates it for apps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
added 2 commits
May 12, 2026 14:39
Align the object-storage validator with the disk-size validator by using loose comparison ($gb != $value) instead of a strict string cast. Inputs like "01" are now accepted, matching the behavior of other size options, while non-integers such as "1.5" or "abc" are still rejected.
The previous fix only hid the column when no app had object_storage defined. Apps that explicitly set it to 0 still triggered the column to appear with a "0" value across the table. Only treat the column as applicable when at least one app has a non-zero object_storage value. Assisted-By: Claude <noreply@anthropic.com>
pjcdawkins
reviewed
May 25, 2026
pjcdawkins
reviewed
May 25, 2026
Treat the --object-storage value as MB on input and in all output, in line with the API (which stores the value in MiB). Previously the CLI accepted the value in GB and multiplied by 1024, while resources:get divided by 1024 for display. Both ends now pass the value through unchanged. - Update help text, example and validator error message - Drop the now-unused ResourcesUtil::formatObjectStorageGB helper and its test - Switch the resources:get column header from "(GB)" to "(MB)" Assisted-By: Claude <noreply@anthropic.com>
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.
Expose the new
resources.disk.objectfield recently added on the platform side.resources:setaccepts--object-storage name:value(non-negative integer in MB, apps only).resources:getadds an optionalObject storage (MB)column, hidden when no app sets a non-zero value.The value is passed through to the API unchanged: the CLI reports it in MB to match the existing disk column, while the API stores it in MiB. No conversion happens in either direction.