Skip to content

fix: unsupported type uint64 errors in server-side apply#291

Merged
matthyx merged 2 commits intomainfrom
uint64
Mar 19, 2026
Merged

fix: unsupported type uint64 errors in server-side apply#291
matthyx merged 2 commits intomainfrom
uint64

Conversation

@matthyx
Copy link
Contributor

@matthyx matthyx commented Mar 2, 2026

Summary by CodeRabbit

  • Refactor
    • Updated internal numeric fields from unsigned to signed integers for syscall and argument/error values.
    • This change improves handling of negative or platform-specific return/value representations and enhances compatibility across environments without altering visible behavior.

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
@coderabbitai
Copy link

coderabbitai bot commented Mar 2, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 21c7e5e and 48031cb.

⛔ Files ignored due to path filters (3)
  • pkg/apis/softwarecomposition/v1beta1/generated.pb.go is excluded by !**/*.pb.go
  • pkg/generated/applyconfiguration/softwarecomposition/v1beta1/arg.go is excluded by !**/generated/**
  • pkg/generated/applyconfiguration/softwarecomposition/v1beta1/syscall.go is excluded by !**/generated/**
📒 Files selected for processing (1)
  • pkg/apis/softwarecomposition/v1beta1/generated.proto
✅ Files skipped from review due to trivial changes (1)
  • pkg/apis/softwarecomposition/v1beta1/generated.proto

📝 Walkthrough

Walkthrough

Type signatures for syscall-related fields changed from unsigned to signed 64-bit integers across API types and the generated protobuf in the softwarecomposition package: Syscall.ErrnoRet, Arg.Index, Arg.Value, and Arg.ValueTwo now use int64 instead of uint64.

Changes

Cohort / File(s) Summary
API Type Definitions
pkg/apis/softwarecomposition/types.go, pkg/apis/softwarecomposition/v1beta1/types.go
Updated four fields from uint64 to int64: Syscall.ErrnoRet, Arg.Index, Arg.Value, Arg.ValueTwo.
Generated Protobuf
pkg/apis/softwarecomposition/v1beta1/generated.proto
Protobuf field types changed from uint64 to int64 for Arg.index, Arg.value, Arg.valueTwo, and Syscall.errnoRet (fields preserved).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped through types by moonlit code,
Unsigned to signed along the road.
Errno and args in gentle sway,
Now int64s lead the way.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: converting uint64 types to int64 to fix server-side apply errors.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch uint64

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pkg/apis/softwarecomposition/v1beta1/types.go`:
- Line 615: The ErrnoRet int64 field (ErrnoRet) and the other seccomp-related
fields recently changed from uint64 to int64 must enforce non-negativity; add
kubebuilder validation markers to require >= 0 (for example add a comment tag
like "+kubebuilder:validation:Minimum=0" immediately above the ErrnoRet field
and the other int64 seccomp fields that used to be uint64) so the CRD schema
will reject negative values while keeping the Go type as int64 for SSA.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2a93f18 and 21c7e5e.

📒 Files selected for processing (2)
  • pkg/apis/softwarecomposition/types.go
  • pkg/apis/softwarecomposition/v1beta1/types.go

// the errno return code to use. Some actions like SCMP_ACT_ERRNO and
// SCMP_ACT_TRACE allow to specify the errno code to return
ErrnoRet uint64 `json:"errnoRet,omitempty" protobuf:"bytes,3,opt,name=errnoRet"`
ErrnoRet int64 `json:"errnoRet,omitempty" protobuf:"bytes,3,opt,name=errnoRet"`
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Reintroduce non-negative validation after changing to int64.

Line 615 and Lines 649-653 now accept negative values that were previously impossible with uint64. Keep int64 for SSA, but enforce >= 0 on these fields to prevent invalid seccomp inputs from entering the API.

Suggested schema-level guardrails
 type Syscall struct {
   // the errno return code to use. Some actions like SCMP_ACT_ERRNO and
   // SCMP_ACT_TRACE allow to specify the errno code to return
+  // +kubebuilder:validation:Minimum=0
   ErrnoRet int64 `json:"errnoRet,omitempty" protobuf:"bytes,3,opt,name=errnoRet"`
 }

 // Arg defines the specific syscall in seccomp.
 type Arg struct {
   // the index for syscall arguments in seccomp
+  // +kubebuilder:validation:Minimum=0
   Index int64 `json:"index" protobuf:"bytes,1,opt,name=index"`
   // the value for syscall arguments in seccomp
+  // +kubebuilder:validation:Minimum=0
   Value int64 `json:"value,omitempty" protobuf:"bytes,2,opt,name=value"`
   // the value for syscall arguments in seccomp
+  // +kubebuilder:validation:Minimum=0
   ValueTwo int64 `json:"valueTwo,omitempty" protobuf:"bytes,3,opt,name=valueTwo"`
 }

Also applies to: 649-653

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/apis/softwarecomposition/v1beta1/types.go` at line 615, The ErrnoRet
int64 field (ErrnoRet) and the other seccomp-related fields recently changed
from uint64 to int64 must enforce non-negativity; add kubebuilder validation
markers to require >= 0 (for example add a comment tag like
"+kubebuilder:validation:Minimum=0" immediately above the ErrnoRet field and the
other int64 seccomp fields that used to be uint64) so the CRD schema will reject
negative values while keeping the Go type as int64 for SSA.

@github-actions
Copy link

github-actions bot commented Mar 2, 2026

Summary:

  • License scan: failure
  • Credentials scan: failure
  • Vulnerabilities scan: failure
  • Unit test: success
  • Go linting: failure

@matthyx matthyx added the release label Mar 2, 2026
@matthyx matthyx moved this to Needs Reviewer in KS PRs tracking Mar 3, 2026
@matthyx matthyx removed the release label Mar 19, 2026
@matthyx matthyx merged commit f95ff9c into main Mar 19, 2026
7 checks passed
@matthyx matthyx deleted the uint64 branch March 19, 2026 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs Reviewer

Development

Successfully merging this pull request may close these issues.

1 participant