Skip to content

Conversation

@lllamnyp
Copy link
Member

@lllamnyp lllamnyp commented Jan 5, 2026

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

[testing] Add k=kubectl alias and enable kubectl completion in the CI
container.

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.

✏️ Tip: You can customize this high-level summary in your review settings.

@lllamnyp lllamnyp requested review from kvaps and nbykov0 as code owners January 5, 2026 13:02
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jan 5, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 5, 2026

Note

Other AI code review bot(s) detected

CodeRabbit 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.

📝 Walkthrough

Walkthrough

A Dockerfile for the e2e-sandbox testing image was modified to install bash-completion and append kubectl bash completion sourcing, an alias k for kubectl, and a kubectl completion hookup into /etc/bash.bashrc during image build.

Changes

Cohort / File(s) Summary
Docker build configuration
packages/core/testing/images/e2e-sandbox/Dockerfile
Added bash-completion to apt installs and a RUN block that appends sourcing of /etc/bash_completion, enables kubectl bash completion, defines alias kkubectl, and registers completion via __start_kubectl in /etc/bash.bashrc

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 In sandbox builds I hop and hum,
I source the shells so tabbing's fun,
I tuck k beneath a completion wing,
A tiny helper for each spring,
Type less, leap more — hooray, yum! 🥕

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title '[testing] Add aliases and autocomplete' directly reflects the main changes: adding a kubectl alias and enabling bash completion in the testing sandbox.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 66e4dae and bf1928c.

📒 Files selected for processing (4)
  • packages/core/testing/Chart.yaml
  • packages/core/testing/Makefile
  • packages/core/testing/images/e2e-sandbox/Dockerfile
  • packages/core/testing/values.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/core/testing/images/e2e-sandbox/Dockerfile

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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 k=kubectl alias and enabling bash completion for kubectl within the e2e-testing sandbox container. These changes aim to simplify command execution and improve efficiency when interacting with Kubernetes clusters inside the CI environment.

Highlights

  • Kubectl Alias: Introduced a k=kubectl alias within the e2e-testing sandbox container, allowing maintainers to use a shorter command for kubectl.
  • Bash Completion for Kubectl: Enabled bash completion for kubectl and its new k alias in the e2e-testing sandbox container, streamlining command input and reducing errors during debugging.

🧠 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@dosubot dosubot bot added the enhancement New feature or request label Jan 5, 2026
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

Comment on lines 24 to 31
RUN <<'EOF'
cat <<'EOT' >> /etc/bash.bashrc
. <(kubectl completion bash)
alias k=kubectl
complete -F __start_kubectl k
EOT
EOF
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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>
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Jan 5, 2026
cat <<'EOT' >> /etc/bash.bashrc
. /etc/bash_completion
. <(kubectl completion bash)
alias k=kubectl
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh god, thank you!

Comment on lines +24 to +31
RUN <<'EOF'
cat <<'EOT' >> /etc/bash.bashrc
. /etc/bash_completion
. <(kubectl completion bash)
alias k=kubectl
complete -F __start_kubectl k
EOT
EOF
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 5, 2026
@lllamnyp lllamnyp added the backport Should change be backported on previus release label Jan 5, 2026
@lllamnyp lllamnyp merged commit 43df3a1 into main Jan 5, 2026
27 checks passed
@lllamnyp lllamnyp deleted the dx/bashrc-testing branch January 5, 2026 18:48
@github-actions
Copy link

github-actions bot commented Jan 5, 2026

Successfully created backport PR for release-0.39:

kvaps added a commit that referenced this pull request Jan 5, 2026
kvaps pushed a commit that referenced this pull request Jan 8, 2026
## 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 -->
kvaps pushed a commit that referenced this pull request Jan 8, 2026
## 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 -->
kvaps pushed a commit that referenced this pull request Jan 9, 2026
## 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 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Should change be backported on previus release enhancement New feature or request lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants