Skip to content

Commit bdefb66

Browse files
🚀 Add user interaction status PolicyChecked for HCP TF (#703)
* Add user interaction status PolicyChecked for HCP TF * Changelog
1 parent 460c963 commit bdefb66

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
kind: ENHANCEMENTS
2+
body: Support for PolicyChecked run status to help right agent scale down
3+
time: 2026-02-20T10:17:34.39567-08:00
4+
custom:
5+
PR: "703"

internal/controller/agentpool_controller_autoscaling.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ var userInteractionRunStatuses = map[tfc.RunStatus]struct{}{
2727
tfc.RunPostPlanAwaitingDecision: {},
2828
tfc.RunPostPlanCompleted: {},
2929
tfc.RunPending: {},
30+
tfc.RunPolicyChecked: {},
3031
}
3132

3233
// matchWildcardName checks if a given string matches a specified wildcard pattern.

internal/controller/agentpool_controller_autoscaling_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,18 @@ func TestPendingRuns(t *testing.T) {
150150
expectedCount: 1,
151151
expectError: false,
152152
},
153+
{
154+
name: "plan and apply runs that might have user interaction status PolicyChecked",
155+
mockRuns: []*tfc.Run{
156+
{ID: "run1", PlanOnly: true, Status: tfc.RunPending, Workspace: &tfc.Workspace{ID: "ws2"}},
157+
{ID: "run2", PlanOnly: true, Status: tfc.RunPlanning, Workspace: &tfc.Workspace{ID: "ws2"}},
158+
{ID: "run3", PlanOnly: true, Status: tfc.RunPlanning, Workspace: &tfc.Workspace{ID: "ws2"}},
159+
{ID: "run4", PlanOnly: true, Status: tfc.RunPlanning, Workspace: &tfc.Workspace{ID: "ws2"}},
160+
{ID: "run5", PlanOnly: true, Status: tfc.RunPolicyChecked, Workspace: &tfc.Workspace{ID: "ws2"}},
161+
},
162+
expectedCount: 3,
163+
expectError: false,
164+
},
153165
}
154166

155167
for _, tt := range tests {

0 commit comments

Comments
 (0)