Skip to content

Add pre-commit config for repo hygiene and secret detection - #30

Open
Harshaada wants to merge 3 commits into
redhat-data-and-ai:mainfrom
Harshaada:hgaikwad-fivetran-operator
Open

Harshaada wants to merge 3 commits into
redhat-data-and-ai:mainfrom
Harshaada:hgaikwad-fivetran-operator

Conversation

@Harshaada

Copy link
Copy Markdown

Updated .pre-commit-config.yaml with gitleaks for secret detection.
Updated CONTRIBUTING.md with steps to install and enable pre-commit locally.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: a7c96afc-1802-4ee3-af51-b740a1f70139

📝 Summary

Summary by CodeRabbit

  • Documentation

    • Added setup guidance for pre-commit checks.
    • Documented available secret-scanning protections, including GitHub Secret Scanning and Push Protection.
  • Chores

    • Expanded repository safeguards to detect private keys and scan for exposed secrets.
    • Added repository-wide exclusions while retaining existing secret checks.

Walkthrough

The pull request expands pre-commit configuration with private-key detection and Gitleaks scanning. It excludes vendor/, retains check-secrets, and adds README instructions for installation and repository secret-scanning protections.

Changes

Secret Scanning Setup

Layer / File(s) Summary
Pre-commit scanning configuration
.pre-commit-config.yaml
The configuration adds repository exclusions, installation guidance, private-key detection, pinned Gitleaks scanning, and grouped project checks.
Developer setup documentation
README.md
The README documents pre-commit installation and secret-scanning protections.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the pre-commit and secret-detection changes.
Description check ✅ Passed The description accurately covers the pre-commit and Gitleaks changes and is related to the documentation update.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.pre-commit-config.yaml:
- Around line 4-5: Update the pre-commit usage comments to accurately describe
the coverage of `pre-commit run --all-files`, noting that
`scripts/check-secrets.sh` scans only staged added, copied, or modified files
because filename passing is disabled. Either document this as staged-only
coverage or add and document a separate full-tree scan mode.
- Around line 28-30: Update scripts/check-secrets.sh, specifically the output
for matches triggered by the check-secrets hook, so it never prints full
matching lines containing secrets. Report only the detection rule, file path,
and line number, or replace the matched secret with a redacted value while
preserving the existing five-match limit and detection behavior.
- Around line 11-23: Configure Gitleaks explicitly for the vendor/ path by
adding a global vendor/ allowlist in .gitleaks.toml, or remove vendor/ from the
pre-commit exclude if it is not trusted generated content; update the gitleaks
hook configuration without changing the detect-private-key hook.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a878ef22-e975-44e2-a8fb-64c63b51cf9d

📥 Commits

Reviewing files that changed from the base of the PR and between 1dcab4b and 4676816.

📒 Files selected for processing (2)
  • .pre-commit-config.yaml
  • README.md

Comment thread .pre-commit-config.yaml
Comment thread .pre-commit-config.yaml
Comment thread .pre-commit-config.yaml
Signed-off-by: Harrshada <hgaikwad@redhat.com>
Harshaada pushed a commit to Harshaada/fivetran-operator that referenced this pull request Sep 17, 2026
Integrate latest main (leader election timeout changes) into
hgaikwad-fivetran-operator for PR redhat-data-and-ai#30.

Signed-off-by: Harrshada <hgaikwad@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@Harshaada
Harshaada force-pushed the hgaikwad-fivetran-operator branch from 4676816 to 0002e56 Compare September 17, 2026 07:55
Integrate latest main (leader election timeout changes) into
hgaikwad-fivetran-operator for PR redhat-data-and-ai#30.
Signed-off-by: Harrshada <hgaikwad@redhat.com>
@Harshaada
Harshaada force-pushed the hgaikwad-fivetran-operator branch from 0002e56 to f9628f0 Compare September 17, 2026 07:58
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.

1 participant