feat: add locales description command for ios and android#969
Conversation
Codecov Report
@@ Coverage Diff @@
## master #969 +/- ##
============================================
+ Coverage 81.28% 81.62% +0.34%
- Complexity 673 687 +14
============================================
Files 206 211 +5
Lines 3746 3816 +70
Branches 569 581 +12
============================================
+ Hits 3045 3115 +70
Misses 395 395
Partials 306 306 |
769975d to
27a10ab
Compare
| - [#970](https://github.com/Flank/flank/pull/970) Fixing Flood of snapshot releases. ([piotradamczyk5](https://github.com/piotradamczyk5)) | ||
| - [#972](https://github.com/Flank/flank/pull/972) Fix printing release version. ([piotradamczyk5](https://github.com/piotradamczyk5)) | ||
| - [#964](https://github.com/Flank/flank/pull/964) Implement network-profiles describe feature. ([pawelpasterz](https://github.com/pawelpasterz)) | ||
| - |
There was a problem hiding this comment.
Removed thanks :)
| locale.tags.filterNotNull().forEach { tag -> appendln("- $tag") } | ||
| }.toString().trim() | ||
|
|
||
| private fun String?.orErrorMessage(locale: String) = this ?: "ERROR: '$locale' is not a valid locale".trimIndent() |
There was a problem hiding this comment.
I think that trimIndent() is not needed for this simple string message
There was a problem hiding this comment.
Thanks! Changed
|
|
||
| fun getLocaleDescription(projectId: String, locale: String) = getLocales(projectId).getLocaleDescription(locale) | ||
|
|
||
| private fun getLocales(projectId: String) = deviceCatalog(projectId).runtimeConfiguration.locales |
There was a problem hiding this comment.
I am wondering why do we need projectId to make this request? I mean, I can see from the code that we use it to set a property for request under the hood, but why since it is publicly available information... maybe it's due to 'default' tag...I don't know and just thinking :)
There was a problem hiding this comment.
Probably device catalogue could be different for different project ids, so API needs this to return catalogue which is available for current projectID.
There was a problem hiding this comment.
@pawelpasterz requested change done. Thanks for the tests. I check if projectID is really required and get feedback
Edit:
We can use empty projectID and result for ios/android is the same but here we loading projectID from selected config or from the default so I think it's ok. I think every flank users have a test-lab project.
WDYT? @pawelpasterz @piotradamczyk5
There was a problem hiding this comment.
As per documenation:
`--project` and its fallback` core/project` property play two roles in the invocation. It specifies the project of the resource to operate on.
It has a fallback option, so if the project is not specified in the environmental variable and not provided by config for me it is ok to use empty
There was a problem hiding this comment.
hey, we need projectId
the reason is select projects have access to secret device catalogs 🙂 These catalogs are not available to the public.
There was a problem hiding this comment.
Probably device catalogue could be different for different project ids,
this is correct!
There was a problem hiding this comment.
Let's add a comment that explains why projectId is sent to the device catalog
pawelpasterz
left a comment
There was a problem hiding this comment.
For incorrect locale, gcloud ends run with exit code 1 where flank's s 0. I think we should also reflect this.
Thanks, changed 👍 |
b7daa90 to
56464de
Compare
56464de to
0467c16
Compare

Fixes #966
Test Plan
When run
flank should return output like gcloud cli when execute
example for
flank firebase test android locales describe enexample for
flank firebase test android locales describe plexample for the wrong LOCALE_ID
flank firebase test android locales describe testChecklist