@rocket.chat/houston 0.27.0-next.3 → 2.1.8
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/LICENSE +1 -1
- package/README.md +108 -15
- package/bin/houston +62 -0
- package/data/docs/ARCHITECTURE.md +387 -0
- package/data/docs/automation.md +107 -0
- package/data/docs/e2ee.md +76 -0
- package/data/docs/eks.md +258 -0
- package/data/docs/gui.md +282 -0
- package/data/docs/guide.md +669 -0
- package/data/docs/kubernetes.md +138 -0
- package/data/docs/troubleshooting.md +193 -0
- package/data/docs/upgrading.md +84 -0
- package/data/docs/voice.md +253 -0
- package/data/iam/engineer-policy.json +11 -0
- package/data/iam/engineer-rbac.yaml +42 -0
- package/data/iam/operator-policy.json +211 -0
- package/data/loadtest/badbot.js +22 -0
- package/data/loadtest/common.js +168 -0
- package/data/loadtest/custom.js +20 -0
- package/data/loadtest/journey.js +58 -0
- package/data/loadtest/login.js +18 -0
- package/data/loadtest/messages.js +13 -0
- package/data/loadtest/mixed.js +39 -0
- package/data/loadtest/read.js +12 -0
- package/data/loadtest/webhook.js +20 -0
- package/data/monitoring/houston-logs.json +98 -0
- package/data/monitoring/k6-loadtest.json +610 -0
- package/data/monitoring/mongodb-exporter.json +3007 -0
- package/data/monitoring/node-exporter-full.json +16114 -0
- package/data/monitoring/rocketchat-metrics.json +6471 -0
- package/data/presets/airgapped.yaml +16 -0
- package/data/presets/default.yaml +9 -0
- package/data/seed/avatar-0.png +0 -0
- package/data/seed/avatar-1.png +0 -0
- package/data/seed/avatar-2.png +0 -0
- package/data/seed/avatar-3.png +0 -0
- package/data/seed/avatar-4.png +0 -0
- package/data/seed/avatar-5.png +0 -0
- package/data/seed/avatar-6.png +0 -0
- package/data/seed/avatar-7.png +0 -0
- package/data/seed/seed-metrics.csv +3 -0
- package/data/seed/seed-preview.png +0 -0
- package/data/seed/seed-report.pdf +32 -0
- package/data/seed/seed-runbook.txt +3 -0
- package/data/skill/SKILL.md +399 -0
- package/data/versions.yaml +55 -0
- package/data/voice/freeswitch/drachtio.xml +52 -0
- package/data/voice/freeswitch/public.xml +87 -0
- package/data/webui/app.css +2003 -0
- package/data/webui/index.html +678 -0
- package/data/webui/js/api.js +561 -0
- package/data/webui/js/boot.js +44 -0
- package/data/webui/js/clusters-tail.js +1377 -0
- package/data/webui/js/clusters.js +896 -0
- package/data/webui/js/create.js +276 -0
- package/data/webui/js/detail.js +507 -0
- package/data/webui/js/jobs.js +636 -0
- package/data/webui/js/logs.js +634 -0
- package/data/webui/js/main.js +14 -0
- package/data/webui/js/options.js +408 -0
- package/data/webui/js/people.js +438 -0
- package/data/webui/js/perf.js +303 -0
- package/data/webui/js/render.js +438 -0
- package/data/webui/js/shared.js +3 -0
- package/data/webui/js/state.js +583 -0
- package/data/webui/js/theme.js +123 -0
- package/data/webui/js/util.js +584 -0
- package/dist/cli/app.js +593 -0
- package/dist/cli/capabilities.js +76 -0
- package/dist/cli/cell-widths.js +495 -0
- package/dist/cli/entry.js +10 -0
- package/dist/cli/error-panel.js +492 -0
- package/dist/cli/handlers/actor.js +84 -0
- package/dist/cli/handlers/https.js +614 -0
- package/dist/cli/handlers/prompt.js +299 -0
- package/dist/cli/handlers/users.js +226 -0
- package/dist/cli/handlers.js +3678 -0
- package/dist/cli/help.js +183 -0
- package/dist/cli/index.js +15 -0
- package/dist/cli/perf.js +810 -0
- package/dist/cli/render.js +254 -0
- package/dist/cli/serve.js +858 -0
- package/dist/cli/spec-data.js +2593 -0
- package/dist/cli/spec-types.js +8 -0
- package/dist/cli/usage-error.js +520 -0
- package/dist/cli/wire.js +70 -0
- package/dist/core/audit.js +346 -0
- package/dist/core/backup-compat.js +85 -0
- package/dist/core/backup.js +1639 -0
- package/dist/core/cluster.js +1398 -0
- package/dist/core/configimport.js +344 -0
- package/dist/core/data.js +267 -0
- package/dist/core/database-of.js +82 -0
- package/dist/core/diagnose.js +159 -0
- package/dist/core/doctor.js +1518 -0
- package/dist/core/edge/acme.js +338 -0
- package/dist/core/edge/engine.js +500 -0
- package/dist/core/edge/networks.js +174 -0
- package/dist/core/edge/paths.js +107 -0
- package/dist/core/edge/routes.js +251 -0
- package/dist/core/edge/routeyml.js +195 -0
- package/dist/core/edge/runtime.js +493 -0
- package/dist/core/edge/spec.js +305 -0
- package/dist/core/edge/types.js +202 -0
- package/dist/core/eks-docs.js +135 -0
- package/dist/core/eks.js +2240 -0
- package/dist/core/envvars.js +562 -0
- package/dist/core/eventlog.js +541 -0
- package/dist/core/firstrun.js +153 -0
- package/dist/core/journal.js +691 -0
- package/dist/core/kube/ask.js +231 -0
- package/dist/core/kube/capabilities.js +269 -0
- package/dist/core/kube/certmanager.js +452 -0
- package/dist/core/kube/chart.js +413 -0
- package/dist/core/kube/cluster.js +196 -0
- package/dist/core/kube/context.js +545 -0
- package/dist/core/kube/endpoints.js +448 -0
- package/dist/core/kube/exec.js +195 -0
- package/dist/core/kube/forward.js +732 -0
- package/dist/core/kube/grafana-ingress.js +110 -0
- package/dist/core/kube/ingress.js +218 -0
- package/dist/core/kube/manifests.js +361 -0
- package/dist/core/kube/monitoring.js +768 -0
- package/dist/core/kube/names.js +237 -0
- package/dist/core/kube/namespace.js +678 -0
- package/dist/core/kube/operator.js +941 -0
- package/dist/core/kube/probe.js +202 -0
- package/dist/core/kube/reachability.js +163 -0
- package/dist/core/kube/release.js +439 -0
- package/dist/core/kube/replicaset.js +180 -0
- package/dist/core/kube/scale.js +398 -0
- package/dist/core/kube/status.js +633 -0
- package/dist/core/kube/tools.js +238 -0
- package/dist/core/kube/transfer.js +173 -0
- package/dist/core/kube/workspace.js +423 -0
- package/dist/core/lifecycle/admin.js +64 -0
- package/dist/core/lifecycle/create-docker.js +1533 -0
- package/dist/core/lifecycle/create-k8s.js +939 -0
- package/dist/core/lifecycle/destroy.js +339 -0
- package/dist/core/lifecycle/inspect.js +635 -0
- package/dist/core/lifecycle/naming.js +298 -0
- package/dist/core/lifecycle/notes.js +726 -0
- package/dist/core/lifecycle/ownership.js +313 -0
- package/dist/core/lifecycle/payload.js +401 -0
- package/dist/core/lifecycle/ports.js +388 -0
- package/dist/core/lifecycle/preconditions.js +367 -0
- package/dist/core/lifecycle/pruning.js +551 -0
- package/dist/core/lifecycle/ready.js +753 -0
- package/dist/core/lifecycle/request.js +525 -0
- package/dist/core/lifecycle/seeding.js +281 -0
- package/dist/core/lifecycle/sizing.js +392 -0
- package/dist/core/lifecycle/state.js +286 -0
- package/dist/core/lifecycle/tlsplan.js +704 -0
- package/dist/core/lifecycle/types.js +232 -0
- package/dist/core/loadtest.js +995 -0
- package/dist/core/migrate.js +612 -0
- package/dist/core/monitor.js +494 -0
- package/dist/core/postready.js +969 -0
- package/dist/core/promote.js +804 -0
- package/dist/core/rcapi.js +1285 -0
- package/dist/core/recovery.js +75 -0
- package/dist/core/runner/engine.js +394 -0
- package/dist/core/runner/host.js +298 -0
- package/dist/core/runner/locks.js +129 -0
- package/dist/core/runner/paths.js +173 -0
- package/dist/core/runner/ports.js +172 -0
- package/dist/core/runner/queries.js +612 -0
- package/dist/core/runner/record.js +563 -0
- package/dist/core/scaleseed.js +271 -0
- package/dist/core/seed-db.js +208 -0
- package/dist/core/sessions.js +472 -0
- package/dist/core/skill.js +326 -0
- package/dist/core/sso-identities.js +172 -0
- package/dist/core/sso.js +703 -0
- package/dist/core/tls-local.js +311 -0
- package/dist/core/tls.js +878 -0
- package/dist/core/topology.js +482 -0
- package/dist/core/upgrade.js +868 -0
- package/dist/core/users.js +739 -0
- package/dist/lib/audit.js +100 -0
- package/dist/lib/close-matches.js +238 -0
- package/dist/lib/compose.js +672 -0
- package/dist/lib/config.js +1398 -0
- package/dist/lib/context.js +18 -0
- package/dist/lib/errors.js +305 -0
- package/dist/lib/events.js +208 -0
- package/dist/lib/float-text.js +126 -0
- package/dist/lib/format.js +1320 -0
- package/dist/lib/home.js +325 -0
- package/dist/lib/journal.js +122 -0
- package/dist/lib/json-text.js +733 -0
- package/dist/lib/jsonout.js +382 -0
- package/dist/lib/lock.js +516 -0
- package/dist/lib/login-name.js +202 -0
- package/dist/lib/map-limit.js +29 -0
- package/dist/lib/mkdir-parents.js +90 -0
- package/dist/lib/mongo-kernel.js +67 -0
- package/dist/lib/monitoring.js +492 -0
- package/dist/lib/platform-name.js +59 -0
- package/dist/lib/presets/common.js +390 -0
- package/dist/lib/presets/composite.js +326 -0
- package/dist/lib/presets/e2ee.js +143 -0
- package/dist/lib/presets/email.js +172 -0
- package/dist/lib/presets/guides.js +27 -0
- package/dist/lib/presets/index.js +490 -0
- package/dist/lib/presets/keycloak.js +369 -0
- package/dist/lib/presets/ldap.js +1285 -0
- package/dist/lib/presets/livechat.js +220 -0
- package/dist/lib/presets/multi-instance.js +124 -0
- package/dist/lib/presets/oidc.js +161 -0
- package/dist/lib/presets/public.js +496 -0
- package/dist/lib/presets/registry.js +64 -0
- package/dist/lib/presets/s3-minio.js +300 -0
- package/dist/lib/presets/saml.js +149 -0
- package/dist/lib/presets/scenario.js +51 -0
- package/dist/lib/presets/types.js +86 -0
- package/dist/lib/presets/voice-pbx.js +320 -0
- package/dist/lib/presets/voice.js +345 -0
- package/dist/lib/presets/webhooks.js +182 -0
- package/dist/lib/redact.js +106 -0
- package/dist/lib/seed-options.js +68 -0
- package/dist/lib/seed-profiles.js +59 -0
- package/dist/lib/targz.js +1383 -0
- package/dist/lib/teammode.js +25 -0
- package/dist/lib/tempdir.js +162 -0
- package/dist/lib/unicode-tables.js +2335 -0
- package/dist/lib/version-spec.js +357 -0
- package/dist/lib/versions.js +463 -0
- package/dist/lib/yaml-dump.js +1361 -0
- package/dist/perf/baseline.js +168 -0
- package/dist/perf/constrain.js +296 -0
- package/dist/perf/k6.js +235 -0
- package/dist/perf/mongoprof.js +171 -0
- package/dist/perf/rcmetrics.js +178 -0
- package/dist/perf/report.js +386 -0
- package/dist/perf/resources.js +224 -0
- package/dist/perf/slo.js +111 -0
- package/dist/perf/timeline.js +187 -0
- package/dist/perf/timings.js +85 -0
- package/dist/perf/verdict.js +201 -0
- package/dist/seams/aws-cli.js +126 -0
- package/dist/seams/docker-cli.js +280 -0
- package/dist/seams/exec.js +861 -0
- package/dist/seams/fs/lock.js +528 -0
- package/dist/seams/kubectl.js +83 -0
- package/dist/seams/rc-http.js +921 -0
- package/dist/seed/apply.js +190 -0
- package/dist/seed/assets.js +76 -0
- package/dist/seed/check.js +391 -0
- package/dist/seed/client.js +172 -0
- package/dist/seed/executor.js +726 -0
- package/dist/seed/history.js +281 -0
- package/dist/seed/kinds.js +91 -0
- package/dist/seed/plan.js +432 -0
- package/dist/seed/receipt.js +339 -0
- package/dist/seed/repairs.js +75 -0
- package/dist/seed/verification.js +363 -0
- package/dist/seed/wording.js +248 -0
- package/dist/web/app.js +326 -0
- package/dist/web/jobs.js +510 -0
- package/dist/web/route-deps.js +211 -0
- package/dist/web/route-table.js +213 -0
- package/dist/web/routes/backup.js +244 -0
- package/dist/web/routes/clusters.js +303 -0
- package/dist/web/routes/data.js +187 -0
- package/dist/web/routes/edge.js +82 -0
- package/dist/web/routes/index.js +63 -0
- package/dist/web/routes/jobs.js +95 -0
- package/dist/web/routes/logs.js +297 -0
- package/dist/web/routes/meta.js +191 -0
- package/dist/web/routes/people.js +151 -0
- package/dist/web/routes/perf.js +95 -0
- package/dist/web/routes/repros.js +550 -0
- package/dist/web/routes/session.js +361 -0
- package/dist/web/routes/spa.js +198 -0
- package/dist/web/security.js +475 -0
- package/dist/web/signin.js +246 -0
- package/package.json +67 -32
- package/.eslintrc +0 -94
- package/.swcrc +0 -18
- package/dist/bin.js +0 -3
- package/dist/cli.js +0 -184
- package/dist/commands/createBranch.js +0 -194
- package/dist/outputCI.js +0 -59
- package/src/bin.js +0 -4
- package/src/cli.ts +0 -25
- package/src/commands/createBranch.ts +0 -28
- package/src/outputCI.ts +0 -12
- package/src-old/logs.js +0 -323
- package/src-old/md.js +0 -191
- package/src-old/release-table.js +0 -60
- package/src-old/set-version.js +0 -614
- package/src-old/utils.js +0 -15
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "createBranch", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return createBranch;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
var _simplegit = require("simple-git");
|
|
12
|
-
var _promises = /*#__PURE__*/ _interop_require_default(require("fs/promises"));
|
|
13
|
-
var _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
14
|
-
var _semver = /*#__PURE__*/ _interop_require_default(require("semver"));
|
|
15
|
-
var _outputCI = require("../outputCI");
|
|
16
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
17
|
-
try {
|
|
18
|
-
var info = gen[key](arg);
|
|
19
|
-
var value = info.value;
|
|
20
|
-
} catch (error) {
|
|
21
|
-
reject(error);
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
if (info.done) {
|
|
25
|
-
resolve(value);
|
|
26
|
-
} else {
|
|
27
|
-
Promise.resolve(value).then(_next, _throw);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
function _async_to_generator(fn) {
|
|
31
|
-
return function() {
|
|
32
|
-
var self = this, args = arguments;
|
|
33
|
-
return new Promise(function(resolve, reject) {
|
|
34
|
-
var gen = fn.apply(self, args);
|
|
35
|
-
function _next(value) {
|
|
36
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
37
|
-
}
|
|
38
|
-
function _throw(err) {
|
|
39
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
40
|
-
}
|
|
41
|
-
_next(undefined);
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
function _interop_require_default(obj) {
|
|
46
|
-
return obj && obj.__esModule ? obj : {
|
|
47
|
-
default: obj
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
function _ts_generator(thisArg, body) {
|
|
51
|
-
var f, y, t, g, _ = {
|
|
52
|
-
label: 0,
|
|
53
|
-
sent: function() {
|
|
54
|
-
if (t[0] & 1) throw t[1];
|
|
55
|
-
return t[1];
|
|
56
|
-
},
|
|
57
|
-
trys: [],
|
|
58
|
-
ops: []
|
|
59
|
-
};
|
|
60
|
-
return g = {
|
|
61
|
-
next: verb(0),
|
|
62
|
-
"throw": verb(1),
|
|
63
|
-
"return": verb(2)
|
|
64
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
65
|
-
return this;
|
|
66
|
-
}), g;
|
|
67
|
-
function verb(n) {
|
|
68
|
-
return function(v) {
|
|
69
|
-
return step([
|
|
70
|
-
n,
|
|
71
|
-
v
|
|
72
|
-
]);
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
function step(op) {
|
|
76
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
77
|
-
while(_)try {
|
|
78
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
79
|
-
if (y = 0, t) op = [
|
|
80
|
-
op[0] & 2,
|
|
81
|
-
t.value
|
|
82
|
-
];
|
|
83
|
-
switch(op[0]){
|
|
84
|
-
case 0:
|
|
85
|
-
case 1:
|
|
86
|
-
t = op;
|
|
87
|
-
break;
|
|
88
|
-
case 4:
|
|
89
|
-
_.label++;
|
|
90
|
-
return {
|
|
91
|
-
value: op[1],
|
|
92
|
-
done: false
|
|
93
|
-
};
|
|
94
|
-
case 5:
|
|
95
|
-
_.label++;
|
|
96
|
-
y = op[1];
|
|
97
|
-
op = [
|
|
98
|
-
0
|
|
99
|
-
];
|
|
100
|
-
continue;
|
|
101
|
-
case 7:
|
|
102
|
-
op = _.ops.pop();
|
|
103
|
-
_.trys.pop();
|
|
104
|
-
continue;
|
|
105
|
-
default:
|
|
106
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
107
|
-
_ = 0;
|
|
108
|
-
continue;
|
|
109
|
-
}
|
|
110
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
111
|
-
_.label = op[1];
|
|
112
|
-
break;
|
|
113
|
-
}
|
|
114
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
115
|
-
_.label = t[1];
|
|
116
|
-
t = op;
|
|
117
|
-
break;
|
|
118
|
-
}
|
|
119
|
-
if (t && _.label < t[2]) {
|
|
120
|
-
_.label = t[2];
|
|
121
|
-
_.ops.push(op);
|
|
122
|
-
break;
|
|
123
|
-
}
|
|
124
|
-
if (t[2]) _.ops.pop();
|
|
125
|
-
_.trys.pop();
|
|
126
|
-
continue;
|
|
127
|
-
}
|
|
128
|
-
op = body.call(thisArg, _);
|
|
129
|
-
} catch (e) {
|
|
130
|
-
op = [
|
|
131
|
-
6,
|
|
132
|
-
e
|
|
133
|
-
];
|
|
134
|
-
y = 0;
|
|
135
|
-
} finally{
|
|
136
|
-
f = t = 0;
|
|
137
|
-
}
|
|
138
|
-
if (op[0] & 5) throw op[1];
|
|
139
|
-
return {
|
|
140
|
-
value: op[0] ? op[1] : void 0,
|
|
141
|
-
done: true
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
var git = (0, _simplegit.simpleGit)();
|
|
146
|
-
function createBranch(_) {
|
|
147
|
-
return _createBranch.apply(this, arguments);
|
|
148
|
-
}
|
|
149
|
-
function _createBranch() {
|
|
150
|
-
_createBranch = _async_to_generator(function(param) {
|
|
151
|
-
var base, type, mainPackageJson, _JSON_parse, currentVersion, newBranch, localBranch;
|
|
152
|
-
return _ts_generator(this, function(_state) {
|
|
153
|
-
switch(_state.label){
|
|
154
|
-
case 0:
|
|
155
|
-
base = param.base, type = param.type;
|
|
156
|
-
// checkout base version
|
|
157
|
-
return [
|
|
158
|
-
4,
|
|
159
|
-
git.checkout(base)
|
|
160
|
-
];
|
|
161
|
-
case 1:
|
|
162
|
-
_state.sent();
|
|
163
|
-
return [
|
|
164
|
-
4,
|
|
165
|
-
_promises.default.readFile(_path.default.resolve(process.cwd(), "package.json"), "utf8")
|
|
166
|
-
];
|
|
167
|
-
case 2:
|
|
168
|
-
mainPackageJson = _state.sent();
|
|
169
|
-
_JSON_parse = JSON.parse(mainPackageJson), currentVersion = _JSON_parse.version;
|
|
170
|
-
newBranch = "release-".concat(_semver.default.inc(currentVersion, type));
|
|
171
|
-
return [
|
|
172
|
-
4,
|
|
173
|
-
git.branchLocal()
|
|
174
|
-
];
|
|
175
|
-
case 3:
|
|
176
|
-
localBranch = _state.sent();
|
|
177
|
-
if (localBranch.all.includes(newBranch)) {
|
|
178
|
-
throw new Error('Branch "'.concat(newBranch, '" already exists'));
|
|
179
|
-
}
|
|
180
|
-
return [
|
|
181
|
-
4,
|
|
182
|
-
git.checkoutLocalBranch(newBranch)
|
|
183
|
-
];
|
|
184
|
-
case 4:
|
|
185
|
-
_state.sent();
|
|
186
|
-
(0, _outputCI.outputCI)("newBranch", newBranch);
|
|
187
|
-
return [
|
|
188
|
-
2
|
|
189
|
-
];
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
});
|
|
193
|
-
return _createBranch.apply(this, arguments);
|
|
194
|
-
}
|
package/dist/outputCI.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "outputCI", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return outputCI;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
var _core = /*#__PURE__*/ _interop_require_wildcard(require("@actions/core"));
|
|
12
|
-
function _getRequireWildcardCache(nodeInterop) {
|
|
13
|
-
if (typeof WeakMap !== "function") return null;
|
|
14
|
-
var cacheBabelInterop = new WeakMap();
|
|
15
|
-
var cacheNodeInterop = new WeakMap();
|
|
16
|
-
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
17
|
-
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
18
|
-
})(nodeInterop);
|
|
19
|
-
}
|
|
20
|
-
function _interop_require_wildcard(obj, nodeInterop) {
|
|
21
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
22
|
-
return obj;
|
|
23
|
-
}
|
|
24
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
25
|
-
return {
|
|
26
|
-
default: obj
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
30
|
-
if (cache && cache.has(obj)) {
|
|
31
|
-
return cache.get(obj);
|
|
32
|
-
}
|
|
33
|
-
var newObj = {};
|
|
34
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
35
|
-
for(var key in obj){
|
|
36
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
37
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
38
|
-
if (desc && (desc.get || desc.set)) {
|
|
39
|
-
Object.defineProperty(newObj, key, desc);
|
|
40
|
-
} else {
|
|
41
|
-
newObj[key] = obj[key];
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
newObj.default = obj;
|
|
46
|
-
if (cache) {
|
|
47
|
-
cache.set(obj, newObj);
|
|
48
|
-
}
|
|
49
|
-
return newObj;
|
|
50
|
-
}
|
|
51
|
-
function _outputCI(name, value) {
|
|
52
|
-
_core.setOutput(name, value);
|
|
53
|
-
}
|
|
54
|
-
var outputCI = function() {
|
|
55
|
-
if (!process.env.CI) {
|
|
56
|
-
return function() {};
|
|
57
|
-
}
|
|
58
|
-
return _outputCI;
|
|
59
|
-
}();
|
package/src/bin.js
DELETED
package/src/cli.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import { createBranch } from './commands/createBranch';
|
|
3
|
-
|
|
4
|
-
const program = new Command();
|
|
5
|
-
|
|
6
|
-
program.name('houston');
|
|
7
|
-
|
|
8
|
-
program
|
|
9
|
-
.command('create-branch')
|
|
10
|
-
.description('Create a new branch for a new release')
|
|
11
|
-
.requiredOption('-b, --base <branch or version>', 'Base branch or version to create the new branch from')
|
|
12
|
-
.requiredOption('-t, --type <patch|minor|major>', 'Type of release')
|
|
13
|
-
.action(async function(str) {
|
|
14
|
-
try {
|
|
15
|
-
if (!['patch', 'minor', 'major'].includes(str.type)) {
|
|
16
|
-
throw new Error('Invalid release type');
|
|
17
|
-
}
|
|
18
|
-
await createBranch({ base: str.base, type: str.type });
|
|
19
|
-
} catch (error) {
|
|
20
|
-
console.error(error);
|
|
21
|
-
process.exit(1);
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
program.parse(process.argv);
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { simpleGit } from 'simple-git';
|
|
2
|
-
import fs from 'fs/promises';
|
|
3
|
-
import path from 'path';
|
|
4
|
-
import semver from 'semver';
|
|
5
|
-
import { outputCI } from '../outputCI';
|
|
6
|
-
|
|
7
|
-
const git = simpleGit();
|
|
8
|
-
|
|
9
|
-
export async function createBranch({ base, type }: { base: string; type: 'patch' | 'minor' | 'major' }) {
|
|
10
|
-
// checkout base version
|
|
11
|
-
await git.checkout(base);
|
|
12
|
-
|
|
13
|
-
// get current version and increment based on type
|
|
14
|
-
const mainPackageJson = await fs.readFile(path.resolve(process.cwd(), 'package.json'), 'utf8');
|
|
15
|
-
const { version: currentVersion } = JSON.parse(mainPackageJson);
|
|
16
|
-
|
|
17
|
-
const newBranch = `release-${semver.inc(currentVersion, type)}`;
|
|
18
|
-
|
|
19
|
-
const localBranch = await git.branchLocal();
|
|
20
|
-
|
|
21
|
-
if (localBranch.all.includes(newBranch)) {
|
|
22
|
-
throw new Error(`Branch "${newBranch}" already exists`);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
await git.checkoutLocalBranch(newBranch);
|
|
26
|
-
|
|
27
|
-
outputCI('newBranch', newBranch);
|
|
28
|
-
}
|
package/src/outputCI.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import * as core from '@actions/core';
|
|
2
|
-
|
|
3
|
-
function _outputCI(name: string, value: string) {
|
|
4
|
-
core.setOutput(name, value);
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export const outputCI = ((): (name: string, value: string) => void => {
|
|
8
|
-
if (!process.env.CI) {
|
|
9
|
-
return () => { };
|
|
10
|
-
}
|
|
11
|
-
return _outputCI;
|
|
12
|
-
})();
|
package/src-old/logs.js
DELETED
|
@@ -1,323 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const fs = require('fs');
|
|
3
|
-
const semver = require('semver');
|
|
4
|
-
const ProgressBar = require('progress');
|
|
5
|
-
const _ = require('underscore');
|
|
6
|
-
const git = require('simple-git/promise')(process.cwd());
|
|
7
|
-
const { Octokit } = require('@octokit/rest');
|
|
8
|
-
const { getMetadata } = require('./utils');
|
|
9
|
-
|
|
10
|
-
const commitRegexString = '(^Merge pull request #([0-9]+) from )|( ?\\(?#([0-9]+)\\)?$)';
|
|
11
|
-
const commitRegex = new RegExp(commitRegexString);
|
|
12
|
-
|
|
13
|
-
const https = require('https');
|
|
14
|
-
|
|
15
|
-
function request(url) {
|
|
16
|
-
return new Promise((resolve, reject) => {
|
|
17
|
-
https.get(url, (res) => {
|
|
18
|
-
|
|
19
|
-
const data = [];
|
|
20
|
-
res.on('data', d => data.push(d));
|
|
21
|
-
res.on('end', () => resolve(Buffer.concat(data).toString()));
|
|
22
|
-
|
|
23
|
-
}).on('error', reject);
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const historyDataFile = path.join(process.cwd(), '.github/history.json');
|
|
28
|
-
|
|
29
|
-
let historyData = (() => {
|
|
30
|
-
try {
|
|
31
|
-
return require(historyDataFile);
|
|
32
|
-
} catch (error) {
|
|
33
|
-
console.error(`File ${ historyDataFile } not found, start a empty one`);
|
|
34
|
-
return {
|
|
35
|
-
version: 1,
|
|
36
|
-
releases: {}
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
})();
|
|
40
|
-
|
|
41
|
-
if (!historyData.version) {
|
|
42
|
-
historyData = {
|
|
43
|
-
version: 1,
|
|
44
|
-
releases: Object.entries(historyData).reduce((result, [release, pull_requests]) => {
|
|
45
|
-
result[release] = {
|
|
46
|
-
pull_requests
|
|
47
|
-
};
|
|
48
|
-
return result;
|
|
49
|
-
}, {})
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const octokit = new Octokit({
|
|
54
|
-
auth: process.env.GITHUB_TOKEN
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
let owner = '';
|
|
58
|
-
let repo = '';
|
|
59
|
-
|
|
60
|
-
function promiseRetryRateLimit(promiseFn, retryWait = 60000) {
|
|
61
|
-
return new Promise((resolve, reject) => {
|
|
62
|
-
function exec() {
|
|
63
|
-
promiseFn()
|
|
64
|
-
.then(data => resolve(data))
|
|
65
|
-
.catch(error => {
|
|
66
|
-
if (error.response.headers['status'] === '403 Forbidden' && error.response.headers['retry-after']) {
|
|
67
|
-
const reset = error.response.headers['retry-after'];
|
|
68
|
-
|
|
69
|
-
console.error('Retrying in', reset, 'seconds');
|
|
70
|
-
console.log('Retrying in', reset, 'seconds');
|
|
71
|
-
setTimeout(exec, reset * 1000);
|
|
72
|
-
} else if (error.response.headers['x-ratelimit-remaining'] === '0') {
|
|
73
|
-
let reset = error.response.headers['x-ratelimit-reset'];
|
|
74
|
-
if (reset) {
|
|
75
|
-
reset = parseInt(reset) * 1000 - Date.now();
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
console.log('Retrying in', (reset || retryWait) / 1000, 'seconds');
|
|
79
|
-
setTimeout(exec, reset || retryWait);
|
|
80
|
-
} else {
|
|
81
|
-
return reject(error);
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
exec();
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function extractDescription(body) {
|
|
90
|
-
const match = body.match(/<!-- CHANGELOG -->\r?\n?(?<description>.*)\r?\n?<!-- END CHANGELOG -->/s);
|
|
91
|
-
if (!match || !match.groups || !match.groups.description) {
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
return match.groups.description.replace(/<!--.*?-->\r?\n?/gs, '').replace(/(\r?\n)*$/gs, '').trim();
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function getPRInfo(number, commit) {
|
|
99
|
-
function onError(error) {
|
|
100
|
-
if (error.status === 404) {
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
console.error(commit, error);
|
|
104
|
-
process.exit(1);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
return promiseRetryRateLimit(() => octokit.pulls.get({owner, repo, pull_number: number}))
|
|
108
|
-
.catch(onError)
|
|
109
|
-
.then(pr => {
|
|
110
|
-
if (pr === undefined) {
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const info = {
|
|
115
|
-
pr: number,
|
|
116
|
-
title: pr.data.title,
|
|
117
|
-
userLogin: pr.data.user.login
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
if (typeof pr.data.body === 'string') {
|
|
121
|
-
const description = extractDescription(pr.data.body);
|
|
122
|
-
if (description) {
|
|
123
|
-
info.description = description;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
// data.author_association: 'CONTRIBUTOR',
|
|
127
|
-
|
|
128
|
-
if (pr.data.milestone) {
|
|
129
|
-
info.milestone = pr.data.milestone.title;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
return promiseRetryRateLimit(() => octokit.pulls.listCommits({owner, repo, pull_number: number}))
|
|
133
|
-
.catch(onError)
|
|
134
|
-
.then(commits => {
|
|
135
|
-
info.contributors = _.unique(_.flatten(commits.data.map(i => {
|
|
136
|
-
if (!i.author || !i.committer) {
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
return [i.author.login, i.committer.login];
|
|
141
|
-
})));
|
|
142
|
-
|
|
143
|
-
return info;
|
|
144
|
-
});
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
function getPRNumberFromMessage(message, item) {
|
|
149
|
-
const match = message.match(commitRegex);
|
|
150
|
-
if (match == null) {
|
|
151
|
-
console.log(message, item);
|
|
152
|
-
}
|
|
153
|
-
const number = match[2] || match[4];
|
|
154
|
-
|
|
155
|
-
if (!/^\d+$/.test(number)) {
|
|
156
|
-
console.error('Invalid number', {number, message});
|
|
157
|
-
process.exit(1);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
return number;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
function getCommitRange(from, to) {
|
|
164
|
-
if (!from && !to) {
|
|
165
|
-
console.error('Invalid commits for range');
|
|
166
|
-
process.exit(1);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
if (from && to) {
|
|
170
|
-
return `${ from }...${ to }`;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
if (!from) {
|
|
174
|
-
return `${ to }^@`;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
return `${ from }...HEAD`;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
async function getPullRequests(from, to) {
|
|
181
|
-
const logParams = ['--no-decorate', '--graph', '-E', `--grep=${ commitRegexString }`, getCommitRange(from, to)];
|
|
182
|
-
logParams.format = {
|
|
183
|
-
hash: '%H',
|
|
184
|
-
date: '%ai',
|
|
185
|
-
message: '%s',
|
|
186
|
-
author_name: '%aN',
|
|
187
|
-
author_email: '%ae'
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
const log = await git.log(logParams);
|
|
191
|
-
|
|
192
|
-
const items = log.all
|
|
193
|
-
.filter(item => commitRegex.test(item.message));
|
|
194
|
-
|
|
195
|
-
const data = [];
|
|
196
|
-
|
|
197
|
-
return new Promise((resolve, reject) => {
|
|
198
|
-
const bar = new ProgressBar(' [:bar] :current/:total :percent :etas', {
|
|
199
|
-
total: items.length,
|
|
200
|
-
incomplete: ' ',
|
|
201
|
-
width: 20
|
|
202
|
-
});
|
|
203
|
-
|
|
204
|
-
function process() {
|
|
205
|
-
if (items.length === 0) {
|
|
206
|
-
resolve(data);
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
const partItems = items.splice(0, 10);
|
|
210
|
-
bar.tick(partItems.length);
|
|
211
|
-
|
|
212
|
-
const promises = partItems.map(item => {
|
|
213
|
-
return getPRInfo(getPRNumberFromMessage(item.message, item), item);
|
|
214
|
-
});
|
|
215
|
-
|
|
216
|
-
return Promise.all(promises).then(result => {
|
|
217
|
-
data.push(..._.compact(result));
|
|
218
|
-
if (items.length) {
|
|
219
|
-
setTimeout(process, 100);
|
|
220
|
-
} else {
|
|
221
|
-
resolve(data);
|
|
222
|
-
}
|
|
223
|
-
}).catch(error => reject(error));
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
process();
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
async function getCurrentLatestTag() {
|
|
231
|
-
return (await git.raw(['describe', '--abbrev=0', '--tags'])).replace(/\n/, '');
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
async function getTags({ minTag }) {
|
|
235
|
-
let tags = await git.tags();
|
|
236
|
-
|
|
237
|
-
tags = tags.all.filter(tag => /^\d+\.\d+\.\d+(-rc\.\d+)?$/.test(tag));
|
|
238
|
-
|
|
239
|
-
tags = tags.sort((a, b) => {
|
|
240
|
-
if (semver.gt(a, b)) {
|
|
241
|
-
return 1;
|
|
242
|
-
}
|
|
243
|
-
if (semver.lt(a, b)) {
|
|
244
|
-
return -1;
|
|
245
|
-
}
|
|
246
|
-
return 0;
|
|
247
|
-
});
|
|
248
|
-
|
|
249
|
-
const currentLatestTag = await getCurrentLatestTag();
|
|
250
|
-
tags = tags.filter(t => semver.lte(t, currentLatestTag));
|
|
251
|
-
|
|
252
|
-
tags.push('HEAD');
|
|
253
|
-
|
|
254
|
-
return tags
|
|
255
|
-
.map((item, index) => {
|
|
256
|
-
return {
|
|
257
|
-
tag: item,
|
|
258
|
-
before: index ? tags[--index] : null
|
|
259
|
-
};
|
|
260
|
-
})
|
|
261
|
-
.filter(item => item.tag === 'HEAD' || !minTag || semver.gte(item.tag, minTag))
|
|
262
|
-
.reduce((value, item) => {
|
|
263
|
-
value[item.tag] = item;
|
|
264
|
-
return value;
|
|
265
|
-
}, {});
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
async function getMissingTags({ minTag }) {
|
|
269
|
-
const tags = await getTags({ minTag });
|
|
270
|
-
const missingTags = _.difference(Object.keys(tags), Object.keys(historyData.releases));
|
|
271
|
-
|
|
272
|
-
missingTags.push('HEAD');
|
|
273
|
-
|
|
274
|
-
return _.pick(tags, missingTags);
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
module.exports = function({headName = 'HEAD', owner:_owner = '', repo:_repo = '', minTag = '' }) {
|
|
278
|
-
owner = _owner;
|
|
279
|
-
repo = _repo;
|
|
280
|
-
|
|
281
|
-
return new Promise((resolve) => {
|
|
282
|
-
getMissingTags({ minTag }).then(missingTags => {
|
|
283
|
-
console.log('Missing tags:');
|
|
284
|
-
console.log(JSON.stringify(Object.keys(missingTags), null, 2));
|
|
285
|
-
missingTags = Object.values(missingTags);
|
|
286
|
-
|
|
287
|
-
function loadMissingTag() {
|
|
288
|
-
if (!missingTags.length) {
|
|
289
|
-
if (headName !== 'HEAD') {
|
|
290
|
-
historyData.releases[headName] = historyData.releases.HEAD;
|
|
291
|
-
historyData.releases.HEAD = {
|
|
292
|
-
pull_requests: []
|
|
293
|
-
};
|
|
294
|
-
}
|
|
295
|
-
fs.writeFileSync(historyDataFile, JSON.stringify(historyData, null, 2));
|
|
296
|
-
resolve();
|
|
297
|
-
return;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
const item = missingTags.shift();
|
|
301
|
-
const from = item.before;
|
|
302
|
-
const to = item.tag;
|
|
303
|
-
console.log('Fetching data for tag:', to, `(from ${ from })`);
|
|
304
|
-
getPullRequests(from, to).then(pull_requests => {
|
|
305
|
-
getMetadata()({ version: to, git, request }).then(metadata => {
|
|
306
|
-
pull_requests = _.compact(pull_requests);
|
|
307
|
-
// console.log(' ', pull_requests.length, 'item(s) found');
|
|
308
|
-
historyData.releases = Object.assign(historyData.releases, {
|
|
309
|
-
[to]: {
|
|
310
|
-
...metadata,
|
|
311
|
-
pull_requests
|
|
312
|
-
}
|
|
313
|
-
});
|
|
314
|
-
fs.writeFileSync(historyDataFile, JSON.stringify(historyData, null, 2));
|
|
315
|
-
loadMissingTag();
|
|
316
|
-
});
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
loadMissingTag();
|
|
321
|
-
});
|
|
322
|
-
});
|
|
323
|
-
};
|