-
Couldn't load subscription status.
- Fork 6.5k
chore(controller): remove underlying deprecated functions and add extra logging #25032
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
chore(controller): remove underlying deprecated functions and add extra logging #25032
Conversation
Signed-off-by: nitishfy <justnitish06@gmail.com>
🔴 Preview Environment stopped on BunnyshellSee: Environment Details | Pipeline Logs Available commands (reply to this comment):
|
| appList.Items = newItems | ||
| return appList, nil | ||
| }, | ||
| WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deprecated.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #25032 +/- ##
==========================================
- Coverage 60.89% 60.84% -0.05%
==========================================
Files 351 351
Lines 60489 60531 +42
==========================================
Hits 36832 36832
- Misses 20736 20775 +39
- Partials 2921 2924 +3 ☔ View full report in Codecov by Sentry. |
Signed-off-by: nitishfy <justnitish06@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall I'm, ok-ish with the logging but the comments inside the code are an anti-pattern
They explaining obvious code and if the code is not obvious we should improve the code vs adding inline comments
| log.Infof("Initializing ApplicationController: appResyncPeriod=%v, appHardResyncPeriod=%v, appResyncJitter=%v", appResyncPeriod, appHardResyncPeriod, appResyncJitter) | ||
|
|
||
| db := db.NewDB(namespace, settingsMgr, kubeClientset) | ||
| // use default rate limiter config if not provided |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we really need this comment? It's apparent what the following line does.
Overall, if we need comments to explain the code, it's better to improve the code and remove the comments
| log.Info("Hydrator feature enabled; initializing hydrator subsystem") | ||
| ctrl.hydrator = hydrator.NewHydrator(&ctrl, appResyncPeriod, commitClientset, repoClientset, db) | ||
| } | ||
| // Apply kubectl concurrency limit if specified |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here about comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why this PR is useful. Did you hear from users that exiting logging is not enough?
The application controller code is written pretty nicely but hasn't been properly documented. There are quite a few fields that were deprecated too which is still getting used. This PR documents the app controller code, remove the deprecated function and add better logs.
Checklist: