Skip to content

chore(Agents): Add agents#1994

Open
FabianDevel wants to merge 1 commit intomainfrom
add-agents.md
Open

chore(Agents): Add agents#1994
FabianDevel wants to merge 1 commit intomainfrom
add-agents.md

Conversation

@FabianDevel
Copy link
Copy Markdown
Contributor

@FabianDevel FabianDevel added documentation Improvements or additions to documentation enhancement New feature or request labels Mar 31, 2026
@github-actions github-actions Bot added the dependent This MR depends on another PR label Mar 31, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 31, 2026

PR Reviewer Guide 🔍

(Review updated until commit 2aad25e)

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected

Comment thread app/AGENTS.md
### Models
- File: `data/models/File.kt`
- Drive: `data/models/Drive.kt`
- User: `data/models/UiSettings.kt`
Copy link
Copy Markdown
Contributor

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]

Suggested change
- User: `data/models/UiSettings.kt`
- User: `data/models/User.kt`

Comment thread app/AGENTS.md
Comment thread app/AGENTS.md
Comment thread app/AGENTS.md
@github-actions
Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 2aad25e

Comment thread app/AGENTS.md

- File: `data/models/File.kt`
- Drive: `data/models/Drive.kt`
- User: `data/models/UiSettings.kt`
Copy link
Copy Markdown
Contributor

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]

Suggested change
- User: `data/models/UiSettings.kt`
- User: `data/models/User.kt`

Comment thread app/AGENTS.md

## Common Gotchas

- **Realm transactions**: Always use `realm.executeTransactionAwait()` with coroutines
Copy link
Copy Markdown
Contributor

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]

Suggested change
- **Realm transactions**: Always use `realm.executeTransactionAwait()` with coroutines
- **Realm transactions**: Always use `realm.write { }` for suspend operations or `realm.writeBlocking { }` for synchronous operations

Comment thread app/AGENTS.md
### Sync & Services

- Sync adapter: `data/sync/SyncAdapter.kt`
- Upload service: `data/services/UploadWorker.kt`
Copy link
Copy Markdown
Contributor

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]

Suggested change
- Upload service: `data/services/UploadWorker.kt`
- Upload worker: `data/services/UploadWorker.kt`

@github-actions github-actions Bot removed the dependent This MR depends on another PR label Apr 23, 2026
@github-actions
Copy link
Copy Markdown
Contributor

This PR/issue depends on:

Copilot AI review requested due to automatic review settings April 23, 2026 09:11
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds agent-facing documentation (AGENTS.md) at the repository root and for the app/ module to help contributors quickly understand structure, conventions, and common commands.

Changes:

  • Add root-level AGENTS.md with project snapshot, setup commands, conventions, and module pointers.
  • Add app/AGENTS.md describing app architecture, key files, quick search commands, and testing notes.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 9 comments.

File Description
AGENTS.md Root “agent guide” with project-wide setup/conventions and links to module-specific guides.
app/AGENTS.md App-module-specific guide covering architecture, key paths, commands, and gotchas.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/AGENTS.md

### Realm Models

- **DO**: Use `@RealmClass` annotation, open classes
Copy link

Copilot AI Apr 23, 2026

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).

Suggested change
- **DO**: Use `@RealmClass` annotation, open classes
- **DO**: Define Realm models as `open class ... : RealmObject()`
- Use `@RealmClass` only where needed (for example, embedded Realm objects)

Copilot uses AI. Check for mistakes.
Comment thread app/AGENTS.md

### Sync & Services

- Sync adapter: `data/sync/SyncAdapter.kt`
Copy link

Copilot AI Apr 23, 2026

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.

Suggested change
- Sync adapter: `data/sync/SyncAdapter.kt`
- Sync worker: `data/sync/MediaObserverWorker.kt`

Copilot uses AI. Check for mistakes.
Comment thread app/AGENTS.md

### String resources

- After every change in strings.xml files, raise a warning for the user that he MUST mirror the changes to Loco
Copy link

Copilot AI Apr 23, 2026

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).

Suggested change
- 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

Copilot uses AI. Check for mistakes.
Comment thread AGENTS.md

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)
Copy link

Copilot AI Apr 23, 2026

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”).

Suggested change
**Languages**: Kotlin (100%), XML layouts (migrating to Compose)
**Languages**: Primary language: Kotlin, with XML layouts/resources (migrating to Compose)

Copilot uses AI. Check for mistakes.
Comment thread AGENTS.md
## Security & Secrets

- Never commit `.env`, `local.properties`, or API keys to repository
- Drive API tokens stored in Room database (encrypted)
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“Drive API tokens stored in Room database (encrypted)” is too specific for what’s visible in this repo: the app uses Core’s UserDatabase (Room) for users/tokens, but the encryption aspect isn’t verifiable here. Please either link to the Core implementation that enforces encryption or soften the claim to avoid misinformation.

Suggested change
- Drive API tokens stored in Room database (encrypted)
- Drive API tokens stored in Core's Room-backed user database

Copilot uses AI. Check for mistakes.
Comment thread AGENTS.md
### Module Structure

- **Main App**: `app/` → [see app/AGENTS.md](app/AGENTS.md)
- **Core Libraries**: `Core/` → [see Core/AGENTS.md](Core/AGENTS.md)
Copy link

Copilot AI Apr 23, 2026

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).

Suggested change
- **Core Libraries**: `Core/`[see Core/AGENTS.md](Core/AGENTS.md)
- **Core Libraries**: `Core/`submodule contents live under `Core/`

Copilot uses AI. Check for mistakes.
Comment thread app/AGENTS.md

## Common Gotchas

- **Realm transactions**: Always use `realm.executeTransactionAwait()` with coroutines
Copy link

Copilot AI Apr 23, 2026

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).

Suggested change
- **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

Copilot uses AI. Check for mistakes.
Comment thread app/AGENTS.md

- **DO**: Use repository pattern with Ktor
- Example: `data/api/ApiRepository.kt`
- Wrapper: `data/api/ApiService.kt`
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ApiService.kt is referenced as an API wrapper, but there is no data/api/ApiService.kt in this module (only ApiRepository.kt, ApiRoutes.kt, etc.). Please update the reference to an existing entry point or add the missing wrapper file so the guide doesn’t point readers to a non-existent path.

Suggested change
- Wrapper: `data/api/ApiService.kt`
- Entry point: `data/api/ApiRepository.kt`

Copilot uses AI. Check for mistakes.
Comment thread app/AGENTS.md

- File: `data/models/File.kt`
- Drive: `data/models/Drive.kt`
- User: `data/models/UiSettings.kt`
Copy link

Copilot AI Apr 23, 2026

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.

Suggested change
- User: `data/models/UiSettings.kt`
- UI settings: `data/models/UiSettings.kt`
- User (Core): `com.infomaniak.core.auth.models.user.User`

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request Review effort 1/5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants