From 4f9a9906c9d4b6b28533015e7c635561d7f4c7dd Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Thu, 27 Jul 2017 13:35:07 -0700 Subject: [PATCH] Do not automatically update apps with a major version change (future) pre-1.0 packages can be considered 'experimental' Fixes #342 --- docs/tutorials/packaging.md | 4 +++- src/apps.js | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/tutorials/packaging.md b/docs/tutorials/packaging.md index 733bf847b..06f53a9cf 100644 --- a/docs/tutorials/packaging.md +++ b/docs/tutorials/packaging.md @@ -692,7 +692,9 @@ For example, let's assume the versions 1.1.3, 1.1.4, 1.1.5, 1.2.4, 1.2.6, 1.3.0, * Once in 1.2.6, the app will update to 1.3.0 * Once in 1.3.0, the app will update to 2.0.0 -The Cloudron admins get notified by email for any major or minor app releases. +Packages with a major version bump are not auto-updated. They require the Cloudron admin to click the +update button. The intention is that the packager can pass on some instructions about possible breakages +in the changelog. ## Failed updates diff --git a/src/apps.js b/src/apps.js index 47ad8ef4c..71d5bd3f4 100644 --- a/src/apps.js +++ b/src/apps.js @@ -1001,6 +1001,8 @@ function updateApps(updateInfo, auditSource, callback) { // updateInfo is { appI assert.strictEqual(typeof callback, 'function'); function canAutoupdateApp(app, newManifest) { + if ((semver.major(app.manifest.version) !== 0) && (semver.major(app.manifest.version) !== semver.major(newManifest.version))) return false; // major changes are blocking + var newTcpPorts = newManifest.tcpPorts || { }; var oldTcpPorts = app.manifest.tcpPorts || { }; var portBindings = app.portBindings; // this is never null