Commit ac39085
fix: POST /api/plan panics when ATLANTIS_ENABLE_POLICY_CHECKS=true (#6484)
* fix: handle API plan policy checks
When API plan command building expands one input project into plan and policy_check contexts, keep workflow hooks tied to plan contexts, route policy_check contexts to the policy-check runner, and return policy-check results to API callers.
Load existing pull status for PR-backed API requests before building plan commands so generated policy_check contexts preserve sticky policy approvals. Stop /api/apply before apply command building when the pre-apply plan phase reports a policy-check failure.
Fixes #6449
Assisted-by: OpenAI <noreply@openai.com>
Signed-off-by: Rui Chen <rui@chenrui.dev>
* fix: preserve API apply pull status semantics
Refresh seeded API apply PullStatus metadata to the current request pull while preserving existing per-project policy status, and let multi-project API apply continue into per-project validation after mixed policy-check results.
Assisted-by: OpenAI <noreply@openai.com>
Signed-off-by: Rui Chen <rui@chenrui.dev>
---------
Signed-off-by: Rui Chen <rui@chenrui.dev>
Co-authored-by: Rui Chen <rui@chenrui.dev>1 parent 81fcae5 commit ac39085
3 files changed
Lines changed: 402 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
70 | 74 | | |
71 | 75 | | |
72 | 76 | | |
| |||
736 | 740 | | |
737 | 741 | | |
738 | 742 | | |
739 | | - | |
740 | 743 | | |
741 | 744 | | |
742 | 745 | | |
743 | 746 | | |
744 | 747 | | |
745 | 748 | | |
746 | 749 | | |
747 | | - | |
748 | 750 | | |
749 | 751 | | |
750 | 752 | | |
| |||
772 | 774 | | |
773 | 775 | | |
774 | 776 | | |
775 | | - | |
776 | | - | |
777 | | - | |
778 | | - | |
779 | | - | |
780 | | - | |
781 | | - | |
782 | | - | |
783 | | - | |
| 777 | + | |
784 | 778 | | |
785 | 779 | | |
786 | 780 | | |
| |||
922 | 916 | | |
923 | 917 | | |
924 | 918 | | |
| 919 | + | |
925 | 920 | | |
926 | 921 | | |
927 | 922 | | |
| |||
1084 | 1079 | | |
1085 | 1080 | | |
1086 | 1081 | | |
| 1082 | + | |
1087 | 1083 | | |
1088 | 1084 | | |
1089 | 1085 | | |
| |||
1102 | 1098 | | |
1103 | 1099 | | |
1104 | 1100 | | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
1105 | 1115 | | |
1106 | 1116 | | |
1107 | 1117 | | |
| |||
0 commit comments