Repository navigation
feat(apps): show owner-site quota usage and structured quota errors - #8
Merged
nathan-thillairajah merged 1 commit intoOct 14, 2026
Merged
Conversation
nandiheath
marked this pull request as ready for review
September 25, 2026 23:55
jonwinton
reviewed
Sep 25, 2026
jonwinton
left a comment
There was a problem hiding this comment.
redact_json_value sanitizes successful responses as well as errors (authorized_json_request, delete_app), so the change at src/bl/apps.rs:1533 affects every successful Apps Platform response, not only the error recovery fields:
- String values now go through
terminal_safe_text, which rewrites newlines, tabs, and other control characters as literal Rust-style escapes (\nbecomes the two characters\n, ESC becomes\u{1b}).print_jsonalready emits valid JSON with bidi controls escaped, so--jsonconsumers only lose data. For example, multi-line pod logs frombl apps debug --jsonnow arrive as a single line with literal\nsequences. The updated contract process test (nested.messageexpecting\\u{1b}[31m) reflects this change on the success path. - The stricter key check at line 1541 also applies to successful responses. A key containing any control or bidi character now fails the whole command. For
delete, that surfaces as "delete outcome unknown" after a request that may have succeeded.
Consider applying terminal-safe escaping and the unsafe-key rejection only inside sanitize_field (error details and next_action), and leaving redact_json_value as credential redaction for successful responses.
Separately, the DCO check is failing; the commit needs a Signed-off-by trailer.
Adapted from Nandi Wong’s quota client contribution in block#8. Keep recovery sanitization off successful responses, retain current validation diagnostics, and describe pending quota cleanup accurately. Signed-off-by: Nathan Thillairajah <nthillairajah@squareup.com>
nathan-thillairajah
force-pushed
the
nandi/owner-site-quota-client
branch
from
October 14, 2026 19:09
268ecf7 to
4b13d83
Compare
nathan-thillairajah
approved these changes
Oct 14, 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.
When Compose refuses a new deployment at the owner's site limit,
bl appsdrops the usage, allowance and structured recovery fields. Preserve those fields alongside the existing HTTP status, trace ID and manifest validation guidance so callers can inspect capacity and choose an explicit retry.Recovery sanitization applies only to errors: successful debug logs and deletion metadata remain intact. The quota guidance also reflects held failed-deploy reservations and
quota_cleanup_pending, which must not be treated as released capacity.The original sanitizer reproduced three process regressions, including
delete_outcome_unknownafter a successful response. These pass with the fix, as dojust checkandjust package-smoke. Process fixtures verify a realistic capped deploy retains its quota fields and trace without retrying the mutation; a read-only Public staging owned-list check also passed.Customers receive this through a rebuilt CLI or Blox image after merge.