[PR #2135] Add support for multiple Pub/Sub notification configurations #2127

Open
opened 2026-03-03 13:29:54 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fsouza/fake-gcs-server/pull/2135
Author: @lberrymage
Created: 2/4/2026
Status: 🔄 Open

Base: mainHead: multiple-event-configs


📝 Commits (3)

  • 9313f54 Add support for multiple Pub/Sub notification configurations
  • a4601ab Require event.config values to be non-empty
  • 5c5f7f8 Make event.config tests consistent with event tests

📊 Changes

6 files changed (+568 additions, -5 deletions)

View changed files

📝 fakestorage/server.go (+18 -4)
📝 fakestorage/server_test.go (+108 -0)
📝 internal/config/config.go (+120 -1)
📝 internal/config/config_test.go (+181 -0)
📝 internal/notification/event.go (+18 -0)
📝 internal/notification/event_test.go (+123 -0)

📄 Description

fake-gcs-server's flags currently support setting only a single object storage notification configuration, rendering it impossible to model certain system architectures which depend on multiple notification configurations (e.g., a system which sends notifications to different Pub/Sub topics depending on the bucket) even if these architectures are possible with Google Cloud Storage proper.

This commit adds support for specifying a full notification configuration with the -event.config flag using semicolon-separated key-value pairs. The flag can be repeated to add additional notification configurations. Backward compatibility is preserved with the old event.* flags (which can specify only a single notification config) by allowing them to work previously, but ignoring them if the new -event.config flag is used. The list of event types which trigger a notification defaults to "finalize" to match existing behavior with the old -event.* flags.

The implementation uses a new MultiEventManager type which simply wraps a list of PubsubEventManagers. This approach allows for maximum code reuse with minimum code churn, although it might technically be cleaner to altogether replace the implementation of PubsubEventManager with that of MultiEventManager in the future.

Implements #2131


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/fsouza/fake-gcs-server/pull/2135 **Author:** [@lberrymage](https://github.com/lberrymage) **Created:** 2/4/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `multiple-event-configs` --- ### 📝 Commits (3) - [`9313f54`](https://github.com/fsouza/fake-gcs-server/commit/9313f547b4d99bc7d5f29b15a2064a30478b1317) Add support for multiple Pub/Sub notification configurations - [`a4601ab`](https://github.com/fsouza/fake-gcs-server/commit/a4601ab1ac9b97c92d15827c8242feb88346c72d) Require event.config values to be non-empty - [`5c5f7f8`](https://github.com/fsouza/fake-gcs-server/commit/5c5f7f8efdeba95a0d185ecf2b8797116691a3f1) Make event.config tests consistent with event tests ### 📊 Changes **6 files changed** (+568 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `fakestorage/server.go` (+18 -4) 📝 `fakestorage/server_test.go` (+108 -0) 📝 `internal/config/config.go` (+120 -1) 📝 `internal/config/config_test.go` (+181 -0) 📝 `internal/notification/event.go` (+18 -0) 📝 `internal/notification/event_test.go` (+123 -0) </details> ### 📄 Description fake-gcs-server's flags currently support setting only a single object storage notification configuration, rendering it impossible to model certain system architectures which depend on multiple notification configurations (e.g., a system which sends notifications to different Pub/Sub topics depending on the bucket) even if these architectures are possible with Google Cloud Storage proper. This commit adds support for specifying a full notification configuration with the -event.config flag using semicolon-separated key-value pairs. The flag can be repeated to add additional notification configurations. Backward compatibility is preserved with the old event.* flags (which can specify only a single notification config) by allowing them to work previously, but ignoring them if the new -event.config flag is used. The list of event types which trigger a notification defaults to "finalize" to match existing behavior with the old -event.* flags. The implementation uses a new MultiEventManager type which simply wraps a list of PubsubEventManagers. This approach allows for maximum code reuse with minimum code churn, although it might technically be cleaner to altogether replace the implementation of PubsubEventManager with that of MultiEventManager in the future. Implements #2131 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/fake-gcs-server#2127
No description provided.