-
-
Notifications
You must be signed in to change notification settings - Fork 135
Fix plan-diff command
#1382
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
Fix plan-diff command
#1382
Conversation
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Suggested labels
Suggested reviewers
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (1)**/*.go📄 CodeRabbit Inference Engine (.cursor/rules/atmos-rules.mdc)
Files:
🧠 Learnings (2)📓 Common learningsinternal/exec/terraform_plan_diff.go (16)Learnt from: aknysh Learnt from: osterman Learnt from: samtholiya Learnt from: aknysh Learnt from: haitham911 Learnt from: aknysh Learnt from: haitham911 Learnt from: aknysh Learnt from: haitham911 Learnt from: aknysh Learnt from: CR Learnt from: Cerebrovinny Learnt from: osterman Learnt from: osterman Learnt from: aknysh Learnt from: aknysh ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
🔇 Additional comments (2)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1382 +/- ##
==========================================
- Coverage 54.19% 54.01% -0.18%
==========================================
Files 259 259
Lines 27164 27167 +3
==========================================
- Hits 14721 14674 -47
- Misses 10736 10796 +60
+ Partials 1707 1697 -10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Please add tests, ideally with the original failure case that is validated by fixes in this PR |
https://github.com/cloudposse/atmos/blob/plan-diff/internal/exec/terraform_plan_diff_test.go#L391 I can not write test for pipe buffer overflow easily |
|
These changes were released in v1.184.0. |
What
Move the logic for reading from stdin (pipe input) into a separate goroutine.
Why
In practice, when Atmos reads large plan files in JSON format from stdin, the output can exceed the pipe buffer capacity. If the main thread does not consume this input concurrently, the buffer may become full, leading to a deadlock or the external command hanging.
By moving the read operation into a goroutine, we ensure that the pipe is drained concurrently, preventing buffer overflow and avoiding the process getting stuck.
Summary by CodeRabbit