refactor: Migrate Machine InstanceType API handlers to WithTx#558
Conversation
Continues the `WithTx` migration, covering both `BeginTx` sites in `machineinstancetype.go` (for Create and Delete). Both handlers trigger a workflow and wait on `we.Get`, so they're also adopting our little `timeoutResp` pattern that has evolved over a few of these PRs. Callouts are: - Create and Delete both use `WithTx` + `timeoutResp` (not good fits for `WithTxResult` here). - Moved `MatchInstanceTypeCapabilitiesForMachines` out of the tx (it was only using the session anyway) as well as `scp.GetClientByID`. - Errors switched to `NewAPIError`. Signed-off-by: Chet Nichols III <chetn@nvidia.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
Summary by CodeRabbit
WalkthroughThis PR refactors the Machine/InstanceType association handlers to use ChangesMachine Instance Type Handler Transaction Management
🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
🔐 TruffleHog Secret Scan✅ No secrets or credentials found! Your code has been scanned for 700+ types of secrets and credentials. All clear! 🎉 🕐 Last updated: 2026-05-21 19:39:25 UTC | Commit: e72546a |
🔍 Container Scan Summary
Per-CVE detail lives in the per-service |
Description
Continues the
WithTxmigration, covering bothBeginTxsites inmachineinstancetype.go(for Create and Delete).Both handlers trigger a workflow and wait on
we.Get, so they're also adopting our littletimeoutResppattern that has evolved over a few of these PRs.Callouts are:
WithTx+timeoutResp(not good fits forWithTxResulthere).MatchInstanceTypeCapabilitiesForMachinesout of the tx (it was only using the session anyway) as well asscp.GetClientByID.NewAPIError.Signed-off-by: Chet Nichols III chetn@nvidia.com
Type of Change
Services Affected
Related Issues (Optional)
Breaking Changes
Testing
Additional Notes