Skip to content

[terraform plugin] Remove stage config for TERRAFORM_APPLY#6259

Merged
ffjlabo merged 2 commits into
masterfrom
comment-out-unmarshaling-logic-for-terraform-plugin
Sep 24, 2025
Merged

[terraform plugin] Remove stage config for TERRAFORM_APPLY#6259
ffjlabo merged 2 commits into
masterfrom
comment-out-unmarshaling-logic-for-terraform-plugin

Conversation

@ffjlabo
Copy link
Copy Markdown
Member

@ffjlabo ffjlabo commented Sep 22, 2025

What this PR does:

as title

Why we need it:

Currently, the TERRAFORM_APPLY stage doesn't have any options.

// TerraformApplyStageOptions contains all configurable values for a TERRAFORM_APPLY stage.
type TerraformApplyStageOptions struct {
}

So we don't need the logic for now. Also, it led the failure to execute TERRAFORM_APPLY as QuickSync

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

  • How are users affected by this change:
  • Is this breaking change:
  • How to migrate (if breaking change):

Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 28.71%. Comparing base (96c15d8) to head (cf89000).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6259      +/-   ##
==========================================
+ Coverage   28.69%   28.71%   +0.01%     
==========================================
  Files         560      560              
  Lines       59738    59749      +11     
==========================================
+ Hits        17144    17159      +15     
+ Misses      41278    41271       -7     
- Partials     1316     1319       +3     
Flag Coverage Δ
. 23.21% <ø> (-0.02%) ⬇️
.-pkg-app-pipedv1-plugin-analysis 32.64% <ø> (ø)
.-pkg-app-pipedv1-plugin-kubernetes 58.19% <ø> (+0.29%) ⬆️
.-pkg-app-pipedv1-plugin-kubernetes_multicluster 67.48% <ø> (ø)
.-pkg-app-pipedv1-plugin-scriptrun 54.83% <ø> (ø)
.-pkg-app-pipedv1-plugin-terraform 39.56% <ø> (+0.30%) ⬆️
.-pkg-app-pipedv1-plugin-wait 35.51% <ø> (ø)
.-pkg-app-pipedv1-plugin-waitapproval 55.73% <ø> (ø)
.-pkg-plugin-sdk 50.47% <ø> (ø)
.-tool-actions-gh-release 19.23% <ø> (ø)
.-tool-actions-plan-preview 25.51% <ø> (ø)
.-tool-codegen-protoc-gen-auth 0.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

t-kikuc
t-kikuc previously approved these changes Sep 22, 2025
Copy link
Copy Markdown
Member

@t-kikuc t-kikuc left a comment

Choose a reason for hiding this comment

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

thank you

return sdk.StageStatusFailure
}
// TODO: use stageConfig if this stage has any options in the future.
// stageConfig := config.TerraformApplyStageOptions{}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@ffjlabo Should we remove the config.TerraformApplyStageOptions structure and this commented code block? If it's not being used, better to remove it 🤔

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also, the root cause of this issue is more like the input.Request.StageConfig is nil, so it's better to have a nil check for input.Request.StageConfig before unmarshalling, wdyt?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@khanhtc1202
As you said, this option is not used for now. I will remove this logic and struct.

// TerraformSyncStageOptions contains all configurable values for a TERRAFORM_SYNC stage.
type TerraformSyncStageOptions struct {
}
// TerraformPlanStageOptions contains all configurable values for a TERRAFORM_PLAN stage.
type TerraformPlanStageOptions struct {
// Exit the pipeline if the result is "No Changes" with success status.
ExitOnNoChanges bool `json:"exitOnNoChanges"`
}
// TerraformApplyStageOptions contains all configurable values for a TERRAFORM_APPLY stage.
type TerraformApplyStageOptions struct {
}

Also, the root cause of this issue is more like the input.Request.StageConfig is nil, so it's better to have a nil check for input.Request.StageConfig before unmarshalling, wdyt?

It is good for the work around. But we might solve this problem in the piped or SDK.
But I will remove this logic.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, please remove the code block instead of comment out.

Signed-off-by: Yoshiki Fujikane <ffjlabo@gmail.com>
@ffjlabo ffjlabo force-pushed the comment-out-unmarshaling-logic-for-terraform-plugin branch from 12863f8 to cf89000 Compare September 22, 2025 08:48
Copy link
Copy Markdown
Member

@khanhtc1202 khanhtc1202 left a comment

Choose a reason for hiding this comment

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

Thank you! 🙏
Note: We will make another issue for updating the SDK to ensure the stage config is not nil.

@ffjlabo ffjlabo merged commit 2abec76 into master Sep 24, 2025
46 checks passed
@ffjlabo ffjlabo deleted the comment-out-unmarshaling-logic-for-terraform-plugin branch September 24, 2025 01:23
@khanhtc1202 khanhtc1202 changed the title [terraform plugin] Comment out stage config unmarshaling logic for TERRAFORM_APPLY [terraform plugin] Remove stage config for TERRAFORM_APPLY Sep 24, 2025
This was referenced Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants