# Contributing Guide Thank you for contributing to VeriRL! This guide explains the development workflow. ## Workflow Overview ``` 1. Create feature branch from main 2. Make changes 3. Create changelog fragment (.changelog.d/.{feature,bugfix,doc,misc}.md) 4. Push to your fork 5. Create pull request to main 6. CI/CD runs (validate, docker build) on PR 7. Review & merge to main 8. CI/CD auto-deploys to HF Spaces 9. Create release via GitHub Actions (bumps version, publishes Docker image) ``` ## Branch Protection Rules The `main` branch is protected: - ✓ **No direct pushes** — all changes via pull requests - ✓ **Requires status checks** — openenv validate + docker build must pass - ✓ **Requires reviews** — at least 1 approval recommended - ✓ **Requires updated branch** — must be up-to-date with main ## Step-by-Step Guide ### 1. Set Up Local Environment ```bash # Clone the repo git clone https://github.com/SupreethRao99/veriRL.git cd veriRL # Create feature branch git checkout -b feature/your-feature-name # Install dependencies uv sync # Verify environment works openenv validate ``` ### 2. Make Changes ```bash # Edit files, add features, fix bugs vim server/verirl_env_environment.py vim tests/test_environment.py # Test locally pytest openenv validate docker build -t verirl:test -f server/Dockerfile . ``` ### 3. Create Changelog Fragment For EVERY change, create a fragment: ```bash # Feature echo "Added new task: XYZ accelerator" > .changelog.d/pr-123.feature.md # Bug fix echo "Fixed STDOUT format parsing" > .changelog.d/pr-124.bugfix.md # Documentation echo "Updated README with new examples" > .changelog.d/pr-125.doc.md # Internal (not shown in changelog) echo "Refactored evaluator for clarity" > .changelog.d/pr-126.misc.md ``` Fragment format: - File: `.changelog.d/..md` - ID: PR number, commit hash, or unique identifier - TYPE: feature, bugfix, doc, misc - Content: One-line description ### 4. Commit & Push ```bash # Stage changes git add server/ tests/ .changelog.d/ # Commit with clear message git commit -m "Add new task and update documentation - Implement XYZ accelerator task - Add 25 test cases - Update README with task description - Create changelog fragment" # Push to your fork git push origin feature/your-feature-name ``` ### 5. Create Pull Request 1. Go to https://github.com/SupreethRao99/veriRL/pulls 2. Click "New pull request" 3. Select: `main` ← `feature/your-feature-name` 4. Fill in description: ```markdown ## Summary Add XYZ accelerator task to environment ## Changes - New task with 25 assertions - Updated scoring weights - Added reference implementation ## Testing - [x] openenv validate passes - [x] Docker builds successfully - [x] All tests pass locally ``` 5. Submit PR ### 6. CI/CD Validation (Automatic) When you create the PR, GitHub Actions automatically: - ✓ Validates openenv spec - ✓ Builds Docker image - ✓ Runs tests **If checks fail:** 1. Review error logs in Actions tab 2. Fix issues locally 3. Commit and push again 4. Checks re-run automatically ### 7. Review & Merge - Code review (recommended) - Request changes if needed - Merge to main when ready ```bash # GitHub UI: Click "Merge pull request" # Or via CLI: gh pr merge ``` ### 8. Auto-Deploy (On Merge) When you merge to main, GitHub Actions automatically: 1. Validates environment 2. Builds Docker image 3. Pushes image to `ghcr.io` as `main` tag 4. Deploys to HF Spaces **Done!** Your changes are live. ### 9. Create Release (Optional) When ready to cut a release: 1. Go to https://github.com/SupreethRao99/veriRL/actions 2. Click "Release" workflow 3. Click "Run workflow" 4. Enter version (e.g., `0.3.0`) 5. Workflow: - Generates CHANGELOG.md from fragments - Updates version in pyproject.toml - Creates git tag `v0.3.0` - Builds & pushes Docker image to `ghcr.io/SupreethRao99/veriRL:v0.3.0` - Creates GitHub Release **Done!** Release is published with versioned Docker image. ## Naming Conventions ### Branch Names ``` feature/ New feature or task bugfix/ Bug fix docs/ Documentation update refactor/ Code refactoring ``` Examples: ``` feature/axi-fifo-task bugfix/stdout-format docs/deployment-guide refactor/evaluator ``` ### Commit Messages ``` :