Skip to content
Closed
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
28 changes: 28 additions & 0 deletions .github/workflows/validate-pr-to-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Validate PR to Main

on:
pull_request:
branches: [main]
types: [opened, synchronize, reopened]

jobs:
validate-source-branch:
name: Validate Source Branch
runs-on: ubuntu-latest

steps:
- name: Check if source branch is allowed
run: |
SOURCE_BRANCH="${{ github.head_ref }}"
echo "PR source branch: $SOURCE_BRANCH"

# Only allow branches with 'release' prefix to target main
if [[ ! "$SOURCE_BRANCH" =~ ^release.* ]]; then
echo "❌ ERROR: Only branches with 'release' prefix can create PRs to main!"
echo "Source branch '$SOURCE_BRANCH' does not start with 'release'"
echo ""
echo "Please create PRs to 'dev' branch instead, or use a release branch."
exit 1
fi

echo "✅ Source branch '$SOURCE_BRANCH' is allowed to target main"
96 changes: 96 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Contributing to ESO Logs Python

Thank you for your interest in contributing to the ESO Logs Python library!

## Branch Naming and PR Guidelines

### Branch Protection and Workflow

This repository follows a strict branching strategy to ensure code quality and proper release management:

1. **`main` branch**: Production-ready code only
- Protected branch with strict rules
- Only accepts PRs from branches with `release` prefix
- Requires all status checks to pass
- Direct pushes are disabled

2. **`dev` branch**: Active development
- All feature branches should target this branch
- Integration testing happens here
- Default target for new PRs

### Targeting Main Branch

**ONLY** branches with `release` prefix can create PRs to `main`:
- ✅ `release/v0.3.0`
- ✅ `release/hotfix-auth`
- ❌ `feature/new-api`
- ❌ `fix/bug-123`

### Development Workflow

1. **Feature Development**
```bash
git checkout dev
git checkout -b feature/your-feature-name
# Make changes
git push origin feature/your-feature-name
# Create PR to dev branch
```

2. **Bug Fixes**
```bash
git checkout dev
git checkout -b fix/issue-description
# Make changes
git push origin fix/issue-description
# Create PR to dev branch
```

3. **Releases**
```bash
git checkout dev
git checkout -b release/v0.3.0
# Update version numbers, changelog, etc.
git push origin release/v0.3.0
# Create PR to main branch
```

4. **Hotfixes** (critical production fixes)
```bash
git checkout main
git checkout -b release/hotfix-description
# Make minimal changes
git push origin release/hotfix-description
# Create PR to main branch
# After merge, backport to dev
```

## Development Setup

1. Clone the repository
2. Create a virtual environment: `python -m venv venv`
3. Activate it: `source venv/bin/activate` (Linux/Mac) or `venv\Scripts\activate` (Windows)
4. Install development dependencies: `pip install -e ".[dev]"`
5. Install pre-commit hooks: `pre-commit install`

## Code Standards

- All code must pass pre-commit hooks (black, isort, ruff, mypy)
- Tests must pass: `pytest`
- Coverage should not decrease
- Update documentation for new features

## Testing

- Write unit tests for new functionality
- Update integration tests if changing API interactions
- Run tests locally before pushing: `pytest`
- Check coverage: `pytest --cov=esologs`

## Documentation

- Update docstrings for new/modified functions
- Update `docs/` for user-facing changes
- Include examples in documentation
- Update changelog for notable changes
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@
| Metric | Status |
|--------|--------|
| **Current Version** | 0.2.0a2 |
| **API Coverage** | ~83% (comprehensive analysis shows 6/8 API sections fully implemented) |
| **API Coverage** | ~76% (32/42 methods implemented) |
| **Development Stage** | Active development |
| **Documentation** | [Read the Docs](https://esologs-python.readthedocs.io/) |
| **Tests** | 278 tests across unit, integration, documentation, and sanity suites |

### Current API Coverage
**Implemented (6/8 sections):**
**Implemented (5/8 sections + partial):**
1. ✅ **gameData** - 13 methods
2. ✅ **characterData** - 5 methods
3. ✅ **reportData** - 9 methods
4. ✅ **worldData** - 4 methods
5. ✅ **rateLimitData** - 1 method
6. 🟡 **guildData** - 2 methods (PARTIAL - missing 4 advanced methods)
6. 🟡 **guildData** - 1 method (PARTIAL - only get_guild_by_id)

**Missing (2/8 sections):**
- ❌ **userData** - 0/3 methods (MISSING - requires user auth)
Expand Down
Loading
Loading