Handle links properly when doing backend build operations

These are fixed from upstream 2.7 branch. Originally from pull
request#3284 in upstream:
  https://github.com/openSUSE/open-build-service/pull/3284/commitsSigned-off-by: default avatarAndrew Lee (李健秋) <ajqlee@debian.org>
parent dff667d0
From be9fc5f2f7c564392948f127faff6486225ba8e6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Geuken?= <bgeuken@suse.de>
Date: Mon, 26 Jun 2017 15:06:51 +0200
Subject: [PATCH] [dist] Use 2.7 packages for testing 2.7 branch in travis
---
dist/ci/obs_testsuite_travis_install.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Origin: upstream, https://github.com/openSUSE/open-build-service/pull/3284/commits
diff --git a/dist/ci/obs_testsuite_travis_install.sh b/dist/ci/obs_testsuite_travis_install.sh
index 85238dbd1..f9ecadaeb 100755
--- a/dist/ci/obs_testsuite_travis_install.sh
+++ b/dist/ci/obs_testsuite_travis_install.sh
@@ -8,7 +8,7 @@ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C5C219E7
# Install updates from our own repository
sudo chmod a+w /etc/apt/sources.list.d
-echo 'deb http://download.opensuse.org/repositories/OBS:/Server:/Unstable/xUbuntu_12.04 /' > /etc/apt/sources.list.d/opensuse.list
+echo 'deb http://download.opensuse.org/repositories/OBS:/Server:/2.7/xUbuntu_12.04 /' > /etc/apt/sources.list.d/opensuse.list
# We could use this to only update the package list from the OBS,
# but apprently this is not possible anymore. So we update all package lists.
--
2.11.0
commit d4bddd6df495cc436185961fb497dacedc046008
Author: Adrian Schröter <adrian@suse.de>
Date: Thu Jun 22 12:12:01 2017 +0200
[webui] Handle links properly when doing backend build operations
OBS wasn't properly handling linked projects when triggering rebuilds,
wipe binaries and abort build. This resulted in packages of linked
projects being aborted, wiped, rebuilt.
This fixes the falsey code.
Pair-programmed with @eduardoj and @bgeuken
Origin: upstream, https://github.com/openSUSE/open-build-service/pull/3284/commits
--- a/src/api/app/models/package.rb
+++ b/src/api/app/models/package.rb
@@ -1344,22 +1344,23 @@ class Package < ActiveRecord::Base
self
end
+ #### WARNING: these operations run in build object, not this package object
def rebuild(params)
- backend_build_command(:rebuild, params.slice(:package, :arch, :repository))
+ backend_build_command(:rebuild, params[:project], params.slice(:package, :arch, :repository))
end
def wipe_binaries(params)
- backend_build_command(:wipe, params.slice(:package, :arch, :repository))
+ backend_build_command(:wipe, params[:project], params.slice(:package, :arch, :repository))
end
def abort_build(params)
- backend_build_command(:abortbuild, params.slice(:package, :arch, :repository))
+ backend_build_command(:abortbuild, params[:project], params.slice(:package, :arch, :repository))
end
- def backend_build_command(command, params)
+ def backend_build_command(command, build_project, params)
begin
- Suse::Backend.post("/build/#{URI.escape(project.name)}?cmd=#{command}&#{params.to_query}", '')
- rescue ActiveXML::Transport::Error, Timeout::Error => e
+ Suse::Backend.post("/build/#{URI.escape(build_project)}?cmd=#{command}&#{params.to_query}", '')
+ rescue ActiveXML::Transport::Error, Timeout::Error, Project::WritePermissionError => e
errors.add(:base, e.message)
return false
end
......@@ -16,3 +16,5 @@ Do-not-ship-database.yml.patch
localgem.patch
disable-slp.patch
CVE-2017-5188.patch
handle-links-properly.patch
dist-Use-2.7-packages-for-testing.patch
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment