-
Notifications
You must be signed in to change notification settings - Fork 18
chore(Agents): Add agents #1994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,105 @@ | ||||||
| # kDrive Android | ||||||
|
|
||||||
| ## Project Snapshot | ||||||
|
|
||||||
| Modular Android application for kDrive cloud storage by Infomaniak. Uses MVVM architecture with Hilt DI, Realm for offline data, Ktor for API calls. Supports 3 build flavors (standard, fdroid, preprod) via Gradle composite builds with Infomaniak Core library. | ||||||
|
|
||||||
| **Languages**: Kotlin (100%), XML layouts (migrating to Compose) | ||||||
|
|
||||||
| **Key Architecture**: MVVM + Repository pattern with Hilt dependency injection | ||||||
|
|
||||||
| ## Root Setup Commands | ||||||
|
|
||||||
| ```bash | ||||||
| # Build entire project | ||||||
| ./gradlew assembleStandardDebug | ||||||
|
|
||||||
| # Run all unit tests | ||||||
| ./gradlew test | ||||||
|
|
||||||
| # Build specific flavor | ||||||
| ./gradlew assembleFdroidDebug | ||||||
| ./gradlew assemblePreprodDebug | ||||||
|
|
||||||
| # Clean build | ||||||
| ./gradlew clean | ||||||
|
|
||||||
| # Install debug on connected device | ||||||
| ./gradlew installStandardDebug | ||||||
| ``` | ||||||
|
|
||||||
| ## Universal Conventions | ||||||
|
|
||||||
| - **Kotlin code style**: Official style guide (enforced via `.editorconfig`) | ||||||
| - **Commit format**: Conventional commits recommended | ||||||
| - **Branch strategy**: Feature branches → main, create issue before PR | ||||||
| - **PR requirements**: CI must pass, at least one review for significant changes | ||||||
| - **Never commit**: API tokens, credentials, or local.properties values | ||||||
|
|
||||||
| ## Security & Secrets | ||||||
|
|
||||||
| - Never commit `.env`, `local.properties`, or API keys to repository | ||||||
| - Drive API tokens stored in Room database (encrypted) | ||||||
|
||||||
| - Drive API tokens stored in Room database (encrypted) | |
| - Drive API tokens stored in Core's Room-backed user database |
Copilot
AI
Apr 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This links to Core/AGENTS.md, but Core is a git submodule and this repository snapshot doesn’t contain that file. Unless this PR also bumps the Core submodule to a commit that adds Core/AGENTS.md, the link will be broken; please ensure the submodule reference is updated (or adjust/remove the link until it exists).
| - **Core Libraries**: `Core/` → [see Core/AGENTS.md](Core/AGENTS.md) | |
| - **Core Libraries**: `Core/` → submodule contents live under `Core/` |
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,233 @@ | ||||||||||||||||
| # kDrive Main App | ||||||||||||||||
|
|
||||||||||||||||
| ## Package Identity | ||||||||||||||||
|
|
||||||||||||||||
| Primary kDrive Android application module. Handles cloud storage synchronization, file management, sharing, and collaboration | ||||||||||||||||
| features. Uses MVVM architecture with Hilt DI, Realm offline cache, and Ktor for API calls. | ||||||||||||||||
|
|
||||||||||||||||
| ## Setup & Run | ||||||||||||||||
|
|
||||||||||||||||
| ```bash | ||||||||||||||||
| # Build debug APK | ||||||||||||||||
| ./gradlew app:assembleStandardDebug | ||||||||||||||||
|
|
||||||||||||||||
| # Install on device | ||||||||||||||||
| ./gradlew app:installStandardDebug | ||||||||||||||||
|
|
||||||||||||||||
| # Run unit tests | ||||||||||||||||
| ./gradlew app:test | ||||||||||||||||
|
|
||||||||||||||||
| # Build F-Droid flavor | ||||||||||||||||
| ./gradlew app:assembleFdroidDebug | ||||||||||||||||
|
|
||||||||||||||||
| # Build pre-production | ||||||||||||||||
| ./gradlew app:assemblePreprodDebug | ||||||||||||||||
| ``` | ||||||||||||||||
|
|
||||||||||||||||
| ## Architecture Patterns | ||||||||||||||||
|
|
||||||||||||||||
| ### MVVM Structure | ||||||||||||||||
|
|
||||||||||||||||
| ``` | ||||||||||||||||
| app/src/main/java/com/infomaniak/drive/ | ||||||||||||||||
| ├── data/ # Repositories, API, cache, models | ||||||||||||||||
| ├── ui/ # Activities, Fragments, ViewModels | ||||||||||||||||
| ├── di/ # Hilt modules (ApplicationModule, ActivityModule) | ||||||||||||||||
| ├── extensions/ # Kotlin extensions | ||||||||||||||||
| └── utils/ # Utility classes | ||||||||||||||||
| ``` | ||||||||||||||||
|
|
||||||||||||||||
| ### Data Layer | ||||||||||||||||
|
|
||||||||||||||||
| - **api/**: Ktor API clients and repository implementations | ||||||||||||||||
| - **cache/**: Realm database configuration and DAOs | ||||||||||||||||
| - **models/**: Data classes (File, Drive, User, etc.) | ||||||||||||||||
| - **sync/**: Background synchronization logic | ||||||||||||||||
| - **services/**: Foreground services for uploads/downloads | ||||||||||||||||
|
|
||||||||||||||||
| ### Key Dependencies Management | ||||||||||||||||
|
|
||||||||||||||||
| - Hilt modules: `di/ApplicationModule.kt`, `di/ActivityModule.kt` | ||||||||||||||||
| - Token provider: `TokenInterceptorListenerProvider.kt` | ||||||||||||||||
| - App initialization: `MainApplication.kt` | ||||||||||||||||
|
|
||||||||||||||||
| ## Patterns & Conventions | ||||||||||||||||
|
|
||||||||||||||||
| ### ViewModel Creation | ||||||||||||||||
|
|
||||||||||||||||
| - **DO**: Inject dependencies via constructor | ||||||||||||||||
| ```kotlin | ||||||||||||||||
| @HiltViewModel | ||||||||||||||||
| class FileListViewModel @Inject constructor( | ||||||||||||||||
| private val fileRepository: FileRepository, | ||||||||||||||||
| savedStateHandle: SavedStateHandle | ||||||||||||||||
| ) : ViewModel() | ||||||||||||||||
| ``` | ||||||||||||||||
|
benjaminVadon marked this conversation as resolved.
|
||||||||||||||||
| - **DON'T**: Use AndroidViewModel unless absolutely necessary (e.g., need Application context) | ||||||||||||||||
|
|
||||||||||||||||
| ### Fragment Pattern | ||||||||||||||||
|
|
||||||||||||||||
| - **DO**: Use Navigation Component with Safe Args | ||||||||||||||||
| - Example: `ui/fileList/FileListFragment.kt` | ||||||||||||||||
| - **DON'T**: Use FragmentTransaction directly | ||||||||||||||||
|
|
||||||||||||||||
| ### Background Work | ||||||||||||||||
|
|
||||||||||||||||
| - **DO**: Use WorkManager for sync operations | ||||||||||||||||
| - Location: `data/sync/` for workers | ||||||||||||||||
| - **DON'T**: Use raw Threads or AsyncTask | ||||||||||||||||
|
|
||||||||||||||||
| ### API Calls | ||||||||||||||||
|
|
||||||||||||||||
| - **DO**: Use repository pattern with Ktor | ||||||||||||||||
| - Example: `data/api/ApiRepository.kt` | ||||||||||||||||
| - Wrapper: `data/api/ApiService.kt` | ||||||||||||||||
|
||||||||||||||||
| - Wrapper: `data/api/ApiService.kt` | |
| - Entry point: `data/api/ApiRepository.kt` |
Copilot
AI
Apr 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section says Realm models should use @RealmClass, but data/models/File.kt (the provided example) is an open class ... : RealmObject() without @RealmClass. Please reword to match actual usage (e.g., open class : RealmObject() and @RealmClass only where needed, such as embedded objects).
| - **DO**: Use `@RealmClass` annotation, open classes | |
| - **DO**: Define Realm models as `open class ... : RealmObject()` | |
| - Use `@RealmClass` only where needed (for example, embedded Realm objects) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: Correct the file path reference for the User model. The current reference to UiSettings.kt appears to be a copy-paste error from the line below it, as UiSettings typically stores UI preferences rather than User account data, which would mislead developers navigating the codebase. [general, importance: 6]
| - User: `data/models/UiSettings.kt` | |
| - User: `data/models/User.kt` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: The User model is incorrectly mapped to UiSettings.kt, which likely contains UI preferences rather than user account data. This documentation error could mislead developers or AI agents attempting to locate the User data class. Update the reference to point to the actual User model file (typically data/models/User.kt or similar). [general, importance: 7]
| - User: `data/models/UiSettings.kt` | |
| - User: `data/models/User.kt` |
Copilot
AI
Apr 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The “Models” list labels UiSettings.kt as “User”, but the app’s user model comes from Core (com.infomaniak.core.auth.models.user.User) and UiSettings is preference storage. Please point “User” to the correct type/file (or rename this entry) to avoid misleading new contributors.
| - User: `data/models/UiSettings.kt` | |
| - UI settings: `data/models/UiSettings.kt` | |
| - User (Core): `com.infomaniak.core.auth.models.user.User` |
Copilot
AI
Apr 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data/sync/SyncAdapter.kt is referenced here, but app/src/main/java/com/infomaniak/drive/data/sync/ currently contains workers (e.g., MediaObserverWorker.kt) and no SyncAdapter.kt. Please update this reference to an existing worker/entry point for sync.
| - Sync adapter: `data/sync/SyncAdapter.kt` | |
| - Sync worker: `data/sync/MediaObserverWorker.kt` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: The entry incorrectly labels a WorkManager Worker as a Service. UploadWorker extends Worker or CoroutineWorker, not Service. Correct the terminology to prevent confusion when developers search for background upload components using the wrong architectural pattern. [general, importance: 6]
| - Upload service: `data/services/UploadWorker.kt` | |
| - Upload worker: `data/services/UploadWorker.kt` |
Copilot
AI
Apr 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wording: “raise a warning for the user that he MUST …” is unclear (who raises the warning?) and uses gendered language. Please rephrase to a concrete action (e.g., add a PR checklist item) and use neutral wording (“they/the user”, avoid all-caps MUST unless it’s an enforced rule).
| - After every change in strings.xml files, raise a warning for the user that he MUST mirror the changes to Loco | |
| - After every change in `strings.xml` files, remind the user to mirror the changes to Loco |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: The executeTransactionAwait() method belongs to the deprecated Realm Java Coroutines extension. Modern Realm Kotlin (io.realm.kotlin) uses realm.write { } for suspend functions. Update this guidance to prevent compilation errors when implementing Realm transactions with coroutines. [general, importance: 7]
| - **Realm transactions**: Always use `realm.executeTransactionAwait()` with coroutines | |
| - **Realm transactions**: Always use `realm.write { }` for suspend operations or `realm.writeBlocking { }` for synchronous operations |
Copilot
AI
Apr 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
realm.executeTransactionAwait() is mentioned as the required pattern, but this symbol doesn’t exist anywhere in this repository (no matches in source). Please update this “Realm transactions” gotcha to the actual coroutine-friendly transaction API used in the app (or add the missing helper if it’s intended).
| - **Realm transactions**: Always use `realm.executeTransactionAwait()` with coroutines | |
| - **Realm transactions**: Use the coroutine-friendly Realm write/transaction pattern already established in the surrounding app code; do not reference `realm.executeTransactionAwait()` unless that helper is actually added to the project |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This says “Kotlin (100%)” but the project also contains XML resources/layouts (and is “migrating to Compose”). Please adjust the wording to avoid a factual inconsistency (e.g., “Mostly Kotlin” / “Primary language: Kotlin”).