-
Notifications
You must be signed in to change notification settings - Fork 0
🎨 Palette: Improve CLI prompts and error messages #97
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: main
Are you sure you want to change the base?
🎨 Palette: Improve CLI prompts and error messages #97
Conversation
- Add helper tips for locating Profile ID and API Token in Control D dashboard - Add "(input hidden)" indicator to password prompt - Make error messages friendlier and more descriptive - Follows Palette micro-UX guidelines
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Merging to
|
| if not args.dry_run and sys.stdin.isatty(): | ||
| if not profile_ids: | ||
| print(f"{Colors.CYAN}ℹ Profile ID is missing.{Colors.ENDC}") | ||
| print(f"{Colors.BLUE} (Tip: You can find this in your Control D dashboard URL: /profiles/<profile_id>){Colors.ENDC}") |
Check warning
Code scanning / Pylint (reported by Codacy)
Line too long (130/100) Warning
|
|
||
| if not TOKEN: | ||
| print(f"{Colors.CYAN}ℹ API Token is missing.{Colors.ENDC}") | ||
| print(f"{Colors.BLUE} (Tip: Generate this in Account > My Account > API Tokens){Colors.ENDC}") |
Check warning
Code scanning / Pylint (reported by Codacy)
Line too long (107/100) Warning
| print(f"{Colors.BLUE} (Tip: Generate this in Account > My Account > API Tokens){Colors.ENDC}") | ||
| import getpass | ||
| t_input = getpass.getpass(f"{Colors.BOLD}Enter Control D API Token:{Colors.ENDC} ").strip() | ||
| t_input = getpass.getpass(f"{Colors.BOLD}Enter Control D API Token (input hidden):{Colors.ENDC} ").strip() |
Check warning
Code scanning / Pylint (reported by Codacy)
Line too long (118/100) Warning
|
|
||
| if not profile_ids and not args.dry_run: | ||
| log.error("PROFILE missing and --dry-run not set. Provide --profiles or set PROFILE env.") | ||
| log.error("Profile ID is missing. Please provide it via --profiles argument or PROFILE environment variable.") |
Check warning
Code scanning / Pylint (reported by Codacy)
Line too long (118/100) Warning
|
|
||
| if not TOKEN and not args.dry_run: | ||
| log.error("TOKEN missing and --dry-run not set. Set TOKEN env for live sync.") | ||
| log.error("API Token is missing. Please provide it via TOKEN environment variable for live sync.") |
Check warning
Code scanning / Pylint (reported by Codacy)
Line too long (106/100) Warning
| if not args.dry_run and sys.stdin.isatty(): | ||
| if not profile_ids: | ||
| print(f"{Colors.CYAN}ℹ Profile ID is missing.{Colors.ENDC}") | ||
| print(f"{Colors.BLUE} (Tip: You can find this in your Control D dashboard URL: /profiles/<profile_id>){Colors.ENDC}") |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Line too long (130/100) Warning
|
|
||
| if not TOKEN: | ||
| print(f"{Colors.CYAN}ℹ API Token is missing.{Colors.ENDC}") | ||
| print(f"{Colors.BLUE} (Tip: Generate this in Account > My Account > API Tokens){Colors.ENDC}") |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Line too long (107/100) Warning
| print(f"{Colors.BLUE} (Tip: Generate this in Account > My Account > API Tokens){Colors.ENDC}") | ||
| import getpass | ||
| t_input = getpass.getpass(f"{Colors.BOLD}Enter Control D API Token:{Colors.ENDC} ").strip() | ||
| t_input = getpass.getpass(f"{Colors.BOLD}Enter Control D API Token (input hidden):{Colors.ENDC} ").strip() |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Line too long (118/100) Warning
|
|
||
| if not profile_ids and not args.dry_run: | ||
| log.error("PROFILE missing and --dry-run not set. Provide --profiles or set PROFILE env.") | ||
| log.error("Profile ID is missing. Please provide it via --profiles argument or PROFILE environment variable.") |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Line too long (118/100) Warning
|
|
||
| if not TOKEN and not args.dry_run: | ||
| log.error("TOKEN missing and --dry-run not set. Set TOKEN env for live sync.") | ||
| log.error("API Token is missing. Please provide it via TOKEN environment variable for live sync.") |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Line too long (106/100) Warning
Improved the CLI user experience by adding helpful context to interactive prompts. Users are now guided on where to find their Profile ID and API Token. Also improved error messages to be less robotic.
PR created automatically by Jules for task 13091619152671985567 started by @abhimehro