googleapis / googleapis/ruby-cloud-env

warmup_time: nil crashes metadata existence checks

Aperta Adatta ai principianti
#112 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Ruby
Stelle
16
Fork
12
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

## 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.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start at ComputeMetadata#warmup_time and trace its use in ensure_existence and post_update_existence. Add regression coverage for a nil warmup_time, confirming ensure_existence uses the minimum explicit check and a failed existence probe settles to :no. Run the focused disabled-warmup model tests and the full suite to verify completion.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
ruby
Ambito
cloud
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
72/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.