-
-
Notifications
You must be signed in to change notification settings - Fork 38
Update repo tracking system - respect repo #125
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
Merged
Moustachauve
merged 45 commits into
Moustachauve:dev
from
netmindz:copilot/update-repo-tracking-system
Mar 16, 2026
Merged
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
b7e70ff
Initial plan
Copilot c526ea0
Add multi-repository support for WLED updates
Copilot c5a901d
Fix code issues found in review
Copilot 1129f0c
Fix incorrect version reference for repo field
Copilot aef5a63
Restore UpdateSourceRegistry as fallback for missing repo field
Copilot b89efb4
Fix checkForUpdates to refresh all discovered device repositories
Copilot cd0ce47
Fix checkForUpdates to only refresh selected device's repository
Copilot a2d0b82
Update app/src/main/java/ca/cgagnier/wlednativeandroid/service/update…
netmindz 24258a2
Update app/src/main/java/ca/cgagnier/wlednativeandroid/ui/homeScreen/…
netmindz f04e26b
Centralize DEFAULT_REPO constant to avoid duplication
Copilot 48a299b
Fix data loss in database migration 9→10
Copilot a026381
Fix manual ReleaseService instantiation in DeviceEditViewModel
Copilot f5b6653
Add MoonMudules to UpdateSourceRegistry
netmindz fb1472a
Update app/src/main/java/ca/cgagnier/wlednativeandroid/service/update…
netmindz 3381ba2
More robust UpdateSourceDefinition matching
netmindz 08c88a1
Revert accidental change to agp version
netmindz b354211
Fix issues with database migration
netmindz 35444a7
Merge branch 'refs/heads/MoonModules' into copilot/update-repo-tracki…
netmindz fc30b52
Attempt at fix for "ReleaseService is being instantiated directly her…
netmindz 0d03fad
Handle forks using different names than WLED for their binaries
netmindz d15c838
Prefer UpdateSourceRegistry over repo field pending checking of accur…
netmindz 8784db1
Prioritize original repo field over registry lookup in getRepositoryF…
netmindz c8ba0c6
Never replace a build with a release name, with platform-only based b…
netmindz 654a7b1
Merge branch 'dev' into copilot/update-repo-tracking-system
netmindz 3b4b6a6
Fix null release name
netmindz 77e39ec
Fix merge typos
netmindz fa0839b
Refactor DevicesDatabase instance variable and update DeviceWebsocket…
netmindz 70f44a8
Fix Asset entity schema mismatch - add defaultValue annotation
Copilot 473e21d
Fix SQL syntax to match Room's expected schema format
Copilot 3553ecb
Bump version
netmindz c409a49
Merge remote-tracking branch 'origin/copilot/update-repo-tracking-sys…
netmindz 238bd18
Update database schema and migration for Asset table
netmindz a40cad4
Enhance repository tracking: add queries to fetch assets and versions…
netmindz d901cd6
Fix lint errors: proper formatting and typo corrections
Copilot c7adcde
Fix remaining lint issues: remove trailing whitespace and split long …
Copilot cb183a1
spotlessApply
netmindz 0d660a5
Address :app:detekt issues
netmindz e24751d
Address final :app:detekt issues
netmindz cbeef95
Update app/src/main/java/ca/cgagnier/wlednativeandroid/service/update…
netmindz 0d1f4a4
Merge branch 'dev' into pr/125
Moustachauve f455dbb
chore: Restore missing database schema version 10
Moustachauve 39bfdda
Fix race condition and remove redundant migration
Copilot 0ed8a84
Enhance device tracking: update database schema to include repository…
netmindz 1daeeea
apply code style formatting
netmindz 4c646bc
fix detekt warning for complexity
netmindz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
228 changes: 228 additions & 0 deletions
228
app/schemas/ca.cgagnier.wlednativeandroid.repository.DevicesDatabase/10.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,228 @@ | ||
| { | ||
| "formatVersion": 1, | ||
| "database": { | ||
| "version": 10, | ||
| "identityHash": "afe44fe308d1a4e01e11eb17839728ef", | ||
| "entities": [ | ||
| { | ||
| "tableName": "Device2", | ||
| "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`macAddress` TEXT NOT NULL, `address` TEXT NOT NULL, `isHidden` INTEGER NOT NULL, `originalName` TEXT NOT NULL DEFAULT '', `customName` TEXT NOT NULL DEFAULT '', `skipUpdateTag` TEXT NOT NULL DEFAULT '', `branch` TEXT NOT NULL DEFAULT 'UNKNOWN', `lastSeen` INTEGER NOT NULL DEFAULT 0, `repository` TEXT NOT NULL DEFAULT 'wled/WLED', PRIMARY KEY(`macAddress`))", | ||
| "fields": [ | ||
| { | ||
| "fieldPath": "macAddress", | ||
| "columnName": "macAddress", | ||
| "affinity": "TEXT", | ||
| "notNull": true | ||
| }, | ||
| { | ||
| "fieldPath": "address", | ||
| "columnName": "address", | ||
| "affinity": "TEXT", | ||
| "notNull": true | ||
| }, | ||
| { | ||
| "fieldPath": "isHidden", | ||
| "columnName": "isHidden", | ||
| "affinity": "INTEGER", | ||
| "notNull": true | ||
| }, | ||
| { | ||
| "fieldPath": "originalName", | ||
| "columnName": "originalName", | ||
| "affinity": "TEXT", | ||
| "notNull": true, | ||
| "defaultValue": "''" | ||
| }, | ||
| { | ||
| "fieldPath": "customName", | ||
| "columnName": "customName", | ||
| "affinity": "TEXT", | ||
| "notNull": true, | ||
| "defaultValue": "''" | ||
| }, | ||
| { | ||
| "fieldPath": "skipUpdateTag", | ||
| "columnName": "skipUpdateTag", | ||
| "affinity": "TEXT", | ||
| "notNull": true, | ||
| "defaultValue": "''" | ||
| }, | ||
| { | ||
| "fieldPath": "branch", | ||
| "columnName": "branch", | ||
| "affinity": "TEXT", | ||
| "notNull": true, | ||
| "defaultValue": "'UNKNOWN'" | ||
| }, | ||
| { | ||
| "fieldPath": "lastSeen", | ||
| "columnName": "lastSeen", | ||
| "affinity": "INTEGER", | ||
| "notNull": true, | ||
| "defaultValue": "0" | ||
| }, | ||
| { | ||
| "fieldPath": "repository", | ||
| "columnName": "repository", | ||
| "affinity": "TEXT", | ||
| "notNull": true, | ||
| "defaultValue": "'wled/WLED'" | ||
| } | ||
| ], | ||
| "primaryKey": { | ||
| "autoGenerate": false, | ||
| "columnNames": [ | ||
| "macAddress" | ||
| ] | ||
| } | ||
| }, | ||
| { | ||
| "tableName": "Version", | ||
| "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`tagName` TEXT NOT NULL, `repository` TEXT NOT NULL DEFAULT 'wled/WLED', `name` TEXT NOT NULL, `description` TEXT NOT NULL, `isPrerelease` INTEGER NOT NULL, `publishedDate` TEXT NOT NULL, `htmlUrl` TEXT NOT NULL, PRIMARY KEY(`tagName`, `repository`))", | ||
| "fields": [ | ||
| { | ||
| "fieldPath": "tagName", | ||
| "columnName": "tagName", | ||
| "affinity": "TEXT", | ||
| "notNull": true | ||
| }, | ||
| { | ||
| "fieldPath": "repository", | ||
| "columnName": "repository", | ||
| "affinity": "TEXT", | ||
| "notNull": true, | ||
| "defaultValue": "'wled/WLED'" | ||
| }, | ||
| { | ||
| "fieldPath": "name", | ||
| "columnName": "name", | ||
| "affinity": "TEXT", | ||
| "notNull": true | ||
| }, | ||
| { | ||
| "fieldPath": "description", | ||
| "columnName": "description", | ||
| "affinity": "TEXT", | ||
| "notNull": true | ||
| }, | ||
| { | ||
| "fieldPath": "isPrerelease", | ||
| "columnName": "isPrerelease", | ||
| "affinity": "INTEGER", | ||
| "notNull": true | ||
| }, | ||
| { | ||
| "fieldPath": "publishedDate", | ||
| "columnName": "publishedDate", | ||
| "affinity": "TEXT", | ||
| "notNull": true | ||
| }, | ||
| { | ||
| "fieldPath": "htmlUrl", | ||
| "columnName": "htmlUrl", | ||
| "affinity": "TEXT", | ||
| "notNull": true | ||
| } | ||
| ], | ||
| "primaryKey": { | ||
| "autoGenerate": false, | ||
| "columnNames": [ | ||
| "tagName", | ||
| "repository" | ||
| ] | ||
| } | ||
| }, | ||
| { | ||
| "tableName": "Asset", | ||
| "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`versionTagName` TEXT NOT NULL, `repository` TEXT NOT NULL DEFAULT 'wled/WLED', `name` TEXT NOT NULL, `size` INTEGER NOT NULL, `downloadUrl` TEXT NOT NULL, `assetId` INTEGER NOT NULL DEFAULT 0, PRIMARY KEY(`versionTagName`, `repository`, `name`), FOREIGN KEY(`versionTagName`, `repository`) REFERENCES `Version`(`tagName`, `repository`) ON UPDATE NO ACTION ON DELETE CASCADE )", | ||
| "fields": [ | ||
| { | ||
| "fieldPath": "versionTagName", | ||
| "columnName": "versionTagName", | ||
| "affinity": "TEXT", | ||
| "notNull": true | ||
| }, | ||
| { | ||
| "fieldPath": "repository", | ||
| "columnName": "repository", | ||
| "affinity": "TEXT", | ||
| "notNull": true, | ||
| "defaultValue": "'wled/WLED'" | ||
| }, | ||
| { | ||
| "fieldPath": "name", | ||
| "columnName": "name", | ||
| "affinity": "TEXT", | ||
| "notNull": true | ||
| }, | ||
| { | ||
| "fieldPath": "size", | ||
| "columnName": "size", | ||
| "affinity": "INTEGER", | ||
| "notNull": true | ||
| }, | ||
| { | ||
| "fieldPath": "downloadUrl", | ||
| "columnName": "downloadUrl", | ||
| "affinity": "TEXT", | ||
| "notNull": true | ||
| }, | ||
| { | ||
| "fieldPath": "assetId", | ||
| "columnName": "assetId", | ||
| "affinity": "INTEGER", | ||
| "notNull": true, | ||
| "defaultValue": "0" | ||
| } | ||
| ], | ||
| "primaryKey": { | ||
| "autoGenerate": false, | ||
| "columnNames": [ | ||
| "versionTagName", | ||
| "repository", | ||
| "name" | ||
| ] | ||
| }, | ||
| "indices": [ | ||
| { | ||
| "name": "index_Asset_versionTagName", | ||
| "unique": false, | ||
| "columnNames": [ | ||
| "versionTagName" | ||
| ], | ||
| "orders": [], | ||
| "createSql": "CREATE INDEX IF NOT EXISTS `index_Asset_versionTagName` ON `${TABLE_NAME}` (`versionTagName`)" | ||
| }, | ||
| { | ||
| "name": "index_Asset_repository", | ||
| "unique": false, | ||
| "columnNames": [ | ||
| "repository" | ||
| ], | ||
| "orders": [], | ||
| "createSql": "CREATE INDEX IF NOT EXISTS `index_Asset_repository` ON `${TABLE_NAME}` (`repository`)" | ||
| } | ||
| ], | ||
| "foreignKeys": [ | ||
| { | ||
| "table": "Version", | ||
| "onDelete": "CASCADE", | ||
| "onUpdate": "NO ACTION", | ||
| "columns": [ | ||
| "versionTagName", | ||
| "repository" | ||
| ], | ||
| "referencedColumns": [ | ||
| "tagName", | ||
| "repository" | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ], | ||
| "setupQueries": [ | ||
| "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", | ||
| "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'afe44fe308d1a4e01e11eb17839728ef')" | ||
| ] | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,8 @@ data class Info( | |
| @param:Json(name = "cn") val codeName: String? = null, | ||
| // Added in 0.15 | ||
| @param:Json(name = "release") val release: String? = null, | ||
| // Added in 0.15.2 | ||
| @param:Json(name = "repo") val repo: String? = null, | ||
|
Comment on lines
+22
to
+23
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| @param:Json(name = "name") val name: String, | ||
| @param:Json(name = "str") val syncToggleReceive: Boolean? = null, | ||
| @param:Json(name = "udpport") val udpPort: Int? = null, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,23 +35,37 @@ interface VersionDao { | |
| @Query("DELETE FROM version") | ||
| suspend fun deleteAll() | ||
|
|
||
| @Query("SELECT * FROM version WHERE repository = :repository") | ||
| suspend fun getVersionsByRepository(repository: String): List<Version> | ||
|
|
||
| @Transaction | ||
| @Query( | ||
| """ | ||
| SELECT * FROM version | ||
| WHERE isPrerelease = 0 AND tagName != '$IGNORED_TAG' | ||
| ORDER BY publishedDate DESC LIMIT 1 | ||
| WHERE repository = :repository | ||
| AND isPrerelease = 0 | ||
| AND tagName != '$IGNORED_TAG' | ||
| ORDER BY publishedDate DESC | ||
| LIMIT 1 | ||
| """, | ||
| ) | ||
| suspend fun getLatestStableVersionWithAssets(): VersionWithAssets? | ||
| suspend fun getLatestStableVersionWithAssets(repository: String): VersionWithAssets? | ||
|
|
||
| @Transaction | ||
| @Query("SELECT * FROM version WHERE tagName != '$IGNORED_TAG' ORDER BY publishedDate DESC LIMIT 1") | ||
| suspend fun getLatestBetaVersionWithAssets(): VersionWithAssets? | ||
| @Query( | ||
| """ | ||
| SELECT * FROM version | ||
| WHERE repository = :repository | ||
| AND tagName != '$IGNORED_TAG' | ||
| ORDER BY publishedDate DESC | ||
| LIMIT 1 | ||
| """, | ||
| ) | ||
| suspend fun getLatestBetaVersionWithAssets(repository: String): VersionWithAssets? | ||
|
|
||
| @Transaction | ||
| @Query("SELECT * FROM version WHERE tagName = :tagName LIMIT 1") | ||
| suspend fun getVersionByTagName(tagName: String): VersionWithAssets? | ||
| @Query("SELECT * FROM version WHERE repository = :repository AND tagName = :tagName LIMIT 1") | ||
| suspend fun getVersionByTagName(repository: String, tagName: String): VersionWithAssets? | ||
|
Comment on lines
+67
to
+68
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| @Transaction | ||
| @Query("SELECT * FROM version") | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.