Skip to content

refactor(core): name the CF quota unlimited sentinel - #5644

Merged
norman-abramovitz merged 1 commit into
cloudfoundry:developfrom
nabramovitz:norm/refactor/cf-quota-unlimited
Jul 18, 2026
Merged

norman-abramovitz merged 1 commit into
cloudfoundry:developfrom
nabramovitz:norm/refactor/cf-quota-unlimited

Conversation

@nabramovitz

Copy link
Copy Markdown
Contributor

CF quota APIs encode 'unlimited' as -1, and twelve call sites compared against the bare literal — two of them re-declaring their own private UNLIMITED = -1 constant.

This adds one exported CF_QUOTA_UNLIMITED constant and an isUnlimited() guard in core (following the existing PAGE_SIZE_ALL shape in page-size.types.ts) and converts all twelve sites: the infinity/byte-formatter pipes, UtilsService, the status/metric cards, UnlimitedInputComponent, the org and space quota tabs, and the app-wall memory columns. The shared write path (toNumber in the quota actions) uses the constant too, so org and space quotas are both covered.

The -1 in profile-settings is deliberately untouched — there it means "size could not be determined", a different sentinel that must not be folded into the unlimited constant.

All sites are read-only comparisons, so the change is mechanical with no behavior change. Part of the sentinel-hardening work in #5613 (step 3).

CF quota APIs encode 'unlimited' as -1. Replace the bare === -1
comparisons and the two private UNLIMITED re-declarations with one
exported CF_QUOTA_UNLIMITED constant and an isUnlimited() guard in
core (same shape as PAGE_SIZE_ALL), consumed by the pipes, utils,
cards, unlimited-input, quota tabs, and app-wall memory columns.

The profile-settings -1 is a different sentinel (size undetermined)
and deliberately stays out.

Part of cloudfoundry#5613 (step 3).

@norman-abramovitz norman-abramovitz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@norman-abramovitz
norman-abramovitz merged commit 8b8c5b9 into cloudfoundry:develop Jul 18, 2026
21 checks passed
@nabramovitz
nabramovitz deleted the norm/refactor/cf-quota-unlimited branch July 18, 2026 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants