-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feature/add auth event arc experiment #10635
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -10,6 +10,10 @@ import * as fsutils from "../../fsutils"; | |||||||||||||||||||||
| import * as backend from "./backend"; | ||||||||||||||||||||||
| import * as utils from "../../utils"; | ||||||||||||||||||||||
| import * as secrets from "../../functions/secrets"; | ||||||||||||||||||||||
| import * as experiments from "../../experiments"; | ||||||||||||||||||||||
| import { AUTH_EVENTS } from "../../functions/events/v2"; | ||||||||||||||||||||||
|
Comment on lines
+13
to
+14
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| const AUTH_EVENTS_SET = new Set<string>(AUTH_EVENTS); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| /** | ||||||||||||||||||||||
| * GCF Gen 1 has a max timeout of 540s. | ||||||||||||||||||||||
|
|
@@ -89,6 +93,11 @@ export function endpointsAreValid(wantBackend: backend.Backend): void { | |||||||||||||||||||||
| validateTimeoutConfig(endpoints); | ||||||||||||||||||||||
| for (const ep of endpoints) { | ||||||||||||||||||||||
| validateScheduledTimeout(ep); | ||||||||||||||||||||||
| if (backend.isEventTriggered(ep)) { | ||||||||||||||||||||||
| if (AUTH_EVENTS_SET.has(ep.eventTrigger.eventType)) { | ||||||||||||||||||||||
| experiments.assertEnabled("autheventarc", "deploy Auth Eventarc triggers"); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
Comment on lines
+96
to
+100
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use the module-level
Suggested change
|
||||||||||||||||||||||
| const service = serviceForEndpoint(ep); | ||||||||||||||||||||||
| if (backend.isBlockingTriggered(ep)) { | ||||||||||||||||||||||
| if (service.name === "noop") { | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of stubbing
experiments.assertEnabledwith Sinon, we can use the publicexperiments.setEnabledAPI to toggle the experiment state. This tests the actual integration with theexperimentsmodule, verifies the real error messages, and avoids stubbing module exports which can be brittle and problematic in some environments.