Tags: commercetools/telefonistka
Tags
monitoring PR handling failures. (#42) Instrument PR handling failures. We track both explicit failures with pr_handle_failures_total And cases where telefonistka commit status check is left in "pending" state (because Telefonistka exploded while handling that event ) Co-authored-by: Yazdan Mohammadi <[email protected]>
Sd 854 parallelize fetching of argocd diff in telefonistka (#43) * wip * Concurrent argocd diff * Move InitArgoClients out of server.go * Update internal/pkg/githubapi/github.go Co-authored-by: Hannes Gustafsson <[email protected]> * Update internal/pkg/argocd/argocd_test.go Co-authored-by: Hannes Gustafsson <[email protected]> * Update internal/pkg/argocd/argocd.go Co-authored-by: Hannes Gustafsson <[email protected]> * Update internal/pkg/argocd/argocd_test.go Co-authored-by: Hannes Gustafsson <[email protected]> * Update internal/pkg/argocd/argocd.go Co-authored-by: Hannes Gustafsson <[email protected]> * Update internal/pkg/argocd/argocd.go Co-authored-by: Hannes Gustafsson <[email protected]> * Update internal/pkg/argocd/argocd.go Co-authored-by: Hannes Gustafsson <[email protected]> * Use dependency injection with argocd client * Remove dangling err check --------- Co-authored-by: Hannes Gustafsson <[email protected]>
Increase processing timeout (#40) Calculating diffs on promotion pull requests like [1] fails since the context is timing out and processing is aborted. This is evident from logs. Error getting manifests for app ..., revision ...: rpc error: code = DeadlineExceeded desc = context deadline exceeded" Error generating diff for component ...: rpc error: code = DeadlineExceeded desc = context deadline exceeded" Handling of PR event failed: err=getting diff information: rpc error: code = DeadlineExceeded desc = context deadline exceeded\n" ... Increasing the timeout is a short-term fix to mitigate the issue and allow users to get the diff while additional investigation is done to figure out how we can address this better long-term. [1] commercetools/k8s-gitops#998
SD-770 fixup unique target paths and multi promotion (#37) Promotion PR description generated by Telefonistka contains all default promotion targets for a certain promotion path. This updates the prBody function to only list the promotion targets to which the promotion is supposed to happen for a certain promotion path. * Added a filterSkipPaths function when generating a pr comment. This will take the targetPaths and filter out any skipped paths from the final promotion pr comment. * Add getPromotionSkipPaths to find the component with fewest skip paths --------- Co-authored-by: Hannes Gustafsson <[email protected]>
SD-838: fix panic (#33) * Fix potential panic The change [1] introduced a potential panic as it is trying to log the app name when a failure happens, but the app variable is overridden during such a failure and is thus nil. This results in the following panic. panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x20ddccb] goroutine 367 [running]: internal/pkg/argocd.generateDiffOfAComponent() internal/pkg/argocd/argocd.go:477 internal/pkg/argocd.GenerateDiffOfChangedComponents() internal/pkg/argocd/argocd.go:561 internal/pkg/githubapi.HandlePREvent() internal/pkg/githubapi/github.go:161 internal/pkg/githubapi.handleEvent() internal/pkg/githubapi/github.go:382 created by internal/pkg/githubapi.ReciveWebhook internal/pkg/githubapi/github.go:322 By instead using the name from the query constructed prior, the panic should be avoided. [1] adbd913
Improve promotion comment. (#31) * Improve promotion comment. Promotion comment used to list all the values in the 'targetPaths' key, ignoring the promotionAllow and promotionBlock lists. This PR limits the comment to only paths that are being promoted. * Use testify library for assert * return nil, use assert * Add t.Parallel()
Sd 766 telefonistka get nil pointer dereference when it tries to diff… … a new application (#27) * add nil condition to found app to prevent nil references * add templates path to generate argo cd diff comments test * add nolint * separate error and nil conditions for clarity * add a unit test to verify the nil return value * update test for clarity
Split too big comment per cluster (#22) * Split too big comment per cluster If a "regular" aggregate diff can't fit in a GH comment create one comment per cluster. There's still a fallback to concise diff (just lists changed objects) for extreme cases * Move logging out of executeTemplate to higher up the stack Create a new "testable" generateArgoCdDiffComments function to generate all the comments content Comment all the comments * Add test for 3 "levels" of comments * Apply suggestions from code review Co-authored-by: Hannes Gustafsson <[email protected]>