feat: Add TriggeredBy field to deployment history entries#36
feat: Add TriggeredBy field to deployment history entries#36LittleChimera merged 1 commit intomainfrom
Conversation
- Add TriggeredByInfo struct with Kind (User/System) and Name fields - Add TriggeredBy field to DeploymentHistoryEntry - Extract user info from rollout.kuberik.com/deploy-user annotation - Set TriggeredBy to System with rollout-controller name for automatic deployments - Clear deploy-user annotation after deployment (similar to deploy-message) - Add comprehensive tests for user and system triggered deployments
There was a problem hiding this comment.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on January 3
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| Kind: "System", | ||
| Name: "rollout-controller", | ||
| } | ||
| } |
There was a problem hiding this comment.
Unused parameter causes incorrect deployment trigger attribution
The extractTriggeredByInfo function accepts an isManualDeployment parameter that is explicitly passed at the call site but never used in the function body. When a user triggers a manual deployment via WantedVersion or force-deploy without setting the deploy-user annotation, the deployment is incorrectly recorded as Kind: "System" instead of properly indicating it was user-initiated. The function comment also incorrectly states it "Returns nil if no user annotation is found" but the function never returns nil.
Additional Locations (1)
| Kind: "System", | ||
| Name: "rollout-controller", | ||
| } | ||
| } |
There was a problem hiding this comment.
Stale deploy-user annotation persists on automatic deployments
The deploy-user annotation is read and used for any deployment regardless of whether it's a manual deployment, but it's only cleared for manual deployments (forceDeployUsed or hasManualDeployment). This differs from deploy-message which is both used and cleared only for manual deployments. If deploy-user is set on a rollout during an automatic deployment, the annotation persists, causing all subsequent automatic deployments to be incorrectly attributed to that user until the annotation is manually removed.
Note
Adds trigger attribution to deployments and exposes it via the API/CRD.
TriggeredByInfoand optionaltriggeredByinDeploymentHistoryEntry; updates deepcopy and CRD schematriggeredByfromrollout.kuberik.com/deploy-user(Kind=User) or defaults to System (rollout-controller)rollout.kuberik.com/deploy-userafter deployments (both force-deploy and WantedVersion), alongside existing annotationstriggeredByto new history entries indeployRelease; factorextractTriggeredByInfoWritten by Cursor Bugbot for commit e9f504f. This will update automatically on new commits. Configure here.