OS Trading Engine
Contributing
Pull Request Process

Pull Request Process

This guide covers how to submit pull requests to Nexgent.

Before You Start

Checklist

  • Issue exists for the change (create one if needed)
  • You've read the Code Style Guide
  • Tests pass locally
  • You've tested your changes manually

Creating a Pull Request

1. Sync Your Fork

git fetch upstream
git checkout main
git merge upstream/main

2. Create a Branch

git checkout -b type/description
 
# Examples
git checkout -b feat/webhook-signature-verification
git checkout -b fix/stop-loss-calculation
git checkout -b docs/api-rate-limiting

3. Make Your Changes

  • Follow the Code Style Guide
  • Write tests for new functionality
  • Update documentation if needed

4. Commit Your Changes

Use conventional commit format:

git add .
git commit -m "feat(signals): add webhook signature verification
 
- Add HMAC-SHA256 signature validation
- Add X-Signature header parsing
- Add tests for signature verification
 
Closes #123"

5. Push to Your Fork

git push origin feat/webhook-signature-verification

6. Open Pull Request

Go to GitHub and click "Compare & pull request".


PR Template

Use this template for your PR description:

## Summary
 
Brief description of what this PR does.
 
## Changes
 
- Change 1
- Change 2
- Change 3
 
## Testing
 
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing performed
 
## Screenshots (if applicable)
 
[Add screenshots for UI changes]
 
## Related Issues
 
Closes #123

PR Requirements

Code Quality

RequirementCheck
TypeScript compilespnpm type-check
Linting passespnpm lint
Tests passpnpm test
No console.logRemove debug logs

Tests

  • New features require tests
  • Bug fixes should include regression tests
  • Maintain or improve coverage

Documentation

  • Update docs for new features
  • Update JSDoc for public APIs
  • Update README if needed

Review Process

What Reviewers Look For

  1. Correctness - Does it solve the problem?
  2. Tests - Are changes tested?
  3. Style - Does it follow conventions?
  4. Performance - Any performance concerns?
  5. Security - Any security implications?

Responding to Feedback

# Make requested changes
git add .
git commit -m "address review feedback"
git push

Or amend if small changes:

git add .
git commit --amend --no-edit
git push --force-with-lease

Request Re-Review

After addressing feedback, request re-review by commenting:

@reviewer Ready for another look!

CI Checks

PRs must pass all CI checks:

CheckDescription
BuildTypeScript compiles
LintESLint passes
Unit TestsAll unit tests pass
Integration TestsAll integration tests pass
Type CheckNo TypeScript errors

Fixing CI Failures

# Check what's failing locally
pnpm type-check
pnpm lint
pnpm test

Common Issues

Merge Conflicts

# Update your branch with main
git fetch upstream
git checkout your-branch
git merge upstream/main
 
# Resolve conflicts, then
git add .
git commit -m "resolve merge conflicts"
git push

Tests Failing in CI

  1. Ensure you ran tests locally: pnpm test
  2. Check for environment-specific issues
  3. Review CI logs for specific failures

PR Too Large

Break large PRs into smaller ones:

  1. Refactoring first - Separate PR for code restructuring
  2. Feature by feature - One PR per feature
  3. Tests separate - Add tests in separate PR if needed

After Merge

Delete Your Branch

git checkout main
git pull upstream main
git branch -d feat/your-feature

Celebrate! 🎉

Thank you for contributing!


Quick Reference

Commit Types

TypeDescription
featNew feature
fixBug fix
docsDocumentation
styleFormatting
refactorCode restructuring
testAdding tests
choreMaintenance

Branch Naming

feat/description    # New feature
fix/description     # Bug fix
docs/description    # Documentation
refactor/description # Refactoring
test/description    # Tests

PR Checklist

- [ ] Code follows style guide
- [ ] Tests added/updated
- [ ] Documentation updated
- [ ] CI checks pass
- [ ] PR description complete