Skip to content

Add support for setting user labels on scheduled functions #3408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
- Fixes manually setting download tokens in Storage Emulator. (#3396)
- Fixes deleting custom metadata in Storage emulator. (#3385)
- Fixes errors when calling makePublic() with Storage Emulator(#3394)
- Adds support for setting user labels on scheduled functions.
5 changes: 4 additions & 1 deletion src/deploy/functions/discovery/jsexports/parseTriggers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,10 @@ export function addResourcesToBackend(
cloudFunction.trigger.eventFilters.resource = `${cloudFunction.trigger.eventFilters.resource}/${id}`;
}

cloudFunction.labels = { "deployment-scheduled": "true" };
cloudFunction.labels = {
...cloudFunction.labels,
"deployment-scheduled": "true",
};
}

want.cloudFunctions.push(cloudFunction);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ describe("addResourcesToBackend", () => {
vpcConnector: "projects/project/locations/region/connectors/connector",
ingressSettings: "ALLOW_ALL",
timeout: "60s",
labels: {
test: "testing",
},
};

const result = backend.empty();
Expand All @@ -146,6 +149,9 @@ describe("addResourcesToBackend", () => {
vpcConnector: "projects/project/locations/region/connectors/connector",
ingressSettings: "ALLOW_ALL",
timeout: "60s",
labels: {
test: "testing",
},
},
],
};
Expand Down Expand Up @@ -260,6 +266,9 @@ describe("addResourcesToBackend", () => {
httpsTrigger: {},
regions: ["us-central1", "europe-west1"],
schedule,
labels: {
test: "testing",
},
};

const result = backend.empty();
Expand All @@ -277,6 +286,7 @@ describe("addResourcesToBackend", () => {
},
labels: {
"deployment-scheduled": "true",
test: "testing",
},
region: "us-central1",
};
Expand All @@ -288,6 +298,7 @@ describe("addResourcesToBackend", () => {
},
labels: {
"deployment-scheduled": "true",
test: "testing",
},
};
const expected: backend.Backend = {
Expand Down