Skip to content

Conversation

@kibertoad
Copy link
Owner

@kibertoad kibertoad commented Dec 11, 2025

Summary by CodeRabbit

  • Documentation

    • Clarified deletion behavior: consumers delete subscriptions only; publishers delete both subscriptions and topics.
    • Added production safety guidance and NODE_ENV configuration details.
  • New Features

    • Added ability to control deletion scope (subscription-only vs. full resource deletion).
  • Tests

    • Added tests for selective resource deletion scenarios.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 11, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The pull request adds selective deletion support to the GCP Pub/Sub package: consumers can now delete only subscriptions while publishers handle both resources. Documentation was updated to clarify deletion semantics and production safety behavior. A GitHub Actions workflow image reference was also updated.

Changes

Cohort / File(s) Change Summary
GitHub Actions Workflow
.github/workflows/ensure-labels.yml
Updated Docker image from agilepathway/label-checker:v1.6.65 to agilepathway/pull-request-label-checker:v1.6.65
Documentation
packages/gcp-pubsub/README.md
Expanded deletion behavior documentation to clarify that consumers delete subscriptions only while publishers delete both; added explanatory notes on Pub/Sub 1:N relationships; enhanced production safety section with NODE_ENV-based behavior, runtime reloading guidance, and practical examples
Core Implementation
packages/gcp-pubsub/lib/utils/pubSubInitter.ts
Introduced PubSubDeletionOptions type with deleteSubscriptionOnly boolean flag; extended deletePubSub() to accept options parameter; updated deletion logic to conditionally skip topic deletion when flag is true
Consumer Initialization
packages/gcp-pubsub/lib/pubsub/AbstractPubSubConsumer.ts
Updated initialization flow to pass deleteSubscriptionOnly: true when deleting, ensuring subscriptions only are removed
Tests
packages/gcp-pubsub/test/utils/pubSubInitter.spec.ts
Added two new test cases covering selective deletion (subscription-only) and full deletion (both topic and subscription) based on flag value

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Areas requiring attention:

  • Verify the deleteSubscriptionOnly flag logic in pubSubInitter.ts correctly bypasses topic deletion without introducing resource leaks
  • Confirm test coverage adequately validates both deletion modes across dev/prod environments
  • Review consistency between AbstractPubSubConsumer usage pattern and updated deletePubSub signature
  • Validate README documentation examples accurately reflect the new selective deletion behavior

Poem

🐰 With careful paws, we prune with grace,
Subscriptions gone, topics stay in place!
Consumers share, so we leave the root,
While publishers clean up, boot and shoot. 🎯

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/adjust-delete

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6503d53 and 46346db.

📒 Files selected for processing (5)
  • .github/workflows/ensure-labels.yml (1 hunks)
  • packages/gcp-pubsub/README.md (1 hunks)
  • packages/gcp-pubsub/lib/pubsub/AbstractPubSubConsumer.ts (1 hunks)
  • packages/gcp-pubsub/lib/utils/pubSubInitter.ts (3 hunks)
  • packages/gcp-pubsub/test/utils/pubSubInitter.spec.ts (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kibertoad kibertoad marked this pull request as ready for review December 11, 2025 14:03
@kibertoad kibertoad merged commit fc4f991 into main Dec 11, 2025
37 of 38 checks passed
@kibertoad kibertoad deleted the fix/adjust-delete branch December 11, 2025 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants