-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
[utils/common] Ask user permission to upload log on dpaste.com #176
Conversation
WalkthroughThe changes introduce a new function, Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (2)
utils/common.sh (2)
10-27
: Approve newask_optin()
function with a minor suggestion.The new
ask_optin()
function is a good addition, implementing user consent for log uploads, which enhances privacy and security. The logic is sound, ensuring valid user input.Consider adding a brief explanation of why the log upload might be necessary, to help users make an informed decision. For example:
function ask_optin() { while true; do + echo "Uploading the log can help us diagnose and fix issues with your installation." read -rp "Upload the log on https://dpaste.com website? (yes/no) " yn case $yn in
Line range hint
496-507
: Approve changes toapt_ensure()
function with a minor suggestion.The modifications to the
apt_ensure()
function improve code formatting and array handling. The use of${ARGS[@]}
in the for-loop is the correct way to iterate over all arguments passed to the function.For improved clarity, consider adding a comment explaining the conversion of arguments to an array:
function apt_ensure() { # Note the $@ is not actually an array, but we can convert it to one # https://linuxize.com/post/bash-functions/#passing-arguments-to-bash-functions ARGS=("$@") + # Now ARGS is a proper array containing all function arguments MISS_PKGS=() HIT_PKGS=()
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- utils/common.sh (3 hunks)
🧰 Additional context used
🔇 Additional comments (2)
utils/common.sh (2)
33-34
: Approve changes toon_error()
function.The modifications to the
on_error()
function improve error message readability and integrate the new user consent mechanism appropriately. This ensures that logs are only uploaded with user permission, enhancing privacy and user control.
Line range hint
1-527
: Overall assessment: Changes improve user privacy and code quality.The modifications to
utils/common.sh
are well-implemented and enhance the script's functionality. The newask_optin()
function adds an important user consent mechanism for log uploads, improving privacy. The changes to existing functions (on_error()
andapt_ensure()
) improve error handling and code consistency.Minor suggestions have been made to further enhance clarity and user experience, but overall, these changes are a positive improvement to the script.
Based on #172 (comment)
Summary by CodeRabbit
New Features
Bug Fixes
Style