From e60da180402d346d9ce8e7606059723ab8b41f40 Mon Sep 17 00:00:00 2001 From: Austin McGee <947888+amcgee@users.noreply.github.com> Date: Tue, 13 Jul 2021 20:33:54 +0200 Subject: [PATCH 1/2] fix: allow command-line configuration of deploy and publish upload timeouts (#588) --- cli/src/commands/deploy.js | 9 +++++++-- cli/src/commands/publish.js | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/cli/src/commands/deploy.js b/cli/src/commands/deploy.js index f5f7c8dae..d6aa515fb 100644 --- a/cli/src/commands/deploy.js +++ b/cli/src/commands/deploy.js @@ -72,7 +72,7 @@ const promptForDhis2Config = async params => { } } -const handler = async ({ cwd = process.cwd(), ...params }) => { +const handler = async ({ cwd = process.cwd(), timeout, ...params }) => { const paths = makePaths(cwd) const config = parseConfig(paths) @@ -141,7 +141,7 @@ const handler = async ({ cwd = process.cwd(), ...params }) => { headers: { ...formData.getHeaders(), }, - timeout: 30000, // Ensure we have enough time to upload a large zip file + timeout: timeout * 1000, // Ensure we have enough time to upload a large zip file }) reporter.info( `Successfully deployed ${config.name} to ${dhis2Config.baseUrl}` @@ -171,6 +171,11 @@ const command = { description: 'The username for authenticating with the DHIS2 instance', }, + timeout: { + description: + 'The timeout (in seconds) for uploading the app bundle', + default: 300, + }, }, handler, } diff --git a/cli/src/commands/publish.js b/cli/src/commands/publish.js index fd7f6ae06..f586ebaca 100644 --- a/cli/src/commands/publish.js +++ b/cli/src/commands/publish.js @@ -175,7 +175,7 @@ const promptForConfig = async params => { } } -const handler = async ({ cwd = process.cwd(), ...params }) => { +const handler = async ({ cwd = process.cwd(), timeout, ...params }) => { const publishConfig = await promptForConfig(params) const appBundle = resolveBundle(cwd, publishConfig) @@ -207,7 +207,7 @@ const handler = async ({ cwd = process.cwd(), ...params }) => { await client.post(uploadAppUrl, formData, { headers: formData.getHeaders(), - timeout: 300000, // Ensure we have enough time to upload a large zip file + timeout: timeout * 1000, // Ensure we have enough time to upload a large zip file }) reporter.info( `Successfully published ${appBundle.name} with version ${appBundle.version}` @@ -267,6 +267,11 @@ const command = { 'Only used with --file option. The semantic version of the app uploaded', implies: 'file', }, + timeout: { + description: + 'The timeout (in seconds) for uploading the app bundle', + default: 300, + }, }), handler, } From 367b30d9f5a641dffaa088f7031fd8c43c7f6485 Mon Sep 17 00:00:00 2001 From: "@dhis2-bot" Date: Tue, 13 Jul 2021 18:39:41 +0000 Subject: [PATCH 2/2] chore(release): cut 7.1.2 [skip ci] ## [7.1.2](https://github.com/dhis2/app-platform/compare/v7.1.1...v7.1.2) (2021-07-13) ### Bug Fixes * allow command-line configuration of deploy and publish upload timeouts ([#588](https://github.com/dhis2/app-platform/issues/588)) ([e60da18](https://github.com/dhis2/app-platform/commit/e60da180402d346d9ce8e7606059723ab8b41f40)) --- CHANGELOG.md | 7 +++++++ adapter/package.json | 4 ++-- cli/package.json | 4 ++-- examples/simple-app/package.json | 4 ++-- package.json | 2 +- shell/package.json | 4 ++-- 6 files changed, 16 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 262c0e33a..7068d6ca8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [7.1.2](https://github.com/dhis2/app-platform/compare/v7.1.1...v7.1.2) (2021-07-13) + + +### Bug Fixes + +* allow command-line configuration of deploy and publish upload timeouts ([#588](https://github.com/dhis2/app-platform/issues/588)) ([e60da18](https://github.com/dhis2/app-platform/commit/e60da180402d346d9ce8e7606059723ab8b41f40)) + ## [7.1.1](https://github.com/dhis2/app-platform/compare/v7.1.0...v7.1.1) (2021-07-08) diff --git a/adapter/package.json b/adapter/package.json index 16a6f9142..9acec9506 100644 --- a/adapter/package.json +++ b/adapter/package.json @@ -1,6 +1,6 @@ { "name": "@dhis2/app-adapter", - "version": "7.1.1", + "version": "7.1.2", "repository": { "type": "git", "url": "https://github.com/amcgee/dhis2-app-platform", @@ -24,7 +24,7 @@ "moment": "^2.24.0" }, "devDependencies": { - "@dhis2/cli-app-scripts": "7.1.1", + "@dhis2/cli-app-scripts": "7.1.2", "enzyme": "^3.11.0", "enzyme-adapter-react-16": "^1.15.5", "react": "^16.8", diff --git a/cli/package.json b/cli/package.json index aa48ca93e..77099f304 100644 --- a/cli/package.json +++ b/cli/package.json @@ -1,6 +1,6 @@ { "name": "@dhis2/cli-app-scripts", - "version": "7.1.1", + "version": "7.1.2", "engines": { "node": ">=12" }, @@ -28,7 +28,7 @@ "@babel/preset-env": "^7.14.7", "@babel/preset-react": "^7.0.0", "@babel/preset-typescript": "^7.6.0", - "@dhis2/app-shell": "7.1.1", + "@dhis2/app-shell": "7.1.2", "@dhis2/cli-helpers-engine": "^3.0.0", "archiver": "^3.1.1", "axios": "^0.20.0", diff --git a/examples/simple-app/package.json b/examples/simple-app/package.json index afd12c627..d361c56ca 100644 --- a/examples/simple-app/package.json +++ b/examples/simple-app/package.json @@ -1,12 +1,12 @@ { "name": "simple-app", - "version": "7.1.1", + "version": "7.1.2", "repository": "https://github.com/amcgee/dhis2-app-platform", "author": "Austin McGee ", "license": "BSD-3-Clause", "private": true, "devDependencies": { - "@dhis2/cli-app-scripts": "7.1.1" + "@dhis2/cli-app-scripts": "7.1.2" }, "scripts": { "start": "d2-app-scripts start", diff --git a/package.json b/package.json index 60738ce16..622633f95 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "root", - "version": "7.1.1", + "version": "7.1.2", "private": true, "repository": { "type": "git", diff --git a/shell/package.json b/shell/package.json index 77f836f3a..342f4f7d5 100644 --- a/shell/package.json +++ b/shell/package.json @@ -1,6 +1,6 @@ { "name": "@dhis2/app-shell", - "version": "7.1.1", + "version": "7.1.2", "repository": { "type": "git", "url": "https://github.com/amcgee/dhis2-app-platform", @@ -12,7 +12,7 @@ "access": "public" }, "dependencies": { - "@dhis2/app-adapter": "7.1.1", + "@dhis2/app-adapter": "7.1.2", "@dhis2/app-runtime": "^2.8.0", "@dhis2/d2-i18n": "^1.1.0", "@dhis2/ui": "^6.10.5",