feat: add manual apply now action#641
feat: add manual apply now action#641arnaud-dezandee wants to merge 2 commits intopadok-team:mainfrom
Conversation
|
Fix #311 |
|
@arnaud-dezandee Thanks for the contribution, LGTM, could you add a test case for the ManualApplyNeeded state ? |
I've considered it but you could have a TerraformLayer with side effects that are not translated into state, and thus, you may want to apply it multiple times with the same version. |
|
Hi Arnaud, thanks a lot for the contribution! This is a highly requested feature, and I'm glad you're taking it on. That said, I have a few concerns regarding the current implementation. At the moment, the behavior of the "Sync" button changes depending on the
This leads to the following behavior:
SuggestionsTo make the behavior clearer and more consistent for users, I propose the following:
Let me know what you think! |
|
I agree with your suggestion @LucasMrqes, we need in the frontend to clarify what "Sync" means. I suggest the following:
|
|
Reviewing this PR, I think introducing the new state To me, if the condition WDYT @arnaud-dezandee? |
|
Hi @LucasMrqes @corrieriluca, I've added the |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #641 +/- ##
==========================================
+ Coverage 40.62% 42.26% +1.64%
==========================================
Files 94 94
Lines 5539 5612 +73
==========================================
+ Hits 2250 2372 +122
+ Misses 3091 3030 -61
- Partials 198 210 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@arnaud-dezandee I agree. In that case, do you think the "apply" must be done with or without previous plan artifact? By default for apply actions Burrito creates a TerraformRun that references the last plan artifact produced: burrito/internal/controllers/terraformlayer/run.go Lines 29 to 35 in ce980e1 In the Burrito runner pod, the artifact will be used for the "apply" unless the setting burrito/internal/runner/actions.go Lines 157 to 162 in ce980e1 |
|
Also, I just thought about an edge case to the Apply Now button. It should not be permitted to run a manual apply run on layers that are generated by the TerraformPullRequest controller as they are temporary layers referencing temporary branches. Only plans should be allowed for these layers. They can be identified by the label |
@corrieriluca Done, I've added a guard to prevent PR layers to be applied |
d47dd97 to
6bf5e37
Compare
|
Hi @corrieriluca, |
6bf5e37 to
937c914
Compare



Hi team,
This PR adds a manual "Apply Now" feature, allowing users to manually trigger an apply operation on Terraform layers that have a valid plan but autoApply is disabled.
Changes
api.terraform.padok.cloud/apply-nowannotation to manually trigger appliesIsApplyScheduledcondition check in the controller to handle manual apply requestsApplyNeededstate to distinguish between manual and automatic applies (manual applies bypass autoApply checks)POST /layers/:namespace/:layer/applyto trigger manual applies