Skip to content

Commit 837fe12

Browse files
authored
Merge branch 'main' into feature/branch-and-type-filtered-transitions
2 parents a703e5a + 6d6a41c commit 837fe12

6 files changed

Lines changed: 95 additions & 20 deletions

File tree

.tekton/build-pipeline.yaml

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ spec:
8080
default: 'false'
8181
description: Enable cache proxy configuration
8282
type: string
83+
- name: enable-package-registry-proxy
84+
default: 'true'
85+
description: Use the package registry proxy when prefetching dependencies
86+
type: string
8387
results:
8488
- description: ''
8589
name: IMAGE_URL
@@ -103,7 +107,7 @@ spec:
103107
- name: name
104108
value: init
105109
- name: bundle
106-
value: quay.io/konflux-ci/tekton-catalog/task-init:0.4@sha256:f2de909151c733da85c7c05de8ecf37c55079c219dcf8db906175ae11fca0142
110+
value: quay.io/konflux-ci/tekton-catalog/task-init:0.4@sha256:b797dd453ddad669365de6de4649e3a9e37e77aa26eb9862ca079a36cbfe64a4
107111
- name: kind
108112
value: task
109113
resolver: bundles
@@ -124,7 +128,7 @@ spec:
124128
- name: name
125129
value: git-clone-oci-ta
126130
- name: bundle
127-
value: quay.io/konflux-ci/tekton-catalog/task-git-clone-oci-ta:0.1@sha256:f3f28a40fb7b4c8a5c1ec935df5576139bb6ba5b80f3531f42da2f1f2448a53b
131+
value: quay.io/konflux-ci/tekton-catalog/task-git-clone-oci-ta:0.1@sha256:13d49df7dc9ae301627e45f95a236011422996152f1bea46cd60217b0f057407
128132
- name: kind
129133
value: task
130134
resolver: bundles
@@ -141,14 +145,16 @@ spec:
141145
value: $(params.output-image).prefetch
142146
- name: ociArtifactExpiresAfter
143147
value: $(params.image-expires-after)
148+
- name: enable-package-registry-proxy
149+
value: $(params.enable-package-registry-proxy)
144150
runAfter:
145151
- clone-repository
146152
taskRef:
147153
params:
148154
- name: name
149155
value: prefetch-dependencies-oci-ta
150156
- name: bundle
151-
value: quay.io/konflux-ci/tekton-catalog/task-prefetch-dependencies-oci-ta:0.3@sha256:db8f7c0640f695d2beab7ff660630873ba921593f764a277cb0c65451bc14077
157+
value: quay.io/konflux-ci/tekton-catalog/task-prefetch-dependencies-oci-ta:0.3@sha256:1b209c0d93e52e418f3e6cd4b4fd915a84e4bd7f68e1cfd0d6446133540d7f43
152158
- name: kind
153159
value: task
154160
resolver: bundles
@@ -195,7 +201,7 @@ spec:
195201
- name: name
196202
value: buildah-oci-ta
197203
- name: bundle
198-
value: quay.io/konflux-ci/tekton-catalog/task-buildah-oci-ta:0.9@sha256:4f177774f52d6ab28ceda38ae843d40fbcd6a32ae637637ae23cbb207e675185
204+
value: quay.io/konflux-ci/tekton-catalog/task-buildah-oci-ta:0.9@sha256:681d9f65a7f50cb260ee576ccab551e11d63c549f1e1ef3d201da3c112855bd6
199205
- name: kind
200206
value: task
201207
resolver: bundles
@@ -217,7 +223,7 @@ spec:
217223
- name: name
218224
value: build-image-index
219225
- name: bundle
220-
value: quay.io/konflux-ci/tekton-catalog/task-build-image-index:0.3@sha256:b65a1e0961e0e768dda1f118bc5b5cab9c7ca7f4ed094e6a4352e66f82b9fa0b
226+
value: quay.io/konflux-ci/tekton-catalog/task-build-image-index:0.3@sha256:550afde50349e22ec11191ea0db9a49395ab46fef4e8317d820b6e946677ebeb
221227
- name: kind
222228
value: task
223229
resolver: bundles
@@ -238,7 +244,7 @@ spec:
238244
- name: name
239245
value: source-build-oci-ta
240246
- name: bundle
241-
value: quay.io/konflux-ci/tekton-catalog/task-source-build-oci-ta:0.3@sha256:0201377594e6e0e9d304aa23b2363e4f47e02f3ebb6fe5a410480c1a17c9edfb
247+
value: quay.io/konflux-ci/tekton-catalog/task-source-build-oci-ta:0.3@sha256:0917cfc7772e82cb8e74743c2104f43bcf2596aceafe87eec6fce69a8cac5f06
242248
- name: kind
243249
value: task
244250
resolver: bundles
@@ -260,7 +266,7 @@ spec:
260266
- name: name
261267
value: deprecated-image-check
262268
- name: bundle
263-
value: quay.io/konflux-ci/tekton-catalog/task-deprecated-image-check:0.5@sha256:5ff16b7e6b4a8aa1adb352e74b9f831f77ff97bafd1b89ddb0038d63335f1a67
269+
value: quay.io/konflux-ci/tekton-catalog/task-deprecated-image-check:0.5@sha256:57d1f556982115311f603dd9a728c52a7a1d092f022e1db4560da01eca9e5d17
264270
- name: kind
265271
value: task
266272
resolver: bundles
@@ -282,7 +288,7 @@ spec:
282288
- name: name
283289
value: clair-scan
284290
- name: bundle
285-
value: quay.io/konflux-ci/tekton-catalog/task-clair-scan:0.3@sha256:89924756c91ded746cf9ccc9f07907595e5b2454ddda0219132913a4875a5f59
291+
value: quay.io/konflux-ci/tekton-catalog/task-clair-scan:0.3@sha256:cd49cdea7e5403a87c4774bd8ea10bc4e6aeb83841ff490cbe42b782779513a7
286292
- name: kind
287293
value: task
288294
resolver: bundles
@@ -302,7 +308,7 @@ spec:
302308
- name: name
303309
value: ecosystem-cert-preflight-checks
304310
- name: bundle
305-
value: quay.io/konflux-ci/tekton-catalog/task-ecosystem-cert-preflight-checks:0.2@sha256:2d439dce35dc07bec38dcf450bcba949851686141a256d87eb6f42e5a217f6e2
311+
value: quay.io/konflux-ci/tekton-catalog/task-ecosystem-cert-preflight-checks:0.2@sha256:25dcef1d9270b2e03fe6710a733171f7c7208e341fc627dac3a579088f44af34
306312
- name: kind
307313
value: task
308314
resolver: bundles
@@ -328,7 +334,7 @@ spec:
328334
- name: name
329335
value: sast-snyk-check-oci-ta
330336
- name: bundle
331-
value: quay.io/konflux-ci/tekton-catalog/task-sast-snyk-check-oci-ta:0.4@sha256:2ad986f28d0b724dabcf76c4de649f058f0e66998c7d2f61b66de46533bdbcad
337+
value: quay.io/konflux-ci/tekton-catalog/task-sast-snyk-check-oci-ta:0.4@sha256:8f3ecbeaff579e41b8278f82d7fabac27845db17a8e687ea6c510c0c9aceabbb
332338
- name: kind
333339
value: task
334340
resolver: bundles
@@ -350,7 +356,7 @@ spec:
350356
- name: name
351357
value: clamav-scan
352358
- name: bundle
353-
value: quay.io/konflux-ci/tekton-catalog/task-clamav-scan:0.3@sha256:4b0f83cf961f0e8fd56089409d872adaca5791d9291c3584be0f6ee386e53f3a
359+
value: quay.io/konflux-ci/tekton-catalog/task-clamav-scan:0.3@sha256:567cb66bd2e1f4b58b9d4d756f3317fc62479e0b40aa0de66094b1f12d296cfc
354360
- name: kind
355361
value: task
356362
resolver: bundles
@@ -402,7 +408,7 @@ spec:
402408
- name: name
403409
value: sast-unicode-check-oci-ta
404410
- name: bundle
405-
value: quay.io/konflux-ci/tekton-catalog/task-sast-unicode-check-oci-ta:0.4@sha256:0854d9261760b2dc8f092569739685a5ab0a5c620e9cb8c1b78fef9e2d077a29
411+
value: quay.io/konflux-ci/tekton-catalog/task-sast-unicode-check-oci-ta:0.4@sha256:90efa582de7770d55102b74014a765cd16a25a56f2cf644b56a788c70c4dc749
406412
- name: kind
407413
value: task
408414
resolver: bundles
@@ -424,7 +430,7 @@ spec:
424430
- name: name
425431
value: apply-tags
426432
- name: bundle
427-
value: quay.io/konflux-ci/tekton-catalog/task-apply-tags:0.3@sha256:de3722bac1bf5ae8a95319162ce7e23fb33a7e2b7c0ac91535549f31a75aac86
433+
value: quay.io/konflux-ci/tekton-catalog/task-apply-tags:0.3@sha256:a291081de7fb27f832c6fc3c4b078acf7e6162ca4c085db38b118ca87e8b5b66
428434
- name: kind
429435
value: task
430436
resolver: bundles
@@ -447,7 +453,7 @@ spec:
447453
- name: name
448454
value: push-dockerfile-oci-ta
449455
- name: bundle
450-
value: quay.io/konflux-ci/tekton-catalog/task-push-dockerfile-oci-ta:0.3@sha256:aa0d54cdd04777562599195439186bb9ea28ced4529e9b860867611cca453a39
456+
value: quay.io/konflux-ci/tekton-catalog/task-push-dockerfile-oci-ta:0.3@sha256:7855471abfe87de080b914f2f3ca27c59e64f6448a7c2435e51435b764494c71
451457
- name: kind
452458
value: task
453459
resolver: bundles
@@ -464,7 +470,7 @@ spec:
464470
- name: name
465471
value: rpms-signature-scan
466472
- name: bundle
467-
value: quay.io/konflux-ci/tekton-catalog/task-rpms-signature-scan:0.2@sha256:65b14e54b86c3b8e7332b53ff8d2e574693fa1335f9720aec21d47e9d15686f0
473+
value: quay.io/konflux-ci/tekton-catalog/task-rpms-signature-scan:0.2@sha256:1d807f6be3be2bd8bff76321e9599bbafce8196dcd9597eeffd9df65466682af
468474
- name: kind
469475
value: task
470476
resolver: bundles

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM registry.access.redhat.com/ubi10/ubi:10.1-1769662757@sha256:64b34b13c0dda61ed9b977bde8068eb0d350f4afb75142715e83be68373e4848
1+
FROM registry.access.redhat.com/ubi10/ubi:10.1-1777453274@sha256:ff3bc6edd7f424bbf18ab671ce60f96593101e64f2c1a56eb5008b6bc3473310
22

33
ARG SYNC2JIRA_GIT_REPO=https://github.com/release-engineering/Sync2Jira.git
44
ARG SYNC2JIRA_GIT_REF=main

Dockerfile.sync-page

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM registry.access.redhat.com/ubi10/ubi:10.1-1769662757@sha256:64b34b13c0dda61ed9b977bde8068eb0d350f4afb75142715e83be68373e4848
1+
FROM registry.access.redhat.com/ubi10/ubi:10.1-1777453274@sha256:ff3bc6edd7f424bbf18ab671ce60f96593101e64f2c1a56eb5008b6bc3473310
22

33
ARG SYNC2JIRA_GIT_REPO=https://github.com/release-engineering/Sync2Jira.git
44
ARG SYNC2JIRA_GIT_REF=main

sync2jira/downstream_issue.py

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1547,6 +1547,33 @@ def sync_with_jira(issue, config):
15471547
retry = True
15481548

15491549

1550+
def convert_content(content: str) -> str:
1551+
"""Convert GitHub Flavored Markdown to Jira format via pypandoc.
1552+
1553+
Falls back to disabling TeX math extensions if the initial conversion
1554+
fails (e.g. content misinterpreted as LaTeX). Returns the original
1555+
content unchanged if both attempts fail.
1556+
1557+
:param str content: GitHub Flavored Markdown text
1558+
:returns: Jira-formatted text, or the original content on failure
1559+
:rtype: str
1560+
"""
1561+
try:
1562+
content = pypandoc.convert_text(content, "jira", format="gfm")
1563+
except Exception as e:
1564+
log.warning("pypandoc conversion failed, retrying with TeX disabled: %s", e)
1565+
try:
1566+
sanitized = content.replace("\\", "\\\\").replace("$", "\\$")
1567+
content = pypandoc.convert_text(
1568+
sanitized,
1569+
"jira",
1570+
format="gfm-tex_math_dollars-tex_math_single_backslash",
1571+
)
1572+
except Exception as e2:
1573+
log.warning("pypandoc fallback also failed; using raw content: %s", e2)
1574+
return content
1575+
1576+
15501577
def update_jira(client, config, issue):
15511578
# Check the status of the JIRA client
15521579
if not config["sync2jira"]["develop"] and not check_jira_status(client):
@@ -1559,7 +1586,7 @@ def update_jira(client, config, issue):
15591586
and issue.content
15601587
and "github_markdown" in issue.downstream["issue_updates"]
15611588
):
1562-
issue.content = pypandoc.convert_text(issue.content, "jira", format="gfm")
1589+
issue.content = convert_content(issue.content)
15631590

15641591
# First, check to see if we have a matching issue using the new method.
15651592
# If we do, then bail out. No sync needed.

sync2jira/downstream_pr.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
from jira import JIRAError
2525
from jira.client import Issue as JIRAIssue
2626
from jira.client import ResultList
27-
import pypandoc
2827

2928
# Local Modules
3029
import sync2jira.downstream_issue as d_issue
@@ -322,7 +321,7 @@ def _create_jira_issue_from_pr(client, pr, config):
322321
and pr_content
323322
and "github_markdown" in pr.downstream["issue_updates"]
324323
):
325-
pr_content = pypandoc.convert_text(pr_content, "jira", format="gfm")
324+
pr_content = d_issue.convert_content(pr_content)
326325

327326
# Convert PR to Issue-like object for creation
328327
# PR and Issue share similar structure, but we need to adapt it

tests/test_downstream_issue.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,6 +1110,49 @@ def test_sync_with_jira_no_matching(
11101110
)
11111111
mock_existing_jira_issue_legacy.assert_not_called()
11121112

1113+
@mock.patch(PATH + "pypandoc")
1114+
def test_convert_content(self, mock_pypandoc):
1115+
"""convert_content(): normal success, TeX fallback, and double failure."""
1116+
# Case 1: Normal GFM conversion succeeds
1117+
mock_pypandoc.convert_text.return_value = "normal markdown"
1118+
1119+
result = d.convert_content("normal markdown")
1120+
1121+
mock_pypandoc.convert_text.assert_called_once_with(
1122+
"normal markdown", "jira", format="gfm"
1123+
)
1124+
self.assertEqual(result, "normal markdown")
1125+
1126+
# Case 2: First call fails (TeX error), fallback succeeds
1127+
mock_pypandoc.convert_text.reset_mock()
1128+
mock_pypandoc.convert_text.side_effect = [
1129+
RuntimeError("Error producing PDF"),
1130+
"fallback converted",
1131+
]
1132+
1133+
result = d.convert_content("bad $tex")
1134+
1135+
self.assertEqual(mock_pypandoc.convert_text.call_count, 2)
1136+
first_call = mock_pypandoc.convert_text.call_args_list[0]
1137+
self.assertEqual(first_call[1]["format"], "gfm")
1138+
1139+
fallback_call = mock_pypandoc.convert_text.call_args_list[1]
1140+
self.assertEqual(
1141+
fallback_call[1]["format"],
1142+
"gfm-tex_math_dollars-tex_math_single_backslash",
1143+
)
1144+
self.assertEqual(fallback_call[0][0], "bad \\$tex")
1145+
self.assertEqual(result, "fallback converted")
1146+
1147+
# Case 3: Both calls fail, raw content preserved
1148+
mock_pypandoc.convert_text.reset_mock()
1149+
mock_pypandoc.convert_text.side_effect = RuntimeError("pandoc broken")
1150+
1151+
result = d.convert_content("raw content")
1152+
1153+
self.assertEqual(mock_pypandoc.convert_text.call_count, 2)
1154+
self.assertEqual(result, "raw content")
1155+
11131156
@mock.patch(PATH + "_update_title")
11141157
@mock.patch(PATH + "_update_description")
11151158
@mock.patch(PATH + "_update_comments")

0 commit comments

Comments
 (0)