@gitpod/gitpod-protocol 0.1.5-wth-argo.0 → 0.1.5-wth-test.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/builtin-theia-plugins.json +9 -9
- package/data/gitpod-schema.json +8 -22
- package/lib/accounting-protocol.d.ts +155 -0
- package/lib/accounting-protocol.d.ts.map +1 -0
- package/lib/accounting-protocol.js +109 -0
- package/lib/accounting-protocol.js.map +1 -0
- package/lib/admin-protocol.d.ts +20 -4
- package/lib/admin-protocol.d.ts.map +1 -1
- package/lib/admin-protocol.js +15 -0
- package/lib/admin-protocol.js.map +1 -1
- package/lib/analytics.d.ts +45 -0
- package/lib/analytics.d.ts.map +1 -0
- package/lib/{util/without.js → analytics.js} +4 -2
- package/lib/analytics.js.map +1 -0
- package/lib/context-url.d.ts +18 -0
- package/lib/context-url.d.ts.map +1 -0
- package/lib/context-url.js +49 -0
- package/lib/context-url.js.map +1 -0
- package/lib/{util/context-url.spec.d.ts → context-url.spec.d.ts} +3 -1
- package/lib/context-url.spec.d.ts.map +1 -0
- package/lib/context-url.spec.js +73 -0
- package/lib/context-url.spec.js.map +1 -0
- package/lib/email-protocol.d.ts +1 -2
- package/lib/email-protocol.d.ts.map +1 -1
- package/lib/email-protocol.js +4 -4
- package/lib/email-protocol.js.map +1 -1
- package/lib/encryption/container-module.js +5 -4
- package/lib/encryption/container-module.js.map +1 -1
- package/lib/encryption/encryption-engine.js +19 -20
- package/lib/encryption/encryption-engine.js.map +1 -1
- package/lib/encryption/encryption-engine.spec.js +29 -36
- package/lib/encryption/encryption-engine.spec.js.map +1 -1
- package/lib/encryption/encryption-service.js +29 -43
- package/lib/encryption/encryption-service.js.map +1 -1
- package/lib/encryption/key-provider.js +25 -30
- package/lib/encryption/key-provider.js.map +1 -1
- package/lib/env.d.ts +1 -2
- package/lib/env.d.ts.map +1 -1
- package/lib/env.js +20 -21
- package/lib/env.js.map +1 -1
- package/lib/gitpod-file-parser.js +25 -41
- package/lib/gitpod-file-parser.js.map +1 -1
- package/lib/gitpod-file-parser.spec.js +116 -116
- package/lib/gitpod-file-parser.spec.js.map +1 -1
- package/lib/gitpod-service.d.ts +132 -18
- package/lib/gitpod-service.d.ts.map +1 -1
- package/lib/gitpod-service.js +168 -256
- package/lib/gitpod-service.js.map +1 -1
- package/lib/headless-workspace-log.d.ts +8 -11
- package/lib/headless-workspace-log.d.ts.map +1 -1
- package/lib/headless-workspace-log.js +4 -7
- package/lib/headless-workspace-log.js.map +1 -1
- package/lib/ide-frontend-service.d.ts +4 -0
- package/lib/ide-frontend-service.d.ts.map +1 -1
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +5 -1
- package/lib/index.js.map +1 -1
- package/lib/messaging/browser/connection.d.ts +5 -3
- package/lib/messaging/browser/connection.d.ts.map +1 -1
- package/lib/messaging/browser/connection.js +183 -33
- package/lib/messaging/browser/connection.js.map +1 -1
- package/lib/messaging/browser/window-connection.js +35 -55
- package/lib/messaging/browser/window-connection.js.map +1 -1
- package/lib/messaging/client-call-metrics.d.ts +35 -0
- package/lib/messaging/client-call-metrics.d.ts.map +1 -0
- package/lib/messaging/client-call-metrics.js +83 -0
- package/lib/messaging/client-call-metrics.js.map +1 -0
- package/lib/messaging/connection-error-handler.js +11 -23
- package/lib/messaging/connection-error-handler.js.map +1 -1
- package/lib/messaging/error.d.ts +3 -1
- package/lib/messaging/error.d.ts.map +1 -1
- package/lib/messaging/error.js +6 -2
- package/lib/messaging/error.js.map +1 -1
- package/lib/messaging/handler.d.ts +10 -0
- package/lib/messaging/handler.d.ts.map +1 -1
- package/lib/messaging/node/connection.js +22 -22
- package/lib/messaging/node/connection.js.map +1 -1
- package/lib/messaging/proxy-factory.d.ts +2 -0
- package/lib/messaging/proxy-factory.d.ts.map +1 -1
- package/lib/messaging/proxy-factory.js +74 -159
- package/lib/messaging/proxy-factory.js.map +1 -1
- package/lib/payment-protocol.d.ts +18 -0
- package/lib/payment-protocol.d.ts.map +1 -0
- package/lib/payment-protocol.js +13 -0
- package/lib/payment-protocol.js.map +1 -0
- package/lib/permission.d.ts +2 -1
- package/lib/permission.d.ts.map +1 -1
- package/lib/permission.js +14 -13
- package/lib/permission.js.map +1 -1
- package/lib/plans.d.ts +210 -0
- package/lib/plans.d.ts.map +1 -0
- package/lib/plans.js +570 -0
- package/lib/plans.js.map +1 -0
- package/lib/protocol.d.ts +94 -16
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +104 -130
- package/lib/protocol.js.map +1 -1
- package/lib/snapshot-url.d.ts +14 -0
- package/lib/snapshot-url.d.ts.map +1 -0
- package/lib/snapshot-url.js +26 -0
- package/lib/snapshot-url.js.map +1 -0
- package/{src/util/without.ts → lib/snapshot-url.spec.d.ts} +2 -3
- package/lib/snapshot-url.spec.d.ts.map +1 -0
- package/lib/snapshot-url.spec.js +41 -0
- package/lib/snapshot-url.spec.js.map +1 -0
- package/lib/team-subscription-protocol.d.ts +73 -0
- package/lib/team-subscription-protocol.d.ts.map +1 -0
- package/lib/team-subscription-protocol.js +63 -0
- package/lib/team-subscription-protocol.js.map +1 -0
- package/lib/teams-projects-protocol.d.ts +103 -0
- package/lib/teams-projects-protocol.d.ts.map +1 -0
- package/lib/teams-projects-protocol.js +23 -0
- package/lib/teams-projects-protocol.js.map +1 -0
- package/lib/util/analytics.d.ts +8 -0
- package/lib/util/analytics.d.ts.map +1 -0
- package/lib/util/analytics.js +79 -0
- package/lib/util/analytics.js.map +1 -0
- package/lib/util/async-iterator.js +55 -133
- package/lib/util/async-iterator.js.map +1 -1
- package/lib/util/cancelable.js +17 -59
- package/lib/util/cancelable.js.map +1 -1
- package/lib/util/date-time.js +8 -8
- package/lib/util/date-time.js.map +1 -1
- package/lib/util/deferred.js +10 -12
- package/lib/util/deferred.js.map +1 -1
- package/lib/util/disposable.js +26 -39
- package/lib/util/disposable.js.map +1 -1
- package/lib/util/event.js +58 -74
- package/lib/util/event.js.map +1 -1
- package/lib/util/garbage-collected-cache.js +22 -46
- package/lib/util/garbage-collected-cache.js.map +1 -1
- package/lib/util/generate-workspace-id.d.ts.map +1 -1
- package/lib/util/generate-workspace-id.js +13 -67
- package/lib/util/generate-workspace-id.js.map +1 -1
- package/lib/util/generate-workspace-id.spec.js +34 -79
- package/lib/util/generate-workspace-id.spec.js.map +1 -1
- package/lib/util/gitpod-cookie.d.ts +20 -0
- package/lib/util/gitpod-cookie.d.ts.map +1 -0
- package/lib/util/gitpod-cookie.js +44 -0
- package/lib/util/gitpod-cookie.js.map +1 -0
- package/lib/util/gitpod-host-url.d.ts +1 -1
- package/lib/util/gitpod-host-url.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.js +98 -98
- package/lib/util/gitpod-host-url.js.map +1 -1
- package/lib/util/gitpod-host-url.spec.d.ts +7 -1
- package/lib/util/gitpod-host-url.spec.d.ts.map +1 -1
- package/lib/util/gitpod-host-url.spec.js +103 -31
- package/lib/util/gitpod-host-url.spec.js.map +1 -1
- package/lib/util/grpc.d.ts +15 -0
- package/lib/util/grpc.d.ts.map +1 -0
- package/lib/util/grpc.js +18 -0
- package/lib/util/grpc.js.map +1 -0
- package/lib/util/logging.d.ts +49 -33
- package/lib/util/logging.d.ts.map +1 -1
- package/lib/util/logging.js +107 -110
- package/lib/util/logging.js.map +1 -1
- package/lib/util/make-link.js +2 -2
- package/lib/util/make-link.js.map +1 -1
- package/lib/util/parse-workspace-id.d.ts +10 -0
- package/lib/util/parse-workspace-id.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.js +32 -7
- package/lib/util/parse-workspace-id.js.map +1 -1
- package/lib/util/parse-workspace-id.spec.d.ts +4 -0
- package/lib/util/parse-workspace-id.spec.d.ts.map +1 -1
- package/lib/util/parse-workspace-id.spec.js +123 -84
- package/lib/util/parse-workspace-id.spec.js.map +1 -1
- package/lib/util/queue.js +16 -55
- package/lib/util/queue.js.map +1 -1
- package/lib/util/queue.spec.js +144 -288
- package/lib/util/queue.spec.js.map +1 -1
- package/lib/util/repeater.js +35 -88
- package/lib/util/repeater.js.map +1 -1
- package/lib/util/safe-promise.js +9 -12
- package/lib/util/safe-promise.js.map +1 -1
- package/lib/util/semaphore.js +15 -46
- package/lib/util/semaphore.js.map +1 -1
- package/lib/util/skip-if.js +6 -6
- package/lib/util/skip-if.js.map +1 -1
- package/lib/util/timeutil.js +28 -16
- package/lib/util/timeutil.js.map +1 -1
- package/lib/util/timeutil.spec.js +21 -24
- package/lib/util/timeutil.spec.js.map +1 -1
- package/lib/util/tracing.js +43 -47
- package/lib/util/tracing.js.map +1 -1
- package/lib/util/workspace-port-authentication.js +3 -2
- package/lib/util/workspace-port-authentication.js.map +1 -1
- package/lib/workspace-cluster.d.ts +74 -0
- package/lib/workspace-cluster.d.ts.map +1 -0
- package/lib/workspace-cluster.js +16 -0
- package/lib/workspace-cluster.js.map +1 -0
- package/lib/workspace-instance.d.ts +7 -2
- package/lib/workspace-instance.d.ts.map +1 -1
- package/lib/wsready.d.ts +1 -1
- package/lib/wsready.js +2 -2
- package/package.json +28 -16
- package/pkg-yarn.lock +17 -9
- package/src/accounting-protocol.ts +229 -0
- package/src/admin-protocol.ts +39 -5
- package/src/analytics.ts +54 -0
- package/src/context-url.spec.ts +39 -0
- package/src/context-url.ts +51 -0
- package/src/email-protocol.ts +2 -3
- package/src/env.ts +10 -10
- package/src/gitpod-service.ts +198 -33
- package/src/headless-workspace-log.ts +7 -11
- package/src/ide-frontend-service.ts +4 -0
- package/src/index.ts +5 -1
- package/src/messaging/browser/connection.ts +195 -14
- package/src/messaging/client-call-metrics.ts +97 -0
- package/src/messaging/error.ts +8 -2
- package/src/messaging/handler.ts +12 -0
- package/src/messaging/node/connection.ts +2 -2
- package/src/messaging/proxy-factory.ts +14 -6
- package/src/payment-protocol.ts +20 -0
- package/src/permission.ts +2 -1
- package/src/plans.ts +632 -0
- package/src/protocol.ts +153 -43
- package/src/snapshot-url.spec.ts +25 -0
- package/src/snapshot-url.ts +27 -0
- package/src/team-subscription-protocol.ts +113 -0
- package/src/teams-projects-protocol.ts +132 -0
- package/src/util/analytics.ts +87 -0
- package/src/util/deferred.ts +1 -1
- package/src/util/garbage-collected-cache.ts +2 -2
- package/src/util/generate-workspace-id.spec.ts +3 -3
- package/src/util/generate-workspace-id.ts +2 -0
- package/src/util/gitpod-cookie.ts +39 -0
- package/src/util/gitpod-host-url.spec.ts +25 -1
- package/src/util/gitpod-host-url.ts +23 -10
- package/src/util/grpc.ts +15 -0
- package/src/util/logging.ts +102 -38
- package/src/util/parse-workspace-id.spec.ts +21 -1
- package/src/util/parse-workspace-id.ts +32 -6
- package/src/util/queue.spec.ts +1 -1
- package/src/util/semaphore.ts +2 -2
- package/src/util/skip-if.ts +1 -1
- package/src/util/timeutil.ts +4 -4
- package/src/workspace-cluster.ts +96 -0
- package/src/workspace-instance.ts +31 -13
- package/src/wsready.ts +2 -2
- package/lib/util/context-url.d.ts +0 -13
- package/lib/util/context-url.d.ts.map +0 -1
- package/lib/util/context-url.js +0 -26
- package/lib/util/context-url.js.map +0 -1
- package/lib/util/context-url.spec.d.ts.map +0 -1
- package/lib/util/context-url.spec.js +0 -52
- package/lib/util/context-url.spec.js.map +0 -1
- package/lib/util/without.d.ts +0 -7
- package/lib/util/without.d.ts.map +0 -1
- package/lib/util/without.js.map +0 -1
- package/src/util/context-url.spec.ts +0 -25
- package/src/util/context-url.ts +0 -23
|
@@ -4,17 +4,6 @@
|
|
|
4
4
|
* Licensed under the GNU Affero General Public License (AGPL).
|
|
5
5
|
* See License-AGPL.txt in the project root for license information.
|
|
6
6
|
*/
|
|
7
|
-
var __assign = (this && this.__assign) || function () {
|
|
8
|
-
__assign = Object.assign || function(t) {
|
|
9
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
10
|
-
s = arguments[i];
|
|
11
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
12
|
-
t[p] = s[p];
|
|
13
|
-
}
|
|
14
|
-
return t;
|
|
15
|
-
};
|
|
16
|
-
return __assign.apply(this, arguments);
|
|
17
|
-
};
|
|
18
7
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
8
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
9
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -23,55 +12,50 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
23
12
|
};
|
|
24
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
14
|
exports.GitpodFileParser = void 0;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
15
|
+
const inversify_1 = require("inversify");
|
|
16
|
+
const yaml = require("js-yaml");
|
|
17
|
+
const Ajv = require("ajv");
|
|
18
|
+
const logging_1 = require("./util/logging");
|
|
19
|
+
const protocol_1 = require("./protocol");
|
|
20
|
+
const schema = require('../data/gitpod-schema.json');
|
|
21
|
+
const validate = new Ajv().compile(schema);
|
|
22
|
+
const defaultParseOptions = {
|
|
34
23
|
acceptPortRanges: false,
|
|
35
24
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
GitpodFileParser.prototype.parse = function (content, parseOptions, defaultConfig) {
|
|
40
|
-
if (parseOptions === void 0) { parseOptions = {}; }
|
|
41
|
-
if (defaultConfig === void 0) { defaultConfig = {}; }
|
|
42
|
-
var options = __assign(__assign({}, defaultParseOptions), parseOptions);
|
|
25
|
+
let GitpodFileParser = class GitpodFileParser {
|
|
26
|
+
parse(content, parseOptions = {}, defaultConfig = {}) {
|
|
27
|
+
const options = Object.assign(Object.assign({}, defaultParseOptions), parseOptions);
|
|
43
28
|
try {
|
|
44
|
-
|
|
29
|
+
const parsedConfig = yaml.safeLoad(content);
|
|
45
30
|
validate(parsedConfig);
|
|
46
|
-
|
|
31
|
+
const validationErrors = validate.errors ? validate.errors.map(e => e.message || e.keyword) : undefined;
|
|
47
32
|
if (validationErrors && validationErrors.length > 0) {
|
|
48
33
|
return {
|
|
49
34
|
config: defaultConfig,
|
|
50
|
-
parsedConfig
|
|
51
|
-
validationErrors
|
|
35
|
+
parsedConfig,
|
|
36
|
+
validationErrors
|
|
52
37
|
};
|
|
53
38
|
}
|
|
54
|
-
|
|
39
|
+
const overrides = {};
|
|
55
40
|
if (!options.acceptPortRanges && Array.isArray(parsedConfig.ports)) {
|
|
56
|
-
overrides.ports = parsedConfig.ports.filter(
|
|
41
|
+
overrides.ports = parsedConfig.ports.filter((port) => !protocol_1.PortRangeConfig.is(port));
|
|
57
42
|
}
|
|
58
43
|
return {
|
|
59
|
-
config:
|
|
60
|
-
parsedConfig
|
|
44
|
+
config: Object.assign(Object.assign(Object.assign({}, defaultConfig), parsedConfig), overrides),
|
|
45
|
+
parsedConfig
|
|
61
46
|
};
|
|
62
47
|
}
|
|
63
48
|
catch (err) {
|
|
64
|
-
logging_1.log.error('Unparsable Gitpod configuration', err, { content
|
|
49
|
+
logging_1.log.error('Unparsable Gitpod configuration', err, { content });
|
|
65
50
|
return {
|
|
66
51
|
config: defaultConfig,
|
|
67
52
|
validationErrors: ['Unparsable Gitpod configuration: ' + err.toString()]
|
|
68
53
|
};
|
|
69
54
|
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}());
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
GitpodFileParser = __decorate([
|
|
58
|
+
(0, inversify_1.injectable)()
|
|
59
|
+
], GitpodFileParser);
|
|
76
60
|
exports.GitpodFileParser = GitpodFileParser;
|
|
77
61
|
//# sourceMappingURL=gitpod-file-parser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitpod-file-parser.js","sourceRoot":"","sources":["../src/gitpod-file-parser.ts"],"names":[],"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CAAC,MAAM,CAAC,CAAC,IAAS,EAAE,EAAE,CAAC,CAAC,0BAAe,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;aACzF;YACD,OAAO;gBACH,MAAM,gDACE,aAAa,GACb,YAAY,GACZ,SAAS,CAChB;gBACD,YAAY;aACf,CAAC;SACL;QAAC,OAAO,GAAG,EAAE;YACV,aAAG,CAAC,KAAK,CAAC,iCAAiC,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;YAC/D,OAAO;gBACH,MAAM,EAAE,aAAa;gBACrB,gBAAgB,EAAE,CAAC,mCAAmC,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;aAC3E,CAAC;SACL;IACL,CAAC;CACJ,CAAA;AAtCY,gBAAgB;IAD5B,IAAA,sBAAU,GAAE;GACA,gBAAgB,CAsC5B;AAtCY,4CAAgB"}
|
|
@@ -14,46 +14,44 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
14
14
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
TestGitpodFileParser.prototype.before = function () {
|
|
17
|
+
const mocha_typescript_1 = require("mocha-typescript");
|
|
18
|
+
const chai = require("chai");
|
|
19
|
+
const gitpod_file_parser_1 = require("./gitpod-file-parser");
|
|
20
|
+
const expect = chai.expect;
|
|
21
|
+
const DEFAULT_IMAGE = "default-image";
|
|
22
|
+
const DEFAULT_CONFIG = { image: DEFAULT_IMAGE };
|
|
23
|
+
let TestGitpodFileParser = class TestGitpodFileParser {
|
|
24
|
+
before() {
|
|
27
25
|
this.parser = new gitpod_file_parser_1.GitpodFileParser();
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
}
|
|
27
|
+
testOnlyOnePort() {
|
|
28
|
+
const content = `ports:\n` +
|
|
29
|
+
` - port: 5555`;
|
|
30
|
+
const result = this.parser.parse(content, {}, DEFAULT_CONFIG);
|
|
33
31
|
expect(result.config).to.deep.equal({
|
|
34
32
|
ports: [{
|
|
35
33
|
port: 5555
|
|
36
34
|
}],
|
|
37
35
|
image: DEFAULT_IMAGE
|
|
38
36
|
});
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
}
|
|
38
|
+
testPortRange() {
|
|
39
|
+
const content = `ports:\n` +
|
|
40
|
+
` - port: 5555\n` +
|
|
41
|
+
` - port: 3000-3999`; // should be filtered out by default
|
|
42
|
+
const result = this.parser.parse(content, {}, DEFAULT_CONFIG);
|
|
45
43
|
expect(result.config).to.deep.equal({
|
|
46
44
|
ports: [{
|
|
47
45
|
port: 5555
|
|
48
46
|
}],
|
|
49
47
|
image: DEFAULT_IMAGE
|
|
50
48
|
});
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
49
|
+
}
|
|
50
|
+
testPortRangeAccepted() {
|
|
51
|
+
const content = `ports:\n` +
|
|
52
|
+
` - port: 5555\n` +
|
|
53
|
+
` - port: 3000-3999`; // should be included if explicitly supported
|
|
54
|
+
const result = this.parser.parse(content, { acceptPortRanges: true }, DEFAULT_CONFIG);
|
|
57
55
|
expect(result.config).to.deep.equal({
|
|
58
56
|
ports: [{
|
|
59
57
|
port: 5555
|
|
@@ -62,123 +60,125 @@ var TestGitpodFileParser = /** @class */ (function () {
|
|
|
62
60
|
}],
|
|
63
61
|
image: DEFAULT_IMAGE
|
|
64
62
|
});
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
}
|
|
64
|
+
testSimpleTask() {
|
|
65
|
+
const content = `tasks:\n` +
|
|
66
|
+
` - command: yarn`;
|
|
67
|
+
const result = this.parser.parse(content, {}, DEFAULT_CONFIG);
|
|
70
68
|
expect(result.config).to.deep.equal({
|
|
71
69
|
tasks: [{
|
|
72
70
|
command: "yarn"
|
|
73
71
|
}],
|
|
74
72
|
image: DEFAULT_IMAGE
|
|
75
73
|
});
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
74
|
+
}
|
|
75
|
+
testSimpleImage() {
|
|
76
|
+
const imageName = "my-test-org/my-test-image:some-tag";
|
|
77
|
+
const content = `image: "${imageName}"\n`;
|
|
78
|
+
const result = this.parser.parse(content);
|
|
81
79
|
expect(result.config).to.deep.equal({
|
|
82
80
|
image: imageName
|
|
83
81
|
});
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
82
|
+
}
|
|
83
|
+
testComplexImageWithoutContext() {
|
|
84
|
+
const dockerFileName = 'Dockerfile';
|
|
85
|
+
const content = `image:\n file: ${dockerFileName}\n`;
|
|
86
|
+
const result = this.parser.parse(content);
|
|
89
87
|
expect(result.config).to.deep.equal({
|
|
90
88
|
image: {
|
|
91
89
|
file: dockerFileName
|
|
92
90
|
}
|
|
93
91
|
});
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
92
|
+
}
|
|
93
|
+
testComplexImageWithContext() {
|
|
94
|
+
const dockerFileName = 'Dockerfile';
|
|
95
|
+
const dockerContext = 'docker';
|
|
96
|
+
const content = `image:\n file: ${dockerFileName}\n context: ${dockerContext}\n`;
|
|
97
|
+
const result = this.parser.parse(content);
|
|
100
98
|
expect(result.config).to.deep.equal({
|
|
101
99
|
image: {
|
|
102
100
|
file: dockerFileName,
|
|
103
101
|
context: dockerContext
|
|
104
102
|
}
|
|
105
103
|
});
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
104
|
+
}
|
|
105
|
+
testGitconfig() {
|
|
106
|
+
const content = `
|
|
107
|
+
gitConfig:
|
|
108
|
+
core.autocrlf: input
|
|
109
|
+
`;
|
|
110
|
+
const result = this.parser.parse(content, {}, DEFAULT_CONFIG);
|
|
110
111
|
expect(result.config).to.deep.equal({
|
|
111
112
|
gitConfig: {
|
|
112
113
|
"core.autocrlf": "input"
|
|
113
114
|
},
|
|
114
115
|
image: DEFAULT_IMAGE
|
|
115
116
|
});
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
}
|
|
118
|
+
testBrokenConfig() {
|
|
119
|
+
const content = `image: 42\n`;
|
|
120
|
+
const result = this.parser.parse(content, {}, DEFAULT_CONFIG);
|
|
120
121
|
expect(result.config).to.deep.equal({
|
|
121
122
|
image: DEFAULT_IMAGE
|
|
122
123
|
});
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
}());
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
__decorate([
|
|
127
|
+
mocha_typescript_1.test,
|
|
128
|
+
__metadata("design:type", Function),
|
|
129
|
+
__metadata("design:paramtypes", []),
|
|
130
|
+
__metadata("design:returntype", void 0)
|
|
131
|
+
], TestGitpodFileParser.prototype, "testOnlyOnePort", null);
|
|
132
|
+
__decorate([
|
|
133
|
+
mocha_typescript_1.test,
|
|
134
|
+
__metadata("design:type", Function),
|
|
135
|
+
__metadata("design:paramtypes", []),
|
|
136
|
+
__metadata("design:returntype", void 0)
|
|
137
|
+
], TestGitpodFileParser.prototype, "testPortRange", null);
|
|
138
|
+
__decorate([
|
|
139
|
+
mocha_typescript_1.test,
|
|
140
|
+
__metadata("design:type", Function),
|
|
141
|
+
__metadata("design:paramtypes", []),
|
|
142
|
+
__metadata("design:returntype", void 0)
|
|
143
|
+
], TestGitpodFileParser.prototype, "testPortRangeAccepted", null);
|
|
144
|
+
__decorate([
|
|
145
|
+
mocha_typescript_1.test,
|
|
146
|
+
__metadata("design:type", Function),
|
|
147
|
+
__metadata("design:paramtypes", []),
|
|
148
|
+
__metadata("design:returntype", void 0)
|
|
149
|
+
], TestGitpodFileParser.prototype, "testSimpleTask", null);
|
|
150
|
+
__decorate([
|
|
151
|
+
mocha_typescript_1.test,
|
|
152
|
+
__metadata("design:type", Function),
|
|
153
|
+
__metadata("design:paramtypes", []),
|
|
154
|
+
__metadata("design:returntype", void 0)
|
|
155
|
+
], TestGitpodFileParser.prototype, "testSimpleImage", null);
|
|
156
|
+
__decorate([
|
|
157
|
+
mocha_typescript_1.test,
|
|
158
|
+
__metadata("design:type", Function),
|
|
159
|
+
__metadata("design:paramtypes", []),
|
|
160
|
+
__metadata("design:returntype", void 0)
|
|
161
|
+
], TestGitpodFileParser.prototype, "testComplexImageWithoutContext", null);
|
|
162
|
+
__decorate([
|
|
163
|
+
mocha_typescript_1.test,
|
|
164
|
+
__metadata("design:type", Function),
|
|
165
|
+
__metadata("design:paramtypes", []),
|
|
166
|
+
__metadata("design:returntype", void 0)
|
|
167
|
+
], TestGitpodFileParser.prototype, "testComplexImageWithContext", null);
|
|
168
|
+
__decorate([
|
|
169
|
+
mocha_typescript_1.test,
|
|
170
|
+
__metadata("design:type", Function),
|
|
171
|
+
__metadata("design:paramtypes", []),
|
|
172
|
+
__metadata("design:returntype", void 0)
|
|
173
|
+
], TestGitpodFileParser.prototype, "testGitconfig", null);
|
|
174
|
+
__decorate([
|
|
175
|
+
mocha_typescript_1.test,
|
|
176
|
+
__metadata("design:type", Function),
|
|
177
|
+
__metadata("design:paramtypes", []),
|
|
178
|
+
__metadata("design:returntype", void 0)
|
|
179
|
+
], TestGitpodFileParser.prototype, "testBrokenConfig", null);
|
|
180
|
+
TestGitpodFileParser = __decorate([
|
|
181
|
+
mocha_typescript_1.suite
|
|
182
|
+
], TestGitpodFileParser);
|
|
183
183
|
module.exports = new TestGitpodFileParser(); // Only to circumvent no usage warning :-/
|
|
184
184
|
//# sourceMappingURL=gitpod-file-parser.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gitpod-file-parser.spec.js","sourceRoot":"","sources":["../src/gitpod-file-parser.spec.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;AAEH,
|
|
1
|
+
{"version":3,"file":"gitpod-file-parser.spec.js","sourceRoot":"","sources":["../src/gitpod-file-parser.spec.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;;;;;;;;;AAEH,uDAA8C;AAC9C,6BAA4B;AAG5B,6DAAwD;AAExD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;AAE1B,MAAM,aAAa,GAAG,eAAe,CAAC;AACtC,MAAM,cAAc,GAAoB,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;AAE1D,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAItB,MAAM;QACT,IAAI,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