Skip to content

Conversation

@Tzvonimir
Copy link
Contributor

@Tzvonimir Tzvonimir commented Nov 8, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced workload policy configuration to support larger startup period timeout values and improved mapping of policy parameters for better configuration management.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 8, 2025

Walkthrough

The WorkloadPolicyResourceModel struct undergoes a type migration for StartupPeriodSeconds from 32-bit to 64-bit integers, with corresponding Terraform schema and protobuf conversion updates. Additional public fields are added to proto mapping paths for policy configuration fields.

Changes

Cohort / File(s) Change Summary
Type Migration and Proto Field Mapping Expansion
internal/provider/workload_policy.go
Migrated StartupPeriodSeconds from types.Int32 to types.Int64 with Terraform schema updated from Int32Attribute to Int64Attribute; removed Computed/Default constraints. Updated toProto/fromProto methods to serialize StartupPeriodSeconds as int64 pointer. Expanded proto conversion mappings to include MinChangePercent, MinDataPoints, StabilityCvMax, HysteresisVsTarget, DriftDeltaPercent, MinVpaWindowDataPoints, and CooldownMinutes. Updated LoopbackPeriodSeconds mapping to int32 pointer handling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Verify backward compatibility implications of the int32 → int64 type migration for StartupPeriodSeconds
  • Cross-check all newly added field mappings (7 fields) for correctness in toProto/fromProto paths
  • Confirm proto serialization/deserialization alignment with updated type constraints
  • Validate removal of Computed/Default constraints doesn't affect schema behavior

Poem

🐰 From thirty-two bits, we leap to sixty-four,
More fields now mapped than ever before,
Proto paths widen with care and precision,
Each mapping refined with careful vision,
The workload finds room to expand its way!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'Add missing fields to workload policies' accurately reflects the main change: adding previously missing field mappings to the WorkloadPolicyResourceModel, including field type migration and proto conversion updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch tzvonimir/add-missing-fields

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a60116c and 2095604.

📒 Files selected for processing (1)
  • internal/provider/workload_policy.go (6 hunks)

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.

@Tzvonimir Tzvonimir changed the title Add missing fields to policies Add missing fields to workload policies Nov 8, 2025
@Tzvonimir Tzvonimir merged commit 9a495f1 into main Nov 8, 2025
14 of 15 checks passed
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.

3 participants