Skip to content

Commit 62b35c9

Browse files
authored
docs: rewrite README, add CONTRIBUTING with conventional commits and claude rules (#100)
What Rewrite README for clarity and add a CONTRIBUTING guide with conventional commit conventions. Why The README had stale version numbers (Spark 3.5.3 / Scala 2.13.15 instead of 3.5.5 / 2.13.8), an incorrect E2E script name, a wrong set-version.sh argument format, and an outdated client-mode config example. Contributing guidelines and commit conventions were not documented anywhere, making it hard for new contributors to follow project standards. Changes - Rewrote README: fix default versions to match pom.xml, add CI version matrix table, add architecture overview, remove stale "local://" client-mode prefix, fix script names and argument formats, point development section to CONTRIBUTING.md - Add CONTRIBUTING.md covering development setup, conventional commits, PR process, coding standards, and Claude Code usage - Update /commit slash command to enforce conventional commit format with types, scopes, and examples - Fix CLAUDE.md: correct set-version.sh argument format and remove Spark 4.1 from CI matrix description (not in build.yaml) --------- Signed-off-by: Sudipto Baral <sudiptobaral.me@gmail.com>
1 parent d50d68a commit 62b35c9

File tree

6 files changed

+205
-111
lines changed

6 files changed

+205
-111
lines changed

.claude/commands/commit.md

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,51 @@
1-
Create a git commit for the current staged/unstaged changes.
1+
Create a git commit for the current staged/unstaged changes using Conventional Commits.
22

33
Rules:
44
1. Run `git status` and `git diff` to understand what changed
55
2. Stage relevant files (prefer specific files over `git add -A`)
6-
3. Write a SHORT commit message (max 50 chars for subject line, imperative mood)
6+
3. Write a commit message following Conventional Commits format
77
4. Use `--signoff` to sign off using the committer's git config (do NOT hardcode any name/email)
8-
5. Do NOT add Co-Authored-By or any other trailers
8+
5. Do NOT add Co-Authored-By or any other trailers beyond Signed-off-by
99
6. If there are no changes, say so and stop
1010

1111
Commit format:
1212
```
13-
git commit --signoff -m "short imperative message"
13+
<type>[optional scope]: <description>
1414
```
1515

16-
The `--signoff` flag automatically uses the name and email from `git config user.name` and `git config user.email`, so each collaborator's own identity is used.
16+
Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore
17+
18+
Scope (optional): a noun describing the affected area in parentheses.
19+
Common scopes: config, submit, allocator, event-watcher, e2e, docker, ci.
20+
21+
Subject line rules:
22+
- Imperative mood ("add", not "added" or "adds")
23+
- Do NOT capitalize the first letter after the type prefix
24+
- Do NOT end with a period
25+
- Keep under 72 characters total
26+
27+
For breaking changes, add `!` after the type/scope:
28+
```
29+
feat(config)!: rename queue config key
30+
```
1731

1832
Examples of good messages:
19-
- "add user and permission models"
20-
- "implement executor allocation logic"
21-
- "fix gang scheduling annotation prefix"
22-
- "add table-driven tests for config parsing"
33+
- "feat(allocator): support configurable batch size"
34+
- "fix(event-watcher): handle reconnection on stream error"
35+
- "refactor(submit): extract TLS channel builder"
36+
- "test(backend): add table-driven tests for state transitions"
37+
- "docs: update architecture diagram in README"
38+
- "build: bump armada-scala-client to 0.5.0"
39+
- "chore: remove unused import in Config.scala"
40+
41+
Commit command:
42+
```
43+
git commit --signoff -m "<type>[scope]: <description>"
44+
```
2345

2446
Do NOT:
25-
- Use long descriptive messages
47+
- Use long multi-line messages for simple changes
2648
- Add Co-Authored-By trailers
2749
- Use past tense ("added", "fixed")
28-
- Prefix with type tags ("feat:", "fix:") unless asked
2950
- Hardcode any author name or email
51+
- Omit the type prefix

.claude/commands/issue.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Create a GitHub issue markdown file from the details provided by the user.
2+
3+
The user will describe a bug, feature request, or discussion context (e.g. Slack conversations, error logs, reproduction steps). Your job is to turn that into a well-structured issue and save it to `plans/`.
4+
5+
Steps:
6+
1. Read the user's input to understand the problem, who reported it, and any logs or reproduction steps provided
7+
2. Investigate the codebase to identify relevant code paths, pinpoint where the issue likely originates, and gather context that would help a contributor understand the problem
8+
3. Write a concise GitHub issue markdown file and save it to `plans/issue-<short-slug>.md`
9+
10+
Issue format:
11+
- Start with `## <title>` as the first line (this becomes the GitHub issue title)
12+
- `### Problem` — 2-3 sentences explaining the issue and its impact
13+
- `### Steps to Reproduce` — numbered list (if applicable)
14+
- `### Expected Behavior` — 1-2 sentences
15+
- `### Actual Behavior` — include relevant log snippets in code blocks, keep them short (trim stack traces to the key lines)
16+
- `### Potential Root Cause` — based on your codebase investigation, explain where the issue likely lives. Link to source code using upstream GitHub URLs: `https://github.com/armadaproject/armada-spark/blob/master/...#L<start>-L<end>`. For Apache Spark references, link to the `apache/spark` repo at the relevant tag.
17+
- `### Affected Files` — table with file links and one-line role descriptions
18+
- `### Additional Context` — bullet points for version info, related code paths, or anything else useful
19+
20+
Style rules:
21+
- Keep it concise — the whole issue should be under 80 lines
22+
- Use code blocks sparingly — only for key log lines and small code snippets
23+
- Do not propose fixes or implementation approaches
24+
- Do not add Labels, Description, or Title as separate sections — the `##` heading is the title
25+
- Write for a contributor who knows the project but hasn't seen this specific bug
26+
- No emojis
27+
28+
$ARGUMENTS

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,4 @@ example/jupyter/workspace/
8686

8787
# Claude Code local settings (personal per-user config)
8888
.claude/settings.local.json
89+
plans/

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ mvn spotless:check
2020
mvn spotless:apply
2121

2222
# Set Spark/Scala versions (e.g., Spark 3.5.5, Scala 2.13.8)
23-
./scripts/set-version.sh 3 5 5 2 13 8
23+
./scripts/set-version.sh 3.5.5 2.13.8
2424
```
2525

2626
**Stack:** Scala 2.13 | Maven | Spark 3.5 | Java 17 | Fabric8 Kubernetes Client | gRPC/Protobuf (via armada-scala-client)
@@ -172,4 +172,4 @@ class BarSuite extends AnyFunSuite with TableDrivenPropertyChecks with Matchers
172172

173173
## CI/CD
174174

175-
GitHub Actions with matrix builds across Spark 3.3/3.5/4.1 and Scala 2.12/2.13. Pipeline: lint -> build -> e2e tests.
175+
GitHub Actions with matrix builds across Spark 3.3/3.5 and Scala 2.12/2.13. Pipeline: lint -> build -> e2e tests.

CONTRIBUTING.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Contributing to armada-spark
2+
3+
## Development Setup
4+
5+
**Prerequisites:** Java 17, Maven 3.9.6+, Scala 2.13.8
6+
7+
```bash
8+
mvn clean package # Build with tests
9+
mvn test # Run unit tests only
10+
mvn spotless:check # Check formatting
11+
mvn spotless:apply # Auto-fix formatting
12+
scripts/dev-e2e.sh # Run E2E tests (requires a running Armada cluster)
13+
14+
# Target a different Spark/Scala version (e.g., Spark 3.3.4, Scala 2.12.15)
15+
./scripts/set-version.sh 3.3.4 2.12.15
16+
```
17+
18+
## Commit Conventions
19+
20+
This project follows [Conventional Commits v1.0.0](https://www.conventionalcommits.org/en/v1.0.0/). All commits must be signed off:
21+
22+
```bash
23+
git commit --signoff -m "feat(allocator): support configurable batch size"
24+
```
25+
26+
Common scopes: `config`, `submit`, `allocator`, `event-watcher`, `e2e`, `docker`, `ci`.
27+
28+
## Pull Requests
29+
30+
1. Branch from `master` (`git checkout -b feat/my-feature master`)
31+
2. Format code (`mvn spotless:apply`) and run tests (`mvn test`)
32+
3. Commit using conventional commits with `--signoff`
33+
4. Open a PR against `master` — the PR title should also follow conventional commit format
34+
35+
### PR Checklist
36+
37+
- [ ] `mvn clean package` compiles
38+
- [ ] `mvn test` passes
39+
- [ ] `mvn spotless:check` passes
40+
- [ ] Commits follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/)
41+
- [ ] New code includes tests
42+
43+
CI runs lint, build (Spark 3.3/3.5 x Scala 2.12/2.13), snapshots, and E2E tests on every PR. All checks must pass.
44+
45+
## Coding Standards
46+
47+
- **Scalafmt** enforced (100-col limit) — Apache 2.0 license header required on all source files
48+
- **Naming:** `PascalCase` classes, `camelCase` methods, `UPPER_SNAKE_CASE` config constants, `{ClassName}Suite` test files
49+
- **Patterns:** `Option`/`Try` over null/exceptions, `private[spark]` scoped visibility, Spark's `Logging` trait
50+
- **Imports:** Java/javax → Scala stdlib → Third-party → Spark
51+
- **Testing:** ScalaTest `AnyFunSuite` + Mockito (`mock(classOf[Type])`), `TableDrivenPropertyChecks` for parameterized tests
52+
- **Version-specific code** lives in `src/main/scala-spark-{3.3,3.5,4.1}/` — changes to submission logic likely need updates in all version directories
53+
54+
## Working with Claude Code (Optional)
55+
56+
This project includes a [Claude Code](https://docs.anthropic.com/en/docs/claude-code) setup. Shared config (`.claude/settings.json`, `.claude/commands/`, `CLAUDE.md`) is checked into git. Hooks auto-format code and verify builds.
57+
58+
| Command | What it does |
59+
|--------------|-------------------------------------------------|
60+
| `/build` | Build the project (`/build fast` to skip tests) |
61+
| `/lint` | Check and auto-fix formatting |
62+
| `/commit` | Create a conventional commit |
63+
| `/ci-local` | Run the full CI pipeline locally |
64+
| `/summary` | Generate a PR description from your branch |
65+
| `/issue` | Draft a GitHub issue from bug details/logs |
66+
67+
**Optional plugins:** Copy `.claude/settings.local.example.json` to `.claude/settings.local.json` and restart. Source: https://github.com/wshobson/agents
68+
69+
## Getting Help
70+
71+
- Open a GitHub issue for bugs or feature requests
72+
- For Armada questions, see [armadaproject.io](https://armadaproject.io/)

0 commit comments

Comments
 (0)