Repository: codemagic-ci-cd/cli-tools (language: python)

Issue:
Feature: Allow using custom tracks with `google-play`
The main purpose of this PR is to add support for custom tracks in `google-play get-latest-build-number` (addresses isseu #152).

**Updated actions**
- `google-play get-latest-build-number`

**New actions**
- `google-play tracks get`
- `google-play tracks list`

In order to support custom release tracks predefined track names were removed entirely, and a single request is now made to Google Play API, which returns all tracks, instead of querying each track separately. That way we get access to all available tracks.

Some quite significant changes were applied the codebase in order to get this done nicely in a modular way. Full overview of the changes are documented under the changelog entry.


Discussion / hints:

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 57d366ed..7e85f2c8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -49,7 +49,11 @@ Changes in this release improve usability of tool `google-play`. Updates are fro
 
 **Docs**
 
-- TBD
+- Update docs for tool `google-play`.
+- Update docs for action `google-play get-latest-build-number`.
+- Add docs for action group `google-play tracks`.
+- Add docs for action `google-play tracks get`.
+- Add docs for action `google-play tracks list`.
 
 Version 0.23.1
 -------------
diff --git a/docs/google-play/README.md b/docs/google-play/README.md
index 53187f2b..774f8b57 100644
--- a/docs/google-play/README.md
+++ b/docs/google-play/README.md
@@ -7,32 +7,15 @@ google-play
 ### Usage
 ```bash
 google-play [-h] [--log-stream STREAM] [--no-color] [--version] [-s] [-v]
-    --package-name PACKAGE_NAME
     [--credentials GCLOUD_SERVICE_ACCOUNT_CREDENTIALS]
-    [--log-api-calls]
-    [--json]
     ACTION
 ```
-### Required arguments for command `google-play`
-
-##### `--package-name=PACKAGE_NAME`
-
-
-Package name of the app in Google Play Console (Ex: com.google.example)
 ### Optional arguments for command `google-play`
 
 ##### `--credentials=GCLOUD_SERVICE_ACCOUNT_CREDENTIALS`
 
 
 Gcloud service account credentials with `JSON` key type to access Google Play Developer API. If not given, the value will be checked from the environment variable `GCLOUD_SERVICE_ACCOUNT_CREDENTIALS`. Alternatively to entering CREDENTIALS in plaintext, it may also be specified using the `@env:` prefix followed by an environment variable name, or the `@file:` prefix followed by a path to the file containing the value. Example: `@env:<variable>` uses the value in the environment variable named `<variable>`, and `@file:<file_path>` uses the value from the file at `<file_path>`.
-##### `--log-api-calls`
-
-
-Turn on logging for Google Play Developer API requests
-##### `--json`
-
-
-Whether to show the request response in JSON format
 ### Common options
 
 ##### `-h, --help`
@@ -64,3 +47,9 @@ Enable verbose logging for commands
 |Action|Description|
 | :--- | :--- |
 |[`get-latest-build-number`](get-latest-build-number.md)|Get latest build number from Google Play Developer API matching given constraints|
+
+### Action groups
+
+|Action group|Description|
+| :--- | :--- |
+|[`tracks`](tracks.md)|Manage your Google Play release tracks|
diff --git a/docs/google-play/tracks.md b/docs/google-play/tracks.md
new file mode 100644
index 00000000..518d41af
--- /dev/null
+++ b/docs/google-play/tracks.md
@@ -0,0 +1,50 @@
+
+tracks
+======
+
+
+**Manage your Google Play release tracks**
+### Usage
+```bash
+google-play tracks [-h] [--log-stream STREAM] [--no-color] [--version] [-s] [-v]
+    [--credentials GCLOUD_SERVICE_ACCOUNT_CREDENTIALS]
+    ACTION
+```
+### Optional arguments for command `google-play`
+
+##### `--credentials=GCLOUD_SERVICE_ACCOUNT_CREDENTIALS`
+
+
+Gcloud service account credentials with `JSON` key type to access Google Play Developer API. If not given, the value will be checked from the environment variable `GCLOUD_SERVICE_ACCOUNT_CREDENTIALS`. Alternatively to entering CREDENTIALS in plaintext, it may also be specified using the `@env:` prefix followed by an environment variable name, or the `@file:` prefix followed by a path to the file containing the value. Example: `@env:<variable>` uses the value in the environment variable named `<variable>`, and `@file:<file_path>` uses the value from the file at `<file_path>`.
+### Common options
+
+##### `-h, --help`
+
+
+show this help message and exit
+##### `--log-stream=stderr | stdout`
+
+
+Log output stream. Default `stderr`
+##### `--no-color`
+
+
+Do not use ANSI colors to format terminal output
+##### `--version`
+
+
+Show tool version and exit
+##### `-s, --silent`
+
+
+Disable log output for commands
+##### `-v, --verbose`
+
+
+Enable verbose logging for commands
+### Actions
+
+|Action|Description|
+| :--- | :--- |
+|[`get`](tracks/get.md)|Get information about specified track from Google Play Developer API|
+|[`list`](tracks/list.md)|Get information about specified track from Google Play Developer API|
diff --git a/docs/google-play/tracks/get.md b/docs/google-play/tracks/get.md
new file mode 100644
index 00000000..44b7574f
--- /dev/null
+++ b/docs/google-play/tracks/get.md
@@ -0,0 +1,62 @@
+
+get
+===
+
+
+**Get information about specified track from Google Play Developer API**
+### Usage
+```bash
+google-play tracks get [-h] [--log-stream STREAM] [--no-color] [--version] [-s] [-v]
+    [--credentials GCLOUD_SERVICE_ACCOUNT_CREDENTIALS]
+    [--json]
+    --package-name PACKAGE_NAME
+    --track TRACK_NAME
+```
+### Required arguments for action `get`
+
+##### `--package-name, -p=PACKAGE_NAME`
+
+
+Package name of the app in Google Play Console. For example `com.example.app`
+##### `--track, -t=TRACK_NAME`
+
+
+Release track name. For example `alpha` or `production`
+### Optional arguments for action `get`
+
+##### `--json, -j`
+
+
+Whether to show the request response in JSON format
+### Optional arguments for command `google-play`
+
+##### `--credentials=GCLOUD_SERVICE_ACCOUNT_CREDENTIALS`
+
+
+Gcloud service account credentials with `JSON` key type to access Google Play Developer API. If not given, the value will be checked from the environment variable `GCLOUD_SERVICE_ACCOUNT_CREDENTIALS`. Alternatively to entering CREDENTIALS in plaintext, it may also be specified using the `@env:` prefix followed by an environment variable name, or the `@file:` prefix followed by a path to the file containing the value. Example: `@env:<variable>` uses the value in the environment variable named `<variable>`, and `@file:<file_path>` uses the value from the file at `<file_path>`.
+### Common options
+
+##### `-h, --help`
+
+
+show this help message and exit
+##### `--log-stream=stderr | stdout`
+
+
+Log output stream. Default `stderr`
+##### `--no-color`
+
+
+Do not use ANSI colors to format terminal output
+##### `--version`
+
+
+Show tool version and exit
+##### `-s, --silent`
+
+
+Disable log output for commands
+##### `-v, --verbose`
+
+
+Enable verbose logging for commands
\ No newline at end of file
diff --git a/docs/google-play/tracks/list.md b/docs/google-play/tracks/list.md
new file mode 100644
index 00000000..a859d517
--- /dev/null
+++ b/docs/google-play/tracks/list.md
@@ -0,0 +1,57 @@
+
+list
+====
+
+
+**Get information about specified track from Google Play Developer API**
+### Usage
+```bash
+google-play tracks list [-h] [--log-stream STREAM] [--no-color] [--version] [-s] [-v]
+    [--credentials GCLOUD_SERVICE_ACCOUNT_CREDENTIALS]
+    [--json]
+    --package-name PACKAGE_NAME
+```
+### Required arguments for action `list`
+
+##### `--package-name, -p=PACKAGE_NAME`
+
+
+Package name of the app in Google Play Console. For example `com.example.app`
+### Optional arguments for action `list`
+
+##### `--json, -j`
+
+
+Whether to show the request response in JSON format
+### Optional arguments for command `google-play`
+
+##### `--credentials=GCLOUD_SERVICE_ACCOUNT_CREDENTIALS`
+
+
+Gcloud service account credentials with `JSON` key type to access Google Play Developer API. If not given, the value will be checked from the environment variable `GCLOUD_SERVICE_ACCOUNT_CREDENTIALS`. Alternatively to entering CREDENTIALS in plaintext, it may also be specified using the `@env:` prefix followed by an environment variable name, or the `@file:` prefix followed by a path to the file containing the value. Example: `@env:<variable>` uses the value in the environment variable named `<variable>`, and `@file:<file_path>` uses the value from the file at `<file_path>`.
+### Common options
+
+##### `-h, --help`
+
+
+show this help message and exit
+##### `--log-stream=stderr | stdout`
+
+
+Log output stream. Default `stderr`
+##### `--no-color`
+
+
+Do not use ANSI colors to format terminal output
+##### `--version`
+
+
+Show tool version and exit
+##### `-s, --silent`
+
+
+Disable log output for commands
+##### `-v, --verbose`
+
+
+Enable verbose logging for commands
\ No newline at end of file


Test patch:
diff --git a/docs/google-play/get-latest-build-number.md b/docs/google-play/get-latest-build-number.md
index fc5b3978..4b1c3d8f 100644
--- a/docs/google-play/get-latest-build-number.md
+++ b/docs/google-play/get-latest-build-number.md
@@ -7,38 +7,28 @@ get-latest-build-number
 ### Usage
 ```bash
 google-play get-latest-build-number [-h] [--log-stream STREAM] [--no-color] [--version] [-s] [-v]
-    --package-name PACKAGE_NAME
     [--credentials GCLOUD_SERVICE_ACCOUNT_CREDENTIALS]
-    [--log-api-calls]
-    [--json]
     [--tracks TRACKS]
+    --package-name PACKAGE_NAME
 ```
-### Optional arguments for action `get-latest-build-number`
+### Required arguments for action `get-latest-build-number`
 
-##### `--tracks=internal | alpha | beta | production`
+##### `--package-name, -p=PACKAGE_NAME`
 
 
-Get the build number from the specified track(s). If not specified, the highest build number across all tracks (internal, alpha, beta, production) is returned. Multiple arguments
-### Required arguments for command `google-play`
+Package name of the app in Google Play Console. For example `com.example.app`
+### Optional arguments for action `get-latest-build-number`
 
-##### `--package-name=PACKAGE_NAME`
+##### `--tracks, -t=TRACKS`
 
 
-Package name of the app in Google Play Console (Ex: com.google.example)
+Get the build number from the specified track(s). If not specified, the highest build number across all tracks is returned. Multiple arguments
 ### Optional arguments for command `google-play`
 
 ##### `--credentials=GCLOUD_SERVICE_ACCOUNT_CREDENTIALS`
 
 
 Gcloud service account credentials with `JSON` key type to access Google Play Developer API. If not given, the value will be checked from the environment variable `GCLOUD_SERVICE_ACCOUNT_CREDENTIALS`. Alternatively to entering CREDENTIALS in plaintext, it may also be specified using the `@env:` prefix followed by an environment variable name, or the `@file:` prefix followed by a path to the file containing the value. Example: `@env:<variable>` uses the value in the environment variable named `<variable>`, and `@file:<file_path>` uses the value from the file at `<file_path>`.
-##### `--log-api-calls`
-
-
-Turn on logging for Google Play Developer API requests
-##### `--json`
-
-
-Whether to show the request response in JSON format
 ### Common options
 
 ##### `-h, --help`