-
Notifications
You must be signed in to change notification settings - Fork 122
HelpersTask622_gitleaks_doesnt_run_in_submodules_2 #664
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
base: master
Are you sure you want to change the base?
HelpersTask622_gitleaks_doesnt_run_in_submodules_2 #664
Conversation
Pre-commit checks: - 'check_master' passed - 'check_author' passed - 'check_file_size' passed - 'check_python_compile' passed - 'check_gitleaks' passed All checks passed ✅
Pre-commit checks: - 'check_master' passed - 'check_author' passed - 'check_file_size' passed - 'check_python_compile' passed - 'check_gitleaks' passed All checks passed ✅
Pre-commit checks: - 'check_master' passed - 'check_author' passed - 'check_file_size' passed - 'check_python_compile' passed - 'check_gitleaks' passed All checks passed ✅
Pre-commit checks: - 'check_master' passed - 'check_author' passed - 'check_file_size' passed - 'check_python_compile' passed - 'check_gitleaks' passed All checks passed ✅
…github.com:causify-ai/helpers into HelpersTask622_gitleaks_doesnt_run_in_submodules_2 Pre-commit checks: - 'check_master' passed - 'check_author' passed - 'check_file_size' passed - 'check_python_compile' passed - 'check_gitleaks' passed All checks passed ✅
git_root_dir = get_git_root_dir() | ||
# Find relative path from the git root to the helpers root. | ||
git_root_dir = hgit.find_git_root() | ||
helpers_root_dir = hgit.find_helpers_root() |
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.
- I realize we'll be copying a lot of code from hgit for these two functions
- Since Git hooks are now installed and run after our thin client is activated, should we consider using the helpers module?
- This script is already somewhat coupled to the helpers, especially with the introduction of the gitleaks config path in dev_script_XYZ dir
- To keep things decoupled, we can also just copy all the functions needed (although a lot of codes) as well
WDYT? @gpsaggese
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.
Agree. Let's just import helpers and embrace it that a piece of the infra checking on the code depends on the code itself.
In an ideal world the git hooks should be a prod container (like the linter), but it is too paranoid
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.
Pull Request Overview
This PR moves the gitleaks configuration from the .github directory into dev_scripts_helpers/git/gitleaks so that it can be referenced by both GitHub Actions and git hooks without relying on symlinks.
- Refactored the check_gitleaks function in utils.py to compute repository paths using the new hgit helpers.
- Updated the GitHub Actions workflow to point to the new gitleaks configuration file path.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
dev_scripts_helpers/git/git_hooks/utils.py | Removed get_git_root_dir and updated check_gitleaks to compute and use the new config path |
.github/workflows/gitleaks.yml | Updated GITLEAKS_CONFIG to reference the new location of the gitleaks configuration file |
Comments suppressed due to low confidence (1)
dev_scripts_helpers/git/git_hooks/utils.py:482
- [nitpick] Consider adding an inline comment to explain the rationale behind concatenating '/app' with the relative helpers root to form the config path, which would help future maintainers understand the docker mount configuration.
config_path = os.path.join("/app", rel_path, "dev_scripts_helpers/git/gitleaks")
Task #622
.github
todev_scripts_helpers/git/gitleaks
so it can be pointed to from both the GH actions and the git hooks without creating symlinks