Add --cooldown-days#73
Conversation
194a594 to
47da87e
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds support for a --cooldown-days CLI flag to avoid updating to very recently published Terraform releases, switching version discovery from scraping HashiCorp’s releases HTML to using GitHub Releases via ghrcooldown.
Changes:
- Add
--cooldown-daysflag and thread it through CLI →Updater.Execute→UpdateTerraformVersion. - Replace HashiCorp releases HTML scraping with GitHub Releases-based logic (and remove the old scraper).
- Update/expand fixtures and tests to use GitHub API responses and cooldown behavior.
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| updater.go | Threads cooldown + updater version into the core update flow and calls into the new GitHub-based updater logic. |
| updater_test.go | Updates integration-style test to use GitHub API fixtures and new Updater/Execute signatures. |
| update_terraform_version.go | Reworks version selection logic to use ghrcooldown (GitHub Releases) and adds cooldown support. |
| update_terraform_version_test.go | Updates tests for new return signature and adds coverage for cooldown/unknown tag behavior. |
| cmd/terraform-version-updater/main.go | Adds --cooldown-days flag and passes app version into Updater for User-Agent construction. |
| terraform.go | Removes the old HashiCorp HTML scraping implementation. |
| terraform_test.go | Removes tests for the old HashiCorp HTML scraping implementation. |
| testdata/terraform-releases.json | Adds GitHub Releases list fixture used by tests. |
| testdata/terraform-tags-v1.14.8.json | Adds GitHub “release by tag” fixture for cooldown checks. |
| testdata/terraform-tags-v1.14.7.json | Adds GitHub “release by tag” fixture for cooldown checks. |
| testdata/terraform-tags-v1.14.0-unknown.json | Adds GitHub 404 fixture for unknown tag test. |
| go.mod | Adds ghrcooldown dependency and updates indirect dependencies. |
| go.sum | Updates checksums for new/updated dependencies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1f07aca to
ea5e72b
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 16 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ea5e72b to
4817b5a
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 15 out of 16 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
b9e5c5b to
0354404
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Close #72