Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
292c48b
initial cloud run no build deploy implementation mvp
brittanycho Dec 19, 2025
57855da
manual testing files - will remove later
brittanycho Dec 19, 2025
b4f9633
fixes formatting issues
brittanycho Dec 20, 2025
f24830e
Fix runv2.spec.ts concurrency expectation
brittanycho Jan 6, 2026
6670e13
removing manual test files
brittanycho Jan 6, 2026
dc1978e
Merge branch 'master' into zip-deploy-4
brittanycho Jan 7, 2026
487ad04
Fix lint errors
brittanycho Jan 7, 2026
15a7b26
Update json schema for dart3
brittanycho Jan 7, 2026
23c6d27
Fix lint errors and remove verify script
brittanycho Jan 7, 2026
366fe34
Fix TS errors in fabricator.ts for vscode build
brittanycho Jan 7, 2026
e66d9de
Fixes minor formatting issues
brittanycho Jan 7, 2026
1975dec
Fixed linting
brittanycho Jan 7, 2026
6b53bf9
Merge branch 'master' into zip-deploy-4
brittanycho Jan 9, 2026
f385cc3
addresses feedback
brittanycho Jan 12, 2026
e98b149
Merge branch 'master' into zip-deploy-4
brittanycho Jan 12, 2026
55ee19f
remove runtime config for v2 and run
brittanycho Jan 13, 2026
92124c2
Merge branch 'master' into zip-deploy-4
brittanycho Jan 14, 2026
2e3ceec
adds relevant comments
brittanycho Jan 15, 2026
f767878
Merge branch 'master' into zip-deploy-4
brittanycho Jan 21, 2026
cc924c4
Merge branch 'master' into zip-deploy-4
brittanycho Jan 24, 2026
7a32e38
add additional fields and other minor fixes
brittanycho Jan 27, 2026
0d985f2
Merge branch 'master' into zip-deploy-4
brittanycho Jan 27, 2026
9a63a38
corrects test
brittanycho Jan 27, 2026
13fb338
fixes error
brittanycho Jan 27, 2026
4714005
fix prettier
brittanycho Jan 27, 2026
d6d22cb
Merge branch 'master' into zip-deploy-4
brittanycho Jan 27, 2026
220df7d
Merge branch 'master' into zip-deploy-4
brittanycho Jan 29, 2026
58225a1
Merge branch 'master' into zip-deploy-4
brittanycho Feb 4, 2026
94677e7
addresses feedback
brittanycho Feb 5, 2026
c5f63f9
fixes error
brittanycho Feb 5, 2026
dba4631
addresses lint
brittanycho Feb 5, 2026
b1843f0
Merge branch 'master' into zip-deploy-4
brittanycho Feb 12, 2026
a7baa0b
modifies updateService to correct issue
brittanycho Feb 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/gcp/runv2.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@
httpsTrigger: {},
environmentVariables: { FOO: "bar" },
};
const expectedServiceInput = JSON.parse(

Check warning on line 101 in src/gcp/runv2.spec.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe assignment of an `any` value
JSON.stringify({
...BASE_RUN_SERVICE,
name: `projects/${PROJECT_ID}/locations/${LOCATION}/services/${FUNCTION_ID.toLowerCase()}`,
}),
);
expectedServiceInput.template.containers[0].env.unshift({ name: "FOO", value: "bar" });

Check warning on line 107 in src/gcp/runv2.spec.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe call of an `any` typed value

Check warning on line 107 in src/gcp/runv2.spec.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .template on an `any` value

expect(runv2.serviceFromEndpoint(endpoint, IMAGE_URI)).to.deep.equal(expectedServiceInput);
});
Expand All @@ -117,13 +117,13 @@
{ key: "MY_SECRET", secret: "secret-name", projectId: PROJECT_ID, version: "1" },
],
};
const expectedServiceInput = JSON.parse(

Check warning on line 120 in src/gcp/runv2.spec.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe assignment of an `any` value
JSON.stringify({
...BASE_RUN_SERVICE,
name: `projects/${PROJECT_ID}/locations/${LOCATION}/services/${FUNCTION_ID.toLowerCase()}`,
}),
);
expectedServiceInput.template.containers[0].env.unshift({

Check warning on line 126 in src/gcp/runv2.spec.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe call of an `any` typed value

Check warning on line 126 in src/gcp/runv2.spec.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .template on an `any` value
name: "MY_SECRET",
valueSource: { secretKeyRef: { secret: "secret-name", version: "1" } },
});
Expand All @@ -137,13 +137,13 @@
minInstances: 1,
maxInstances: 10,
};
const expectedServiceInput = JSON.parse(

Check warning on line 140 in src/gcp/runv2.spec.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe assignment of an `any` value
JSON.stringify({
...BASE_RUN_SERVICE,
name: `projects/${PROJECT_ID}/locations/${LOCATION}/services/${FUNCTION_ID.toLowerCase()}`,
}),
);
expectedServiceInput.scaling = {

Check warning on line 146 in src/gcp/runv2.spec.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .scaling on an `any` value
minInstanceCount: 1,
maxInstanceCount: 10,
};
Expand All @@ -157,13 +157,13 @@
httpsTrigger: {},
concurrency: 50,
};
const expectedServiceInput = JSON.parse(

Check warning on line 160 in src/gcp/runv2.spec.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe assignment of an `any` value
JSON.stringify({
...BASE_RUN_SERVICE,
name: `projects/${PROJECT_ID}/locations/${LOCATION}/services/${FUNCTION_ID.toLowerCase()}`,
}),
);
expectedServiceInput.template.maxInstanceRequestConcurrency = 50;

Check warning on line 166 in src/gcp/runv2.spec.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unsafe member access .template on an `any` value

expect(runv2.serviceFromEndpoint(endpoint, IMAGE_URI)).to.deep.equal(expectedServiceInput);
});
Expand Down Expand Up @@ -451,7 +451,7 @@
entryPoint: SERVICE_ID, // No FUNCTION_TARGET_ANNOTATION
availableMemoryMb: 128,
cpu: 0.5,
eventTrigger: { eventType: "unknown", retry: false },
httpsTrigger: {},
labels: {},
environmentVariables: {},
secretEnvironmentVariables: [],
Expand Down
5 changes: 3 additions & 2 deletions src/gcp/runv2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export async function updateService(service: Omit<Service, ServiceOutputFields>)
);
// Always update revision name to ensure null generates a new unique revision name.
fieldMask.push("template.revision");
const res = await client.post<Omit<Service, ServiceOutputFields>, LongRunningOperation<Service>>(
const res = await client.patch<Omit<Service, ServiceOutputFields>, LongRunningOperation<Service>>(
service.name,
service,
{
Expand Down Expand Up @@ -619,7 +619,8 @@ export function endpointFromService(service: Omit<Service, ServiceOutputFields>)
? "ALLOW_INTERNAL_AND_GCLB"
: "ALLOW_ALL") as backend.IngressSettings,
// TODO: Figure out how to encode all trigger types to the underlying Run service that is compatible with both V2 functions and "direct to run" functions
...(service.annotations?.[TRIGGER_TYPE_ANNOTATION] === "HTTP_TRIGGER"
...(!service.annotations?.[TRIGGER_TYPE_ANNOTATION] ||
service.annotations?.[TRIGGER_TYPE_ANNOTATION] === "HTTP_TRIGGER"
Comment on lines +622 to +623
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This condition is a bit repetitive. To improve readability and maintainability, consider extracting service.annotations?.[TRIGGER_TYPE_ANNOTATION] into a variable before this object literal.

For example:

const triggerType = service.annotations?.[TRIGGER_TYPE_ANNOTATION];
// ...
...(!triggerType || triggerType === "HTTP_TRIGGER"
  ? { httpsTrigger: {} }
  : { /* ... */ })

? { httpsTrigger: {} }
: {
eventTrigger: {
Expand Down
Loading