Skip to content

Add --cooldown-days#73

Merged
sue445 merged 15 commits into
mainfrom
feature/cooldown
Apr 11, 2026
Merged

Add --cooldown-days#73
sue445 merged 15 commits into
mainfrom
feature/cooldown

Conversation

@sue445

@sue445 sue445 commented Apr 11, 2026

Copy link
Copy Markdown
Owner

Close #72

@sue445 sue445 force-pushed the feature/cooldown branch from 194a594 to 47da87e Compare April 11, 2026 10:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-days flag and thread it through CLI → Updater.ExecuteUpdateTerraformVersion.
  • 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.

Comment thread updater.go
Comment thread update_terraform_version.go
Comment thread update_terraform_version.go Outdated
Comment thread cmd/terraform-version-updater/main.go
Comment thread update_terraform_version.go Outdated
Comment thread update_terraform_version_test.go Outdated
Comment thread updater_test.go

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread updater.go
Comment thread update_terraform_version_test.go
Comment thread update_terraform_version_test.go
Comment thread CHANGELOG.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread update_terraform_version_test.go
Comment thread update_terraform_version.go Outdated
sue445 and others added 6 commits April 11, 2026 22:55
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>
@sue445 sue445 force-pushed the feature/cooldown branch from b9e5c5b to 0354404 Compare April 11, 2026 13:55
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@sue445 sue445 marked this pull request as ready for review April 11, 2026 13:58
@sue445 sue445 merged commit 4d275bd into main Apr 11, 2026
6 checks passed
@sue445 sue445 deleted the feature/cooldown branch April 11, 2026 13:58
@sue445 sue445 added the enhancement New feature or request label Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add --cooldown-days

2 participants