Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 124 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
## πŸ“‹ Pull Request Description

### Summary
Provide a brief description of the changes in this PR.

### 🎯 Type of Change
- [ ] πŸ› Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] πŸ’₯ Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] πŸ“š Documentation update
- [ ] πŸ”§ Refactoring (no functional changes)
- [ ] ⚑ Performance improvement
- [ ] πŸ§ͺ Test improvements

### πŸ”— Related Issues
Closes #(issue number)
Fixes #(issue number)
Relates to #(issue number)

### πŸš€ What's Changed
Describe the changes made in detail:

- Change 1
- Change 2
- Change 3

### πŸ§ͺ Testing

#### Test Coverage
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] All existing tests pass
- [ ] New tests cover edge cases

#### Manual Testing
Describe manual testing performed:
- [ ] Tested on local environment
- [ ] Tested with real API endpoints (if applicable)
- [ ] Tested error scenarios
- [ ] Verified backward compatibility

### πŸ“Έ Screenshots (if applicable)
Add screenshots to help explain your changes.

### πŸ”§ Configuration Changes
List any new environment variables, configuration options, or setup requirements:

```yaml
# Example configuration changes
NEW_ENV_VAR: "description of what this does"
```

### πŸ“š Documentation Updates
- [ ] README.md updated
- [ ] CHANGELOG.md updated
- [ ] Code comments and docstrings added/updated
- [ ] API documentation updated

### πŸ›‘οΈ Security Considerations
- [ ] No sensitive data exposed
- [ ] Input validation implemented
- [ ] Authentication/authorization handled properly
- [ ] Security scan passed

### ⚑ Performance Impact
- [ ] No performance degradation
- [ ] Performance improved
- [ ] Added performance monitoring
- [ ] Load tested (if applicable)

### πŸ”„ Migration Required
If this is a breaking change, describe the migration path:

```python
# Before
old_function_call()

# After
new_function_call()
```

### βœ… Pre-submission Checklist
- [ ] Code follows project style guidelines
- [ ] Self-review completed
- [ ] Code is well-commented
- [ ] Changes generate no new warnings
- [ ] Tests are added that prove the fix is effective or feature works
- [ ] New and existing unit tests pass locally
- [ ] Any dependent changes have been merged and published

### πŸ” Code Quality
- [ ] Code follows PEP 8 standards
- [ ] Type hints added where appropriate
- [ ] Error handling implemented
- [ ] Logging added for debugging
- [ ] No code duplication

### 🎯 Reviewer Notes
Add any specific areas you'd like reviewers to focus on:

- Focus on the error handling in `file.py`
- Check the performance of the new algorithm
- Verify the API integration works correctly

### πŸ“‹ Deployment Notes
Any special considerations for deployment:

- [ ] No deployment considerations
- [ ] Requires environment variable updates
- [ ] Requires database migrations
- [ ] Requires infrastructure changes

---

### πŸ“ Additional Notes
Add any other context or information that reviewers should know.

---

**By submitting this PR, I confirm that:**
- [ ] I have read and agree to the project's contributing guidelines
- [ ] This contribution is my own original work
- [ ] I have the right to submit this work under the project's license
- [ ] I understand this will be publicly available and may be redistributed
108 changes: 108 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Continuous Integration

on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, 3.10, 3.11]

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r common/requirements.txt
pip install -r tests/requirements.txt

- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

- name: Test with pytest
run: |
python -m pytest tests/ -v --cov=common --cov-report=xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella

security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install bandit safety

- name: Run Bandit security scan
run: bandit -r . -f json -o bandit-report.json || true

- name: Run Safety check
run: safety check --json --output safety-report.json || true

- name: Upload security reports
uses: actions/upload-artifact@v3
with:
name: security-reports
path: |
bandit-report.json
safety-report.json

code-quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black isort mypy

- name: Check code formatting with Black
run: black --check --diff .

- name: Check import sorting with isort
run: isort --check-only --diff .

- name: Type check with mypy
run: mypy common/ --ignore-missing-imports || true
74 changes: 74 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# Virtual environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# IDE
.vscode/
.idea/
*.swp
*.swo
*~

# Logs
*.log
logs/

# Environment variables
.env.local
.env.production
.env.development

# Jupyter Notebook
.ipynb_checkpoints

# OS
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# Treasure Data
*.td

# Temporary files
tmp/
temp/
*.tmp

# Sensitive data
secrets/
credentials/
api_keys/
Loading