Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(pubsub): copy v1 samples to new directory #4887

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hongalex
Copy link
Contributor

In preparation for the pubsub v2.0.0 migration, we should duplicate our samples into an old directory. I created region tags for these old samples so they will show up in our sample browser. Once the v2.0 changes are ready, we will replace the samples in the current golang-samples/pubsub directory with v2 samples, which negates the need to change large swaths of our documentation.

This PR has a lot of changes but is effectively doing two things:

  1. Copy all samples into new v1samples directory
  2. Replace all region tags of pubsub_* with pubsub_old_version_*

@hongalex hongalex requested review from a team as code owners December 18, 2024 23:11
@product-auto-label product-auto-label bot added api: pubsub Issues related to the Pub/Sub API. samples Issues that are directly related to samples. labels Dec 18, 2024
Copy link

@code-review-assist code-review-assist bot left a comment

Choose a reason for hiding this comment

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

Hi @hongalex, reviewers, and future viewers,

I'm currently reviewing this pull request and will post my full review in a few minutes. In the meantime, here's a quick summary to help everyone get up to speed:

This PR prepares for the Pub/Sub v2.0.0 migration by creating a copy of the existing v1 samples in a new directory (v1samples). This avoids disrupting existing documentation and allows for a smoother transition to the new version.

Here's a breakdown of the changes:

  • Intent: Duplicate Pub/Sub v1 samples to a new directory to facilitate a future migration to v2 without major documentation changes.
  • Changes:
    • Created a new v1samples directory under the pubsub directory.
    • Copied all the v1 samples into the new v1samples directory.
    • Updated all region tags in the sample files from pubsub_* to pubsub_old_version_*.
    • The following files were modified:
      • pubsub/v1samples/pubsub_quickstart/main.go
      • pubsub/v1samples/schemas/commit_avro_schema.go
      • pubsub/v1samples/schemas/commit_proto_schema.go
      • pubsub/v1samples/schemas/create_avro_schema.go
      • pubsub/v1samples/schemas/create_proto_schema.go
      • pubsub/v1samples/schemas/create_topic_with_schema.go
      • pubsub/v1samples/schemas/create_topic_with_schema_revisions.go
      • pubsub/v1samples/schemas/delete_schema.go
      • pubsub/v1samples/schemas/delete_schema_revision.go
      • pubsub/v1samples/schemas/get_schema.go
      • pubsub/v1samples/schemas/get_schema_revision.go
      • pubsub/v1samples/schemas/list_schema_revisions.go
      • pubsub/v1samples/schemas/list_schemas.go
      • pubsub/v1samples/schemas/publish_avro_records.go
      • pubsub/v1samples/schemas/publish_proto_messages.go
      • pubsub/v1samples/schemas/resources/us-states-plus.avsc
      • pubsub/v1samples/schemas/resources/us-states-plus.proto
      • pubsub/v1samples/schemas/resources/us-states.avsc
      • pubsub/v1samples/schemas/resources/us-states.proto
      • pubsub/v1samples/schemas/rollback_schema.go
      • pubsub/v1samples/schemas/schemas_test.go
      • pubsub/v1samples/subscriptions/add_users.go
      • pubsub/v1samples/subscriptions/async_pull.go
      • pubsub/v1samples/subscriptions/async_pull_custom_attributes.go
      • pubsub/v1samples/subscriptions/create.go
      • pubsub/v1samples/subscriptions/create_bigquery_subscription.go
      • pubsub/v1samples/subscriptions/create_cloud_storage_subscription.go
      • pubsub/v1samples/subscriptions/create_endpoint.go
      • pubsub/v1samples/subscriptions/create_exactly_once_delivery.go
      • pubsub/v1samples/subscriptions/create_filter.go
      • pubsub/v1samples/subscriptions/create_ordering.go
      • pubsub/v1samples/subscriptions/create_push_no_wrapper_subscription.go
      • pubsub/v1samples/subscriptions/dead_letter_create.go
      • pubsub/v1samples/subscriptions/dead_letter_delivery_attempt.go
      • pubsub/v1samples/subscriptions/dead_letter_remove.go
      • pubsub/v1samples/subscriptions/dead_letter_update.go
      • pubsub/v1samples/subscriptions/delete.go
      • pubsub/v1samples/subscriptions/detach_subscription.go
      • pubsub/v1samples/subscriptions/list.go
      • pubsub/v1samples/subscriptions/optimistic_subscribe.go
      • pubsub/v1samples/subscriptions/policy.go
      • pubsub/v1samples/subscriptions/pull_concurrency.go
      • pubsub/v1samples/subscriptions/pull_error.go
      • pubsub/v1samples/subscriptions/pull_exactly_once_delivery.go
      • pubsub/v1samples/subscriptions/pull_otel_tracing.go
      • pubsub/v1samples/subscriptions/pull_settings.go
      • pubsub/v1samples/subscriptions/subscription_test.go
      • pubsub/v1samples/subscriptions/subscribe_avro_records.go
      • pubsub/v1samples/subscriptions/subscribe_proto_messages.go
      • pubsub/v1samples/subscriptions/subscribe_with_avro_schema_revisions.go
      • pubsub/v1samples/subscriptions/sync_pull.go
      • pubsub/v1samples/subscriptions/test_permissions.go
      • pubsub/v1samples/subscriptions/update.go
      • pubsub/v1samples/topics/add_users.go
      • pubsub/v1samples/topics/create.go
      • pubsub/v1samples/topics/create_topic_gcs_ingestion.go
      • pubsub/v1samples/topics/create_topic_kinesis_ingestion.go
      • pubsub/v1samples/topics/delete.go
      • pubsub/v1samples/topics/list_subs.go
      • pubsub/v1samples/topics/list_topics.go
      • pubsub/v1samples/topics/policy.go
      • pubsub/v1samples/topics/publish.go
      • pubsub/v1samples/topics/publish_custom.go
      • pubsub/v1samples/topics/publish_flow_control.go
      • pubsub/v1samples/topics/publish_ordering.go
      • pubsub/v1samples/topics/publish_otel_tracing.go
      • pubsub/v1samples/topics/publish_resume_ordering.go
      • pubsub/v1samples/topics/publish_retry.go
      • pubsub/v1samples/topics/publish_scale.go
      • pubsub/v1samples/topics/publish_settings.go
      • pubsub/v1samples/topics/publish_single.go
      • pubsub/v1samples/topics/publish_with_compression.go
      • pubsub/v1samples/topics/test_permissions.go
      • pubsub/v1samples/topics/topics_test.go
      • pubsub/v1samples/topics/update_topic_type.go

Let's keep the code clean and the reviews fun!

Code moves fast,
Versioning keeps it all straight,
Future's bright and bold.

Copy link

Gemini encountered an error creating the review. You can try again by commenting @code-review-assist review.

Copy link

snippet-bot bot commented Dec 19, 2024

Here is the summary of changes.

You are about to add 70 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: pubsub Issues related to the Pub/Sub API. samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant