Skip to content

Conversation

@mildwonkey
Copy link
Contributor

@steve-hashi reported a bug where any configuration with actions would panic when running terraform plan --refresh-only. This removes the panic, returning nil if no changes are found for the resource.

Fixes #

Target Release

1.15.x

Rollback Plan

  • If a change needs to be reverted, we will roll out an update to the code within 7 days.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

CHANGELOG entry

  • This change is user-facing and I added a changelog entry.
  • This change is not user-facing.

@mildwonkey mildwonkey requested a review from a team as a code owner September 26, 2025 16:34
@mildwonkey mildwonkey added 1.4-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged no-changelog-needed Add this to your PR if the change does not require a changelog entry labels Sep 26, 2025
@mildwonkey mildwonkey merged commit 8ed2f39 into main Sep 26, 2025
9 of 11 checks passed
@mildwonkey mildwonkey deleted the mildwonkey/actions/dont-panic-on-refresh branch September 26, 2025 16:57
if change == nil {
panic("change cannot be nil")
// nothing to do (this may be a refresh )
return nil
Copy link
Member

Choose a reason for hiding this comment

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

We might want something more robust here eventually, having a nil change under any other circumstance is worthy of a panic (and with the refactoring that will probably continue around actions, mistakes like a missing change are even more likely)

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps we shouldn't have even gotten to this point during a refresh only plan, since actions are in effect changes, and we're promising that there can be no changes with -refresh-only.

mildwonkey added a commit that referenced this pull request Sep 26, 2025
actions: don't panic when resource change is nil - it might be a refresh

This is a manual backport, I selected the wrong label.
mildwonkey added a commit that referenced this pull request Sep 26, 2025
actions: don't panic when resource change is nil - it might be a refresh
@github-actions
Copy link
Contributor

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

1.4-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged no-changelog-needed Add this to your PR if the change does not require a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants