From bad104f34406fed989e7c74687460f09b913ed81 Mon Sep 17 00:00:00 2001 From: Ivan Borshchov Date: Tue, 21 Jun 2022 23:55:54 +0300 Subject: [PATCH 1/2] implement changesNotSentForReview --- README.md | 8 ++++++++ src/Edit.ts | 5 ++++- src/actions/Upload.ts | 2 ++ src/cli/index.ts | 5 +++++ src/cli/promote.ts | 3 ++- src/cli/upload.ts | 3 ++- src/index.ts | 6 ++++-- 7 files changed, 27 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4f2d78a..ab75818 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ A fork of [playup](https://github.com/jeduan/playup). - [Usage](#usage) - [Authentication](#authentication) - [Contributing](CONTRIBUTING.md) +- [Troubleshooting](#troubleshooting) - [Authors](#authors) - [Acknowledgments](#acknowledgement) @@ -115,6 +116,13 @@ The created Service Account needs the following role: See the full docs [here](https://oss.eventone.page/apkup/classes/index.apkup). +## Troubleshooting + +If you receive "ERROR: Changes cannot be sent for review automatically. Please set the query parameter changesNotSentForReview to true. Once committed, the changes in this edit can be sent for review from the Google Play Console UI." + +then just pass `--changesNotSentForReview` param + + ## ✍️ Authors - [@nprail](https://github.com/nprail) - Maintainer diff --git a/src/Edit.ts b/src/Edit.ts index e613bec..c989683 100644 --- a/src/Edit.ts +++ b/src/Edit.ts @@ -10,6 +10,8 @@ export interface IEditParams { packageName: string /** Version code of the package to be edited. */ versionCode: number + /** Weather to set changesNotSentForReview to true. */ + changesNotSentForReview: boolean } export interface IEditResponse { @@ -112,7 +114,8 @@ export class Edit { debug('> Commiting changes') const editCommit = await this.publisher.edits.commit({ editId: this.editId, - packageName: this.editParams.packageName + packageName: this.editParams.packageName, + changesNotSentForReview: this.editParams.changesNotSentForReview ? 'true' : undefined }) debug('> Commited changes') diff --git a/src/actions/Upload.ts b/src/actions/Upload.ts index 040ce94..8290422 100644 --- a/src/actions/Upload.ts +++ b/src/actions/Upload.ts @@ -18,6 +18,8 @@ export interface IUploadParams { obbs?: string[] /** A paths to the deobfuscation file for this release. */ deobfuscation?: string + + changesNotSentForReview?: boolean } export interface IReleaseNotes { diff --git a/src/cli/index.ts b/src/cli/index.ts index 8f69628..fa0ac75 100644 --- a/src/cli/index.ts +++ b/src/cli/index.ts @@ -23,6 +23,11 @@ const argv = yargs describe: 'Path to the APK file', type: 'array' }) + .option('changesNotSentForReview', { + alias: 'cnsfr', + describe: 'Pass this argument if your App is under review to fix ERROR: Changes cannot be sent for review automatically', + type: 'boolean' + }) .config( 'key', 'Path to a JSON file that contains the private key and client email (can be specified via APKUP_KEY env variable)', diff --git a/src/cli/promote.ts b/src/cli/promote.ts index 76e0bf5..d34d36b 100644 --- a/src/cli/promote.ts +++ b/src/cli/promote.ts @@ -45,7 +45,8 @@ export const promote: CommandModule = { } const editParams: IEditParams = { packageName: argv.packageName, - versionCode: argv.versionCode + versionCode: argv.versionCode, + changesNotSentForReview: argv.changesNotSentForReview } const apkup = new Apkup(argv.auth) diff --git a/src/cli/upload.ts b/src/cli/upload.ts index cc33608..524ab79 100644 --- a/src/cli/upload.ts +++ b/src/cli/upload.ts @@ -41,7 +41,8 @@ export const upload: CommandModule = { deobfuscation: argv.deobfuscation, obbs: argv.obbs, releaseNotes: [], - track: argv.track + track: argv.track, + changesNotSentForReview: argv.changesNotSentForReview } if (argv.releaseNotes) { diff --git a/src/index.ts b/src/index.ts index 83a7f0e..7dfb3e9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -71,7 +71,8 @@ export class Apkup { const editParams: IEditParams = { packageName: apkPackage.packageName, - versionCode: apkPackage.versionCode + versionCode: apkPackage.versionCode, + changesNotSentForReview: uploadParams?.changesNotSentForReview || false } const upload = new Upload(this.client, apk, uploadParams, editParams) @@ -118,7 +119,8 @@ export class Apkup { edit = { packageName: apkPackage.packageName, - versionCode: apkPackage.versionCode + versionCode: apkPackage.versionCode, + changesNotSentForReview: editParams?.changesNotSentForReview || false } } else if (editParams) { edit = editParams From 06233c1a99b52438f2f928b34d835f93baa2761c Mon Sep 17 00:00:00 2001 From: Ivan Borshchov Date: Mon, 27 Jun 2022 20:19:58 +0300 Subject: [PATCH 2/2] Fix CLI param description --- src/cli/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli/index.ts b/src/cli/index.ts index fa0ac75..e85a62e 100644 --- a/src/cli/index.ts +++ b/src/cli/index.ts @@ -25,7 +25,7 @@ const argv = yargs }) .option('changesNotSentForReview', { alias: 'cnsfr', - describe: 'Pass this argument if your App is under review to fix ERROR: Changes cannot be sent for review automatically', + describe: 'Indicates that the changes in publish will not be reviewed until they are explicitly sent for review from the Google Play Console UI. These changes will be added to any other changes that are not yet sent for review', type: 'boolean' }) .config(