-
Notifications
You must be signed in to change notification settings - Fork 136
[testing] Add aliases and autocomplete #1803
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
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 📝 WalkthroughWalkthroughA Dockerfile for the e2e-sandbox testing image was modified to install bash-completion and append kubectl bash completion sourcing, an alias Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (1)
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. Comment |
Summary of ChangesHello @lllamnyp, 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 enhances the debugging experience for maintainers by adding a 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 adds a kubectl alias and bash completion to the e2e-testing sandbox container, which is a helpful improvement for developers debugging in the container. The change is functionally correct. I've provided one suggestion to simplify the Dockerfile syntax, making it more idiomatic and easier to read. As a side note for future improvements, you might consider combining some of the RUN instructions in the Dockerfile to reduce the number of image layers, which is a common Docker best practice.
| RUN <<'EOF' | ||
| cat <<'EOT' >> /etc/bash.bashrc | ||
| . <(kubectl completion bash) | ||
| alias k=kubectl | ||
| complete -F __start_kubectl k | ||
| EOT | ||
| EOF |
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 nested heredoc (RUN <<'EOF' containing cat <<'EOT') is unnecessarily complex. You can achieve the same result more simply and readably by using a single RUN instruction with a single heredoc. This is a more common and idiomatic way to append multi-line text to a file in a shell script or Dockerfile.
RUN cat >> /etc/bash.bashrc <<'EOF'
# kubectl alias and completion
. <(kubectl completion bash)
alias k=kubectl
complete -F __start_kubectl k
EOF
## What this PR does Adds a `k=kubectl` alias and bash completion for kubectl to the e2e-testing sandbox container to maintainers have an easier time exec'ing into the CI container when something needs to be debugged. ### Release note ```release-note [testing] Add k=kubectl alias and enable kubectl completion in the CI container. ``` Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
66e4dae to
bf1928c
Compare
| cat <<'EOT' >> /etc/bash.bashrc | ||
| . /etc/bash_completion | ||
| . <(kubectl completion bash) | ||
| alias k=kubectl |
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.
Oh god, thank you!
| RUN <<'EOF' | ||
| cat <<'EOT' >> /etc/bash.bashrc | ||
| . /etc/bash_completion | ||
| . <(kubectl completion bash) | ||
| alias k=kubectl | ||
| complete -F __start_kubectl k | ||
| EOT | ||
| EOF |
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.
| RUN <<'EOF' | |
| cat <<'EOT' >> /etc/bash.bashrc | |
| . /etc/bash_completion | |
| . <(kubectl completion bash) | |
| alias k=kubectl | |
| complete -F __start_kubectl k | |
| EOT | |
| EOF | |
| RUN printf '%s\n' \ | |
| '. /etc/bash_completion' \ | |
| '. <(kubectl completion bash)' \ | |
| 'alias k=kubectl' \ | |
| 'complete -F __start_kubectl k' \ | |
| >> /etc/bash.bashrc |
|
Successfully created backport PR for |
# Description Backport of #1803 to `release-0.39`.
## What this PR does Adds a `k=kubectl` alias and bash completion for kubectl to the e2e-testing sandbox container to maintainers have an easier time exec'ing into the CI container when something needs to be debugged. ### Release note ```release-note [testing] Add k=kubectl alias and enable kubectl completion in the CI container. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Enhanced the e2e sandbox image to enable shell bash-completion and kubectl command completion. * Added an alias (k) and completion wiring for kubectl to improve interactive command use. * These changes augment the test environment shell during image build to provide a smoother developer/testing experience. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What this PR does Adds a `k=kubectl` alias and bash completion for kubectl to the e2e-testing sandbox container to maintainers have an easier time exec'ing into the CI container when something needs to be debugged. ### Release note ```release-note [testing] Add k=kubectl alias and enable kubectl completion in the CI container. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Enhanced the e2e sandbox image to enable shell bash-completion and kubectl command completion. * Added an alias (k) and completion wiring for kubectl to improve interactive command use. * These changes augment the test environment shell during image build to provide a smoother developer/testing experience. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What this PR does Adds a `k=kubectl` alias and bash completion for kubectl to the e2e-testing sandbox container to maintainers have an easier time exec'ing into the CI container when something needs to be debugged. ### Release note ```release-note [testing] Add k=kubectl alias and enable kubectl completion in the CI container. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Enhanced the e2e sandbox image to enable shell bash-completion and kubectl command completion. * Added an alias (k) and completion wiring for kubectl to improve interactive command use. * These changes augment the test environment shell during image build to provide a smoother developer/testing experience. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
What this PR does
Adds a
k=kubectlalias and bash completion for kubectl to the e2e-testing sandbox container to maintainers have an easier time exec'ing into the CI container when something needs to be debugged.Release note
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.