- Add Language default ("jp") so missing field no longer produces empty
string, and include language selector in setup wizard
- Add --setup flag to re-run wizard even when config.json exists,
providing a recovery path for corrupted configs
- Auto-apply seed data on fresh databases so users who skip the wizard
still get shops, events, and gacha
- Fix stale docs referencing non-existent init/setup.sh and
schemas/patch-schema/ in docker/README, CONTRIBUTING, and README
5.6 KiB
Contributing to Erupe
Thank you for your interest in contributing to Erupe! This guide will help you get started.
Getting Started
Prerequisites
- Go 1.25+
- PostgreSQL
- Git
Setting Up Your Development Environment
-
Fork the repository on GitHub
-
Clone your fork:
git clone https://github.com/YOUR_USERNAME/Erupe.git cd Erupe -
Set up the database following the Installation guide
-
Copy
config.example.jsontoconfig.jsonand set your database password (seeconfig.reference.jsonfor all available options) -
Install dependencies:
go mod download -
Build and run:
go build ./erupe-ce
Code Contribution Workflow
-
Create a branch for your changes:
git checkout -b feature/your-feature-nameUse descriptive branch names:
feature/for new featuresfix/for bug fixesrefactor/for code refactoringdocs/for documentation changes
-
Make your changes and commit them with clear, descriptive messages:
git commit -m "feat: add new quest loading system" git commit -m "fix: resolve database connection timeout" git commit -m "docs: update configuration examples" -
Test your changes (see Testing Requirements)
-
Push to your fork:
git push origin feature/your-feature-name -
Create a Pull Request on GitHub with:
- Clear description of what changes you made
- Why the changes are needed
- Any related issue numbers
-
Respond to code review feedback promptly
Coding Standards
Go Style
-
Run
gofmtbefore committing:gofmt -w . -
Use
golangci-lintfor linting:golangci-lint run ./... -
Follow standard Go naming conventions
-
Keep functions focused and reasonably sized
-
Add comments for exported functions and complex logic
-
Handle errors explicitly (don't ignore them)
Code Organization
- Place new handlers in appropriate files under
server/channelserver/ - Keep database queries in structured locations
- Use the existing pattern for message handlers
Testing Requirements
Before submitting a pull request:
-
Run all tests:
go test -v ./... -
Check for race conditions:
go test -v -race ./... -
Ensure your code has adequate test coverage:
go test -v -cover ./...
Writing Tests
- Add tests for new features in
*_test.gofiles - Test edge cases and error conditions
- Use table-driven tests for multiple scenarios
- Mock external dependencies where appropriate
Example:
func TestYourFunction(t *testing.T) {
tests := []struct {
name string
input int
want int
}{
{"basic case", 1, 2},
{"edge case", 0, 0},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
got := YourFunction(tt.input)
if got != tt.want {
t.Errorf("got %v, want %v", got, tt.want)
}
})
}
}
Database Schema Changes
Erupe uses an embedded auto-migrating schema system in server/migrations/.
When adding schema changes:
- Create a new file in
server/migrations/sql/with format:NNNN_description.sql(e.g.0002_add_new_table.sql) - Increment the number from the last migration
- Test the migration on both a fresh and existing database
- Document what the migration does in SQL comments
Migrations run automatically on startup in order. Each runs in its own transaction and is tracked in the schema_version table.
For seed/demo data (shops, events, gacha), add files to server/migrations/seed/. Seed data is applied automatically on fresh databases and can be re-applied via the setup wizard.
Documentation Requirements
Always Update
- CHANGELOG.md: Document your changes under "Unreleased" section
- Use categories: Added, Changed, Fixed, Removed, Security
- Be specific about what changed and why
When Applicable
-
README.md: Update if you change:
- Installation steps
- Configuration options
- Requirements
- Usage instructions
-
Code Comments: Add or update comments for:
- Exported functions and types
- Complex algorithms
- Non-obvious business logic
- Packet structures and handling
Getting Help
Questions and Discussion
- Mogapedia's Discord: Active development discussions
- Mezeporta Square Discord: Community support
- GitHub Issues: For bug reports and feature requests
Reporting Bugs
When filing a bug report, include:
- Erupe version (git commit hash or release version)
- Client version (ClientMode setting)
- Go version:
go version - PostgreSQL version:
psql --version - Steps to reproduce the issue
- Expected behavior vs actual behavior
- Relevant logs (enable debug logging if needed)
- Configuration (sanitize passwords!)
Requesting Features
For feature requests:
- Check existing issues first
- Describe the feature and its use case
- Explain why it would benefit the project
- Be open to discussion about implementation
Code of Conduct
- Be respectful and constructive
- Welcome newcomers and help them learn
- Focus on the code, not the person
- Assume good intentions
License
By contributing to Erupe, you agree that your contributions will be licensed under the same license as the project.
Thank you for contributing to Erupe!