First off, thank you for considering contributing to OceanBase seekdb! We value your time and effort.
The following are a set of guidelines for contributing to OceanBase seekdb. Following these guidelines makes contributing to this project easy and transparent. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
Content
By participating, you are expected to uphold our Code of Conduct. Please report unacceptable behavior to the project maintainers.
Our workflow differs depending on whether you are fixing a bug or implementing a new feature. We prioritize design and discussion for new features to ensure architectural consistency.
All contributions must be associated with a GitHub Issue.
- Search first: Check if the issue already exists.
- Create new: If not, open a new issue.
- Use
[Bug]in the title for bugs. - Use
[Feature]in the title for new capabilities.
- Use
For verified bugs, you can proceed directly to coding after the issue is acknowledged.
- Fork the repository to your own GitHub account.
- Branch from
develop(e.g.,fix/issue-123). - Fix the bug and add a regression test case.
- Submit PR.
For new features, we strictly enforce a Design-First workflow. Do not submit code PRs for large features without an approved design.
- Discuss: Share your initial thoughts in the Issue comments. Wait for a maintainer to validate the requirement.
- Draft Design: Write a design document in Markdown.
- Submit Design PR:
- Place your file in the
docs/design/directory. - Filename convention:
YYYY-MM-DD-feature-name.md. - Submit a Pull Request targeting the
developbranch. - Title:
[Design] Proposal for <Feature Name>.
- Place your file in the
- Design Review: Maintainers will review the architecture, API changes, and compatibility.
- Implementation: Once the Design PR is merged, you may start coding.
We follow a standard "fork-and-pull" workflow. All development should be based on the develop branch.
- Fork the seekdb repository on GitHub.
- Clone your fork:
git clone https://github.com/<your-github-name>/seekdb.git cd seekdb
- Configure your local repo by adding the remote official repo as upstream:
git remote add upstream https://github.com/oceanbase/seekdb.git
- Create a Branch Sync with upstream and create a descriptive branch:
git fetch upstream git checkout upstream/develop -b fix/issue-123
Naming convention: type/description-issue-number
Before submitting, you must ensure the code builds and passes tests locally.The development guide is located under the docs folder. Please refer to it for detailed build instructions.
Basic build commands:
# Configure the project (Generate build files)
cmake -B build -DCMAKE_BUILD_TYPE=Release
# Build for debugging
cmake debug
# Build the project
cmake --build build -- -j$(nproc)
- Coverage: Write unit tests for all new features and bug fixes, including edge cases.
- Regression: Ensure all local tests pass before submitting.
- Consistency: Follow existing test patterns.
Run tests:
# Run all tests via [CTest](https://cmake.org/cmake/help/latest/manual/ctest.1.html):
cd build
ctest --output-on-failure
# Alternatively, for Debug build:
cd build_debug
ctest --output-on-failureWhen you are ready to submit your code:
- Push your branch to your forked repository.
- Open a Pull Request against the
developbranch ofoceanbase/seekdb. - Link the Issue: In the PR description, explicitly link the issue (e.g.,
Fixes #123) and the Design PR (if applicable). - Sign the CLA: You will be prompted to sign the OceanBase Contributor License Agreement (CLA) if you haven't already.
- Code Review: Community maintainers will review your code. Be prepared to make changes based on feedback.
- CI: Your PR must pass all automated CI checks (Build, Test, Linter).
- Merge: Once approved by maintainers and passing CI, your code will be merged!
By default, pull requests are merged into the
developbranch, which is the default branch of seekdb. The maintainers will mergedevelopintomasterbranch periodically. If you want to get the latest code, you can pull themasterbranch.
Before submitting your pull requests for review, make sure that:
- Your changes are consistent with the project's coding style.
- You have run all relevant tests and they pass.
- Your code is well-documented and commented where necessary.
- You have considered backward compatibility when making changes.
- The maintenance burden of new features is acceptable.
- Avoid large pull requests: Large PRs are much less likely to be merged as they are incredibly hard to review. Split large changes into smaller, focused PRs.
- Discuss first: For major changes or new features, discuss your intended changes with the core team on GitHub before starting implementation.
- Announce your work: If you're working on an existing issue, announce that you are working on it to avoid duplicate work.
- Update documentation: If your changes affect user-facing functionality, update the relevant documentation.
All pull requests must pass continuous integration (CI) checks before merging. Currently, there are two types of CI checks:
- Compile: This check will compile the code on CentOS and Ubuntu to ensure your changes compile successfully on different platforms.
- Farm: This check will run the unit tests and some MySQL test cases to ensure your changes don't break existing functionality.
Note: If the farm check fails and you think it is not related to your changes, you can ask the reviewer to re-run the farm check, or the reviewer will re-run it if needed.
Follow the same guidelines as commit messages. Provide a clear description of:
- What changes were made
- Why the changes were necessary
- How the changes were tested
- Any breaking changes or migration notes
For more guidance on writing good commit messages, refer to this guide.
Thank you for contributing to OceanBase seekdb! Your help is essential for making it better.