-
Notifications
You must be signed in to change notification settings - Fork 6.5k
feat: Refactor about the way to use context.TODO and context.Background #21963
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?
Conversation
❗ Preview Environment undeploy from Bunnyshell failedSee: Environment Details | Pipeline Logs Available commands (reply to this comment):
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #21963 +/- ##
==========================================
+ Coverage 56.06% 56.07% +0.01%
==========================================
Files 343 343
Lines 57545 57573 +28
==========================================
+ Hits 32262 32286 +24
- Misses 22633 22645 +12
+ Partials 2650 2642 -8 ☔ View full report in Codecov by Sentry. |
51cca73 to
3434bcc
Compare
87862b8 to
a7a71f9
Compare
db4446c to
80f6145
Compare
d293908 to
262e38b
Compare
| github.com/argoproj/gitops-engine => github.com/sivchari/gitops-engine v0.0.0-20250421124833-45bcf5629986 | ||
| github.com/argoproj/notifications-engine => github.com/sivchari/notifications-engine v0.0.0-20250420144357-6843172f87f1 |
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.
It should be replaced before this PR is merged.
8be83f1 to
e3d4897
Compare
|
Hi @crenshaw-dev |
|
@gdsoumya @blakepettersson PTAL 🙏 |
Signed-off-by: sivchari <[email protected]>
Signed-off-by: sivchari <[email protected]>
7d46ef1 to
64c1c05
Compare
Signed-off-by: sivchari <[email protected]>
close #21942
Until now, we have logics not to pass context, but was using context.Background or context.TODO. This isn't best practice for Go since if the context isn't passed, the logics are out of control of cancellation. By propagating context correctly makes some advantages. At first, we can cancel all goroutines and some requests (e.g. Git, Helm and http client etc). This can avoid goroutine leaks, so the machine doesn't remain extra cpu and memory. Next, our interfaces are enable to define context at first params surely. This practice makes good impact in the future development.
I think the most concerning is that some interface are changed, so if you have some opinion, let me know about it. Please join us with discussion to improve Argo CD.
Checklist: