-
Notifications
You must be signed in to change notification settings - Fork 118
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
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
release_notes.md
Outdated
@@ -15,6 +15,7 @@ | |||
- [#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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed :)
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that trimIndent()
is not needed for this simple string message
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.
Thanks! Changed
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.
For flank firebase test android locales describe zu_ZA
flank is missing region
information
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably device catalogue could be different for different project ids,
this is correct!
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.
Let's add a comment that explains why projectId is sent to the device catalog
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.
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.
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 en
example for
flank firebase test android locales describe pl
example for the wrong LOCALE_ID
flank firebase test android locales describe test
Checklist