File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
tools/githubactions/projects Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,27 @@ def fix_single_line_retention_policy(config):
103
103
return config
104
104
105
105
106
+ def fix_single_line_tentacle_retention_policy (config ):
107
+ """
108
+ The LLM kept insisting on using a single line tentacle_retention_policy block. This is not valid HCL2 syntax.
109
+ """
110
+
111
+ match = re .match (
112
+ r"tentacle_retention_policy\s*{\s*quantity_to_keep\s*=\s*(\d+)\s*unit\s*=\s*\"([^\"]+)\"\s*}" ,
113
+ config ,
114
+ )
115
+ if match :
116
+ # If we get a single line lifecycle block, just replace it with a multi-line one
117
+ return (
118
+ "tentacle_retention_policy {\n "
119
+ f" quantity_to_keep = { match .group (1 )} \n "
120
+ f' unit = "{ match .group (2 )} "\n '
121
+ "}"
122
+ )
123
+
124
+ return config
125
+
126
+
106
127
def fix_account_type (config ):
107
128
"""
108
129
Fix up invalid account_type values.
Original file line number Diff line number Diff line change 22
22
fix_account_type ,
23
23
fix_single_line_retention_policy ,
24
24
remove_duplicate_definitions ,
25
+ fix_single_line_tentacle_retention_policy ,
25
26
)
26
27
from domain .sanitizers .markdown_remove import remove_markdown_code_block
27
28
from domain .tools .debug import get_params_message
@@ -279,6 +280,9 @@ async def inner_function():
279
280
# Deal with the LLM returning a single line for a release_retention_policy block
280
281
configuration = fix_single_line_retention_policy (configuration )
281
282
283
+ # Deal with the LLM returning a single line for a tentacle_retention_policy block
284
+ configuration = fix_single_line_tentacle_retention_policy (configuration )
285
+
282
286
# Deal with invalid account_types in data blocks
283
287
configuration = fix_account_type (configuration )
284
288
You can’t perform that action at this time.
0 commit comments