googleapis / googleapis/ruby-cloud-env

warmup_time: nil crashes metadata existence checks

Abierto Apto para principiantes
#112 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Ruby
Estrellas
16
Forks
12
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

## Summary

`ComputeMetadata#warmup_time` is writable and documented as a duration, but assigning `nil` to disable the warmup window leads to arithmetic/comparison errors in both `ensure_existence` and `post_update_existence`.

## Reproduction

On current `main` (`7936c72eb2c809214858f47473aafb04c6bbf469`):

1. Create a `ComputeMetadata` instance.
2. Set `warmup_time = nil`.
3. Call `ensure_existence`, or exercise a failed existence update.

The former evaluates `@startup_time + nil`; the latter compares time against the same expression.

## Proposed correction

Treat `nil` as no warmup window: use the normal minimum one-second explicit check in `ensure_existence`, and allow a failed existence probe to settle to `:no` immediately. I verified the focused disabled-warmup model and the full current suite (91 runs / 419 assertions / 0 failures / 0 errors / 2 skips).

If `nil` is not intended to be supported, rejecting it in the writer would make the contract explicit; silently accepting it and failing later is the current correctness issue.

I used an AI coding assistant during investigation and verification. I am opening this issue first because this repository requires tests and a Google CLA for pull requests; I have not modified repository tests or signed a CLA as part of this audit.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza en ComputeMetadata#warmup_time y sigue su uso en ensure_existence y post_update_existence. Añade cobertura de regresión para un warmup_time nil, confirmando que ensure_existence utiliza la comprobación explícita mínima y que una sonda de existencia fallida termina en :no. Ejecuta las pruebas de modelo centradas en el warmup deshabilitado y la suite completa para verificar la finalización.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
ruby
Área
cloud
Tipo de issue
Error
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Activo
Claridad
Bastante claro
Aptitud para principiantes
72/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.