Skip to content

kwlockwo/dfl-manager

Repository files navigation

Contributing to DFL Manager

Getting Started

1. Clone the Repository

git clone https://github.com/kwlockwo/dfl-manager.git
cd dfl-manager/code

2. Install Git Hooks

Important: Run this setup script to install automated testing hooks:

.githooks/setup.sh

This will configure git to run tests automatically before each commit, ensuring code quality.

Development Workflow

Before You Start

  1. Make sure you're on the latest main branch:

    git checkout main
    git pull origin main
  2. Create a feature branch:

    git checkout -b feature/your-feature-name

Making Changes

  1. Make your code changes

  2. Run tests manually to verify:

    mvn test
  3. Commit your changes:

    git add .
    git commit -m "Your commit message"

    Note: The pre-commit hook will automatically run tests. If they fail, your commit will be blocked.

Pre-Commit Hook

The pre-commit hook automatically runs BaseHandlerTest before each commit:

  • ✅ If tests pass → commit proceeds
  • ❌ If tests fail → commit is blocked

To skip the hook (not recommended):

git commit --no-verify -m "Your message"

Testing

Run All Tests

mvn test

Run Specific Test Class

mvn test -Dtest=BaseHandlerTest

Run Tests in Quiet Mode

mvn test -q

Code Standards

Handlers

  • All handlers must extend BaseHandler
  • Use ServiceFactory for service instantiation
  • Call ensureLoggingConfigured() at the start of execute() methods

Services

  • Create services via ServiceFactory.getInstance().createXxxService()
  • Never use new XxxServiceImpl() directly

Transactions

  • Use TransactionHelper.executeInTransaction() for database operations
  • This provides automatic rollback on exceptions

Pull Requests

  1. Push your feature branch:

    git push origin feature/your-feature-name
  2. Create a pull request on GitHub

  3. Ensure all tests pass in CI

  4. Request review from maintainers

  5. Address any feedback

  6. Once approved, it will be merged to main

Build

Compile

mvn clean compile

Package

mvn clean package

Troubleshooting

Git Hook Not Running

If the pre-commit hook isn't running:

  1. Check if hooks are configured:

    git config core.hooksPath

    Should output: .githooks

  2. Re-run the setup script:

    .githooks/setup.sh
  3. Verify hook is executable:

    ls -la .githooks/pre-commit

Tests Failing Locally

  1. Make sure you're on the latest main:

    git checkout main
    git pull
  2. Clean and rebuild:

    mvn clean compile
  3. Run tests:

    mvn test

Questions?

License

[Add your license information here]

About

No description or website provided.

Topics

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages