From eec4e67b82341c0fc17820034dc9877809e45fea Mon Sep 17 00:00:00 2001 From: grigo Date: Sat, 2 May 2026 18:48:01 +0300 Subject: [PATCH] refs TG-2: test Jenkins comment --- Jenkinsfile | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 409b9d1..8d3f70f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -32,8 +32,8 @@ pipeline { def result = currentBuild.currentResult ?: 'UNKNOWN' withCredentials([string(credentialsId: 'TAIGA_TOKEN', variable: 'TAIGA_TOKEN')]) { - sh """ - set -e + sh(returnStatus: true, script: """ + set +e REF=\$(git log -1 --pretty=%B | grep -oE 'TG-[0-9]+' | head -1 | cut -d- -f2 || true) @@ -67,7 +67,8 @@ def get_json(path): try: with urllib.request.urlopen(req) as r: return json.loads(r.read().decode("utf-8")) - except urllib.error.HTTPError: + except Exception as e: + print(f"Taiga lookup warning: {e}") return None targets = [ @@ -111,24 +112,11 @@ req = urllib.request.Request( try: with urllib.request.urlopen(req) as r: print(f"Commented Taiga TG-{ref} ({label}), HTTP {r.status}") -except urllib.error.HTTPError as e: - body = e.read().decode("utf-8", errors="replace") - print(f"Taiga comment failed: HTTP {e.code}") - print(body) +except Exception as e: + print(f"Taiga comment warning: {e}") raise SystemExit(0) - -url = f"{taiga_url}/api/v1/{endpoint}/{data['id']}/comments" -req = urllib.request.Request( - url, - data=payload, - headers=headers, - method="POST", -) - -with urllib.request.urlopen(req) as r: - print(f"Commented Taiga TG-{ref} ({label}), HTTP {r.status}") PY - """.stripIndent() + """.stripIndent()) } } }