Attention is currently required from: neels.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/30688 )
Change subject: drop bogus error log 'no MGW fsm'
......................................................................
Patch Set 2: Code-Review+1
(1 comment)
File src/osmo-hnbgw/mgw_fsm.c:
https://gerrit.osmocom.org/c/osmo-hnbgw/+/30688/comment/58ecf845_3ec8b068
PS2, Line 785: if (!map->mgw_fi)
> I disagree here. The common pattern I am thinking of here is: when cleaned up, NULL the pointer. […]
Ack
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/30688
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I89dd4fb6913bfb84b6667b159e09968734e2102a
Gerrit-Change-Number: 30688
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 18 Jan 2023 14:49:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Comment-In-Reply-To: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: comment
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/30987 )
Change subject: jobs/gerrit-verifications-comment: rename
......................................................................
jobs/gerrit-verifications-comment: rename
Rename the jenkins job from gerrit-pipeline-result to
gerrit-verifications-comment, as the next patch will not only use this
job to post a comment at the end of the gerrit verification, but also at
the beginning when the pipeline starts.
Give the pipeline_summary* scripts more generic names as well.
Change-Id: I1b947522aa5f2bb21f5e438db9df3420c998f1bc
---
R jobs/gerrit-verifications-comment.yml
M jobs/gerrit-verifications.yml
R scripts/jenkins-gerrit/comment_generate.py
R scripts/jenkins-gerrit/comment_send.sh
4 files changed, 9 insertions(+), 9 deletions(-)
Approvals:
laforge: Looks good to me, approved
fixeria: Looks good to me, but someone else must approve
pespin: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/jobs/gerrit-pipeline-result.yml b/jobs/gerrit-verifications-comment.yml
similarity index 92%
rename from jobs/gerrit-pipeline-result.yml
rename to jobs/gerrit-verifications-comment.yml
index e1a7a74..1c672b9 100644
--- a/jobs/gerrit-pipeline-result.yml
+++ b/jobs/gerrit-verifications-comment.yml
@@ -2,12 +2,12 @@
# post a list of failed/successful job links to gerrit and to vote +V/-V.
- project:
- name: gerrit-pipeline-result
+ name: gerrit-verifications-comment
jobs:
- - 'gerrit-pipeline-result'
+ - 'gerrit-verifications-comment'
- job:
- name: 'gerrit-pipeline-result'
+ name: 'gerrit-verifications-comment'
project-type: freestyle
node: osmocom-gerrit
retry-count: 3 # scm checkout
@@ -68,7 +68,7 @@
wipe-workspace: true
builders:
- - shell: 'cd scripts/jenkins-gerrit && ./pipeline_summary_send.sh'
+ - shell: 'cd scripts/jenkins-gerrit && ./comment_send.sh'
wrappers:
- ansicolor:
diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml
index 0f35fcd..1896a98 100644
--- a/jobs/gerrit-verifications.yml
+++ b/jobs/gerrit-verifications.yml
@@ -501,17 +501,17 @@
}}
}}
}}
- stage("Result") {{
+ stage("Result Comment") {{
steps {{
echo "PIPELINE_BUILD_PASSED=${{env.PIPELINE_BUILD_PASSED}}"
echo "PIPELINE_LINT_PASSED=${{env.PIPELINE_LINT_PASSED}}"
echo "PIPELINE_DEB_PASSED=${{env.PIPELINE_DEB_PASSED}}"
echo "PIPELINE_RPM_PASSED=${{env.PIPELINE_RPM_PASSED}}"
- // Run the result job to get successful/failed links and add a
+ // Run the comment job to get successful/failed links and add a
// comment + vote to gerrit
script {{
- build job: 'gerrit-pipeline-result', parameters: [
+ build job: 'gerrit-verifications-comment', parameters: [
string(name: "GERRIT_PROJECT", value: "${{env.GERRIT_PROJECT}}"),
string(name: "GERRIT_CHANGE_NUMBER", value: "${{env.GERRIT_CHANGE_NUMBER}}"),
string(name: "GERRIT_PATCHSET_NUMBER", value: "${{env.GERRIT_PATCHSET_NUMBER}}"),
diff --git a/scripts/jenkins-gerrit/pipeline_summary.py b/scripts/jenkins-gerrit/comment_generate.py
similarity index 98%
rename from scripts/jenkins-gerrit/pipeline_summary.py
rename to scripts/jenkins-gerrit/comment_generate.py
index 53c0f4a..d4937c0 100755
--- a/scripts/jenkins-gerrit/pipeline_summary.py
+++ b/scripts/jenkins-gerrit/comment_generate.py
@@ -28,7 +28,7 @@
def stage_from_job_name(job_name):
- if job_name == "gerrit-pipeline-result":
+ if job_name == "gerrit-verifications-comment":
# The job that runs this script. Don't include it in the summary.
return None
if job_name == "gerrit-lint":
diff --git a/scripts/jenkins-gerrit/pipeline_summary_send.sh b/scripts/jenkins-gerrit/comment_send.sh
similarity index 92%
rename from scripts/jenkins-gerrit/pipeline_summary_send.sh
rename to scripts/jenkins-gerrit/comment_send.sh
index 29ea860..bd7b81d 100755
--- a/scripts/jenkins-gerrit/pipeline_summary_send.sh
+++ b/scripts/jenkins-gerrit/comment_send.sh
@@ -16,7 +16,7 @@
set -x
-./pipeline_summary.py "$PIPELINE_BUILD_URL" \
+./comment_generate.py "$PIPELINE_BUILD_URL" \
-o gerrit_report.json \
$arg_notify
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/30987
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I1b947522aa5f2bb21f5e438db9df3420c998f1bc
Gerrit-Change-Number: 30987
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/30988 )
Change subject: jobs/gerrit-verifications: post comment on start
......................................................................
jobs/gerrit-verifications: post comment on start
Post a link to gerrit when starting the build that contains the link to
the pipeline, without sending mail notifications.
This is useful when a gerrit verification build takes rather long, and
it's not clear if a build for gerrit verification was actually started
or not. Also I find this useful when debugging the CI scripts.
Change-Id: I75c5b8874f606739ff557ff0711bb9449a2b4259
---
M jobs/gerrit-verifications-comment.yml
M jobs/gerrit-verifications.yml
M scripts/jenkins-gerrit/comment_generate.py
M scripts/jenkins-gerrit/comment_send.sh
4 files changed, 52 insertions(+), 10 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/jobs/gerrit-verifications-comment.yml b/jobs/gerrit-verifications-comment.yml
index 1c672b9..f781bf8 100644
--- a/jobs/gerrit-verifications-comment.yml
+++ b/jobs/gerrit-verifications-comment.yml
@@ -1,5 +1,6 @@
-# This job runs at the end of the pipeline in gerrit-verififactions.yml, to
-# post a list of failed/successful job links to gerrit and to vote +V/-V.
+# This job runs at the start/end of the pipeline in gerrit-verifications.yml.
+# On start it posts a link to the pipeline to gerrit, and on end a list of
+# failed/successful job links together with a vote +V/-V.
- project:
name: gerrit-verifications-comment
@@ -18,7 +19,7 @@
artifact-days-to-keep: -1
artifact-num-to-keep: -1
description: |
- Result job of CI for patches sent to <a href="https://gerrit.osmocom.org">gerrit</a>.
+ Send start and result comments to <a href="https://gerrit.osmocom.org">gerrit</a>.
</br></br>
Related issue: <a href="https://osmocom.org/issues/2385">OS#2385</a>
@@ -29,6 +30,9 @@
osmo-ci.git branch
default: 'master'
- string:
+ name: COMMENT_TYPE
+ description: set by gerrit verification pipeline job
+ - string:
name: GERRIT_PROJECT
description: set by gerrit verification pipeline job
- string:
diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml
index 1896a98..b83b5aa 100644
--- a/jobs/gerrit-verifications.yml
+++ b/jobs/gerrit-verifications.yml
@@ -416,6 +416,29 @@
stages {{
stage("Verification") {{
parallel {{
+ stage("Start Comment") {{
+ steps {{
+ // Run the comment job to add the pipeline link to gerrit
+ script {{
+ // Keep going on failure
+ catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {{
+ build job: 'gerrit-verifications-comment', parameters: [
+ string(name: "COMMENT_TYPE", value: "start"),
+ string(name: "GERRIT_PROJECT", value: "${{env.GERRIT_PROJECT}}"),
+ string(name: "GERRIT_CHANGE_NUMBER", value: "${{env.GERRIT_CHANGE_NUMBER}}"),
+ string(name: "GERRIT_PATCHSET_NUMBER", value: "${{env.GERRIT_PATCHSET_NUMBER}}"),
+ string(name: "GERRIT_BRANCH", value: "${{env.GERRIT_BRANCH}}"),
+ string(name: "GERRIT_HOST", value: "${{env.GERRIT_HOST}}"),
+ string(name: "GERRIT_PATCHSET_REVISION", value: "${{env.GERRIT_PATCHSET_REVISION}}"),
+ string(name: "GERRIT_PATCHSET_UPLOADER_NAME", value: "${{env.GERRIT_PATCHSET_UPLOADER_NAME}}"),
+ string(name: "GERRIT_PORT", value: "${{env.GERRIT_PORT}}"),
+ string(name: "GERRIT_REFSPEC", value: "${{env.GERRIT_REFSPEC}}"),
+ string(name: "PIPELINE_BUILD_URL", value: "${{env.BUILD_URL}}"),
+ ]
+ }}
+ }}
+ }}
+ }}
stage("Build") {{
when {{
expression {{ params.PIPELINE_BUILD }}
@@ -512,6 +535,7 @@
// comment + vote to gerrit
script {{
build job: 'gerrit-verifications-comment', parameters: [
+ string(name: "COMMENT_TYPE", value: "result"),
string(name: "GERRIT_PROJECT", value: "${{env.GERRIT_PROJECT}}"),
string(name: "GERRIT_CHANGE_NUMBER", value: "${{env.GERRIT_CHANGE_NUMBER}}"),
string(name: "GERRIT_PATCHSET_NUMBER", value: "${{env.GERRIT_PATCHSET_NUMBER}}"),
diff --git a/scripts/jenkins-gerrit/comment_generate.py b/scripts/jenkins-gerrit/comment_generate.py
index d4937c0..dc69f8f 100755
--- a/scripts/jenkins-gerrit/comment_generate.py
+++ b/scripts/jenkins-gerrit/comment_generate.py
@@ -15,12 +15,16 @@
def parse_args():
parser = argparse.ArgumentParser(
- description="Get a summary of failed / successful builds from the CI"
- " pipeline we run for patches submitted to gerrit.")
+ description="Prepare a comment to be submitted to gerrit. Depending on"
+ " the comment type, (start) either a link to the pipeline,"
+ " or (result) a summary of failed / successful builds from"
+ " the pipeline we run for patches submitted to gerrit.")
parser.add_argument("build_url",
help="$BUILD_URL of the pipeline job, e.g."
" https://jenkins.osmocom.org/jenkins/job/gerrit-osmo-bsc-nat/17/")
parser.add_argument("-o", "--output", help="output json file")
+ parser.add_argument("-t", "--type", help="comment type",
+ choices=["start", "result"], required=True)
parser.add_argument("-n", "--notify-on-success", action="store_true",
help="always indicate in json that the owner should be"
" notified via mail, not only on failure")
@@ -153,7 +157,7 @@
return ret
-def get_pipeline_summary(build_url, notify_on_success):
+def get_comment_result(build_url, notify_on_success):
""" Generate a summary of failed and successful builds for gerrit.
:returns: a dict that is expected by gerrit's set-review api, e.g.
{"tag": "jenkins",
@@ -211,17 +215,26 @@
"notify": notify}
+def get_comment_start(build_url):
+ return {"tag": "jenkins",
+ "message": f"Build Started\n{build_url}consoleFull",
+ "notify": "NONE"}
+
+
def main():
args = parse_args()
- summary = get_pipeline_summary(args.build_url, args.notify_on_success)
+ if args.type == "result":
+ comment = get_comment_result(args.build_url, args.notify_on_success)
+ else:
+ comment = get_comment_start(args.build_url)
print()
- print(summary["message"])
- print(f"notify: {summary['notify']}")
+ print(comment["message"])
+ print(f"notify: {comment['notify']}")
if args.output:
with open(args.output, "w") as handle:
- json.dump(summary, handle, indent=4)
+ json.dump(comment, handle, indent=4)
if __name__ == "__main__":
main()
diff --git a/scripts/jenkins-gerrit/comment_send.sh b/scripts/jenkins-gerrit/comment_send.sh
index bd7b81d..24fec27 100755
--- a/scripts/jenkins-gerrit/comment_send.sh
+++ b/scripts/jenkins-gerrit/comment_send.sh
@@ -18,6 +18,7 @@
./comment_generate.py "$PIPELINE_BUILD_URL" \
-o gerrit_report.json \
+ -t "$COMMENT_TYPE" \
$arg_notify
ssh \
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/30988
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I75c5b8874f606739ff557ff0711bb9449a2b4259
Gerrit-Change-Number: 30988
Gerrit-PatchSet: 2
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged