Thank you for your interest in contributing to HiMarket!
We welcome contributions of all kinds: bug fixes, new features, documentation improvements, and more.
- Fork the HiMarket repository to your GitHub account
- Clone your fork to your local machine:
git clone https://github.com/YOUR_USERNAME/himarket.git
cd himarket- Add the upstream repository so you can keep your fork in sync:
git remote add upstream https://github.com/higress-group/himarket.git- Set up your development environment by following the instructions in README.md
Before starting work, sync your fork with the upstream repository:
# Switch to main branch
git checkout main
# Pull latest changes from upstream
git pull upstream main
# Push updates to your fork
git push origin main
# Create a new feature branch
git checkout -b feat/your-feature-nameWrite your code following our coding standards.
Before committing, always format your code to ensure it meets our style guidelines:
# Format Java code (required)
mvn spotless:apply
# Format frontend code if you modified it
cd himarket-web/himarket-admin
npm run formatWe follow the Conventional Commits specification. Your commit messages should be clear and descriptive:
git add .
git commit -m "feat: add user authentication feature"Commit message format:
type: brief description (50 chars or less)
[Optional detailed explanation if needed]
Common types:
feat- A new featurefix- A bug fixdocs- Documentation changesstyle- Code style changes (formatting, missing semicolons, etc.)refactor- Code refactoring without changing functionalityperf- Performance improvementstest- Adding or updating testschore- Maintenance tasks, dependency updates, etc.
git push origin feat/your-feature-name- Go to your fork on GitHub
- Click the "New Pull Request" button
- Ensure the base repository is
higress-group/himarketand the base branch ismain - Select your feature branch as the compare branch
- Fill in the PR template (auto-loaded) with details about your changes
- Click "Create Pull Request"
Your PR title must follow the format: type: brief description
Good examples:
✅ feat: add product feature configuration
✅ fix: resolve pagination issue in product list
✅ docs: update deployment guide in README
✅ refactor: simplify client initialization logic
Bad examples:
❌ Add new feature (missing type)
❌ feat: Add Feature (description should be lowercase)
❌ update code (not descriptive)
Your PR must include the following sections:
-
Description (Required)
- Clearly explain what changes you made and why
- Use bullet points for clarity
- Minimum 10 characters
-
Related Issues (Optional but recommended)
- Link to related issues using keywords:
Fix #123,Close #456,Resolve #789 - This helps us track which issues are being addressed
- Link to related issues using keywords:
-
Checklist (Required)
- Confirm you've run
mvn spotless:applyto format your code - Indicate whether you've added tests or updated documentation
- Check off applicable items
- Confirm you've run
Example PR description:
## Description
- Add feature configuration field to Product entity
- Create ModelFeatureForm component for the admin UI
- Implement backend service to persist feature settings
- Add Flyway migration script for database schema changes
## Related Issues
Fix #123
Close #456
## Checklist
- [x] Code has been formatted with `mvn spotless:apply`
- [x] Code is self-reviewed
- [x] Tests added/updated (if applicable)
- [x] Documentation updated (if applicable)Every PR will automatically trigger the following checks:
- PR Check - Validates your PR title and description format (Required ✅)
- Code Format Check - Runs
mvn spotless:checkto verify code formatting (Required ✅)
All checks must pass before your PR can be merged. If a check fails, the bot will comment with instructions on how to fix it.
For more detailed PR guidelines, please see:
- PR_GUIDE.md - English version
- PR_GUIDE_CN.md - 中文版本
Code Formatting (Required):
- Run
mvn spotless:applybefore committing to auto-format your code - This ensures consistent code style across the project
- CI will fail if code is not formatted
Best Practices:
- Use clear, descriptive names for variables, methods, and classes
- Add Javadoc comments for public APIs
- Avoid magic numbers and empty catch blocks
- Keep methods focused and reasonably sized
- Remove unused imports
- Formatting: Use Prettier to format your code:
npm run format - Style Guide: Follow the Airbnb JavaScript Style Guide
- Type Safety: Always use TypeScript types/interfaces; avoid
anywhen possible - Components: Prefer functional components with React Hooks
- Naming: Use descriptive names; follow PascalCase for components, camelCase for functions
- Tool: Use Flyway for all database schema changes
- Location: Place migration files in
himarket-bootstrap/src/main/resources/db/migration/ - Naming: Follow the pattern
V{version}__{description}.sql- Example:
V3__Add_product_feature.sql
- Example:
- Testing: Always test your migrations on a clean database before submitting