Skip to content

Commit 6ea8400

Browse files
authored
Merge pull request #3582 from aleksandrychev/ENT-13497_3.27
ENT-13497: Changelog pages adjustments (3.27)
2 parents 327488c + 5536d0f commit 6ea8400

4 files changed

Lines changed: 21 additions & 12 deletions

File tree

content/release-notes/whatsnew/changelog-core.markdown

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,4 @@ aliases:
88

99
**See also:** [Enterprise changelog][Enterprise changelog], [Masterfiles changelog][Masterfiles changelog]
1010

11-
<pre>
12-
1311
{{< CFEngine_include_markdown(core/CHANGELOG.md) >}}
14-
15-
</pre>

content/release-notes/whatsnew/changelog-enterprise.markdown

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,4 @@ aliases:
88

99
**See also:** [Core changelog][Changelog], [Masterfiles changelog][Masterfiles changelog]
1010

11-
<pre>
12-
1311
{{< CFEngine_include_markdown(enterprise/CHANGELOG.md) >}}
14-
15-
</pre>

content/release-notes/whatsnew/changelog-masterfiles-policy-framework.markdown

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,4 @@ aliases:
88

99
**See also:** [Core changelog][Changelog], [Enterprise changelog][Enterprise changelog]
1010

11-
<pre>
12-
1311
{{< CFEngine_include_markdown(masterfiles/CHANGELOG.md) >}}
14-
15-
</pre>

generator/_scripts/cfdoc_linkresolver.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
import re
2626
import cfdoc_qa as qa
2727

28+
JIRA_BASE_URL = "https://northerntech.atlassian.net/browse/"
29+
# Pattern to match Jira ticket references (ENT-1234, CFE-4567, etc.)
30+
# (?<!/) skips tickets in URLs (/)
31+
# (?<!\[) and (?!\]) skips inside link text ([])
32+
JIRA_TICKET_PATTERN = re.compile(r"(?<!/)(?<!\[)(ENT|CFE)-(\d+)\b(?!\])")
33+
2834

2935
def run(config):
3036
markdown_files = config["markdown_files"]
@@ -115,6 +121,13 @@ def headerToAnchor(header):
115121
return anchor
116122

117123

124+
def convertJiraTicketsToLinks(line):
125+
"""Convert Jira ticket references (ENT-1234, CFE-4567) to markdown links."""
126+
return JIRA_TICKET_PATTERN.sub(
127+
lambda m: "[%s](%s%s)" % (m[0], JIRA_BASE_URL, m[0]), line
128+
)
129+
130+
118131
def parseMarkdownForAnchors(file_name, config):
119132
in_file = open(file_name, "r")
120133
lines = in_file.readlines()
@@ -305,6 +318,14 @@ def applyLinkMap(file_name, config):
305318
else:
306319
break
307320
new_line += markdown_line
321+
322+
# Convert Jira ticket references to links (only outside code blocks)
323+
if not in_pre:
324+
original_line = new_line
325+
new_line = convertJiraTicketsToLinks(new_line)
326+
if new_line != original_line:
327+
write_changes = True
328+
308329
new_lines.append(new_line)
309330
previous_empty = markdown_line.lstrip() == ""
310331

0 commit comments

Comments
 (0)