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

Prompt user to install new hooks for new languages detected on commit #493

Open
JordoHeffernan opened this issue Mar 22, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@JordoHeffernan
Copy link
Contributor

JordoHeffernan commented Mar 22, 2024

As a SeCurLI user, I want to easily add new languages to my repository
 
So that when I have an existing repo with secureli installed, and I add a new language to the repo (ie add a .js file for the first time) we currently abort their commit until they run secureli init again. A prompt comes up in the CLI but I don't wait for input.

AC

-              When I commit a new language, I am prompted to install new hooks and wait for their response
-              If I input "n" I continue the commit with existing hooks
-              If I input "y" SeCurLI install the new hooks, and then continues the pre-commit process with all installed hooks

@blonienc blonienc added the bug Something isn't working label Mar 22, 2024
@isaac-heist-slalom isaac-heist-slalom self-assigned this Mar 26, 2024
@isaac-heist-slalom
Copy link
Contributor

@blonienc
I don't think that we can fix this issue as described in the AC's. The reason the commit is aborted is because the pre-commit triggers code that requests user input. From my research, git hooks don't allow user input since they are supposed to be completely automated. There are some possible workarounds, but this would involve changing the way git hooks operate, which I don't think we want to do. The pre-commit hook triggers the following securely command secureli scan --publish-results=always. If this command is run via the cmd line, it works as described in the AC's already, but aborts if run via pre-commit.

One possible solution is to not ask the "add new language question" during the commit. This could be done by passing a flag in with the pre-commit, such as "is-commit=true"

@isaac-heist-slalom isaac-heist-slalom removed their assignment Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Discussion Required
Development

No branches or pull requests

3 participants