Skip to content

chore: Migrate samples to google-cloud-pubsub v3#30618

Merged
aandreassa merged 6 commits into
mainfrom
pubsub-schema-samples
Jul 22, 2025
Merged

chore: Migrate samples to google-cloud-pubsub v3#30618
aandreassa merged 6 commits into
mainfrom
pubsub-schema-samples

Conversation

@aandreassa
Copy link
Copy Markdown
Contributor

No description provided.

@aandreassa aandreassa force-pushed the pubsub-schema-samples branch from d0ae18f to 72ce692 Compare July 14, 2025 19:02
@aandreassa aandreassa marked this pull request as ready for review July 14, 2025 19:47
@aandreassa aandreassa requested a review from a team July 14, 2025 19:47
@snippet-bot
Copy link
Copy Markdown

snippet-bot Bot commented Jul 14, 2025

Here is the summary of changes.

You are about to add 5 region tags.
You are about to delete 5 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@aandreassa aandreassa changed the title chore: Migrate schema samples to google-cloud-pubsub-v2 chore: Migrate schema samples to google-cloud-pubsub v3 Jul 15, 2025
@aandreassa aandreassa changed the title chore: Migrate schema samples to google-cloud-pubsub v3 chore: Migrate samples to google-cloud-pubsub v3 Jul 15, 2025
Comment thread google-cloud-pubsub/samples/acceptance/schemas_test.rb Outdated
Comment thread google-cloud-pubsub/samples/acceptance/subscriptions_test.rb Outdated

subscription_admin = pubsub.subscription_admin

subscription = subscription_admin.create_subscription name: pubsub.subscription_path(subscription_id),
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.

We should try to limit actual samples to 80 columns so they show up well on the web page without requiring excessive horizontal scrolling. This might mean formatting method calls with these long names differently. For example, you could either:

subscription = subscription_admin.create_subscription(
  name: pubsub.subscription_path(subscription_id),
  topic: pubsub.topic_path(topic_id),
  bigquery_config: {
    table: bigquery_table_id,
    write_metadata: true
  }
)

or sometimes we've done:

subscription = subscription_admin.create_subscription \
  name: pubsub.subscription_path(subscription_id),
  topic: pubsub.topic_path(topic_id),
  bigquery_config: {
    table: bigquery_table_id,
    write_metadata: true
  }

Copy link
Copy Markdown
Contributor Author

@aandreassa aandreassa Jul 17, 2025

Choose a reason for hiding this comment

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

Updated a bunch of them to follow it. FYI I added second commit for s/Pubsub/PubSub/g module name in the samples directory.

Comment thread google-cloud-pubsub/samples/pubsub_dead_letter_update_subscription.rb Outdated
Comment thread google-cloud-pubsub/samples/pubsub_list_schema_revisions.rb Outdated
Comment thread google-cloud-pubsub/samples/pubsub_publish_avro_records.rb Outdated
Comment thread google-cloud-pubsub/samples/pubsub_publish_proto_messages.rb Outdated
Comment thread google-cloud-pubsub/samples/pubsub_list_schemas.rb Outdated
@aandreassa aandreassa requested a review from dazuma July 17, 2025 18:36
@aandreassa
Copy link
Copy Markdown
Contributor Author

Those sample test cases are somewhat flaky. It passes locally consistently.

Copy link
Copy Markdown
Contributor

@dazuma dazuma left a comment

Choose a reason for hiding this comment

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

Thanks!

@aandreassa aandreassa closed this Jul 22, 2025
@aandreassa aandreassa reopened this Jul 22, 2025
@aandreassa
Copy link
Copy Markdown
Contributor Author

Misclicked to close PR. Merging!

@aandreassa aandreassa merged commit 14c3722 into main Jul 22, 2025
27 of 29 checks passed
@aandreassa aandreassa deleted the pubsub-schema-samples branch July 22, 2025 00:32
@github-actions github-actions Bot added the release-please:force-run To run release-please label Jul 22, 2025
@release-please release-please Bot removed the release-please:force-run To run release-please label Jul 22, 2025
shubhangi-google pushed a commit to shubhangi-google/google-cloud-ruby that referenced this pull request Sep 2, 2025
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.

3 participants