Skip to content
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

[common-utils] - append shell history functionality - #1026 #1157

Open
wants to merge 36 commits into
base: main
Choose a base branch
from

Conversation

gauravsaini04
Copy link
Contributor

Ref: #1026

Feature

  • Common-Utils

Description

changelog

  • Have added changes to devcontainer-feature.json file, added boolean option allowShellHistory and mounts as a configurable option
  • Have added changes to main.sh in common-utils features src
  • Have added to scenarios to test this new feature
  • Have added test cases in allow_shell_history.sh file

Checklist

  • checked that applied changes work as expected

Copy link
Contributor

@eitsupi eitsupi left a comment

Choose a reason for hiding this comment

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

Some questions:

@gauravsaini04 gauravsaini04 marked this pull request as ready for review October 28, 2024 22:26
@gauravsaini04 gauravsaini04 requested a review from a team as a code owner October 28, 2024 22:26
src/common-utils/devcontainer-feature.json Outdated Show resolved Hide resolved
src/common-utils/main.sh Outdated Show resolved Hide resolved
Copy link
Contributor

@eitsupi eitsupi left a comment

Choose a reason for hiding this comment

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

Why add this functionality to common-utils instead of relying on another Feature?
Wouldn't common-utils be too heavy a dependency for users who only want to use history?

And I am also convinced that the lifecycle script approach is far superior when implementing such a functionality.
Please check stuartleeks/dev-container-features#16

@gauravsaini04 gauravsaini04 marked this pull request as draft November 3, 2024 00:31
@gauravsaini04
Copy link
Contributor Author

And I am also convinced that the lifecycle script approach is far superior when implementing such a functionality.

Thanks for valuable inputs @eitsupi, waiting for the logic to be approved by @chrmarti, will be converting to a lifecycle script after this

src/common-utils/main.sh Outdated Show resolved Hide resolved
src/common-utils/main.sh Outdated Show resolved Hide resolved
src/common-utils/main.sh Outdated Show resolved Hide resolved
@chrmarti
Copy link

chrmarti commented Nov 4, 2024

Why add this functionality to common-utils instead of relying on another Feature? Wouldn't common-utils be too heavy a dependency for users who only want to use history?

I agree, I'm also not sure if adding a devcontainers volume for all users of our base images will be ideal. Though having persistence for shell history built-in would be a great feature.

And I am also convinced that the lifecycle script approach is far superior when implementing such a functionality. Please check stuartleeks/dev-container-features#16

This seems to require password-less sudo access. The feature would not work without that.

@eitsupi
Copy link
Contributor

eitsupi commented Nov 6, 2024

This seems to require password-less sudo access. The feature would not work without that.

Isn't that irrelevant whether or not lifecycle scripts are used? We don't know the permissions of a mounted volume until it is mounted, do we?

@Kaniska244
Copy link

Kaniska244 commented Dec 10, 2024

Hi @chrmarti ,

Further changes done to implement a new test case for bash history retention logic. Would you kindly review the changes & provide comments on the same.

With Regards,
Kaniska Sengupta

@gauravsaini04 gauravsaini04 marked this pull request as ready for review December 13, 2024 08:08
@chrmarti
Copy link

One issue with the change is that it unconditionally adds mount points independent of whether preserving the shell history is enabled or not. Given that the common-utils are in all our base images, this would affect a lot of dev containers. Possible approaches to avoid this are:

  • Add support for conditional mount points for features in the spec and CLI.
  • Move the functionality to a separate feature. Users will have to add it explicitly.
  • Make support for preserving the shell history part of the CLI. (This could allow us to reuse the vscode volume because the Dev Containers extension could tell the CLI to use that. It might also allow us to enable it by default with a setting in the Dev Containers extension.)

I suggest we put this on hold for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants