SK-3014-gitleaks-detection-fix-added-script-to-fix-generated-files - #282
Open
skyflow-himanshupal wants to merge 4 commits into
Conversation
skyflow-himanshupal
requested review from
saileshwar-skyflow,
skyflow-bharti and
yaswanth-pula-skyflow
September 21, 2026 07:34
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Unresolved moderate issues affect redaction correctness, staging safety, and secret-scan enforcement.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Open (2)
What changed in this PR
Adds automated gitleaks redaction for generated Python files and an opt-in pre-commit guard.
Changes:
- Adds secret detection, redaction, validation, and rescanning.
- Adds Git hook installation and staged scanning.
- Replaces generated JWT examples with placeholders.
| File | Summary |
|---|---|
scripts/patch_generated_secrets.py |
Implements redaction and verification; duplicate spans, subprocess failures, and missing test coverage remain. |
scripts/install_git_hooks.sh |
Configures repository-local Git hooks. |
common/generated/rest/authentication/client.py |
Replaces generated JWT examples with placeholders. |
.githooks/pre-commit |
Runs redaction and staged scans; contains invalid path staging, unintended staging side effects, and an unenforced CI fallback. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| # in practice: these directories are machine-owned (Fern-generated, never | ||
| # hand edited), so there's no legitimate "leave part of it unstaged" case to | ||
| # worry about disturbing. | ||
| git add -- "${GENERATED_DIRS[@]}" |
| # span, it must only be redacted once. Applied back-to-front | ||
| # (highest offset first) so replacing a later span never shifts | ||
| # the offsets of an earlier one still waiting to be processed. | ||
| unique_spans_by_file[file_path] = sorted(set(spans), reverse=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

No description provided.