GAPIC-generated clients scribble on global DEFAULT_CLIENT_INFO #5710
Labels
api: automl
Issues related to the AutoML API.
api: bigquerydatatransfer
Issues related to the BigQuery Data Transfer Service API.
api: bigtable
Issues related to the Bigtable API.
api: clouderrorreporting
Issues related to the Error Reporting API.
api: cloudiot
Issues related to the IoT Core API.
api: cloudtasks
Issues related to the Cloud Tasks API.
api: cloudtrace
Issues related to the Cloud Trace API.
api: container
Issues related to the Kubernetes Engine API API.
api: dataproc
Issues related to the Dataproc API.
api: datastore
Issues related to the Datastore API.
api: dlp
Issues related to the Sensitive Data Protection API.
api: firestore
Issues related to the Firestore API.
api: language
Issues related to the Cloud Natural Language API API.
api: logging
Issues related to the Cloud Logging API.
api: monitoring
Issues related to the Cloud Monitoring API.
api: pubsub
Issues related to the Pub/Sub API.
api: redis
Issues related to the Memorystore for Redis API.
api: spanner
Issues related to the Spanner API.
api: speech
Issues related to the Speech-to-Text API.
api: texttospeech
Issues related to the Text-to-Speech API.
api: videointelligence
Issues related to the Video Intelligence API API.
api: vision
Issues related to the Cloud Vision API.
codegen
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
tl;dr
The GAPIC-generated class constructors listed below scribble on the fallback
google.api_core.gapic_v1.client_info.DEFAULT_CLIENT_INFO
instance, rather than creating their own copy.@crwilcox Can you please link in the related codegen issue?
Analysis
The pattern is that these client classes take an optional
client_info
parameter: if not passed, they use theDEFAULT_CLIENT_INFO
instance. In either case, they then assign over itsgapic_version
attribute:I am certain that it is inappropriate to scribble on the global
DEFAULT_CLIENT_INFO
instance. Rather they should be creating a newgoogle.api_core.gapic.client_info.ClientInfo
instance. Ibelieve that if the user passes in a non-None
client_info
, these clients should not scribble on it. E.g.:Offending Classes
google.cloud.automl_v1beta1.gapic.auto_ml_client.AutoMlClient
google.cloud.automl_v1beta1.gapic.prediction_service_client.PredictionServiceClient
google.cloud.bigquery_datatransfer_v1.gapic.data_transfer_service_client.DataTransferServiceClient
google.cloud.bigtable_admin_v2.gapic.bigtable_instance_admin_client.BigtableInstanceAdminClient
google.cloud.bigtable_admin_v2.gapic.bigtable_table_admin_client.BigtableTableAdminClient
google.cloud.bigtable_v2.gapic.bigtable_client.BigtableClient
google.cloud.container_v1.gapic.cluster_manager_client.ClusterManagerClient
google.cloud.dataproc_v1.gapic.cluster_controller_client.ClusterControllerClient
google.cloud.dataproc_v1.gapic.job_controller_client.JobControllerClient
google.cloud.datastore_v1.gapic.datastore_client.DatastoreClient
google.cloud.dlp_v2.gapic.dlp_service_client.DlpServiceClient
google.cloud.errorreporting_v1beta1.gapic.error_group_service_client.ErrorGroupServiceClient
google.cloud.errorreporting_v1beta1.gapic.error_stats_service_client.ErrorStatsServiceClient
google.cloud.errorreporting_v1beta1.gapic.report_errors_service_client.ReportErrorsServiceClient
google.cloud.firestore_v1beta1.gapic.firestore_client.FirestoreClient
google.cloud.iot_v1.gapic.device_manager_client.DeviceManagerClient
google.cloud.kms_v1.gapic.key_management_service_client.KeyManagementServiceClient
google.cloud.language_v1.gapic.language_service_client.LanguageServiceClient
google.cloud.language_v1beta2.gapic.language_service_client.LanguageServiceClient
google.cloud.logging_v2.gapic.config_service_v2_client.ConfigServiceV2Client
google.cloud.logging_v2.gapic.logging_service_v2_client.LoggingServiceV2Client
google.cloud.logging_v2.gapic.metrics_service_v2_client.MetricsServiceV2Client
google.cloud.monitoring_v3.gapic.alert_policy_service_client.AlertPolicyServiceClient
google.cloud.monitoring_v3.gapic.group_service_client.GroupServiceClient
google.cloud.monitoring_v3.gapic.metric_service_client.MetricServiceClient
google.cloud.monitoring_v3.gapic.notification_channel_service_client.NotificationChannelServiceClient
google.cloud.monitoring_v3.gapic.uptime_check_service_client.UptimeCheckServiceClient
google.cloud.oslogin_v1.gapic.os_login_service_client.OsLoginServiceClient
google.cloud.pubsub_v1.gapic.publisher_client.PublisherClient
google.cloud.pubsub_v1.gapic.subscriber_client.SubscriberClient
google.cloud.redis_v1beta1.gapic.cloud_redis_client.CloudRedisClient
google.cloud.spanner_admin_database_v1.gapic.database_admin_client.DatabaseAdminClient
google.cloud.spanner_admin_instance_v1.gapic.instance_admin_client.InstanceAdminClient
google.cloud.spanner_v1.gapic.spanner_client.SpannerClient
google.cloud.speech_v1.gapic.speech_client.SpeechClient
google.cloud.speech_v1p1beta1.gapic.speech_client.SpeechClient
google.cloud.tasks_v2beta2.gapic.cloud_tasks_client.CloudTasksClient
google.cloud.texttospeech_v1.gapic.text_to_speech_client.TextToSpeechClient
google.cloud.texttospeech_v1beta1.gapic.text_to_speech_client.TextToSpeechClient
google.cloud.trace_v1.gapic.trace_service_client.TraceServiceClient
google.cloud.trace_v2.gapic.trace_service_client.TraceServiceClient
google.cloud.videointelligence_v1.gapic.video_intelligence_service_client.VideoIntelligenceServiceClient
google.cloud.videointelligence_v1beta1.gapic.video_intelligence_service_client.VideoIntelligenceServiceClient
google.cloud.videointelligence_v1beta2.gapic.video_intelligence_service_client.VideoIntelligenceServiceClient
google.cloud.videointelligence_v1p1beta1.gapic.video_intelligence_service_client.VideoIntelligenceServiceClient
google.cloud.vision_v1.gapic.image_annotator_client.ImageAnnotatorClient
google.cloud.vision_v1p1beta1.gapic.image_annotator_client.ImageAnnotatorClient
google.cloud.vision_v1p2beta1.gapic.image_annotator_client.ImageAnnotatorClient
google.cloud.vision_v1p3beta1.gapic.image_annotator_client.ImageAnnotatorClient
google.cloud.vision_v1p3beta1.gapic.product_search_client.ProducSearchClient
google.cloud.websecurityscanner_v1alpha.gapic.web_security_scanner_client.WebSecurityScannerClient
The text was updated successfully, but these errors were encountered: