Skip to content

Comments

feat: Add TriggeredBy field to deployment history entries#36

Merged
LittleChimera merged 1 commit intomainfrom
add-triggered-by-to-history
Dec 26, 2025
Merged

feat: Add TriggeredBy field to deployment history entries#36
LittleChimera merged 1 commit intomainfrom
add-triggered-by-to-history

Conversation

@LittleChimera
Copy link
Contributor

@LittleChimera LittleChimera commented Dec 26, 2025

  • 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

Note

Adds trigger attribution to deployments and exposes it via the API/CRD.

  • Introduces TriggeredByInfo and optional triggeredBy in DeploymentHistoryEntry; updates deepcopy and CRD schema
  • Controller sets triggeredBy from rollout.kuberik.com/deploy-user (Kind=User) or defaults to System (rollout-controller)
  • Clears rollout.kuberik.com/deploy-user after deployments (both force-deploy and WantedVersion), alongside existing annotations
  • Appends triggeredBy to new history entries in deployRelease; factor extractTriggeredByInfo
  • Comprehensive tests for user/system cases and annotation clearing

Written by Cursor Bugbot for commit e9f504f. This will update automatically on new commits. Configure here.

- 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
@LittleChimera LittleChimera merged commit e2abaa8 into main Dec 26, 2025
4 of 8 checks passed
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

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",
}
}
Copy link

Choose a reason for hiding this comment

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

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)

Fix in Cursor Fix in Web

Kind: "System",
Name: "rollout-controller",
}
}
Copy link

Choose a reason for hiding this comment

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

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.

Additional Locations (1)

Fix in Cursor Fix in Web

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.

1 participant