Skip to content
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

Prevent pinTags + minInstances from any functions, not just frameworks #6684

Merged
merged 3 commits into from
Jan 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Prevent pinTags + minInstances from any functions rewrite, not just w…
…eb frameworks
  • Loading branch information
inlined committed Jan 12, 2024
commit 8c6825c9b36a612fe49235de8074bbcc4adb29e5
13 changes: 13 additions & 0 deletions src/deploy/hosting/convertConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,19 @@
},
};
if (rewrite.function.pinTag) {
// b/319616292. Functions currently set min instances at the revision
// level and Run will maintain all those min instances for each revision
// whenever that revision is accessible (e.g. via a traffic tag). This
// can lead to customers paying lots of money with zero benefit. Until
// Run makes min instances dynamic, we must not allow both features to
// be used at the same time.
if (endpoint.minInstances) {
throw new FirebaseError(
`Function ${endpoint.id} has minInstances set and is in a rewrite ` +
"pinTags=true. These features are not currently compatible with each " +
"other."
);
}
experiments.assertEnabled("pintags", "pin a function version");
apiRewrite.run.tag = runTags.TODO_TAG_NAME;
}
Expand Down Expand Up @@ -250,7 +263,7 @@
// kind of rewrite and we haven't yet handled it.
try {
assertExhaustive(rewrite);
} catch (e: any) {

Check warning on line 266 in src/deploy/hosting/convertConfig.ts

View workflow job for this annotation

GitHub Actions / lint (20)

Unexpected any. Specify a different type
throw new FirebaseError(
"Invalid hosting rewrite config in firebase.json. " +
"A rewrite config must specify 'destination', 'function', 'dynamicLinks', or 'run'"
Expand Down
Loading