Add Security and IP related contributing guide and configure coderabbit to catch such issues#935
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdded repository-level security checks and knowledge-base entries, expanded and consolidated security and contributor documentation, updated PR template formatting, adjusted example README installation instructions, and changed several example dependency requirements and setup.py extras. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
2a84d7b to
08d35a7
Compare
There was a problem hiding this comment.
Pull request overview
This PR enhances security documentation and practices in the Model Optimizer repository by consolidating security guidance, adding IP policy instructions, updating the PR template with security checklists, and configuring CodeRabbit for automated security reviews. The changes also clean up dependency management by centralizing common dependencies in setup.py's optional dependency groups.
Changes:
- Consolidated security documentation from
docs/source/reference/2_security.rstintoSECURITY.mdwith expanded security coding practices for contributors - Updated
CONTRIBUTING.mdwith instructions for copying code from other sources, including license header format and IP policy compliance - Enhanced PR template with security best practices checklist and IP policy acknowledgment
- Configured CodeRabbit YAML for automated incremental reviews with security anti-pattern detection
- Cleaned up dependency files by moving common dependencies (sentencepiece, peft, etc.) from individual example requirements.txt to setup.py's optional dependency groups
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| setup.py | Moved sentencepiece from dev-test to hf optional dependencies with version constraint and clarifying comment |
| examples/windows/accuracy_benchmark/perplexity_metrics/requirements.txt | Updated sentencepiece, torch, and transformers version constraints to match setup.py |
| examples/onnx_ptq/requirements.txt | Added version constraint to sentencepiece |
| examples/llm_sparsity/weight_sparsity/requirements.txt | Removed sentencepiece (now in hf optional deps) |
| examples/llm_sparsity/weight_sparsity/README.md | Added installation prerequisites section |
| examples/llm_qat/requirements.txt | Removed peft and sentencepiece (now in hf optional deps) |
| examples/gpt-oss/requirements.txt | Removed common dependencies covered by hf optional deps |
| examples/gpt-oss/README.md | Added installation command for hf optional dependencies |
| examples/diffusers/requirements.txt | Removed sentencepiece |
| docs/source/reference/2_security.rst | Removed (content migrated to SECURITY.md) |
| SECURITY.md | Consolidated and expanded security documentation with detailed coding practices section |
| CONTRIBUTING.md | Reorganized with security practices and IP policy sections, added guidance on copying code |
| .github/PULL_REQUEST_TEMPLATE.md | Updated with security checklist and IP policy acknowledgment |
| .coderabbit.yaml | Enabled incremental reviews, added security anti-pattern checks, and configured knowledge base |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1523a74 to
865394d
Compare
… review Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
865394d to
ff70cc7
Compare
What does this PR do?
SECURITY.mdand merge with2_security.rstCONTRIBUTING.mdfor instructions to follow if copying code from other repositoriesmto.load_modelopt_statedoing the insecuretorch.load(f, weights_only=False)instead of doing it separately everywhere. This also allows us to later improve the input validation formodelopt_state_pathor use safer alternatives totorch.loadTesting
N/A
Before your PR is "Ready for review"
Make sure you read and follow Contributor guidelines and your commits are signed (
git commit -s -S).Make sure you read and follow the Security Best Practices (e.g. hardcoded
trust_remote_code=True,torch.load(..., weights_only=True),pickle, etc.).Summary by CodeRabbit
Documentation
Chores