Skip to content
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

Data scratch - device model #1745

Closed
jan-goral opened this issue Mar 29, 2021 · 0 comments · Fixed by #1834
Closed

Data scratch - device model #1745

jan-goral opened this issue Mar 29, 2021 · 0 comments · Fixed by #1834

Comments

@jan-goral
Copy link
Contributor

Plan

According to the specification described in epic #1727
add abstraction and implementation for the following part of the data layer:

Abstraction

ftl/data/DeviceModels.kt

package ftl.data

val fetchDeviceModelAndroid: DeviceModel.Android.Fetch get() = TODO()
val fetchDeviceModelIos: DeviceModel.Ios.Fetch get() = TODO()

object DeviceModel {

    data class Android(
        val id: String,
        val name: String,
        val tags: List<String>,
        val screenX: Int,
        val screenY: Int,
        val formFactor: String,
        val screenDensity: Int,
        val supportedVersionIds: List<String>,
        val form: String,
        val brand: String,
        val codename: String,
        val manufacturer: String,
        val thumbnailUrl: String,
        val supportedAbis: List<String>,
        val lowFpsVideoRecording: Boolean,
    ) {

        interface Fetch : (projectId: String) -> List<Android>
    }

    data class Ios(
        val id: String,
        val name: String,
        val tags: List<String>,
        val screenX: Int,
        val screenY: Int,
        val formFactor: String,
        val screenDensity: Int,
        val supportedVersionIds: List<String>,
        val deviceCapabilities: List<String>,
    ) {

        interface Fetch : (projectId: String) -> List<Ios>
    }
}

Target

  • AndroidModelDescribeCommand -> AndroidCatalog/describeModel -> AndroidCatalog/getModels
  • AndroidModelsListCommand -> AndroidCatalog/devicesCatalogAsTable -> AndroidCatalog/getModels
  • IosModelDescribeCommand -> IosCatalog/describeModel -> IosCatalog/getModels
  • IosModelsListCommand -> IosCatalog/devicesCatalogAsTable -> IosCatalog/getModels
  • AndroidArgs/validate -> AndroidArgs/assertDevicesSupported
    • AndroidCatalog/supportedDeviceConfig -> AndroidCatalog/deviceCatalog(projectId).models
    • AndroidCatalog/androidModelIds -> AndroidCatalog/deviceCatalog(projectId).models
    • AndroidCatalog/getSupportedVersionId -> AndroidCatalog/deviceCatalog(projectId).models
  • IosArgs/validateRefresh -> IosArgs/assertDevicesSupported -> IosCatalog/iosDeviceCatalog(projectId).models

Adapter

  • ftl/adapter/GoogleDeviceModelAndroidFetch.kt
  • ftl/adapter/GoogleDeviceModelIosFetch.kt
@piotradamczyk5 piotradamczyk5 self-assigned this Apr 20, 2021
@mergify mergify bot closed this as completed in #1834 Apr 23, 2021
mergify bot pushed a commit that referenced this issue Apr 23, 2021
Fixes #1745

## Test Plan
> How do we know the code works?

- Code is refactored according to the description in #1745
- commands working property
  - `android models describe`
  - `ios models describe`
  - `android models list`
  - `ios models describe`
- iOS and Android run validation works properly 

## Checklist

- [x] Unit tested
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants