Skip to content

Commit 0021669

Browse files
committed
chore: update agents.md with accurate project guidelines
Signed-off-by: Jorge Aguado Recio <jaguado@izertis.com>
1 parent 7e7dc46 commit 0021669

1 file changed

Lines changed: 98 additions & 35 deletions

File tree

‎agents.md‎

Lines changed: 98 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -10,48 +10,117 @@ This file provides context for AI coding agents (Claude Code, GitHub Copilot, Cu
1010
- **CI system:** GitHub Actions
1111

1212
## Architecture & Key Paths
13-
- `owncloudApp/` - Main Android application module
14-
- `owncloudDomain/` - Domain layer (business logic, use cases)
15-
- `owncloudData/` - Data layer (repositories, data sources)
16-
- `owncloudComLibrary/` - Common library module
17-
- `owncloudTestUtil/` - Test utilities
18-
- `build.gradle` - Root Gradle build file
19-
- `gradle/` - Gradle wrapper
20-
- `config/` - Build configuration
21-
- `fastlane/` - Fastlane deployment configuration
22-
- `doc/` - Developer documentation
23-
- `SETUP.md` - Development environment setup
24-
- `CONTRIBUTING.md` - Contribution guidelines
25-
- `CHANGELOG.md` - Release history
2613

27-
## Development Conventions
28-
- **Branching:** master
29-
- **Commit messages:** DCO sign-off required (`git commit -s`)
30-
- **Code style:** Detekt (Kotlin linter), EditorConfig
31-
- **PR process:** Open a PR against master. All CI checks must pass.
14+
Four modules in a strict dependency chain:
15+
16+
```
17+
owncloudComLibrary → owncloudData → owncloudDomain ← owncloudApp
18+
```
19+
20+
- `owncloudApp/` — presentation layer: Activities, Fragments, ViewModels, Koin wiring
21+
- `owncloudDomain/` — business layer: UseCases, domain Models, Repository interfaces, Exceptions
22+
- `owncloudData/` — data layer: Repository implementations, Room DB, Remote/Local DataSources
23+
- `owncloudComLibrary/` — networking layer: OkHttp, DAV4Android (WebDAV), OAuth/OIDC, Moshi
24+
- `owncloudTestUtil/` — shared test factories, mocks, and extensions (test-only dependency)
25+
- `build.gradle` — Root Gradle build file
26+
- `gradle/` — Gradle wrapper and version catalog (`gradle/libs.versions.toml`)
27+
- `config/` — Build configuration
28+
- `fastlane/` — Fastlane deployment configuration
29+
- `doc/` — Developer documentation
30+
- `SETUP.md` — Development environment setup
31+
- `CONTRIBUTING.md` — Contribution guidelines
32+
- `CHANGELOG.md` — Release history
33+
34+
**Pattern:** MVVM + Clean Architecture. Data flows strictly in one direction:
35+
36+
```
37+
Fragment → ViewModel → UseCase → Repository → DataSource → ownCloud server (WebDAV/Graph API)
38+
```
39+
40+
UseCases extend `BaseUseCase<R>` or `BaseUseCaseWithResult<P, R>`. ViewModels call them via coroutines and expose `Flow` (preferred) or `LiveData` to the UI.
41+
42+
**DI:** Koin with module-per-layer structure under `owncloudApp/.../dependecyinjection/`:
43+
`CommonModule`, `RemoteDataSourceModule`, `LocalDataSourceModule`, `RepositoryModule`, `UseCaseModule`, `ViewModelModule`.
44+
45+
## Product Flavors
46+
47+
Dimension: `management`
48+
49+
| Flavor | Purpose |
50+
|--------|---------|
51+
| `original` | Standard ownCloud app |
52+
| `mdm` | Mobile Device Management — custom branding/policies |
53+
| `qa` | QA variant for automated testing |
54+
55+
Build types: `debug` / `release`. Combined targets follow the pattern `assembleOriginalDebug`, `testMdmDebugUnitTest`, etc.
56+
57+
## SDK & Toolchain
58+
59+
- Min SDK 28 (Android 9), Target/Compile SDK 36
60+
- Kotlin 2.3.10, JDK 17, AGP 9.2.1
61+
- Version catalog: `gradle/libs.versions.toml`
3262

3363
## Build & Test Commands
64+
3465
```bash
3566
# Build
3667
./gradlew assembleDebug
68+
./gradlew assembleRelease # requires signing env vars
69+
70+
# Unit tests (all flavors)
71+
./gradlew testDebugUnitTest testMdmDebugUnitTest --continue
72+
73+
# Single module unit tests
74+
./gradlew :owncloudApp:testOriginalDebugUnitTest
75+
./gradlew :owncloudData:testDebugUnitTest
76+
77+
# Instrumented tests (requires running emulator/device)
78+
./gradlew :owncloudData:connectedAndroidTest
79+
80+
# Lint & static analysis
81+
./gradlew detekt # maxIssues: 0 — any issue fails CI
82+
./gradlew lintDebug
83+
./gradlew ktlintCheck
84+
./gradlew ktlintFormat # auto-fix formatting
85+
```
86+
87+
## Development Conventions
88+
89+
- **Branching (OneFlow):** `feature/feature_name`, `fix/fix_name`, `improvement/improvement_name`, `technical/technical_description`
90+
- **Commit messages:** Conventional Commits format enforced by CI (`feat:`, `fix:`, `refactor:`, `test:`, `build:`, `chore:`)
91+
- `feat:` new capability visible to users or other modules
92+
- `fix:` corrects a defect
93+
- `refactor:` restructuring with no change to observable behavior
94+
- `test:` adds or updates tests only — no production code changes
95+
- `build:` dependency changes (libs.versions.toml or any build.gradle)
96+
- `chore:` maintenance with no user-facing effect — do not use for dependency changes
97+
- **Signed commits:** All commits **must** be GPG-signed with DCO sign-off: `git commit -s -S -m "type: description"`
98+
- **Rebase policy:** Always rebase; never create merge commits. Use `git pull --rebase` before pushing.
99+
- **Code style:** Detekt (zero-tolerance, `maxIssues: 0`), ktlint, EditorConfig (max line length: 150)
100+
- **PR process:** Rebase on the target branch before opening a PR. All CI checks must pass.
101+
102+
## Changelog
103+
104+
Every PR must include a file in `changelog/unreleased/` named after the PR number (e.g., `4936`):
37105

38-
# Test (unit)
39-
./gradlew testDebugUnitTest
106+
```
107+
Enhancement: Short title under 80 chars
40108
41-
# Test (instrumented)
42-
./gradlew connectedDebugAndroidTest
109+
Description in present perfect passive tense.
43110
44-
# Lint
45-
./gradlew detekt
111+
https://github.com/owncloud/android/issues/<issue> ← optional, omit if there is no linked issue
112+
https://github.com/owncloud/android/pull/<pr>
46113
```
47114

115+
Types: `Bugfix`, `Change`, `Enhancement`, `Security`. Calens reads these files to auto-generate `CHANGELOG.md` after merge.
116+
48117
## Important Constraints
49-
- All code contributions must be compatible with the **GPL-2.0** license
50-
- Do not introduce new **copyleft-licensed dependencies** (GPL, AGPL, LGPL, MPL) without explicit discussion in an issue first. This is especially important for repos migrating to Apache 2.0.
51-
- Do not introduce new dependencies without discussion in an issue first
52-
- Minimum SDK version is 24 (Android 7.0), target SDK is 35
53-
- The app uses a clean architecture pattern with domain/data/presentation layers
54118

119+
- **No translation PRs** — submit translations to Transifex only.
120+
- **Detekt is zero-tolerance** (`maxIssues: 0`). Run `./gradlew detekt` locally before pushing.
121+
- **License migration in progress** (GPL-2.0 → Apache 2.0): do not introduce new copyleft dependencies without discussion.
122+
- **Security issues** go to security.owncloud.com, not GitHub issues.
123+
- Do not introduce new dependencies without discussion in an issue first.
55124

56125
## OSPO Policy Constraints
57126

@@ -65,12 +134,6 @@ This file provides context for AI coding agents (Claude Code, GitHub Copilot, Cu
65134
- Review and merge Dependabot PRs as part of regular maintenance.
66135
- Do not introduce new dependencies without discussion in an issue first.
67136

68-
### Git Workflow
69-
- **Rebase policy**: Always rebase; never create merge commits. Use `git pull --rebase` and `git rebase` before pushing.
70-
- **Signed commits**: All commits **must** be PGP/GPG signed (`git commit -S -s`).
71-
- **DCO sign-off**: Every commit needs a `Signed-off-by` line (`git commit -s`).
72-
- **Conventional Commits & Squash Merge**: Use the [Conventional Commits](https://www.conventionalcommits.org/) format where the repository enforces it. Many repos use squash merge, where the PR title becomes the commit message on the default branch — apply Conventional Commits format to PR titles as well. A reusable GitHub Actions workflow enforces this.
73-
74137
## Context for AI Agents
75138
- Match existing code style
76139
- Do not refactor unrelated code in the same PR

0 commit comments

Comments
 (0)