Skip to content

Conversation

@stevendborrelli
Copy link
Member

@stevendborrelli stevendborrelli commented Jan 12, 2026

Description of your changes

Add a GitHub workflow in ci.yaml to re-generate protobuf files from the run_function.proto file.

Detect if any uncommitted changes are made to the generated files. The first few actions should error out
until I commit the changed files.

I have:

  • Read and followed Upbound's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR, as appropriate.

How has this code been tested

The first run failed successfully: https://github.com/upbound/function-sdk-typescript/actions/runs/20917111591/job/60093230709?pr=11.

After adding the generated protobuf files with the newest version, the run succeeds https://github.com/upbound/function-sdk-typescript/actions/runs/20917799678/job/60095578927

Error: Protobuf generation caused changes in src directory
Please run 'npm run protoc-gen' locally and commit the changes
HEAD detached at pull/11/merge
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   src/proto/google/protobuf/duration.ts
	modified:   src/proto/google/protobuf/struct.ts
	modified:   src/proto/run_function.ts

no changes added to commit (use "git add" and/or "git commit -a")
diff --git a/src/proto/google/protobuf/duration.ts b/src/proto/google/protobuf/duration.ts
index 16bd020..86ec551 100644
--- a/src/proto/google/protobuf/duration.ts
+++ b/src/proto/google/protobuf/duration.ts
@@ -1,7 +1,7 @@
 // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
 // versions:
-//   protoc-gen-ts_proto  v2.8.3
-//   protoc               v6.33.0
+//   protoc-gen-ts_proto  v2.10.1
+//   protoc               v4.23.4
 // source: google/protobuf/duration.proto
 
 /* eslint-disable */
diff --git a/src/proto/google/protobuf/struct.ts b/src/proto/google/protobuf/struct.ts
index 7a27dae..988e9f6 100644
--- a/src/proto/google/protobuf/struct.ts
+++ b/src/proto/google/protobuf/struct.ts
@@ -1,7 +1,7 @@
 // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
 // versions:
-//   protoc-gen-ts_proto  v2.8.3
-//   protoc               v6.33.0
+//   protoc-gen-ts_proto  v2.10.1
+//   protoc               v4.23.4
 // source: google/protobuf/struct.proto
       : undefined;
-    message.resources = Object.entries(object.resources ?? {}).reduce<{ [key: string]: Resource }>(
-      (acc, [key, value]) => {
+    message.resources = (globalThis.Object.entries(object.resources ?? {}) as [string, Resource][]).reduce(
+      (acc: { [key: string]: Resource }, [key, value]: [string, Resource]) => {
         if (value !== undefined) {
           acc[key] = Resource.fromPartial(value);
         }
@@ -2421,7 +2447,7 @@ export const Resource: MessageFns<Resource> = {
     if (message.resource !== undefined) {
       Struct.encode(Struct.wrap(message.resource), writer.uint32(10).fork()).join();
     }
-    Object.entries(message.connectionDetails).forEach(([key, value]) => {
+    globalThis.Object.entries(message.connectionDetails).forEach(([key, value]: [string, Buffer]) => {
       Resource_ConnectionDetailsEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).join();
     });
     if (message.ready !== 0) {
@@ -2477,10 +2503,13 @@ export const Resource: MessageFns<Resource> = {
     return {
       resource: isObject(object.resource) ? object.resource : undefined,
       connectionDetails: isObject(object.connectionDetails)
-        ? Object.entries(object.connectionDetails).reduce<{ [key: string]: Buffer }>((acc, [key, value]) => {
-          acc[key] = Buffer.from(bytesFromBase64(value as string));
-          return acc;
-        }, {})
+        ? (globalThis.Object.entries(object.connectionDetails) as [string, any][]).reduce(
+          (acc: { [key: string]: Buffer }, [key, value]: [string, any]) => {
+            acc[key] = Buffer.from(bytesFromBase64(value as string));
+            return acc;
+          },
+          {},
+        )
         : {},
       ready: isSet(object.ready) ? readyFromJSON(object.ready) : 0,
     };
@@ -2492,7 +2521,7 @@ export const Resource: MessageFns<Resource> = {
       obj.resource = message.resource;
     }
     if (message.connectionDetails) {
-      const entries = Object.entries(message.connectionDetails);
+      const entries = globalThis.Object.entries(message.connectionDetails) as [string, Buffer][];
       if (entries.length > 0) {
         obj.connectionDetails = {};
         entries.forEach(([k, v]) => {
@@ -2512,15 +2541,13 @@ export const Resource: MessageFns<Resource> = {
   fromPartial<I extends Exact<DeepPartial<Resource>, I>>(object: I): Resource {
     const message = createBaseResource();
     message.resource = object.resource ?? undefined;
-    message.connectionDetails = Object.entries(object.connectionDetails ?? {}).reduce<{ [key: string]: Buffer }>(
-      (acc, [key, value]) => {
+    message.connectionDetails = (globalThis.Object.entries(object.connectionDetails ?? {}) as [string, Buffer][])
+      .reduce((acc: { [key: string]: Buffer }, [key, value]: [string, Buffer]) => {
         if (value !== undefined) {
           acc[key] = value;
         }
         return acc;
-      },
-      {},
-    );
+      }, {});
     message.ready = object.ready ?? 0;
     return message;
   },
Error: Process completed with exit code 1.

Signed-off-by: Steven Borrelli <steve@borrelli.org>
Signed-off-by: Steven Borrelli <steve@borrelli.org>
Signed-off-by: Steven Borrelli <steve@borrelli.org>
@stevendborrelli stevendborrelli merged commit ee21649 into upbound:main Jan 12, 2026
4 checks passed
@stevendborrelli stevendborrelli deleted the github-action-pb branch January 12, 2026 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant