Skip to content

Conversation

@gjrtimmer
Copy link
Contributor

Motivation

I was missing autocomplete during development, so I added it to make my life easier.

Description

This PR will update the .devcontainer/post-install.sh script to install bash autocomplete for the various development tools. This will make development easier, faster, and more convenient for the developers.

Bash autocomplete is already part of the golang:1.25 image.

Impact

None

Affected Tools

  • kind
  • kubebuilder
  • kubectl
  • docker

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 24, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: gjrtimmer
Once this PR has been reviewed and has the lgtm label, please assign camilamacedo86 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 24, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @gjrtimmer. Thanks for your PR.

I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds bash autocompletion support for development tools (kind, kubebuilder, kubectl, and docker) to improve developer experience in devcontainer environments.

Key Changes:

  • Added autocompletion setup scripts for kind, kubebuilder, kubectl, and docker after their respective installations
  • Implemented idempotent marker-based checks to prevent duplicate autocompletion entries

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
testdata/project-v4/.devcontainer/post-install.sh Added autocompletion configuration for all four tools in v4 project template
testdata/project-v4-with-plugins/.devcontainer/post-install.sh Added autocompletion configuration for all four tools in v4-with-plugins template
testdata/project-v4-multigroup/.devcontainer/post-install.sh Added autocompletion configuration for all four tools in v4-multigroup template
pkg/plugins/golang/v4/scaffolds/internal/templates/devcontainer.go Updated devcontainer template to generate autocompletion setup code
docs/book/src/multiversion-tutorial/testdata/project/.devcontainer/post-install.sh Added autocompletion configuration for multiversion tutorial
docs/book/src/getting-started/testdata/project/.devcontainer/post-install.sh Added autocompletion configuration for getting-started tutorial
docs/book/src/cronjob-tutorial/testdata/project/.devcontainer/post-install.sh Added autocompletion configuration for cronjob tutorial

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 27, 2025
#!/bin/bash
set -x

BASHRC_FILE="$HOME/.bashrc"
Copy link
Member

Choose a reason for hiding this comment

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

How we will know that?
Are all envs using bashrc?
I do not think so

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, they do, for the simple fact that this is part of the devcontainer post-install. And the devcontainer is set to bash.

Copy link
Member

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

Hi @gjrtimmer

Thank you a lot for your contribution 🥇
But we can only add to the default scaffold if we can ensure that the changes will work well in all environments.

In this case, I do not see how we could ensure and be able to know what the profile file for any env and so. I think that will be an issue to allow us to move forward within.

@gjrtimmer
Copy link
Contributor Author

gjrtimmer commented Oct 27, 2025

Hi @gjrtimmer

Thank you a lot for your contribution 🥇 But we can only add to the default scaffold if we can ensure that the changes will work well in all environments.

In this case, I do not see how we could ensure and be able to know what the profile file for any env and so. I think that will be an issue to allow us to move forward within.

Hi @camilamacedo86

This involves the post-install of the devcontainer. Any other environment used by a developer is not the responsibility of this repository. However, this repository provides a devcontainer. All these changes are within that devcontainer, which sets the default environment to bash.

Please clarify your line of reasoning regarding this change and how it applies to the devcontainer development environment, as the devcontainer environment is fixed to ensure an easy, consistent development environment for all developers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants