Skip to content

Conversation

@jourdee-lab
Copy link
Contributor

@jourdee-lab jourdee-lab commented Aug 13, 2025

Summary by Sourcery

Add a configurable HTTP request body size limit to Rekor by extending the CRD and API, updating deepcopy logic, and forwarding the flag to the server deployment

New Features:

  • Introduce MaxRequestBodySize field in the Rekor CRD and Go API with a default of 10485760 bytes
  • Pass the --max_request_body_size flag to the Rekor server container when the field is set

Enhancements:

  • Update the autogenerated DeepCopy function to handle the new MaxRequestBodySize field

Tests:

  • Add a default MaxRequestBodySize value in the Rekor types unit test

@sourcery-ai
Copy link

sourcery-ai bot commented Aug 13, 2025

Reviewer's Guide

This pull request introduces a configurable MaxRequestBodySize parameter across Rekor and SecureSign components by extending CRDs, adding the field to the API types with a default, wiring it into the controller deployment args, updating deepcopy logic, and adjusting tests.

Class diagram for updated RekorSpec struct

classDiagram
    class RekorSpec {
        +Auth *auth
        +int64 *MaxRequestBodySize
    }
    RekorSpec --> Auth
Loading

File-Level Changes

Change Details Files
Extend CRD schemas with maxRequestBodySize property
  • Add maxRequestBodySize field under spec with default, description, format, and type in Rekors CRD
  • Mirror the same maxRequestBodySize addition in SecureSigns CRD
config/crd/bases/rhtas.redhat.com_rekors.yaml
config/crd/bases/rhtas.redhat.com_securesigns.yaml
Add MaxRequestBodySize field to RekorSpec API type
  • Declare optional MaxRequestBodySize *int64 with kubebuilder default tag
  • Annotate JSON field and add comment for HTTP flag
api/v1alpha1/rekor_types.go
Implement deep copy support for new field
  • Insert nil-check for MaxRequestBodySize
  • Allocate and copy underlying int64 value
api/v1alpha1/zz_generated.deepcopy.go
Wire MaxRequestBodySize into deployment args and tests
  • Append --max_request_body_size flag when Spec field is set in server deployment
  • Update RekorSpec test generator to include default MaxRequestBodySize
internal/controller/rekor/actions/server/deployment.go
api/v1alpha1/rekor_types_test.go

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @jourdee-lab - I've reviewed your changes - here's some feedback:

  • Consider adding validation for MaxRequestBodySize (e.g., ensuring it’s positive and within reasonable bounds) so misconfigured values are rejected early.
  • You might want to always emit the --max_request_body_size flag (using the default when unset) to ensure the deployed server config is explicit and won’t drift if upstream defaults change.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider adding validation for MaxRequestBodySize (e.g., ensuring it’s positive and within reasonable bounds) so misconfigured values are rejected early.
- You might want to always emit the --max_request_body_size flag (using the default when unset) to ensure the deployed server config is explicit and won’t drift if upstream defaults change.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@jourdee-lab jourdee-lab merged commit 9491293 into main Aug 14, 2025
31 of 35 checks passed
@jourdee-lab jourdee-lab deleted the joutan/SECURESIGN-2189 branch August 14, 2025 08:18
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