-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: STFT-57 - Prompt for update on linter version mismatch #3
Conversation
Also updates the update command to re-generate the config so it matches expectations.
Also corrects 2 bugs: - Incorrectly processing case with missing/added linter and version mismatch at same time - Moved config validation after upgrade check
…b.com/slalombuild/secureli into feature/STFT-057-prompt-linter-update
Great catch, that is absolutely a bug. Let me get that squared away! |
If someone manually updates the value in the pre-commit config yaml and then tries to push that update, should this feature block that commit? |
No, this doesn't block any commits containing a modified |
Not sure if something changed, but now whenever I run a |
@centenor - Are you still having issues with it detecting changes now? |
I spoke with Raul offline and he confirmed the error was the result of using the wrong venv to test and that the application is working as expected. |
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.
Currently this part of the AC is not being met: "Linter versions can be upgraded OR downgraded."
An acceptance of the update prompt is reverting back to the base version prior to running the scan.
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.
Looks good
This PR implements a check during a scan which determines if the current configuration is out of date with the configuration SeCureLI expects.
This check will determine there is a mismatch if you modify the
.secureli.yaml
file, or if the.pre-commit-config.yaml
file is modified directly.If it detects a mismatch, the user will be prompted to update to the expected configuration. If they decline, then the scan will be aborted.
If the mismatch is caused by a linter being added or removed, then SeCureLI will inform the user and indicate which linters were removed, or added unexpectedly.
If the mismatch is caused by a linter version being different, then secureli will notify the user which linter and will indicate which version it expected to find and what version it actually found.
Testing this PR should be fairly straight forward, any change to the
.pre-commit-config.yaml
file in the root directory will trigger the update request. You can change linter versions, remove linters, or any combination that you like and you should see the prompt to update when you attempt to perform a scan.Note: There are a bunch of pycache files that are deleted as part of this PR. When this repo was migrated from BitBucket, the .gitignore file was not included, so the cache files were committed. These files should have been ignored, so I removed them while I was working on this PR.