lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

October 2022

  • 2 participants
  • 2331 discussions
Change in docker-playground[master]: ttcn3-mgw: Increase number of enpoints in osmo-mgw.cfg
by osmith 07 Oct '22

07 Oct '22
Attention is currently required from: pespin. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/docker-playground/+/29666 ) Change subject: ttcn3-mgw: Increase number of enpoints in osmo-mgw.cfg ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/docker-playground/+/29666 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-Change-Id: I14e3abdf63c585e4518b0c0a61dbc57e6710a998 Gerrit-Change-Number: 29666 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Fri, 07 Oct 2022 14:02:20 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in docker-playground[master]: ttcn3-mgw: jenkins.sh Fix centos tests
by osmith 07 Oct '22

07 Oct '22
Attention is currently required from: pespin. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/docker-playground/+/29665 ) Change subject: ttcn3-mgw: jenkins.sh Fix centos tests ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/docker-playground/+/29665 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-Change-Id: I369bb61f3979bd9118fad17c3d202253411ba14b Gerrit-Change-Number: 29665 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Fri, 07 Oct 2022 14:02:08 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-bsc-nat[master]: [do not merge] test rpm/deb CI
by Jenkins Builder 07 Oct '22

07 Oct '22
Attention is currently required from: osmith. Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc-nat/+/29492 ) Change subject: [do not merge] test rpm/deb CI ...................................................................... Patch Set 4: Verified+1 4 passed: [build] https://jenkins.osmocom.org/jenkins/job/gerrit-osmo-bsc-nat-build/a1=defaul… [rpm] https://jenkins.osmocom.org/jenkins/job/gerrit-binpkgs-rpm/9/consoleFull [lint] https://jenkins.osmocom.org/jenkins/job/gerrit-lint/14/consoleFull [deb] https://jenkins.osmocom.org/jenkins/job/gerrit-binpkgs-deb/7/consoleFull Build Successful -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc-nat/+/29492 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc-nat Gerrit-Branch: master Gerrit-Change-Id: I6842b5c641e6b6a0cfb428c7538e0a041751143e Gerrit-Change-Number: 29492 Gerrit-PatchSet: 4 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Fri, 07 Oct 2022 13:55:45 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-bsc-nat[master]: [do not merge] test rpm/deb CI
by osmith 07 Oct '22

07 Oct '22
Attention is currently required from: osmith. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-bsc-nat/+/29492 to look at the new patch set (#4). Change subject: [do not merge] test rpm/deb CI ...................................................................... [do not merge] test rpm/deb CI Change-Id: I6842b5c641e6b6a0cfb428c7538e0a041751143e --- A test2 1 file changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc-nat refs/changes/92/29492/4 -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc-nat/+/29492 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc-nat Gerrit-Branch: master Gerrit-Change-Id: I6842b5c641e6b6a0cfb428c7538e0a041751143e Gerrit-Change-Number: 29492 Gerrit-PatchSet: 4 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
Change in osmo-ci[master]: jobs/gerrit-binpkgs: new job for deb, rpm packages
by osmith 07 Oct '22

07 Oct '22
Attention is currently required from: pespin. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/29604 ) Change subject: jobs/gerrit-binpkgs: new job for deb, rpm packages ...................................................................... Patch Set 4: (1 comment) This change is ready for review. Patchset: PS2: > agreed with getting too many mails from jenkins/gerrit verifications... […] done. it now leaves only one comment at the end with the vote and a summary of all jobs, direct links to them and whether they failed or not. -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/29604 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: I7ca8869c2e9f2e7c74a360933be12b5c2b47c2fc Gerrit-Change-Number: 29604 Gerrit-PatchSet: 4 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Fri, 07 Oct 2022 13:48:06 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: osmith <osmith(a)sysmocom.de> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
Change in osmo-ci[master]: jobs/gerrit-lint: run as part of pipeline
by osmith 07 Oct '22

07 Oct '22
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/29670 ) Change subject: jobs/gerrit-lint: run as part of pipeline ...................................................................... jobs/gerrit-lint: run as part of pipeline Reduce mails by running gerrit-lint as part of the gerrit-verifications pipeline. Related: OS#2385 Change-Id: I5f1340248cd116c5fa5134eee3fae50baf7ef851 --- M jobs/gerrit-lint.yml M jobs/gerrit-verifications.yml 2 files changed, 65 insertions(+), 116 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/70/29670/1 diff --git a/jobs/gerrit-lint.yml b/jobs/gerrit-lint.yml index 602ce68..819d17d 100644 --- a/jobs/gerrit-lint.yml +++ b/jobs/gerrit-lint.yml @@ -1,99 +1,17 @@ # This file holds all gerrit lint verifications https://jenkins.osmocom.org/jenkins/view/Jenkins-Gerrit/. -# One can simply add a gerrit job by adding project's repository to repos list. +# Add project's repositories to jobs/gerrit-verifications.yml. When +# pipeline_lint is set for that project, the pipeline will call the gerrit-lint +# job for it. - project: name: gerrit-lint - # following default values can be overridden by each repo - disabled: false - gerrit_url: 'ssh://jenkins@gerrit.osmocom.org:29418' - repos_url: '{gerrit_url}/{repos}' - gerrit_project: '{repos}' - - # in alphabetical order - repos: - - asn1c - - cellmgr-ng - - docker-playground - - libasn1c - - libgtpnl - - libosmo-abis - - libosmo-gprs - - libosmo-netif - - libosmo-pfcp - - libosmo-sccp - - libosmocore - - libsmpp34 - - libtelnet - - libusrp - - openbsc - - openggsn - - osmo-bsc - - osmo-bsc-nat - - osmo-bts - - osmo-hnodeb - - osmo-hnbgw - - osmo-upf - - osmo-ci - - - osmo_dia2gsup: - repos_url: '{gerrit_url}/erlang/{repos}' - gerrit_project: 'erlang/{repos}' - - - osmo-e1-hardware - - osmo-ggsn - - osmo-gsm-manuals - - - osmo_gsup: - repos_url: '{gerrit_url}/erlang/{repos}' - gerrit_project: 'erlang/{repos}' - - - osmo-hlr - - osmo-iuh - - osmo-mgw - - osmo-msc - - osmo-pcap - - osmo-pcu - - - osmo-python-tests: - repos_url: '{gerrit_url}/python/{repos}' - gerrit_project: 'python/{repos}' - - - osmo-sgsn - - - osmo_ss7: - repos_url: '{gerrit_url}/erlang/{repos}' - gerrit_project: 'erlang/{repos}' - - - osmo-sip-connector - - osmo-trx - - osmocom-bb - - osmo-tetra - - osmo-sysmon - - osmo-remsim - - simtrace2 - - osmo-asf4-dfu - - osmo-ccid-firmware - - osmo-e1d - - osmo-cbc - - osmo-e1-recorder - - gapk - - osmo-uecups - - osmo-el2tpd - - osmo-smlc - - osmo-gbproxy - - pysim - - - osmo-ttcn3-hacks: - repos_url: 'https://gerrit.osmocom.org/{repos}' - jobs: - - 'gerrit-{repos}-lint' + - 'gerrit-lint' -- job-template: - name: 'gerrit-{repos}-lint' +- job: + name: 'gerrit-lint' project-type: freestyle node: osmocom-gerrit-debian9 - disabled: '{obj:disabled}' retry-count: 3 # scm checkout properties: - build-discarder: @@ -102,8 +20,7 @@ artifact-days-to-keep: -1 artifact-num-to-keep: -1 description: | - Run linting on patches submitted to gerrit for - <a href="https://gerrit.osmocom.org/#/q/status:open+project:{repos}">{repos}</a> + Lint job of CI for patches sent to <a href="https://gerrit.osmocom.org">gerrit</a>. </br></br> Related issue: <a href="https://osmocom.org/issues/5087">OS#5087</a> @@ -113,11 +30,29 @@ description: | osmo-ci.git branch default: 'master' + - string: + name: GERRIT_BRANCH + description: set by gerrit verification pipeline job + - string: + name: GERRIT_HOST + description: set by gerrit verification pipeline job + - string: + name: GERRIT_PATCHSET_REVISION + description: set by gerrit verification pipeline job + - string: + name: GERRIT_PORT + description: set by gerrit verification pipeline job + - string: + name: GERRIT_REFSPEC + description: set by gerrit verification pipeline job + - string: + name: GERRIT_REPO_URL + description: set by gerrit verification pipeline job scm: - git: basedir: 'code-from-gerrit' - url: '{obj:repos_url}' + url: '$GERRIT_REPO_URL' credentials-id: d5eda5e9-b59d-44ba-88d2-43473cb6e42d branches: - $GERRIT_BRANCH @@ -130,35 +65,12 @@ recursive: false - git: basedir: 'osmo-ci' - url: '{gerrit_url}/osmo-ci' + url: 'https://gerrit.osmocom.org/osmo-ci' credentials-id: d5eda5e9-b59d-44ba-88d2-43473cb6e42d branches: - '$BRANCH_CI' wipe-workspace: true - triggers: - - gerrit: - trigger-on: - - patchset-created-event: - exclude-drafts: true - exclude-no-code-change: true - projects: - - project-compare-type: 'PLAIN' - project-pattern: '{obj:gerrit_project}' - branches: - - branch-compare-type: 'ANT' - branch-pattern: '**' - skip-vote: - successful: false - failed: false - unstable: false - notbuilt: false - silent: false - escape-quotes: false - no-name-and-email: false - trigger-for-unreviewed-patches: true - server-name: gerrit.osmocom.org - builders: - shell: 'cd code-from-gerrit && ../osmo-ci/lint/lint_diff.sh HEAD~1' diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 26f7f64..135e04f 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -66,11 +66,16 @@ gerrit_project: '{repos}' # Which jobs to run in the pipeline pipeline_build: true + pipeline_lint: true # in alphabetical order repos: - asn1c - cellmgr-ng + + - docker-playground: + pipeline_build: false + - libasn1c - libgtpnl - libosmo-abis @@ -300,7 +305,8 @@ su build -c 'make compile'; " - - dahdi-tools + - dahdi-tools: + pipeline_lint: false jobs: - 'gerrit-{repos}' @@ -314,6 +320,14 @@ name: PIPELINE_BUILD description: Enable the build job (runs contrib/jenkins.sh) default: '{obj:pipeline_build}' + - bool: + name: PIPELINE_LINT + description: Enable the lint job + default: '{obj:pipeline_lint}' + - string: + name: REPO_URL + description: Clone URL, to be passed to jobs started in the pipeline + default: '{obj:repos_url}' dsl: | pipeline {{ agent {{ label "osmocom-gerrit" }} @@ -338,11 +352,34 @@ }} }} }} + stage("Lint") {{ + when {{ + expression {{ params.PIPELINE_LINT }} + }} + steps {{ + script {{ + // Run the lint job for this repository and keep going on failure + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {{ + env.PIPELINE_LINT_PASSED = "0" + build job: 'gerrit-lint', parameters: [ + 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_PORT", value: "${{env.GERRIT_PORT}}"), + string(name: "GERRIT_REFSPEC", value: "${{env.GERRIT_REFSPEC}}"), + string(name: "GERRIT_REPO_URL", value: "${{env.REPO_URL}}"), + ] + env.PIPELINE_LINT_PASSED = "1" + }} + }} + }} + }} }} }} stage("Result") {{ steps {{ echo "PIPELINE_BUILD_PASSED=${{env.PIPELINE_BUILD_PASSED}}" + echo "PIPELINE_LINT_PASSED=${{env.PIPELINE_LINT_PASSED}}" }} }} // The end result is success if all started jobs were successful, -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/29670 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: I5f1340248cd116c5fa5134eee3fae50baf7ef851 Gerrit-Change-Number: 29670 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-ci[master]: obs: support Osmocom projects without prefix
by osmith 07 Oct '22

07 Oct '22
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/29672 ) Change subject: obs: support Osmocom projects without prefix ...................................................................... obs: support Osmocom projects without prefix Allow running build_srcpkg.py with "osmo_dia2gsup" instead of "erlang/osmo_dia2gsup", because that's how it gets passed along from jobs/gerrit-verifications.yml for the binary package build verifications. Related: OS#2385 Change-Id: I09304b219e7002495bd3fcce61bc68c34d5ffcd8 --- M scripts/obs/build_srcpkg.py M scripts/obs/lib/__init__.py M scripts/obs/update_obs_project.py 3 files changed, 12 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/72/29672/1 diff --git a/scripts/obs/build_srcpkg.py b/scripts/obs/build_srcpkg.py index 4c848b8..ad21927 100755 --- a/scripts/obs/build_srcpkg.py +++ b/scripts/obs/build_srcpkg.py @@ -37,7 +37,7 @@ lib.check_required_programs() if args.package: - lib.check_package(args.package) + args.package = lib.set_proper_package_name(args.package) lib.remove_temp() if args.meta: diff --git a/scripts/obs/lib/__init__.py b/scripts/obs/lib/__init__.py index 5979623..479c1c1 100644 --- a/scripts/obs/lib/__init__.py +++ b/scripts/obs/lib/__init__.py @@ -78,11 +78,16 @@ exit(1) -def check_package(package): +def set_proper_package_name(package): if package in lib.config.projects_osmocom: - return + return package if package in lib.config.projects_other: - return + return package + + # Add prefix to Osmocom package if missing + for package_cfg in lib.config.projects_osmocom: + if os.path.basename(package_cfg) == package: + return package_cfg print(f"ERROR: unknown package: {package}") print("See packages_osmocom and packages_other in obs/lib/config.py") diff --git a/scripts/obs/update_obs_project.py b/scripts/obs/update_obs_project.py index 43748e9..86cf40a 100755 --- a/scripts/obs/update_obs_project.py +++ b/scripts/obs/update_obs_project.py @@ -20,13 +20,13 @@ def parse_packages(packages_arg): + ret = [] if packages_arg: for package in packages_arg: - lib.check_package(package) - return packages_arg + ret += [lib.set_proper_package_name(package)] + return ret # Default to all - ret = [] ret += lib.config.projects_osmocom ret += lib.config.projects_other return ret -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/29672 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: I09304b219e7002495bd3fcce61bc68c34d5ffcd8 Gerrit-Change-Number: 29672 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-ci[master]: jobs/gerrit-verifications: write summary comment
by osmith 07 Oct '22

07 Oct '22
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/29671 ) Change subject: jobs/gerrit-verifications: write summary comment ...................................................................... jobs/gerrit-verifications: write summary comment Instead of having multiple mails from jenkins per submitted gerrit patch, only have one at the end of the pipeline that writes a summary with all relevant links and votes +1/-1 for verified. This also resolves the problem we had for a long time, that the link for the build job didn't directly point to the relevant console output. Instead it pointed to a matrix job that didn't have a direct link to the relevant job. The summary looks like this: 1 failed: [build] https://jenkins.osmocom.org/jenkins/job/gerrit-osmo-bsc-nat-build/a1=defaul… 3 passed: [rpm] https://jenkins.osmocom.org/jenkins/job/gerrit-binpkgs-rpm/5/consoleFull [deb] https://jenkins.osmocom.org/jenkins/job/gerrit-binpkgs-deb/5/consoleFull [lint] https://jenkins.osmocom.org/jenkins/job/gerrit-lint/11/consoleFull Build Failed Related: OS#2385 Change-Id: Idcab969e1b5ca4e0f1383bee8f36f2d1aac4f624 --- A jobs/gerrit-pipeline-result.yml M jobs/gerrit-verifications.yml A scripts/jenkins-gerrit/pipeline_summary.py A scripts/jenkins-gerrit/pipeline_summary_send.sh 4 files changed, 280 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/71/29671/1 diff --git a/jobs/gerrit-pipeline-result.yml b/jobs/gerrit-pipeline-result.yml new file mode 100644 index 0000000..ac54cee --- /dev/null +++ b/jobs/gerrit-pipeline-result.yml @@ -0,0 +1,68 @@ +# 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. + +- project: + name: gerrit-pipeline-result + jobs: + - 'gerrit-pipeline-result' + +- job: + name: 'gerrit-pipeline-result' + project-type: freestyle + node: osmocom-gerrit-debian10 || osmocom-gerrit-debian11 + retry-count: 3 # scm checkout + properties: + - build-discarder: + days-to-keep: 30 + num-to-keep: 120 + 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>. + </br></br> + Related issue: <a href="https://osmocom.org/issues/2385">OS#2385</a> + + parameters: + - string: + name: BRANCH_CI + description: | + osmo-ci.git branch + default: 'master' + - string: + name: GERRIT_BRANCH + description: set by gerrit verification pipeline job + - string: + name: GERRIT_HOST + description: set by gerrit verification pipeline job + - string: + name: GERRIT_PATCHSET_REVISION + description: set by gerrit verification pipeline job + - string: + name: GERRIT_PORT + description: set by gerrit verification pipeline job + - string: + name: GERRIT_REFSPEC + description: set by gerrit verification pipeline job + - string: + name: PIPELINE_BUILD_URL + description: set by gerrit verification pipeline job + + scm: + - git: + url: 'https://gerrit.osmocom.org/osmo-ci' + credentials-id: d5eda5e9-b59d-44ba-88d2-43473cb6e42d + branches: + - '$BRANCH_CI' + wipe-workspace: true + + builders: + - shell: 'cd scripts/jenkins-gerrit && ./pipeline_summary_send.sh' + + wrappers: + - ansicolor: + colormap: xterm + - ssh-agent-credentials: + users: + - d5eda5e9-b59d-44ba-88d2-43473cb6e42d + +# vim: expandtab tabstop=2 shiftwidth=2 diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 5235525..0e64ff3 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -458,6 +458,19 @@ 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 + // comment + vote to gerrit + script {{ + build job: 'gerrit-pipeline-result', parameters: [ + 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_PORT", value: "${{env.GERRIT_PORT}}"), + string(name: "GERRIT_REFSPEC", value: "${{env.GERRIT_REFSPEC}}"), + string(name: "PIPELINE_BUILD_URL", value: "${{env.BUILD_URL}}"), + ] + }} }} }} // The end result is success if all started jobs were successful, @@ -509,7 +522,7 @@ failed: false unstable: false notbuilt: false - silent: false + silent: true # comment + vote is done in gerrit-pipeline-result.yml escape-quotes: false no-name-and-email: false trigger-for-unreviewed-patches: true diff --git a/scripts/jenkins-gerrit/pipeline_summary.py b/scripts/jenkins-gerrit/pipeline_summary.py new file mode 100755 index 0000000..c12ad64 --- /dev/null +++ b/scripts/jenkins-gerrit/pipeline_summary.py @@ -0,0 +1,185 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright 2022 sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> +import argparse +import io +import json +import re +import urllib.request + +jenkins_url = "https://jenkins.osmocom.org" +re_start_build = re.compile("Starting building: gerrit-[a-zA-Z-_]* #[0-9]*") +re_result = re.compile("^PIPELINE_[A-Z]*_PASSED=[01]$") + +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.") + 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") + return parser.parse_args() + + +def stage_from_job_name(job_name): + if job_name == "gerrit-pipeline-result": + # The job that runs this script. Don't include it in the summary. + return None + if job_name == "gerrit-lint": + return "lint" + if job_name == "gerrit-binpkgs-deb": + return "deb" + if job_name == "gerrit-binpkgs-rpm": + return "rpm" + if job_name.endswith("-build"): + return "build" + assert False, f"couldn't figure out stage from job_name: {job_name}" + + +def parse_pipeline(build_url): + """ Parse started jobs and result from the pipeline log. + :returns: a dict that looks like: + {"build": {"name": "gerrit-osmo-bsc-nat-build", id=7, + "passed": True, "url": "https://..."}, + "lint": {...}, + "deb": {...}, + "rpm: {...}} """ + global re_start_build + global re_result + global jenkins_url + ret = {} + + url = f"{build_url}/consoleText" + with urllib.request.urlopen(url) as response: + for line in io.TextIOWrapper(response, encoding='utf-8'): + # Parse start build lines + for match in re_start_build.findall(line): + job_name = match.split(" ")[2] + job_id = int(match.split(" ")[3].replace("#", "")) + job_url = f"{jenkins_url}/jenkins/job/{job_name}/{job_id}" + stage = stage_from_job_name(job_name) + if stage: + ret[stage] = {"url": job_url, "name": job_name, "id": job_id} + + # Parse result lines + if re_result.match(line): + stage = line.split("_")[1].lower() + passed = line.split("=")[1].rstrip() == "1" + ret[stage]["passed"] = passed + + return ret + + +def parse_build_matrix(job): + """ Parse started jobs and result from the matrix of the build job. Usually + it is only one job, but for some projects we build for multiple arches + (x86_64, arm) or build multiple times with different configure flags. + :param job: "build" dict from parse_pipeline() + :returns: a list of jobs in the matrix, looks like: + [{"passed": True, "url": "https://..."}, ...] + """ + global jenkins_url + + ret = [] + url = f"{job['url']}/consoleFull" + with urllib.request.urlopen(url) as response: + for line in io.TextIOWrapper(response, encoding='utf-8'): + if " completed with result " in line: + url = line.split("<a href='", 1)[1].split("'", 1)[0] + url = f"{jenkins_url}{url}{job['id']}" + result = line.split(" completed with result ")[1].rstrip() + passed = result == "SUCCESS" + ret += [{"passed": passed, "url": url}] + return ret + + +def jobs_for_summary(pipeline, build_matrix): + """ Sort the jobs from pipeline and build matrix into passed/failed lists. + :returns: a dict that looks like: + {"passed": [{"stage": "build", "url": "https://..."}, ...], + "failed": [...]} """ + ret = {"passed": [], "failed": []} + + # Build errors are most interesting, display them first + for job in build_matrix: + category = "passed" if job["passed"] else "failed" + ret[category] += [{"stage": "build", "url": job["url"]}] + + # Hide the build matrix job (we show the jobs started by it instead), as + # long as there is at least one failed started job when the matrix failed + matrix_failed = "build" in pipeline and not pipeline["build"]["passed"] + show_build_matrix_job = matrix_failed and not ret["failed"] + + # Add jobs from the pipeline + for stage, job in pipeline.items(): + if stage == "build" and not show_build_matrix_job: + continue + category = "passed" if job["passed"] else "failed" + ret[category] += [{"stage": stage, "url": job["url"]}] + + return ret + + +def get_jobs_list_str(jobs): + ret = "" + for job in jobs: + ret += f" [{job['stage']}] {job['url']}/consoleFull\n" + return ret + + +def get_pipeline_summary(build_url): + """ 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", + "message": "...", + "labels": {"Code-Review": -1}} """ + summary = "" + pipeline = parse_pipeline(build_url) + + build_matrix = [] + if "build" in pipeline: + build_matrix = parse_build_matrix(pipeline["build"]) + + jobs = jobs_for_summary(pipeline, build_matrix) + + if jobs["failed"]: + summary += f"{len(jobs['failed'])} failed:\n" + summary += get_jobs_list_str(jobs["failed"]) + summary += "\n" + + summary += f"{len(jobs['passed'])} passed:\n" + summary += get_jobs_list_str(jobs["passed"]) + + if "lint" in pipeline and not pipeline["lint"]["passed"]: + summary += "\n" + summary += "Please fix the linting errors. More information:\n" + summary += "https://osmocom.org/projects/cellular-infrastructure/wiki/Linting\n" + + summary += "\n" + if jobs["failed"]: + summary += "Build Failed\n" + vote = -1 + else: + summary += "Build Successful\n" + vote = 1 + + # Reference: + # https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#… + return {"tag": "jenkins", + "message": summary, + "labels": {"Verified": vote}} + + +def main(): + args = parse_args() + summary = get_pipeline_summary(args.build_url) + + print(summary["message"]) + + if args.output: + with open(args.output, "w") as handle: + json.dump(summary, handle, indent=4) + +if __name__ == "__main__": + main() diff --git a/scripts/jenkins-gerrit/pipeline_summary_send.sh b/scripts/jenkins-gerrit/pipeline_summary_send.sh new file mode 100755 index 0000000..d52ad9f --- /dev/null +++ b/scripts/jenkins-gerrit/pipeline_summary_send.sh @@ -0,0 +1,13 @@ +#!/bin/sh -ex + +./pipeline_summary.py "$PIPELINE_BUILD_URL" -o gerrit_report.json + +ssh \ + -p "$GERRIT_PORT" \ + -l jenkins \ + "$GERRIT_HOST" \ + gerrit \ + review \ + "$GERRIT_PATCHSET_REVISION" \ + --json \ + < gerrit_report.json -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/29671 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: Idcab969e1b5ca4e0f1383bee8f36f2d1aac4f624 Gerrit-Change-Number: 29671 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-ci[master]: jobs/gerrit-verifications: wrap in pipeline job
by osmith 07 Oct '22

07 Oct '22
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/29668 ) Change subject: jobs/gerrit-verifications: wrap in pipeline job ...................................................................... jobs/gerrit-verifications: wrap in pipeline job Prepare to reduce the amount of comments sent to gerrit from jenkins and resulting mails. Instead of triggering the jobs directly from gerrit, trigger a pipeline job that calls the original job (now called gerrit-{repos}-build) and will in future patches call all other gerrit verification jobs too (linter, building deb/rpm packages). Change-Id: Ica208a5177739655cdd493d461da146d440cd542 --- M jobs/gerrit-verifications.yml 1 file changed, 113 insertions(+), 24 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/68/29668/1 diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 85c78b4..0a7ccac 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -1,5 +1,22 @@ # This file holds all gerrit build verifications https://jenkins.osmocom.org/jenkins/view/Jenkins-Gerrit/. -# One cane simply add a gerrit job by adding project's repository to repos list. +# One can simply add a gerrit job by adding project's repository to repos list. +# +# How it works: +# * Two jobs get added for each repository: +# gerrit-{repos} +# gerrit-{repos}-build +# * The gerrit-{repos} job is a pipeline that runs the gerrit-{repos}-build job +# and other jobs (linting, building debian packages, ...). The purpose of +# this job is to reduce the amount of comments (and resulting mails) in +# gerrit coming from the jenkins build verification. If each job ran +# separately without this pipeline job, they would each generate mails. +# The gerrit-{repos} job gets triggered from gerrit whenever a new patch to +# test is available. It passes the GERRIT_BRANCH and GERRIT_REFSPEC variables +# from gerrit to the jobs called in the pipeline. +# * The gerrit-{repos}-build job runs contrib/jenkins.sh in docker in a matrix. +# By default the matrix results in only one job, however for some projects we +# use the matrix to build for multiple CPU architectures (x86_64, arm) or use +# it to build multiple configurations of the same project (see osmo-bts). - project: name: gerrit @@ -285,9 +302,96 @@ jobs: - 'gerrit-{repos}' + - 'gerrit-{repos}-build' - job-template: name: 'gerrit-{repos}' + project-type: pipeline + dsl: | + pipeline {{ + agent {{ label "osmocom-gerrit" }} + stages {{ + stage("Verification") {{ + parallel {{ + stage("Build") {{ + steps {{ + script {{ + // Run the build job for this repository and keep going on failure + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {{ + env.PIPELINE_BUILD_PASSED = "0" + build job: 'gerrit-{repos}-build', parameters: [ + string(name: "GERRIT_BRANCH", value: "${{env.GERRIT_BRANCH}}"), + string(name: "GERRIT_REFSPEC", value: "${{env.GERRIT_REFSPEC}}"), + ] + env.PIPELINE_BUILD_PASSED = "1" + }} + }} + }} + }} + }} + }} + stage("Result") {{ + steps {{ + echo "PIPELINE_BUILD_PASSED=${{env.PIPELINE_BUILD_PASSED}}" + }} + }} + // The end result is success if all started jobs were successful, + // and failed otherwise. + }} + }} + disabled: '{obj:disabled}' + retry-count: 3 # scm checkout + properties: + - build-discarder: + days-to-keep: 30 + num-to-keep: 120 + artifact-days-to-keep: -1 + artifact-num-to-keep: -1 + description: | + Pipeline of CI for patches sent to + <a href="https://gerrit.osmocom.org/#/q/status:open+project:{repos}">{repos}</a> + <br/><br/> + <b>Auto-generated using Jenkins Job Builder. DO NOT EDIT MANUALLY!</b> + + scm: + - git: + url: '{obj:repos_url}' + credentials-id: d5eda5e9-b59d-44ba-88d2-43473cb6e42d + branches: + - $GERRIT_BRANCH + refspec: $GERRIT_REFSPEC + name: + choosing-strategy: gerrit + wipe-workspace: false + skip-tag: true + submodule: + recursive: true + + triggers: + - gerrit: + trigger-on: + - patchset-created-event: + exclude-drafts: true + exclude-no-code-change: true + projects: + - project-compare-type: 'PLAIN' + project-pattern: '{obj:gerrit_project}' + branches: + - branch-compare-type: 'ANT' + branch-pattern: '**' + skip-vote: + successful: false + failed: false + unstable: false + notbuilt: false + silent: false + escape-quotes: false + no-name-and-email: false + trigger-for-unreviewed-patches: true + server-name: gerrit.osmocom.org + +- job-template: + name: 'gerrit-{repos}-build' project-type: matrix node: '{node}' concurrent: '{obj:concurrent}' @@ -300,7 +404,7 @@ artifact-days-to-keep: -1 artifact-num-to-keep: -1 description: | - Pending gerrit code reviews of + Build job of CI for patches sent to <a href="https://gerrit.osmocom.org/#/q/status:open+project:{repos}">{repos}</a> <br/><br/> <b>Auto-generated using Jenkins Job Builder. DO NOT EDIT MANUALLY!</b> @@ -345,28 +449,13 @@ submodule: recursive: true - triggers: - - gerrit: - trigger-on: - - patchset-created-event: - exclude-drafts: true - exclude-no-code-change: true - projects: - - project-compare-type: 'PLAIN' - project-pattern: '{obj:gerrit_project}' - branches: - - branch-compare-type: 'ANT' - branch-pattern: '**' - skip-vote: - successful: false - failed: false - unstable: false - notbuilt: false - silent: false - escape-quotes: false - no-name-and-email: false - trigger-for-unreviewed-patches: true - server-name: gerrit.osmocom.org + parameters: + - string: + name: GERRIT_BRANCH + description: set by gerrit-{repos} job + - string: + name: GERRIT_REFSPEC + description: set by gerrit-{repos} job builders: - shell: '{obj:cmd}' -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/29668 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: Ica208a5177739655cdd493d461da146d440cd542 Gerrit-Change-Number: 29668 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-ci[master]: jobs/gerrit-verifications: add param to skip build
by osmith 07 Oct '22

07 Oct '22
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/29669 ) Change subject: jobs/gerrit-verifications: add param to skip build ...................................................................... jobs/gerrit-verifications: add param to skip build Prepare to unify the list of projects in jobs/gerrit-verifications.yml and jobs/gerrit-lint.yml by allowing to skip the build for some repositories (e.g. docker-playground is linted but we don't run a contrib/jenkins.sh there). Change-Id: Ie6264d44120798c0ecbcaf9c63d9b95f74ae9e37 --- M jobs/gerrit-verifications.yml 1 file changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/69/29669/1 diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 0a7ccac..26f7f64 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -64,6 +64,8 @@ gerrit_url: 'ssh://jenkins@gerrit.osmocom.org:29418' repos_url: '{gerrit_url}/{repos}' gerrit_project: '{repos}' + # Which jobs to run in the pipeline + pipeline_build: true # in alphabetical order repos: @@ -307,6 +309,11 @@ - job-template: name: 'gerrit-{repos}' project-type: pipeline + parameters: + - bool: + name: PIPELINE_BUILD + description: Enable the build job (runs contrib/jenkins.sh) + default: '{obj:pipeline_build}' dsl: | pipeline {{ agent {{ label "osmocom-gerrit" }} @@ -314,6 +321,9 @@ stage("Verification") {{ parallel {{ stage("Build") {{ + when {{ + expression {{ params.PIPELINE_BUILD }} + }} steps {{ script {{ // Run the build job for this repository and keep going on failure -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/29669 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: Ie6264d44120798c0ecbcaf9c63d9b95f74ae9e37 Gerrit-Change-Number: 29669 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • ...
  • 234
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.