Skip to content

Commit 28e18e7

Browse files
author
Pierre Guceski
authored
Merge pull request DataDog#7271 from DataDog/gus/integration-merge-corner-case
Handling integrations merge
2 parents 481e1d0 + df06b5b commit 28e18e7

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

local/bin/py/build/actions/integrations.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,23 @@ def merge_integrations(self):
272272
content,
273273
count=0,
274274
)
275+
regex_skip_sections_end = r"(```|\{\{< \/code-block >\}\})"
276+
regex_skip_sections_start = r"(```|\{\{< code-block)"
277+
278+
## Inlining all link from the file to merge
279+
## to avoid link ref colision with the existing references.
280+
content = self.inline_references(content,regex_skip_sections_start,regex_skip_sections_end)
281+
275282
target_file.write(content)
283+
284+
## Formating all link as reference in the new merged integration file
285+
try:
286+
final_text = format_link_file(output_file,regex_skip_sections_start,regex_skip_sections_end)
287+
with open(output_file, 'w') as final_file:
288+
final_file.write(final_text)
289+
except Exception as e:
290+
print(e)
291+
276292
try:
277293
remove(input_file)
278294
except OSError:
@@ -401,7 +417,7 @@ def process_integration_readme(self, file_name):
401417
:param file_name: path to a readme md file
402418
"""
403419
no_integration_issue = True
404-
420+
tab_logic = False
405421
metrics = glob.glob(
406422
"{path}{sep}*metadata.csv".format(
407423
path=dirname(file_name), sep=sep

0 commit comments

Comments
 (0)