TT#43813 support changes on build_deps in the middle of a release

* added mr8.1.2 and data to test it
* don't add project as failed for piuparts job with FAILURE status

Change-Id: I95a8bdbf5a73b4f353d99bc172f879a90870e1f0
changes/79/38379/1
Victor Seva 5 years ago
parent 16038c203c
commit 9ef5a238a3

@ -0,0 +1,286 @@
distris:
- release-mr8.1
- buster
debian_release: buster
release-mr8.1: &packages
# TT#32916 TT#44119 bcg729 for G.729 codec support for rtpengine
- bcg729: 1.0.4+git20180222-0.1~bpo10+1
# TT#44190 needed by ngcp-panel
- grafana: 5.4.3
# TT#59085 needed by csta-testsuite, not available in buster (or sid)
- libanyevent-connector-perl: 0.03-1~bpo10+1
- libanyevent-websocket-client-perl: 0.53-0.1sipwise1~bpo10+1
- libprotocol-websocket-perl: 0.26-1~bpo10+1
- liburi-ws-perl: 0.03-1~bpo10+1
# TT#69900 needed by ngcp-panel, not available in buster (or sid)
- libcatalyst-plugin-session-store-redis-perl: 0.09-0.1sipwise1~bpo10+1
# TT#69950 needed by bulk-processor, not available in buster (or sid)
- libexcel-reader-xlsx-perl: 0.00~git20161017.3b576a55-0.1sipwise1~bpo10+1
# MT#13097 + TT#11775 + TT#44117 needed by libinewrate
- libactivemq-cpp: 3.9.4-0.1~bpo10+1sipwise1
# TT#66753 needed by sems*, version in buster is too old
- log4cplus: 2.0.4-0.1sipwise1~bpo10+1
# TT#44184 needed by platform
- mariadb-connector-odbc: 3.1.1-1sipwise1~bpo10+1
# TT#44155 needed by sems*, not available in Buster at the moment
# TT#55301 does not build with latest mariadb libraries.
- mysql++: 3.2.2+pristine-2sipwise1~bpo10+1
# MT#19499 local robustness patches
- net-snmp: 5.7.3+dfsg-5sipwise1~bpo10+1
# TT#2398 influxdb + dependencies
- golang-github-influxdata-influxql: 0.0~git20180925.1cbfca8-0.1sipwise1~bpo10+1
# TT#28100 needed by platform
# + Packaging updates: R³:no.
# + Default to use the unix socket if available.
- influxdb: 1.6.4-1+sipwise1~bpo10+1
# TT#44187 needed by platform
# + Packaging updates: R³:no, Standards-Version=4.2.1, debhelper=11, © years.
# + Version should have been -0.1sipwiseN from the start.
- influxdb-relay: 0.0~20161114.0.adaa2ea-1sipwise2~bpo10+1
# TT#44188 needed by platform
- telegraf: 1.7.4-0.1sipwise1~bpo10+4
# TT#44918 Needed for Debian/buster PRO/Carrier
- ngcp-pxe-boot: 0.6.3.1+0~sipwise20191022
# TT#59330 rebuild of package pulled from non-free
- snmp-mibs-downloader: 1.2~bpo10+1
# TT#62202 Needed for Debian/buster PRO/Carrier
- monit: 5.25.2-3+deb10u1
# TT#66582 The version in Debian/buster does not work for us (yet)
- prosody: 0.9.12-2+deb9u2+bpo10+1
buster: *packages
repository-verify:
white-list: []
jenkins-jobs:
ignore:
- heartbeat-binaries
- heartbeat-tap-test
build_deps:
data-hal:
- ngcp-panel
ngcp-schema:
- ngcp-panel
libinewrate:
- sems-pbx
libswrate:
- kamailio
- sems-pbx
libtcap:
- kamailio
- lnpd
sipwise-base:
- ngcp-panel
- ngcp-schema
check-tools:
- snmp-agent
templates:
- bootenv # libngcp-template-perl needed on Dockerfile
projects:
- asterisk-voicemail
- backup-tools
- bulk-processor
- bulk-processor-projects
- bootenv
- cdr-exporter
- cfg-schema
- check-tools
- cleanup-tools
- cloudpbx-sources
- comx-fileshare-service
- csta-testsuite
- data-hal
- db-schema
- deployment-iso
- dhtest
- documentation
- faxserver
- heartbeat
- installer
- janus-admin
- janus-client
- kamailio
- kamailio-config-tests
- keyring
- klish
- libinewrate
- libswrate
- libtcap
- license-client
- lnpd
- lua-ngcp-kamailio
- mediator
- megacli
- metapackages
- monitoring-tools
- ngcp-api-tools
- ngcp-csc-ui
- ngcp-exporter
- ngcp-fauditd
- ngcp-inventory
- ngcp-logfs
- ngcp-klish-config
- ngcp-panel
- ngcp-prompts
- ngcp-rtcengine
- ngcp-schema
- ngcp-status
- ngcp-sudo-plugin
- ngcp-support
- ngcp-user-framework
- ngcpcfg
- ngcpcfg-api
- ngcpcfg-ha
- ngrep-sip
- prosody
- pushd
- rate-o-mat
- reminder
- rtpengine
- sems
- sems-ha
- sems-modules
- sems-pbx
- sipwise-base
- snmp-agent
- system-tests
- system-tools
- templates
- upgrade
- vmnotify
- voisniff-ng
- websocket
release_mirror:
common:
copysrc:
- kamailio-config-tests
- klish
- libdata-hal-perl
- libsipwise-base-perl
- lua-ngcp-kamailio
- ngcp-api-tools
- ngcp-asterisk-voicemail
- ngcp-bulk-processor
- ngcp-cdr-exporter
- ngcp-cfg-schema
- ngcp-check-tools
- ngcp-cleanup-tools
- ngcp-csc-ui
- ngcp-db-schema
- ngcp-deployment-iso
- ngcp-dhtest
- ngcp-handbook
- ngcp-installer
- ngcp-kamailio
- ngcp-keyring
- ngcp-klish-config
- ngcp-libswrate
- ngcp-libtcap
- ngcp-license-client
- ngcp-mediator
- ngcp-metapackages
- ngcp-ngcpcfg
- ngcp-panel
- ngcp-prompts
- ngcp-prosody-modules
- ngcp-rate-o-mat
- ngcp-reminder
- ngcp-rtpengine
- ngcp-schema
- ngcp-status
- ngcp-support
- ngcp-system-tests
- ngcp-system-tools
- ngcp-templates
- ngcp-upgrade
- ngcp-vmnotify
- ngrep-sip
remove:
source:
- ngcp-handbook
- ngcp-installer
- ngcp-libswrate
- ngcp-license-client
- ngcp-prompts
- ngcp-templates
- ngcp-upgrade
binary:
- ngcp-handbook-internal
- ngcp-handbook-pdf-internal
matched: []
ce:
copysrc:
- ngcp-sems
remove:
source: []
binary:
- ngcp-ngcpcfg-testsuite
matched:
- '*-carrier'
- '*-pro'
- '*-pro-dbgsym'
pro:
backports:
# cloudpbx firmwares(PRO ONLY), commented are empty
#- ngcp-cloudpbx-firmwares-audiocodes: '1.0.0.0'
- ngcp-cloudpbx-firmwares-ale: '1.0.0.1'
- ngcp-cloudpbx-firmwares-cisco: '1.0.0.0'
- ngcp-cloudpbx-firmwares-grandstream: '1.0.0.1'
- ngcp-cloudpbx-firmwares-innovaphone: '1.0.0.0'
- ngcp-cloudpbx-firmwares-panasonic: '1.0.0.2'
- ngcp-cloudpbx-firmwares-polycom: '1.0.0.1'
#- ngcp-cloudpbx-firmwares-snom: '1.0.0.0'
- ngcp-cloudpbx-firmwares-yealink: '1.0.0.1'
copysrc:
- heartbeat-2
- janus-admin
- janus-client
- megacli
- ngcp-backup-tools
- ngcp-bootenv
- ngcp-bulk-processor-projects
- ngcp-cloudpbx-devices
- ngcp-comx-fileshare-service
- ngcp-csta-testsuite
- ngcp-exporter
- ngcp-fauditd
- ngcp-faxserver
- ngcp-inventory
- ngcp-libinewrate
- ngcp-lnpd
- ngcp-logfs
- ngcp-monitoring-tools
- ngcp-ngcpcfg-ha
- ngcp-pushd
- ngcp-rtcengine
- ngcp-sems-modules
- ngcp-sems-pbx
- ngcp-snmp
- ngcp-sudo-plugin
- ngcp-user-framework
- ngcp-voisniff
- ngcp-websocket
- ngcpcfg-api
remove:
binary: []
source:
- ngcp-cloudpbx-devices
- ngcp-csta-testsuite
- ngcp-fauditd
- ngcp-logfs
- ngcp-monitoring-tools
- ngcp-ngcpcfg-ha
- ngcp-pushd
- ngcp-sems-modules
- ngcp-sems-pbx
- ngcp-sudo-plugin
- ngcp-user-framework
- ngcp-voisniff
- ngcpcfg-api
matched:
- '*ngcp*-ce'
- '*ngcp*-ce-*'

File diff suppressed because it is too large Load Diff

@ -150,9 +150,11 @@ class BuildRelease(models.Model):
return True
def append_built(self, jbi):
jobname = jbi.jobname
if jbi.result == "FAILURE":
if jobname.endswith("-piuparts"):
return False
return self._append_falied(jbi.projectname)
jobname = jbi.jobname
if jobname.endswith("-repos") or jobname in settings.RELEASE_JOBS:
if jbi.result in ["SUCCESS", "UNSTABLE"]:
return self._append_built(jbi.projectname)
@ -168,19 +170,17 @@ class BuildRelease(models.Model):
if self.built_projects is None:
return self.build_deps[0][0]
built_len = len(self.built_projects)
if built_len == len(self.projects):
release_jobs_len = len(",".join(settings.RELEASE_JOBS))
if built_len == release_jobs_len + 1 + len(self.projects):
return
built_list = self.built_projects_list
build_deps_size = len(",".join(self.config.build_deps.keys()))
if built_len < build_deps_size:
for grp in self.build_deps:
for prj in grp:
if prj not in built_list:
return prj
else:
for prj in self.projects_list:
for grp in self.build_deps:
for prj in grp:
if prj not in built_list:
return prj
for prj in self.projects_list:
if prj not in built_list:
return prj
@property
def next(self):
@ -191,7 +191,9 @@ class BuildRelease(models.Model):
res = self._next()
if res is not None:
if res in failed_projects:
logger.info("project: %s marked as failed, stop sending jobs")
logger.error(
"project: %s marked as failed, stop sending jobs", res
)
else:
return res

@ -145,6 +145,16 @@ class BuildReleaseStepsTest(TestCase):
self.jbi = MagicMock()
self.jbi.result = "SUCCESS"
def test_append_built_fist(self):
self.br.built_projects = "release-copy-debs-yml"
self.jbi.projectname = "data-hal"
self.jbi.jobname = "data-hal-repos"
self.assertTrue(self.br.append_built(self.jbi))
self.assertEqual(
self.br.built_projects, "release-copy-debs-yml,data-hal"
)
self.assertEqual(self.br.pool_size, 0)
def test_append_built_empty(self):
self.jbi.projectname = "data-hal"
self.jbi.jobname = "data-hal-repos"
@ -207,6 +217,16 @@ class BuildReleaseStepsTest(TestCase):
self.assertEqual(self.br.failed_projects, "libinewrate")
self.assertEqual(self.br.pool_size, 1)
def test_append_built_fail_piuparts(self):
self.br.built_projects = "data-hal,libinewrate"
self.jbi.projectname = "libinewrate"
self.jbi.jobname = "libinewrate-piuparts"
self.jbi.result = "FAILURE"
self.assertFalse(self.br.append_built(self.jbi))
self.assertEqual(self.br.built_projects, "data-hal,libinewrate")
self.assertIsNone(self.br.failed_projects)
self.assertEqual(self.br.pool_size, 1)
def test_append_built_release_job_fail(self):
self.jbi.projectname = "release-copy-debs-yml"
self.jbi.jobname = "release-copy-debs-yml"
@ -253,14 +273,25 @@ class BuildReleaseStepsTest(TestCase):
self.assertEqual(self.br.next, "asterisk-voicemail")
def test_next_last(self):
self.br.built_projects = ",".join(self.br.projects_list[:-1])
pl = self.br.projects_list[:-1]
pl.insert(0, "release-copy-debs-yml")
self.br.built_projects = ",".join(pl)
self.assertTrue(
self.br.built_projects.startswith("release-copy-debs-yml,")
)
last_projectname = self.br.projects_list[-2]
self.assertTrue(
self.br.built_projects.endswith(",{}".format(last_projectname))
)
self.jbi.projectname = self.br.projects_list[-1]
self.jbi.jobname = "{}-repos".format(self.jbi.projectname)
self.assertTrue(self.br.append_built(self.jbi))
self.assertIsNone(self.br.next)
def test_next_stop(self):
self.br.built_projects = self.br.projects
self.br.built_projects = "release-copy-debs-yml,{}".format(
self.br.projects
)
self.assertIsNone(self.br.next)

@ -0,0 +1,56 @@
# Copyright (C) 2017 The Sipwise Team - http://sipwise.com
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
from copy import deepcopy
from unittest.mock import MagicMock
from django.test import override_settings
from django.test import TestCase
from build.models import BuildRelease
@override_settings(DEBUG=True)
class BuildReleaseStepsTest(TestCase):
fixtures = [
"test_change_build_deps",
]
def setUp(self):
self.br = BuildRelease.objects.get(pk=1)
self.built_projects = deepcopy(self.br.built_projects)
self.jbi = MagicMock()
self.jbi.result = "SUCCESS"
def test_stopped(self):
self.test_append_built()
self.assertIsNone(self.br.next)
def test_append_built(self):
self.jbi.projectname = "templates"
self.jbi.jobname = "templates-repos"
self.assertTrue(self.br.append_built(self.jbi))
self.built_projects += ",templates"
self.assertEqual(self.br.built_projects, self.built_projects)
self.assertEqual(self.br.pool_size, 0)
def test_next_build_deps_changed(self):
self.assertEqual(self.br.next, "templates")
def test_next_retrigger(self):
self.test_append_built()
self.jbi.projectname = "bootenv"
self.jbi.jobname = "{}-repos".format(self.jbi.projectname)
self.assertTrue(self.br.append_built(self.jbi))
self.assertIsNotNone(self.br.next)

@ -79,6 +79,7 @@ class ReleaseConfigTestCase(SimpleTestCase):
def test_supported_releases(self):
supported = [
"trunk",
"mr8.1.2",
"mr8.1",
"mr7.5.3",
"mr7.5.2",

Loading…
Cancel
Save