Skip to content

Commit

Permalink
fix(cmd-api-server): build occasionally broken - protoc-gen-ts hyperl…
Browse files Browse the repository at this point in the history
…edger-cacti#1563

Upgrading protoc-gen-ts from 0.4.0 to 0.6.0 instantly fixed the issue
while I had it in a reproduced state (e.g. my build was broken on main)

This is not necessarily evidence that the fix is legit, but it's most likely
a step in the right direction and there's also the possibility that this
is the actual fix. It would take too much time to properly debug if
it really is the fix, so I'll just give it the benefit of the doubt
for now and assume that it is.

Fixes hyperledger-cacti#1563

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
  • Loading branch information
petermetz committed Nov 23, 2021
1 parent e1e8aee commit 1ae01ad
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
"npm-run-all": "4.1.5",
"npm-watch": "0.11.0",
"prettier": "2.1.2",
"protoc-gen-ts": "0.4.0",
"protoc-gen-ts": "0.6.0",
"run-time-error": "1.4.0",
"secp256k1": "4.0.2",
"shebang-loader": "0.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ export namespace google.protobuf {
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []);
if (!Array.isArray(data) && typeof data == "object") { }
}
static fromObject(data: {}) {
const message = new Empty({});
return message;
}
toObject() {
const data: {} = {};
return data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,23 @@ export namespace org.hyperledger.cactus.cmd_api_server {
set memoryUsage(value: dependency_1.org.hyperledger.cactus.cmd_api_server.MemoryUsagePB) {
pb_1.Message.setWrapperField(this, 335792418, value);
}
static fromObject(data: {
success?: boolean;
createdAt?: string;
memoryUsage?: ReturnType<typeof dependency_1.org.hyperledger.cactus.cmd_api_server.MemoryUsagePB.prototype.toObject>;
}) {
const message = new HealthCheckResponsePB({});
if (data.success != null) {
message.success = data.success;
}
if (data.createdAt != null) {
message.createdAt = data.createdAt;
}
if (data.memoryUsage != null) {
message.memoryUsage = dependency_1.org.hyperledger.cactus.cmd_api_server.MemoryUsagePB.fromObject(data.memoryUsage);
}
return message;
}
toObject() {
const data: {
success?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,31 @@ export namespace org.hyperledger.cactus.cmd_api_server {
set arrayBuffers(value: number) {
pb_1.Message.setField(this, 116952168, value);
}
static fromObject(data: {
rss?: number;
heapTotal?: number;
heapUsed?: number;
external?: number;
arrayBuffers?: number;
}) {
const message = new MemoryUsagePB({});
if (data.rss != null) {
message.rss = data.rss;
}
if (data.heapTotal != null) {
message.heapTotal = data.heapTotal;
}
if (data.heapUsed != null) {
message.heapUsed = data.heapUsed;
}
if (data.external != null) {
message.external = data.external;
}
if (data.arrayBuffers != null) {
message.arrayBuffers = data.arrayBuffers;
}
return message;
}
toObject() {
const data: {
rss?: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ export namespace org.hyperledger.cactus.cmd_api_server {
set data(value: string) {
pb_1.Message.setField(this, 1, value);
}
static fromObject(data: {
data?: string;
}) {
const message = new GetPrometheusMetricsV1Response({});
if (data.data != null) {
message.data = data.data;
}
return message;
}
toObject() {
const data: {
data?: string;
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19641,10 +19641,10 @@ protobufjs@6.11.2, protobufjs@^6.10.0, protobufjs@^6.10.2, protobufjs@^6.11.2:
"@types/node" ">=13.7.0"
long "^4.0.0"

protoc-gen-ts@0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/protoc-gen-ts/-/protoc-gen-ts-0.4.0.tgz#4be7e2086dc32db15f01733a7a200793f1e1081a"
integrity sha512-TUoAT45fC9Fpcbp+rOdjzUPytnYkV8YR0xQ9atZi69RNV2/if600cDxBPXXbujGIegTmiEaUkQIz4Rrk2lOyUQ==
protoc-gen-ts@0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/protoc-gen-ts/-/protoc-gen-ts-0.6.0.tgz#a2c3e117ae43fa7821a7f46dee25fb6d20d12565"
integrity sha512-bO9uI49c1IyYW0r+yyydtsYknY+U/QFOePbvcoikB4zPEGBtZwDXwMEPbpCn14U+DqeNAMlzb3IuuUQGORnk1w==

protocols@^1.1.0, protocols@^1.4.0:
version "1.4.8"
Expand Down

0 comments on commit 1ae01ad

Please sign in to comment.