osmith has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-ci/+/30006
)
Change subject: jenkins-gerrit: display JOB_TYPE infront of url
......................................................................
jenkins-gerrit: display JOB_TYPE infront of url
In the summary comment posted by jenkins to the patch on gerrit, display
the JOB_TYPE infront of the URL instead of "build", if the build job is
a matrix job that uses JOB_TYPE as variable.
For such jobs, it changes:
[build]
https://jenkins.osmocom.org/…
[build]
https://jenkins.osmocom.org/…
[build]
https://jenkins.osmocom.org/…
[build]
https://jenkins.osmocom.org/…
[lint]
https://jenkins.osmocom.org/…
to:
[manuals]
https://jenkins.osmocom.org/…
[gateware]
https://jenkins.osmocom.org/…
[firmware]
https://jenkins.osmocom.org/…
[software]
https://jenkins.osmocom.org/…
[lint]
https://jenkins.osmocom.org/…
JOB_TYPE is used by osmo-e1-hardware and pysim.
Change-Id: I51f49e4799961776dbddaedd76c14ed37a0e6c84
---
M scripts/jenkins-gerrit/pipeline_summary.py
1 file changed, 19 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/06/30006/1
diff --git a/scripts/jenkins-gerrit/pipeline_summary.py
b/scripts/jenkins-gerrit/pipeline_summary.py
index 44424d7..53c0f4a 100755
--- a/scripts/jenkins-gerrit/pipeline_summary.py
+++ b/scripts/jenkins-gerrit/pipeline_summary.py
@@ -10,6 +10,8 @@
jenkins_url = "https://jenkins.osmocom.org"
re_start_build = re.compile("Starting building: gerrit-[a-zA-Z-_0-9]*
#[0-9]*")
re_result = re.compile("^PIPELINE_[A-Z]*_PASSED=[01]$")
+re_job_type = re.compile("JOB_TYPE=([a-zA-Z-_0-9]*),")
+
def parse_args():
parser = argparse.ArgumentParser(
@@ -128,10 +130,26 @@
return ret
+def get_job_short_name(job):
+ """ :returns: a short job name, usually the stage (lint, deb, rpm,
build).
+ Or in case of build a more useful name like the JOB_TYPE part
+ of the URL if it is found. For osmo-e1-hardware it could be
+ one of: manuals, gateware, firmware, software """
+ global re_job_type
+ stage = job["stage"]
+
+ if stage == "build":
+ match = re_job_type.search(job["url"])
+ if match:
+ return match.group(1)
+
+ return stage
+
+
def get_jobs_list_str(jobs):
ret = ""
for job in jobs:
- ret += f" [{job['stage']}]
{job['url']}/consoleFull\n"
+ ret += f" [{get_job_short_name(job)}]
{job['url']}/consoleFull\n"
return ret
--
To view, visit
https://gerrit.osmocom.org/c/osmo-ci/+/30006
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I51f49e4799961776dbddaedd76c14ed37a0e6c84
Gerrit-Change-Number: 30006
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newchange