|
| 1 | +# Repository Guidelines |
| 2 | + |
| 3 | +## Project Structure & Module Organization |
| 4 | +- Multi-module Maven repository with root `pom.xml`. |
| 5 | +- Core modules: |
| 6 | + - `apollo-core`: shared constants/utilities. |
| 7 | + - `apollo-client`: main Java client and Spring integration. |
| 8 | + - `apollo-client-config-data`: Spring Boot ConfigData integration. |
| 9 | + - `apollo-mockserver`: test/mock support. |
| 10 | + - `apollo-openapi`: OpenAPI client. |
| 11 | + - `apollo-plugin`: plugin modules. |
| 12 | +- Tests follow standard Maven layout: `*/src/test/java` and `*/src/test/resources`. |
| 13 | +- CI workflows are in `.github/workflows`. |
| 14 | + |
| 15 | +## Build, Test, and Development Commands |
| 16 | +- Build all modules: `mvn -B clean package -Dmaven.gitcommitid.skip=true` |
| 17 | +- Run all tests: `mvn clean test` |
| 18 | +- Run one module tests: `mvn -pl apollo-client clean test` |
| 19 | +- Run targeted tests: `mvn -pl apollo-client -Dtest=ClassNameTest test` |
| 20 | +- Compile only: `mvn -B clean compile -Dmaven.gitcommitid.skip=true` |
| 21 | +- Notes: |
| 22 | + - This repository does **not** configure `spotless`; do not use `spotless:apply` here. |
| 23 | + - Some integration tests log connection warnings in local/dev environments; focus on final Maven summary. |
| 24 | + |
| 25 | +## Coding Style & Naming Conventions |
| 26 | +- Java style: follow existing codebase conventions (Google-style Java patterns in current files). |
| 27 | +- Keep changes minimal and module-scoped. |
| 28 | +- Preserve existing package/class naming conventions. |
| 29 | +- Add/adjust tests for non-trivial behavior changes. |
| 30 | + |
| 31 | +## Testing Guidelines |
| 32 | +- JUnit 4 + JUnit Vintage are both used in this repo. |
| 33 | +- For bug fixes: |
| 34 | + - Add a regression test first when feasible. |
| 35 | + - Run module-level tests for changed modules. |
| 36 | + - Prefer full `mvn clean test` before opening PR. |
| 37 | + |
| 38 | +## Commit & Pull Request Guidelines |
| 39 | +- Use Conventional Commits, e.g. `fix: ...`, `feat: ...`, `docs: ...`. |
| 40 | +- If applicable, include issue linkage in commit message body, e.g. `Fixes #88`. |
| 41 | +- Keep PR commits clean: |
| 42 | + - Require a single commit in the PR branch before review (squash locally if needed). |
| 43 | +- Open PRs with `.github/PULL_REQUEST_TEMPLATE.md` and fill all sections with concrete content. |
| 44 | +- PR description should include: |
| 45 | + - purpose/root cause |
| 46 | + - change summary |
| 47 | + - test commands actually run |
| 48 | +- PR submission flow: |
| 49 | + - Push branch to personal fork remote first (for example `origin`). |
| 50 | + - Open PR from `<your-fork>:<branch>` to `apolloconfig/apollo-java:main`. |
| 51 | + - If history is rewritten for squash, update remote branch with `--force-with-lease`. |
| 52 | + |
| 53 | +## CHANGES.md Rules |
| 54 | +- Update `CHANGES.md` for user-visible fixes/features. |
| 55 | +- Use bullet style consistent with existing entries. |
| 56 | +- Entry format should be a Markdown link: |
| 57 | + - link text = the actual change description |
| 58 | + - link target = the PR URL (not issue URL) |
| 59 | +- Example: |
| 60 | + - `[Fix ... detailed summary](https://github.com/apolloconfig/apollo-java/pull/123)` |
| 61 | + |
| 62 | +## Agent Workflow Hints |
| 63 | +- Reproduce first, then fix. |
| 64 | +- Prefer targeted module/test runs during iteration, then run broader tests before PR. |
| 65 | +- When creating upstream PRs: |
| 66 | + - use a branch in personal fork |
| 67 | + - base repository is `apolloconfig/apollo-java` |
| 68 | + - ensure PR branch is squashed to one commit |
0 commit comments