Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased](https://github.com/Space48/cloud-seed/compare/v4.1.0...HEAD)
## [Unreleased](https://github.com/Space48/cloud-seed/compare/HEAD...v5.0.0)

### Breaking changes

- `Firestore` functions `event trigger filter attribute` now includes `database` in addition to `document`. Ensure you update and complete full regression testing of your firestore functions after upgrading

## [4.1.2](https://github.com/Space48/cloud-seed/compare/v4.1.0...v4.1.2)

### Added

Expand Down Expand Up @@ -45,7 +51,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Updated package dependencies
- Enhanced type safety for environment-specific configurations


## [v3.0.0](https://github.com/Space48/cloud-seed/compare/v2.1.0...v3.0.0)

### Breaking changes
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@space48/cloud-seed",
"version": "4.1.2",
"version": "5.0.0",
"description": "Cloud infrastructure automation tool that uses Terraform CDK.",
"main": "dist/index.js",
"bin": {
Expand Down Expand Up @@ -59,4 +59,4 @@
"lint-staged": {
"*.{js,ts}": "eslint --cache --fix"
}
}
}
6 changes: 5 additions & 1 deletion stacks/gcp/GcpStack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,13 @@ export default class GcpStack extends TerraformStack {
retryPolicy,
eventFilters: [
{
attribute: "database",
attribute: "document",
value: config.document,
},
{
attribute: "database",
value: config.database,
},
],
},
};
Expand Down
1 change: 1 addition & 0 deletions types/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export type QueueConfig = {
export type FirestoreConfig = {
type: "firestore";
document: string;
database: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

@ansnaldo I'm concerned that this is a required value, but it's not used for gen1 functions at all. It means that if someone upgrades Cloud Seed, but wants to keep gen1 functions, they would have to enter some dummy data that is unused.

Can we make this optional? Is it actually required for gen2 functions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ansnaldo I'm concerned that this is a required value, but it's not used for gen1 functions at all. It means that if someone upgrades Cloud Seed, but wants to keep gen1 functions, they would have to enter some dummy data that is unused.

Can we make this optional? Is it actually required for gen2 functions?

@tgerulaitis good point. Yes it looks to be required looking at GCP docs. Also when I tested the first beta version (with document only) I got this error :

Error: Error creating function: googleapi: Error 400: Validation failed for trigger xxx : The request was invalid: missing required attribute "database" in trigger.event_filters
│ 
│   with google_cloudfunctions2_function.firestore-create-export,
│   on cdk.tf.json line 115, in resource.google_cloudfunctions2_function.firestore-create-export:
│  115:       },
│ 
╵

Updated now.

firestoreEvent?: "create" | "write" | "update" | "delete";
} & FunctionConfig;

Expand Down
Loading