feat(cas-backend): add configurable max blob size per backend#2453
Merged
migmartri merged 9 commits intochainloop-dev:mainfrom Oct 6, 2025
Merged
feat(cas-backend): add configurable max blob size per backend#2453migmartri merged 9 commits intochainloop-dev:mainfrom
migmartri merged 9 commits intochainloop-dev:mainfrom
Conversation
Add ability to configure maximum blob size for CAS backends dynamically through API and CLI, replacing the static Helm chart configuration. Changes: - Add max_bytes optional field to CASBackend Create/Update API with 10MB minimum validation - Update business logic to enforce 10MB minimum and prevent inline backend size updates - Add --max-bytes persistent flag to CLI parent add/update commands - Support human-readable formats (e.g., 100MB, 1GB) in CLI - Server-side validation only, no client-side checks - Update integration tests to handle new parameter Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
Refactored duplicated max-bytes flag parsing logic across 6 CAS backend commands (add/update for S3, OCI, and Azure Blob). The parsing and validation now happens once in the parent command's PersistentPreRunE, following the existing pattern used for captureUpdateFlags. Changes: - Added parseMaxBytesOption() helper function in casbackend.go - Added PersistentPreRunE to newCASBackendAddCmd and newCASBackendUpdateCmd - Removed duplicated parsing logic from all child commands - Updated license headers to 2024-2025 Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
Piskoo
approved these changes
Oct 5, 2025
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
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
This PR adds the ability to configure maximum blob size for CAS backends dynamically through API and CLI, replacing the static Helm chart configuration.
Changes
max_bytesfield to CASBackend Create/Update requests with buf validation (10MB minimum)max_bytesupdated (they use fixed 500KB limit)--max-bytesas persistent flag on parentaddandupdatecommands100MB,1GB)API Examples
Create backend with custom max size
Update backend max size
Validation
max_bytes(returns validation error)bytefmtlibrary