-
Notifications
You must be signed in to change notification settings - Fork 881
[Jobs] Show jobs names in the confirmation message for sky jobs cancel #8387
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?
[Jobs] Show jobs names in the confirmation message for sky jobs cancel #8387
Conversation
Summary of ChangesHello @zancheema, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a user experience improvement for the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request enhances the sky jobs cancel command by displaying job names in the confirmation message, which is a great UX improvement. The implementation correctly fetches job names for the provided IDs. I've suggested a minor refinement to also handle cases where some job IDs might be invalid, ensuring the confirmation prompt is as accurate as possible for the user.
| names = [ | ||
| f'{r.get("job_name")!r} [{r.get("job_id")}]' | ||
| for r in job_records | ||
| ] | ||
| if names: | ||
| jobs_str = ', '.join(map(str, names)) | ||
| else: | ||
| jobs_str = ', '.join(map(str, jobs)) |
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.
The current implementation for fetching job names doesn't handle cases where some provided job IDs are valid and others are not. If a user provides a mix of valid and invalid job IDs, only the names of the valid jobs are shown, and the invalid ones are silently ignored. This could be misleading. For example, if a user enters sky jobs cancel 13 999 and 999 is an invalid ID, the confirmation will only mention job 13. It would be better to display the names for found jobs and the IDs for those not found, so the user gets a complete picture of what they are attempting to cancel.
| names = [ | |
| f'{r.get("job_name")!r} [{r.get("job_id")}]' | |
| for r in job_records | |
| ] | |
| if names: | |
| jobs_str = ', '.join(map(str, names)) | |
| else: | |
| jobs_str = ', '.join(map(str, jobs)) | |
| job_id_to_name = {r.get('job_id'): r.get('job_name') for r in job_records} | |
| display_parts = [] | |
| for job_id in jobs: | |
| job_name = job_id_to_name.get(job_id) | |
| if job_name is not None: | |
| display_parts.append(f'{job_name!r} [{job_id}]') | |
| else: | |
| display_parts.append(str(job_id)) | |
| jobs_str = ', '.join(display_parts) |
|
Thanks for working on this issue @zancheema! Is it possible we update the output to: |
Closes #8336
Cancelling jobs by ID's will show job names along with each ID in confirmation message. This will let user know if they are cancelling the correct job(s).
Example
Given Command:
sky jobs cancel 13 15Confirmation Message:
Cancelling 'Train Model o2' [13], 'Deploy Model o1' [15]. Proceed?Tested (run the relevant ones):
bash format.sh/smoke-test(CI) orpytest tests/test_smoke.py(local)/smoke-test -k test_name(CI) orpytest tests/test_smoke.py::test_name(local)/quicktest-core(CI) orpytest tests/smoke_tests/test_backward_compat.py(local)@Michaelvll Please review when you find time.
Thanks