Skip to content

bug-2037435: Add notification command to gcs-cli. - #223

Merged
smarnach merged 3 commits into
mainfrom
gcs-notifications
Aug 14, 2026
Merged

bug-2037435: Add notification command to gcs-cli.#223
smarnach merged 3 commits into
mainfrom
gcs-notifications

Conversation

@smarnach

Copy link
Copy Markdown
Contributor

For the new Tecken upload API we need Cloud Storage Pub/Sub notifications. We use gcs-cli to set up Cloud Storage buckets in the emulator, so we need to add the ability to configure Pub/Sub notifications to the tool.

The GCS emulator only recently gained the ability to configure Pub/Sub notifications, so we also need to upgrade the emulator to the latest version to make the tests pass.

@biancadanforth biancadanforth self-assigned this Aug 11, 2026

@biancadanforth biancadanforth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It took me a while to figure out how to test this locally, but I finally did. I don't think the obs-common README is very helpful on how to run these CLIs, particularly with the more recent switch to uv.

While we're here, would you mind improving the README slightly?

Here are the steps that ultimately worked for me for the GCS emulator:

just down
just build
just up
uv self update (I was getting some warnings for an unrecognized field in pyproject.toml -- we don't constrain the version of `uv`, but we use the latest version in CI)
uv sync
export STORAGE_EMULATOR_HOST="http://localhost:8001"
uv run gcs-cli create test-bucket
uv run gcs-cli notification test-bucket test-project test-topic-name

Also, how does this connect to the pubsub emulator? Is that going to be done in the Tecken repo? I thought perhaps there may need to be some config for the GCS emulator to send things to the PubSub emulator (or something)...

Comment thread tests/test_gcs_cli.py
@smarnach

Copy link
Copy Markdown
Contributor Author

While we're here, would you mind improving the README slightly?

I can try. I feel a better solution than what we currently have would be a just shell command with the relevant environment variables set, but I don't want to spend time on that at the moment.

Here are the steps that ultimately worked for me for the GCS emulator:

just down
just build
just up
uv self update (I was getting some warnings for an unrecognized field in pyproject.toml -- we don't constrain the version of `uv`, but we use the latest version in CI)
uv sync
export STORAGE_EMULATOR_HOST="http://localhost:8001"
uv run gcs-cli create test-bucket
uv run gcs-cli notification test-bucket test-project test-topic-name

That's essentially what I did as well (except for the uv self update; I'm usually on a fairly recent version).

Also, how does this connect to the pubsub emulator? Is that going to be done in the Tecken repo? I thought perhaps there may need to be some config for the GCS emulator to send things to the PubSub emulator (or something)...

The GCS emulator uses the normal Go pub/sub client library, which respects the PUBSUB_EMULATOR_HOST environment variable (just as the Python pub/sub client library does). So hooking that up turned out to be easier than expected.

@smarnach
smarnach added this pull request to the merge queue Aug 14, 2026
Merged via the queue into main with commit e0d39ea Aug 14, 2026
5 checks passed
@smarnach
smarnach deleted the gcs-notifications branch August 14, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants