Thank you for considering contributing to Magazine! This guide explains the process for contributing to this project.
- Code of Conduct
- Getting Started
- Development Setup
- Making Changes
- Pull Request Process
- Coding Standards
- Reporting Issues
This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to opensource@phonepe.com.
- Fork the repository on GitHub.
- Clone your fork locally:
git clone https://github.com/<your-username>/Magazine.git cd Magazine
- Add the upstream remote:
git remote add upstream https://github.com/PhonePe/Magazine.git
- Java 17 or later
- Apache Maven 3.8+
- Docker (integration tests use Testcontainers to run a real Aerospike server)
mvn clean installAlways build the full reactor and use verify, not test:
mvn clean verify -PcoverageTwo reasons this matters:
mvn testdoes not run Javadoc. Broken@linkreferences only surface underverify/package, and the build treats them as errors.- Building
-pl magazine-dw-bundlealone resolves a possibly stalemagazine-corefrom your local repository, so bundle tests can pass against code you did not just change.
Testcontainers only finds Docker automatically at the default socket. On macOS with Rancher
Desktop, Colima or Podman you must point it at the right one, or AerospikeTestContainer fails to
start:
# Rancher Desktop
export DOCKER_HOST=unix://$HOME/.rd/docker.sock
# Colima
export DOCKER_HOST=unix://$HOME/.colima/default/docker.sock
# Podman
export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/podman/podman.sockexport TESTCONTAINERS_RYUK_DISABLED=true also helps if the Ryuk reaper cannot start in your
runtime.
The container requires the NET_ADMIN capability, which rootless Podman and some hardened Docker
configurations refuse. The first run also pulls the Aerospike image, so allow a few minutes.
ArchitectureTest enforces the package layering with ArchUnit — acyclic packages, Aerospike types
confined to impl, no Micrometer outside metrics and impl, and no DLM dependency returning.
These fail for non-obvious reasons, so read the rule's because(...) clause before working around
one.
-Pcoverage activates JaCoCo. The magazine-coverage module aggregates the per-module reports
into magazine-coverage/target/site/jacoco-aggregate/, which is what Sonar reads.
mvn javadoc:javadoc- Create a feature branch from
main:git checkout -b feature/my-feature
- Make your changes in small, focused commits.
- Write or update tests for your changes.
- Ensure all tests pass:
mvn clean verify
- Update documentation if your changes affect the public API.
- Push your branch to your fork:
git push origin feature/my-feature
- Open a Pull Request against the
mainbranch of the upstream repository. - Fill in the PR template with:
- A clear description of the change
- The motivation / issue being addressed
- Steps to test the change
- Ensure the CI build passes.
- Request review from at least one maintainer.
- Address review feedback by pushing additional commits.
- Once approved, a maintainer will merge your PR.
- Language level: Java 17 (use pattern matching, records, sealed classes where appropriate).
- Formatting: Follow the existing code style. Lombok annotations are used throughout—keep it consistent.
- Naming: Use clear, descriptive names. Prefix test methods with
testor use descriptiveshould_X_when_Ynaming. - Documentation: Add Javadoc to all public classes and methods.
- Testing:
- Unit tests with JUnit 5 and Mockito.
- Integration tests with Testcontainers for backend-specific logic.
- Aim for meaningful coverage; don't just chase numbers.
- Dependencies: Avoid adding new dependencies unless absolutely necessary. Discuss in the issue first.
- Commits: Write clear commit messages. Use the imperative mood ("Add feature" not "Added feature").
- Use GitHub Issues to report bugs or request features.
- Include:
- A clear title and description
- Steps to reproduce (for bugs)
- Expected vs. actual behavior
- Magazine version, Java version, and backend version
- Relevant logs or stack traces
By contributing to Magazine, you agree that your contributions will be licensed under the Apache License 2.0.