Skip to content

Revert "Update to latest spanner package (#1781)"#1784

Draft
n-h-diaz wants to merge 1 commit intomasterfrom
revert-1781-mod
Draft

Revert "Update to latest spanner package (#1781)"#1784
n-h-diaz wants to merge 1 commit intomasterfrom
revert-1781-mod

Conversation

@n-h-diaz
Copy link
Contributor

This reverts commit c027143.

The original PR was missing updates to docker to also update the version. This is causing the mixer-on-push-to-branch to autopush to fail. Rolling back so I can fix the issue within the same PR

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @n-h-diaz, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request performs a full revert of a previous dependency update, specifically targeting the Spanner package and other Go modules. The rollback is a temporary measure to resolve build and deployment failures that arose because the original update lacked crucial Docker configuration changes. The author plans to re-implement the dependency updates, ensuring all necessary accompanying changes are included, in a future pull request.

Highlights

  • Reverted Go Module Dependencies: The pull request reverts the Go version from 1.24.0 to 1.23.11 and downgrades numerous Go module dependencies, including several Google Cloud libraries (e.g., BigQuery, Bigtable, Pub/Sub, Spanner, Storage) and OpenTelemetry related packages, to their previous stable versions.
  • Pub/Sub Client Library API Update: The Pub/Sub client library import path was changed from cloud.google.com/go/pubsub/v2 to cloud.google.com/go/pubsub, and the subscription creation and deletion logic in internal/pubsub/pubsub.go was refactored to use the older API, specifically client.CreateSubscription and subscriber.Delete.
  • Reason for Revert: This revert addresses a critical issue where a previous update (PR Update to latest spanner package #1781) caused mixer-on-push-to-branch autopush failures due to missing corresponding Docker configuration updates. The author intends to re-introduce the update with the necessary fixes in a new pull request.
Changelog
  • go.mod
    • Reverted Go language version from 1.24.0 to 1.23.11.
    • Downgraded cloud.google.com/go/bigquery from v1.72.0 to v1.69.0.
    • Downgraded cloud.google.com/go/bigtable from v1.41.0 to v1.38.0.
    • Downgraded cloud.google.com/go/pubsub/v2 to cloud.google.com/go/pubsub v1.49.0.
    • Downgraded cloud.google.com/go/secretmanager from v1.16.0 to v1.15.0.
    • Downgraded cloud.google.com/go/spanner from v1.88.0 to v1.83.0.
    • Downgraded cloud.google.com/go/storage from v1.56.0 to v1.55.0.
    • Downgraded github.com/stretchr/testify from v1.11.1 to v1.10.0.
    • Downgraded go.opentelemetry.io/otel from v1.39.0 to v1.37.0.
    • Downgraded go.opentelemetry.io/otel/metric from v1.39.0 to v1.37.0.
    • Downgraded go.opentelemetry.io/otel/sdk/metric from v1.39.0 to v1.37.0.
    • Downgraded golang.org/x/oauth2 from v0.35.0 to v0.30.0.
    • Downgraded golang.org/x/sync from v0.19.0 to v0.16.0.
    • Downgraded golang.org/x/text from v0.33.0 to v0.27.0.
    • Downgraded google.golang.org/api from v0.265.0 to v0.243.0.
    • Downgraded google.golang.org/genproto/googleapis/api from a newer version to v0.0.0-20250721164621-a45f3dfb1074.
    • Downgraded google.golang.org/grpc from v1.78.0 to v1.75.0.
    • Downgraded google.golang.org/protobuf from v1.36.11 to v1.36.6.
    • Downgraded various indirect dependencies to align with the reverted versions.
  • internal/pubsub/pubsub.go
    • Removed unused imports fmt and cloud.google.com/go/pubsub/v2/apiv1/pubsubpb.
    • Added time import for duration parsing.
    • Updated cloud.google.com/go/pubsub/v2 import to cloud.google.com/go/pubsub.
    • Refactored subscription creation to use client.CreateSubscription with pubsub.SubscriptionConfig instead of client.SubscriptionAdminClient.CreateSubscription.
    • Refactored subscription deletion to use subscriber.Delete(ctx) instead of client.SubscriptionAdminClient.DeleteSubscription.
  • internal/server/server.go
    • Updated cloud.google.com/go/pubsub/v2 import to cloud.google.com/go/pubsub.
Activity
  • The pull request was opened by n-h-diaz.
  • The PR explicitly reverts commit c02714376c10f32350f9aae0aeac31c6d1af4bcf.
  • The revert was initiated because the original update caused CI/CD failures (specifically mixer-on-push-to-branch autopush) due to an incomplete dependency update that did not include necessary Docker configuration changes.
  • The author plans to fix the underlying issue and re-submit the dependency update in a subsequent pull request.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-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.

Code Review

This pull request reverts the update to the latest spanner package due to issues with the docker image update. The changes primarily involve downgrading several Go packages in go.mod and reverting the PubSub client library update in internal/pubsub/pubsub.go and internal/server/server.go.

Comment on lines 57 to +58
if err != nil {
return fmt.Errorf("failed to create subscription: %w", err)
return err
Copy link
Contributor

Choose a reason for hiding this comment

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

high

high: The error err is returned without being wrapped with a user-friendly message. Wrap the error with a descriptive message to provide more context to the user, as per the general rules.

References
  1. Wrap generic errors from underlying functions with more descriptive, user-friendly error messages.

err := client.SubscriptionAdminClient.DeleteSubscription(ctx, &pubsubpb.DeleteSubscriptionRequest{
Subscription: subscription.GetName(),
})
err := subscriber.Delete(ctx)
Copy link
Contributor

Choose a reason for hiding this comment

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

high

high: The error err is returned without being wrapped with a user-friendly message. Wrap the error with a descriptive message to provide more context to the user, as per the general rules.

References
  1. Wrap generic errors from underlying functions with more descriptive, user-friendly error messages.

Comment on lines +49 to +50
expiration, _ := time.ParseDuration("36h")
retention, _ := time.ParseDuration("24h")
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

medium: The code ignores the error returned by time.ParseDuration. While the durations are hardcoded and unlikely to cause an error, it's still best practice to handle the error to prevent unexpected behavior. Consider logging the error or using a more robust error handling mechanism.

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.

1 participant