Skip to content

Commit efc160a

Browse files
authored
Allow v1 and v2 functions to set the Omit option on a function (#1298)
1 parent 39cff12 commit efc160a

14 files changed

+62
-0
lines changed

src/runtime/manifest.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import { WireParamSpec } from "../params/types";
3232
export interface ManifestEndpoint {
3333
entryPoint?: string;
3434
region?: string[];
35+
omit?: boolean | Expression<boolean>;
3536
platform?: string;
3637
availableMemoryMb?: number | Expression<number> | ResetValue;
3738
maxInstances?: number | Expression<number> | ResetValue;

src/v1/cloud-functions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,7 @@ export function optionsToEndpoint(options: DeploymentOptions): ManifestEndpoint
597597
copyIfPresent(
598598
endpoint,
599599
options,
600+
"omit",
600601
"minInstances",
601602
"maxInstances",
602603
"ingressSettings",

src/v1/function-configuration.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,10 @@ export interface RuntimeOptions {
252252
* Configuration options for a function that applies during function deployment.
253253
*/
254254
export interface DeploymentOptions extends RuntimeOptions {
255+
/**
256+
* If true, do not deploy or emulate this function.
257+
*/
258+
omit?: boolean | Expression<boolean>;
255259
/**
256260
* Regions where function should be deployed.
257261
*/

src/v2/options.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ export type IngressSetting = "ALLOW_ALL" | "ALLOW_INTERNAL_ONLY" | "ALLOW_INTERN
9494
* These options are common to HTTPS and Event handling functions.
9595
*/
9696
export interface GlobalOptions {
97+
/**
98+
* If true, do not deploy or emulate this function.
99+
*/
100+
omit?: boolean | Expression<boolean>;
101+
97102
/**
98103
* Region where functions should be deployed.
99104
*/
@@ -317,6 +322,7 @@ export function optionsToEndpoint(
317322
copyIfPresent(
318323
endpoint,
319324
opts,
325+
"omit",
320326
"concurrency",
321327
"minInstances",
322328
"maxInstances",

src/v2/providers/alerts/alerts.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ export interface FirebaseAlertOptions extends options.EventHandlerOptions {
8686
/** Scope the function to trigger on a specific application. */
8787
appId?: string;
8888

89+
/**
90+
* If true, do not deploy or emulate this function.
91+
*/
92+
omit?: boolean | Expression<boolean>;
93+
8994
/**
9095
* Region where functions should be deployed.
9196
*/

src/v2/providers/alerts/appDistribution.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ export interface AppDistributionOptions extends options.EventHandlerOptions {
9797
/** Scope the function to trigger on a specific application. */
9898
appId?: string;
9999

100+
/**
101+
* If true, do not deploy or emulate this function.
102+
*/
103+
omit?: boolean | Expression<boolean>;
104+
100105
/**
101106
* Region where functions should be deployed.
102107
*/

src/v2/providers/alerts/crashlytics.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ export interface CrashlyticsOptions extends options.EventHandlerOptions {
177177
/** Scope the function to trigger on a specific application. */
178178
appId?: string;
179179

180+
/**
181+
* If true, do not deploy or emulate this function.
182+
*/
183+
omit?: boolean | Expression<boolean>;
184+
180185
/**
181186
* Region where functions should be deployed.
182187
*/

src/v2/providers/database.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ export interface ReferenceOptions<Ref extends string = string> extends options.E
9898
*/
9999
instance?: string;
100100

101+
/**
102+
* If true, do not deploy or emulate this function.
103+
*/
104+
omit?: boolean | Expression<boolean>;
105+
101106
/**
102107
* Region where functions should be deployed.
103108
*/

src/v2/providers/eventarc.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ export interface EventarcTriggerOptions extends options.EventHandlerOptions {
6262
*/
6363
filters?: Record<string, string>;
6464

65+
/**
66+
* If true, do not deploy or emulate this function.
67+
*/
68+
omit?: boolean | Expression<boolean>;
69+
6570
/**
6671
* Region where functions should be deployed.
6772
*/

src/v2/providers/https.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ export { Request, CallableRequest, FunctionsErrorCode, HttpsError };
5050
* Options that can be set on an onRequest HTTPS function.
5151
*/
5252
export interface HttpsOptions extends Omit<GlobalOptions, "region"> {
53+
/**
54+
* If true, do not deploy or emulate this function.
55+
*/
56+
omit?: boolean | Expression<boolean>;
57+
5358
/** HTTP functions can override global options and can specify multiple regions to deploy to. */
5459
region?: SupportedRegion | string | Array<SupportedRegion | string>;
5560

src/v2/providers/identity.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ export interface BlockingOptions {
6464
/** Pass the Refresh Token credential to the function. */
6565
refreshToken?: boolean;
6666

67+
/**
68+
* If true, do not deploy or emulate this function.
69+
*/
70+
omit?: boolean | Expression<boolean>;
71+
6772
/**
6873
* Region where functions should be deployed.
6974
*/

src/v2/providers/pubsub.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ export interface PubSubOptions extends options.EventHandlerOptions {
155155
/** The Pub/Sub topic to watch for message events */
156156
topic: string;
157157

158+
/**
159+
* If true, do not deploy or emulate this function.
160+
*/
161+
omit?: boolean | Expression<boolean>;
162+
158163
/**
159164
* Region where functions should be deployed.
160165
*/

src/v2/providers/storage.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,11 @@ export interface StorageOptions extends options.EventHandlerOptions {
203203
/** The name of the bucket containing this object. */
204204
bucket?: string;
205205

206+
/**
207+
* If true, do not deploy or emulate this function.
208+
*/
209+
omit?: boolean | Expression<boolean>;
210+
206211
/**
207212
* Region where functions should be deployed.
208213
*/

src/v2/providers/tasks.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ export interface TaskQueueOptions extends options.EventHandlerOptions {
6060
*/
6161
invoker?: "private" | string | string[];
6262

63+
/**
64+
* If true, do not deploy or emulate this function.
65+
*/
66+
omit?: boolean | Expression<boolean>;
67+
6368
/**
6469
* Region where functions should be deployed.
6570
*/

0 commit comments

Comments
 (0)