warmup_time: nil crashes metadata existence checks
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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):
- Create a
ComputeMetadatainstance. - Set
warmup_time = nil. - 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.
- Dominant language
- Ruby
- Stars
- 16
- Forks
- 12
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from googleapis/ruby-cloud-env
-
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
googleapis/ruby-cloud-env#111 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
googleapis/ruby-cloud-env#110 · 1 comment ·
-
priority: p3 type: feature request
Difficulty 5/5 Over a week Newbie friendliness 35/100
googleapis/ruby-cloud-env#90 ·
-
Dependency Dashboard Opentype: process
Difficulty 4/5 3-5 days Newbie friendliness 20/100
googleapis/ruby-cloud-env#22 ·
All issues in googleapis/ruby-cloud-env
Similar issues
-
user-reported
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Kong/developer.konghq.com#7316 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
TheOdinProject/curriculum#31408 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
notch8/utk_knapsack#148 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Homebrew/homebrew-cask#288729 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100