Backport of Cloud, backend/remote: forward -minimal-refresh to HCPT and TFE into v1.17 - #39321
Merged
austinvalle merged 10 commits intoOct 2, 2026
Conversation
austinvalle
approved these changes
Oct 2, 2026
austinvalle
left a comment
Member
There was a problem hiding this comment.
This PR just enables the -minimal-refresh flag in HCPT, of which the feature has already been merged to v1.17 👍🏻
austinvalle
deleted the
backport/shweta/minimal-refresh-remote/ultimately-factual-chow
branch
October 2, 2026 13:23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This PR is auto-generated from #39310 to be assessed for backporting due to the inclusion of the label 1.17-backport.
The below text is copied from the body of the original PR.
Forwards the
-minimal-refreshplanning option to HCP Terraform / Terraform Enterprise through thecloudblock and the legacyremotebackend.Core already supports
-minimal-refreshlocally, but remote operations reject it with a temporary "Minimal refresh mode is currently not supported" error, because HCP Terraform and go-tfe didn't support it yet. HCP Terraform's Runs API now accepts aminimal-refreshrun attribute, and go-tfe v1.112.0 exposes it (hashicorp/go-tfe#1502).Changes Made
github.com/hashicorp/go-tfefrom v1.110.0 to v1.112.0cloudandremote): setsMinimalRefresh = trueon the run create options only when-minimal-refreshis requested. It stays nil otherwise, so ordinary runs never send the attribute and older servers see no change.TFP-API-Version, following the existing-target/-replace/-refresh-onlypattern in theremotebackend. If the version is belowMinimalRefreshMinAPIVersion(2.7) or can't be parsed, Terraform returns an error before any run is created:Older servers silently drop unknown run attributes, so without this check a run on an older server would quietly do a full refresh.
Tests
Manual testing
Terraform built from this branch against a local HCP Terraform stack
API 2.6:
plan -minimal-refreshandapply -minimal-refreshare rejected by Core before any run is created:-minimal-refreshwith-refresh=falseor-refresh-onlyis still rejected by argument parsing and a plainplanworks as before.API 2.7:
minimal-refreshplan-onlyplan -minimal-refreshtruetrueplanned_and_finishedapply -minimal-refreshtruefalseappliedplanfalsetrueplanned_and_finishedAll runs had
refresh: true,refresh-only: false. Atlas validation errors still reach the user.Specs
New tests in
internal/cloud/backend_minimal_refresh_test.goandinternal/backend/remote/backend_minimal_refresh_test.go, using the mock client:-minimal-refresh→MinimalRefresh == true; without it → nil (not false)The mock runs client now records
MinimalRefreshfrom the create options.Manual testing against a local HCP Terraform stack: see below / to be added.
Follow-ups (not in this PR)
Target Release
1.17.x
Rollback Plan
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.
CHANGELOG entry
Overview of commits
9739f0a
6c2fa1a
aca4e46
a916649
26ba0a3
307cd7b
6324797
fff2e50
4eae50a
4a5d9c5