Update Pub/Sub Emulator
DevOps & SecurityUpdate Pub/Sub Emulator is an Agent Skill for devops & security published in the firebase/firebase-tools repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
How to update the Pub/Sub emulator
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Inspect the Agent Skill at https://github.com/firebase/firebase-tools/blob/HEAD/.agent/skills/update-pubsub-emulator/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/update-pub-sub-emulator, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Update Pub/Sub Emulator
-
Update Local Emulator Run the following command to make sure you have the latest version of the pubsub emulator installed via gcloud:
gcloud components update pubsub-emulator -
Locate Emulator Directory The emulator represents a directory likely located at
<gcloud-install-path>/platform/pubsub-emulator. You can find the exact path by running the emulator and checking the output, or by inspecting wheregcloudis installed (e.g.which gcloudusually points to a bin directory, and the platform directory is a sibling ofbin). Verify the version by running the emulator or checking theVERSIONfile if it exists. -
Package the Emulator Zip the directory found in the previous step. Name it
pubsub-emulator-<version>.zip. Ensure the zip structure is such that the top-level directory inside the zip ispubsub-emulator. Note: The existing code expects the binary atpubsub-emulator-<version>/pubsub-emulator/bin/cloud-pubsub-emulatorinside the cache, which usually means the zip contains a root folderpubsub-emulator. -
Upload to Storage Upload the zip file to the Firebase preview bucket:
gcloud storage cp pubsub-emulator-<version>.zip gs://firebase-preview-drop/emulator/Make the file publicly readable if necessary (usually the bucket permissions handle this, or use
gcloud storage objects update ... --add-acl-grant=entity=allUsers,role=READER).Note: For the version 0.8.27 update, this step was already done.
-
Calculate Metadata Calculate the file size in bytes, MD5 checksum, and SHA256 checksum of the zip file.
# Size ls -l pubsub-emulator-<version>.zip # MD5 (macOS: `md5`, Linux: `md5sum`) md5 pubsub-emulator-<version>.zip # SHA256 (macOS: `shasum -a 256`, Linux: `sha256sum`) shasum -a 256 pubsub-emulator-<version>.zip -
Update Configuration Edit
src/emulator/downloadableEmulatorInfo.json:- Update
pubsub.versionto the new version. - Update
pubsub.expectedSize. - Update
pubsub.expectedChecksum(MD5). - Update
pubsub.expectedChecksumSHA256. - Update
pubsub.remoteUrlandpubsub.downloadPathRelativeToCacheDir.
- Update
-
Verify Run the emulators to ensure the new version is downloaded and starts correctly.
firebase emulators:start --only pubsub -
Add a Changelog Entry Add a changelog entry to
CHANGELOG.mdlike '- Updated Pub/Sub emulator to version '