Give more commands "--allow-incompatible-change"

build, deploy, --prepare-app, and --get-ready for now.

Make the error message more generic (not mention which commands
support the flag, because it will be basically "all" of them). Also
replace "breaking" with "potentially incompatible" as discussed with
Matt a while back.
This commit is contained in:
David Greenspan
2015-03-10 03:50:41 -07:00
parent 284f4ad6aa
commit 3d64b13555
5 changed files with 33 additions and 12 deletions

View File

@@ -184,7 +184,7 @@ Tinytest.add("constraint solver - input - don't break root dep", function (test)
"bar 2.0.1": []
}
}
}, 'Breaking change required to top-level dependency: bar 2.0.0, was 2.0.1.\nConstraints on package "bar":\n* bar@=2.0.0 <- foo 1.0.0\n\nTo allow breaking changes to top-level dependencies, you must pass --allow-incompatible-update to meteor [run], update, add, or remove.');
}, 'Potentially incompatible change required to top-level dependency: bar 2.0.0, was 2.0.1.\nConstraints on package "bar":\n* bar@=2.0.0 <- foo 1.0.0\n\nTo allow potentially incompatible changes to top-level dependencies, you must pass --allow-incompatible-update on the command line.');
});
Tinytest.add("constraint solver - input - don't pick RCs", function (test) {

View File

@@ -713,12 +713,13 @@ CS.Solver.prototype.getSolution = function (options) {
var pv = CS.PackageAndVersion.fromString(pvStr);
var prevVersion = input.previousSolution[pv.package];
self.errors.push(
'Breaking change required to top-level dependency: ' +
'Potentially incompatible change required to top-level dependency: ' +
pvStr + ', was ' + prevVersion + '.\n' +
self.listConstraintsOnPackage(pv.package));
});
self.errors.push('To allow breaking changes to top-level dependencies, you ' +
'must pass --allow-incompatible-update to meteor [run], update, add, or remove.');
self.errors.push('To allow potentially incompatible changes to top-level ' +
'dependencies, you must pass --allow-incompatible-update ' +
'on the command line.');
self.throwAnyErrors();
}

View File

@@ -112,14 +112,18 @@ var formatArchitecture = function (s) {
// whenever necessary!
main.registerCommand({
name: '--get-ready',
catalogRefresh: new catalog.Refresh.OnceAtStart({ ignoreErrors: false })
catalogRefresh: new catalog.Refresh.OnceAtStart({ ignoreErrors: false }),
options: {
'allow-incompatible-update': { type: Boolean }
}
}, function (options) {
// If we're in an app, make sure that we can build the current app. Otherwise
// just make sure that we can build some fake app.
var projectContext = new projectContextModule.ProjectContext({
projectDir: options.appDir || files.mkdtemp('meteor-get-ready'),
neverWriteProjectConstraintsFile: true,
neverWritePackageMap: true
neverWritePackageMap: true,
allowIncompatibleUpdate: options['allow-incompatible-update']
});
main.captureAndExit("=> Errors while initializing project:", function () {
projectContext.initializeCatalog();
@@ -157,10 +161,14 @@ main.registerCommand({
main.registerCommand({
name: '--prepare-app',
requiresApp: true,
catalogRefresh: new catalog.Refresh.Never()
catalogRefresh: new catalog.Refresh.Never(),
options: {
'allow-incompatible-update': { type: Boolean }
}
}, function (options) {
var projectContext = new projectContextModule.ProjectContext({
projectDir: options.appDir
projectDir: options.appDir,
allowIncompatibleUpdate: options['allow-incompatible-update']
});
main.captureAndExit("=> Errors while initializing project:", function () {
projectContext.prepareProjectForBuild();

View File

@@ -712,7 +712,8 @@ var buildCommands = {
server: { type: String },
// XXX COMPAT WITH 0.9.2.2
"mobile-port": { type: String },
verbose: { type: Boolean, short: "v" }
verbose: { type: Boolean, short: "v" },
'allow-incompatible-update': { type: Boolean }
},
catalogRefresh: new catalog.Refresh.Never()
};
@@ -761,7 +762,8 @@ var buildCommand = function (options) {
var projectContext = new projectContextModule.ProjectContext({
projectDir: options.appDir,
serverArchitectures: _.uniq([bundleArch, archinfo.host()])
serverArchitectures: _.uniq([bundleArch, archinfo.host()]),
allowIncompatibleUpdate: options['allow-incompatible-update']
});
main.captureAndExit("=> Errors while initializing project:", function () {
@@ -1078,7 +1080,8 @@ main.registerCommand({
// it contains binary packages that should be incompatible. A hack to allow
// people to deploy from checkout or do other weird shit. We are not
// responsible for the consequences.
'override-architecture-with-local' : { type: Boolean }
'override-architecture-with-local' : { type: Boolean },
'allow-incompatible-update': { type: Boolean }
},
requiresApp: function (options) {
return ! options.delete;
@@ -1125,7 +1128,8 @@ main.registerCommand({
var projectContext = new projectContextModule.ProjectContext({
projectDir: options.appDir,
serverArchitectures: _.uniq([buildArch, archinfo.host()])
serverArchitectures: _.uniq([buildArch, archinfo.host()]),
allowIncompatibleUpdate: options['allow-incompatible-update']
});
main.captureAndExit("=> Errors while initializing project:", function () {

View File

@@ -296,6 +296,10 @@ Options:
developer machine's architecture. Valid architectures
include os.osx.x86_64, os.linux.x86_64, and
os.linux.x86_32.
--allow-incompatible-update Allow packages in your project to be upgraded or
downgraded to versions that are potentially incompatible
with the current versions, if required to satisfy all
package version constraints.
>>> shell
@@ -379,6 +383,10 @@ Options:
--delete, -D permanently delete this deployment
--debug deploy in debug mode (don't minify, etc)
--settings set optional data for Meteor.settings
--allow-incompatible-update Allow packages in your project to be upgraded or
downgraded to versions that are potentially incompatible with
the current versions, if required to satisfy all package version
constraints.
>>> logs