[copr] master: Automatic commit of package [copr-selinux] release [1.35-1]. (fd02b99)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit fd02b99a0cde3fb7fad3c6d4888912cc71aba4ea
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Oct 22 16:52:40 2014 +0200
Automatic commit of package [copr-selinux] release [1.35-1].
>---------------------------------------------------------------
rel-eng/packages/copr-selinux | 2 +-
selinux/copr-selinux.spec | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/rel-eng/packages/copr-selinux b/rel-eng/packages/copr-selinux
index 1cdd8d5..e2e44df 100644
--- a/rel-eng/packages/copr-selinux
+++ b/rel-eng/packages/copr-selinux
@@ -1 +1 @@
-1.34-1 selinux/
+1.35-1 selinux/
diff --git a/selinux/copr-selinux.spec b/selinux/copr-selinux.spec
index 11afd6a..25120c3 100644
--- a/selinux/copr-selinux.spec
+++ b/selinux/copr-selinux.spec
@@ -8,7 +8,7 @@
%{!?_selinux_policy_version: %global _selinux_policy_version %(sed -e 's,.*selinux-policy-\\([^/]*\\)/.*,\\1,' %{_datadir}/selinux/devel/policyhelp 2>/dev/null)}
Name: copr-selinux
-Version: 1.34
+Version: 1.35
Release: 1%{?dist}
Summary: SELinux module for COPR
@@ -111,6 +111,9 @@ fi
%dir %{_datadir}/selinux/mls
%changelog
+* Wed Oct 22 2014 Miroslav Suchý <msuchy(a)redhat.com> 1.35-1
+- remove old changelogs
+
* Mon Oct 20 2014 Miroslav Suchý <msuchy(a)redhat.com> 1.34-1
- 1077795 - co-own /usr/share/selinux/mls
9 years, 7 months
[copr] master: remove old changelogs (b5ca7da)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit b5ca7da804bea994d96ed5a4e6ba7aafb30e97b2
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Oct 22 16:38:34 2014 +0200
remove old changelogs
>---------------------------------------------------------------
selinux/copr-selinux.spec | 442 ---------------------------------------------
1 files changed, 0 insertions(+), 442 deletions(-)
diff --git a/selinux/copr-selinux.spec b/selinux/copr-selinux.spec
index c80b8ba..11afd6a 100644
--- a/selinux/copr-selinux.spec
+++ b/selinux/copr-selinux.spec
@@ -125,445 +125,3 @@ fi
* Tue Mar 18 2014 Miroslav Suchý <msuchy(a)redhat.com> 1.30-1
- finish move selinux into separate package
-
-* Tue Mar 18 2014 Miroslav Suchý <msuchy(a)redhat.com> 1.29-1
-- new package built with tito
-
-* Thu Feb 27 2014 Miroslav Suchý <msuchy(a)redhat.com> 1.28-1
-- [backend] - pass lock to Actions
-
-* Wed Feb 26 2014 Miroslav Suchý <msuchy(a)redhat.com> 1.27-1
-- [frontend] update to jquery 1.11.0
-- [fronted] link username to fas
-- [cli] allow to build into projects of other users
-- [backend] do not create repo in destdir
-- [backend] ensure that only one createrepo is running at the same time
-- [cli] allow to get data from sent build
-- temporary workaround for BZ 1065251
-- Chroot details API now uses GET instead of POST
-- when deleting/canceling task, go to same page
-- add copr modification to web api
-- 1063311 - admin should be able to delete task
-- [frontend] Stray end tag h4.
-- [frontend] another s/coprs/projects/ rename
-- [frontend] provide info about last successfull build
-- [spec] rhel5 needs group definition even in subpackage
-- [frontend] move 'you agree' text to dd
-- [frontend] add margin to chroots-set
-- [frontend] add margin to field label
-- [frontend] put disclaimer to paragraph tags
-- [frontend] use black font color
-- [frontend] use default filter instead of *_not_filled
-- [frontend] use markdown template filter
-- [frontend] use isdigit instead of is_int
-- [frontend] move Serializer to helpers
-- [frontend] fix coding style and py3 compatibility
-- [cli] fix coding style and py3 compatibility
-- [backend] fix coding style and py3 compatibility
-
-* Tue Jan 28 2014 Miroslav Suchý <miroslav(a)suchy.cz> 1.26-1
-- lower testing date
-- move localized_time into filters
-- [frontend] update user data after login
-- [frontend] use iso-8601 date
-
-* Mon Jan 27 2014 Miroslav Suchý <msuchy(a)redhat.com> 1.25-1
-- 1044085 - move timezone modification out of template and make it actually
- work
-- clean up temp data if any
-- [db] timezone can be nullable
-- [frontend] actually save the timezone to model
-- fix colision of revision id
-- 1044085 - frontend: display time in user timezone
-- [frontend] rebuild stuck task
-- disable test on i386
-- use experimental createrepo_c to get rid of lock on temp files
-- [frontend] - do not throw ISE when build_id is malformed
-- [tests] add test for BuildLogic.add
-- [tests] add test for build resubmission
-- [frontend] permission checking is done in BuildLogic.add
-- [frontend] remove BuildLogic.new, use BL.add only
-- [api] fix validation error handling
-- [cli] fix initial_pkgs and repos not sent to backend
-- [frontend] fix BuildsLogic.new not assigning copr to build
-- [frontend] allow resubmitting builds from monitor
-- [frontend] allow GET on repeat_build
-- [frontend] 1050904 - monitor shows not submitted chroots
-- [frontend] rename active_mock_chroots to active_chroots
-- [frontend] rename MockChroot.chroot_name to .name
-- [frontend] 1054474 - drop Copr.build_count nonsense
-- [tests] fix https and repo generation
-- [tests] return exit code from manage.py test
-- 1054472 - Fix deleting multiple SRPMs
-- [spec] tighten acl on copr-be.conf
-- [backend] - add missing import
-- 1054082 - general: encode to utf8 if err in mimetext
-- [backend] lock log file before writing
-- 1055594 - mockremote: always unquote pkg url
-- 1054086 - change vendor tag
-- mockremote: rawhide instead of $releasever in repos when in rawhide chroot
-- 1055499 - do not replace version with $releasever on rawhide
-- 1055119 - do not propagate https until it is properly signed
-- fix spellings on chroot edit page
-- 1054341 - be more verbose about allowed licenses
-- 1054594 - temporary disable https in repo file
-
-* Thu Jan 16 2014 Miroslav Suchý <msuchy(a)redhat.com> 1.24-1
-- add BR python-markdown
-- [fronted] don't add description to .repo files
-- [spec] fix with_tests conditional
-- add build deletion
-- 1044158 - do not require fas username prior to login
-- replace http with https in copr-cli and in generated repo file
-- [cli] UX changes - explicitely state that pkgs is URL
-- 1053142 - only build copr-cli on el6
-- [frontend] correctly handle mangled chroot
-- [frontend] do not traceback when user malform url
-- [frontend] change default description and instructions to sound more
- dangerously
-- 1052075 - do not set chroots on repeated build
-- 1052071 - do not throw ISE when copr does not exist
-
-* Mon Jan 13 2014 Miroslav Suchý <msuchy(a)redhat.com> 1.23-1
-- [backend] rhel7-beta do not have comps
-- 1052073 - correctly parse malformed chroot
-
-* Fri Jan 10 2014 Miroslav Suchý <msuchy(a)redhat.com> 1.22-1
-- [backend] if we could not spawn VM, wait a moment and try again
-- [backend] use createrepo_c instead of createrepo
-- 1050952 - check if copr_url exist in config
-- [frontend] replace newlines in description by space in repo file
-
-* Wed Jan 08 2014 Miroslav Suchý <msuchy(a)redhat.com> 1.21-1
-- 1049460 - correct error message
-- [cron] manualy clean /var/tmp after createrepo
-
-* Wed Jan 08 2014 Miroslav Suchý <msuchy(a)redhat.com> 1.20-1
-- [cli] no need to set const with action=store_true
-- [cli] code cleanup
-- 1049460 - print nice error when projects does not exist
-- 1049392 - require python-setuptools
-- [backend] add --verbose to log to stderr
-- [backend] handle KeyboardInterrupt without tons of tracebacks
-- 1048508 - fix links at projects lists
-- [backend] in case of error the output is in e.output
-- [selinux] allow httpd to search
-- [backend] set number of worker in name of process
-- [logrotate] rotate every week unconditionally
-- [backend] do not traceback if jobfile is mangled
-- [backend] print error messages to stderr
-- [cli] do not require additional arguments for --nowait
-- [backend] replace procname with setproctitle
-- [cli] use copr.fedoraproject.org as default url
-- [frontend] show monitor even if last build have been canceled
-- [backend] call correct function
-- [cli] print errors to stderr
-- 1044136 - do not print TB if config in mangled
-- 1044165 - Provide login and token information in the same form as entered to
- ~/.config-copr
-- [frontend] code cleanup
-- [frontend] move rendering of .repo file to helpers
-- 1043649 - in case of Fedora use $releasever in repo file
-- [frontend] condition should be in reverse
-
-* Mon Dec 16 2013 Miroslav Suchý <msuchy(a)redhat.com> 1.19-1
-- [backend] log real cause if ansible crash
-- [frontend] try again if whoosh does not get lock
-- [backend] if frontend does not respond, repeat
-- print yum repos nicely
-- Bump the copr-cli release to 0.2.0 with all the changes made
-- Refer to the man page for more information about the configuration file for
- copr-cli
-- Rework the layout of the list command
-- Fix parsing the copr_url from the configuration file
-- [backend] run createrepo as copr user
-- 1040615 - wrap lines with long URL
-
-* Wed Dec 11 2013 Miroslav Suchý <msuchy(a)redhat.com> 1.18-1
-- [frontend] inicialize variable
-
-* Wed Dec 11 2013 Miroslav Suchý <msuchy(a)redhat.com> 1.17-1
-- [frontend] fix latest build variable overwrite
-
-* Wed Dec 11 2013 Miroslav Suchý <msuchy(a)redhat.com> 1.16-1
-- [backend] store jobs in id-chroot.json file
-- [frontend] handle unknown build/chroot status
-- use newstyle ansible variables
-
-* Tue Dec 10 2013 Miroslav Suchý <msuchy(a)redhat.com> 1.15-1
-- [frontend] smarter package name parsing
-- [frontend] extend range to allow 0
-- handle default timeout on backend
-- initial support for SCL
-- [backend] create word readable files in result directory
-- [backend] print tracebacks
-- [frontend] monitor: display only pkg name w/o version
-- [doc] update api docs
-- [doc] update copr-cli manpage
-- [cli] list only name, description and instructions
-- [cli] add support for build status & build monitor
-- [frontend] add build status to API
-- [playbook] do not overwrite mockchain
-- [backend] add spece between options
-- [backend] pass mock options correctly
-- [frontend] support markdown in description and instructions
-- [backend] Add macros to mockchain define arguments
-- [backend] Pass copr username and project name to MockRemote
-- [backend] Handle additional macro specification in MockRemote
-- [frontend] monitor: show results per package
-- [frontend] add favicon
-- [backend] quote strings before passing to mockchain
-- send chroots with via callback to frontend
-- [cli] change cli to new api call
-- enhance API documentation
-- add yum_repos to coprs/user API call
-- [frontend] provide link to description of allowed content
-- [backend] we pass just one chroot
-- [backend] - variable play is not defined
-- if createrepo fail, run it again
-- [cron] fix syntax error
-- [man] state that --chroot for create command is required
-- [spec] enable tests
-- [howto] add note about upgrading db schema
-- [frontend]: add copr monitor
-- [tests]: replace test_allowed_one
-- [tests]: fix for BuildChroots & new backend view
-- [frontend] rewrite backend view to use Build <-> Chroot relation
-- [frontend] add Build <-> Chroot relation
-- 1030493 - [cli] check that at least one chroot is entered
-- [frontend] typo
-- fixup! [tests]: fix test_build_logic to handle BuildChroot
-- fixup! [frontend] add ActionsLogic
-- [tests]: fix test_build_logic to handle BuildChroot
-- [spec] enable/disable test using variable
-- add migration script - add table build_chroot
-- [frontend] skip legal-flag actions when dumping waiting actions
-- [frontend] rewrite backend view to use Build <-> Chroot relation
-- [frontend] add ActionsLogic
-- [frontend] create BuildChroot objects on new build
-- [frontend] add Build <-> Chroot relation
-- [frontend] add StatusEnum
-- [frontend] fix name -> coprname typo
-- [frontend] remove unused imports
-- [frontend] add missing json import
-- [backend] rework ip address extraction
-- ownership of /etc/copr should be just normal
-- [backend] - wrap up returning action in "action" blok
-- [backend] rename backend api url
-- [backend] handle "rename" action
-- [backend] handle "delete" action
-- base handling of actions
-- move callback to frontend to separate object
-- secure waiting_actions with password
-- pick only individual builds
-- make address, where we send legal flags, configurable
-- send email to root after legal flag have been raised
-
-* Fri Nov 08 2013 Miroslav Suchý <msuchy(a)redhat.com> 1.14-1
-- 1028235 - add disclaimer about repos
-- fix pagination
-- fix one failing test
-
-* Wed Nov 06 2013 Miroslav Suchý <msuchy(a)redhat.com> 1.13-1
-- suggest correct name of repo file
-- we could not use releasever macro
-- no need to capitalize Projects
-- another s/copr/project
-- add link to header for sign-in
-- fix failing tests
-- UX - let textarea will full widht of box
-- UX - make background of hovered builds darker
-- generate yum repo for each chroot of copr
-- align table header same way as ordinary rows
-- enable resulting repo and disable gpgchecks
-
-* Mon Nov 04 2013 Miroslav Suchý <msuchy(a)redhat.com> 1.12-1
-- do not send parameters when we neither need them nor use them
-- authenticate using api login, not using username
-- disable editing name of project
-- Add commented out WTF_CSRF_ENABLED = True to configs
-- Use new session for each test
-- fix test_coprs_general failures
-- fix test_coprs_builds failures
-- Add WTF_CSRF_ENABLED = False to unit test config
-- PEP8 fixes
-- Fix compatibility with wtforms 0.9
-- typo s/submited/submitted/
-- UX - show details of build only after click
-- add link to FAQ to footer
-- UX - add placeholders
-- UX - add asterisk to required fields
-- dynamicly generate url for home
-- add footer
-
-* Sat Oct 26 2013 Miroslav Suchý <msuchy(a)redhat.com> 1.11-1
-- catch IOError from libravatar if there is no network
-
-* Fri Oct 25 2013 Miroslav Suchý <msuchy(a)redhat.com> 1.10-1
-- do not normalize url
-- specify full prefix of http
-- execute playbook using /usr/bin/ansible-playbook
-- use ssh transport
-- check after connection is made
-- add notes about debuging mockremote
-- clean up instance even when worker fails
-- normalize paths before using
-- do not use exception variable
-- operator should be preceded and followed by space
-- remove trailing whitespace
-- convert comment to docstring
-- use ssh transport
-- do not create new ansible connection, reuse self.conn
-- run copr-be.py as copr
-- s/Copr/Project/ where we use copr in meaning of projects
-- number will link to those coprs, to which it refers
-- run log and jobgrab as copr user
-- log event to log file
-- convert comment into docstring
-- use unbufferred output for copr-be.py
-- hint how to set ec2 variables
-- document sleeptime
-- document copr_url for copr-cli
-- document how to set api key for copr-cli
-- do not create list of list
-- document SECRET_KEY variable
-- make note how to become admin
-- instruct people to install selinux with frontend
-
-* Thu Oct 03 2013 Miroslav Suchý <msuchy(a)redhat.com> 1.9-1
-- prune old builds
-- require python-decorator
-- remove requirements.txt
-- move TODO-backend to our wiki
-- create pid file in /var/run/copr-backend
-- add backend service file for systemd
-- remove daemonize option in config
-- use python logging
-- create pid file in /var/run by default
-- do not create destdir
-- use daemon module instead of home brew function
-- fix default location of copr-be.conf
-- 2 tests fixed, one still failing
-- fix failing test test_fail_on_missing_dash
-- fixing test_fail_on_nonexistent_copr test
-- run frontend unit tests when building package
-- Adjust URLs in the unit-tests to their new structure
-- Adjust the CLI to call the adjuste endpoint of the API
-- Adjust API endpoint to reflects the UI endpoints in their url structure
-- First pass at adding fedmsg hooks.
-
-* Tue Sep 24 2013 Miroslav Suchý <msuchy(a)redhat.com> 1.8-1
-- 1008532 - require python2-devel
-- add note about ssh keys to copr-setup.txt
-- set home of copr user to system default
-
-* Mon Sep 23 2013 Miroslav Suchý <msuchy(a)redhat.com> 1.7-1
-- 1008532 - backend should own _pkgdocdir
-- 1008532 - backend should owns /etc/copr as well
-- 1008532 - require logrotate
-- 1008532 - do not distribute empty copr.if
-- 1008532 - use %%{?_smp_mflags} macro with make
-- move jobsdir to /var/lib/copr/jobs
-- correct playbooks path
-- selinux with enforce can be used for frontend
-
-* Wed Sep 18 2013 Miroslav Suchý <msuchy(a)redhat.com> 1.6-1
-- add BR python-devel
-- generate selinux type for /var/lib/copr and /var/log/copr
-- clean up backend setup instructions
-- initial selinux subpackage
-
-* Mon Sep 16 2013 Miroslav Suchý <msuchy(a)redhat.com> 1.5-1
-- 1008532 - use __python2 instead of __python
-- 1008532 - do not mark man page as doc
-- 1008532 - preserve timestamp
-
-* Mon Sep 16 2013 Miroslav Suchý <msuchy(a)redhat.com> 1.4-1
-- add logrotate file
-
-* Mon Sep 16 2013 Miroslav Suchý <msuchy(a)redhat.com> 1.3-1
-- be clear how we create tgz
-
-* Mon Sep 16 2013 Miroslav Suchý <msuchy(a)redhat.com> 1.2-1
-- fix typo
-- move frontend data into /var/lib/copr
-- no need to own /usr/share/copr by copr-fe
-- mark application as executable
-- coprs_frontend does not need to be owned by copr-fe
-- add executable attribute to copr-be.py
-- remove shebang from dispatcher.py
-- squeeze description into 80 chars
-- fix typo
-- frontend need argparse too
-- move results into /var/lib/copr/public_html
-- name of dir is just copr-%%version
-- Remove un-necessary quote that breaks the tests
-- Adjust unit-tests to the new urls
-- Update the URL to be based upon a /user/copr/<action> structure
-- comment config copr-be.conf and add defaults
-- put examples of builderpb.yml and terminatepb.yml into doc dir
-- more detailed description of copr-be.conf
-- move files in config directory not directory itself
-- include copr-be.conf
-- include copr-be.py
-- create copr with lighttpd group
-- edit backend part of copr-setup.txt
-- remove fedora16 and add 19 and 20
-- create -doc subpackage with python documentation
-- add generated documentation on gitignore list
-- add script to generate python documentation
-- copr-setup.txt change to for mock
-- rhel6 do not know _pkgdocdir macro
-- make instruction clear
-- require recent whoosh
-- add support for libravatar
-- include backend in rpm
-- add notes about lighttpd config files and how to deploy them
-- do not list file twice
-- move log file to /var/log
-- change destdir in copr-be.conf.example
-- lightweight is the word and buildsystem has more meaning than 'koji'.
-- restart apache after upgrade of frontend
-- own directory where backend put results
-- removal of hidden-file-or-dir
- /usr/share/copr/coprs_frontend/coprs/logic/.coprs_logic.py.swo
-- copr-backend.noarch: W: spelling-error %%description -l en_US latests ->
- latest, latest's, la tests
-- simplify configuration - introduce /etc/copr/copr*.conf
-- Replace "with" statements with @TransactionDecorator decorator
-- add python-flexmock to deps of frontend
-- remove sentence which does not have meaning
-- change api token expiration to 120 days and make it configurable
-- create_chroot must be run as copr-fe user
-- add note that you have to add chroots to db
-- mark config.py as config so it is not overwritten during upgrade
-- own directory data/whooshee/copr_user_whoosheer
-- gcc is not needed
-- sqlite db must be owned by copr-fe user
-- copr does not work with selinux
-- create subdirs under data/openid_store
-- suggest to install frontend as package from copr repository
-- on el6 add python-argparse to BR
-- add python-requests to BR
-- add python-setuptools to BR
-- maintain apache configuration on one place only
-- apache 2.4 changed access control
-- require python-psycopg2
-- postgresql server is not needed
-- document how to create db
-- add to HOWTO how to create db
-- require python-alembic
-- add python-flask-script and python-flask-whooshee to requirements
-- change user in coprs.conf.example to copr-fe
-- fix paths in coprs.conf.example
-- copr is noarch package
-- add note where to configure frontend
-- move frontend to /usr/share/copr/coprs_frontend
-- put production placeholders in coprs_frontend/coprs/config.py
-- put frontend into copr.spec
-- web application should be put in /usr/share/%%{name}
-
-* Mon Jun 17 2013 Miroslav Suchý <msuchy(a)redhat.com> 1.1-1
-- new package built with tito
-
-
9 years, 7 months
[copr] master: Automatic commit of package [copr-keygen] release [1.59-1]. (0b6cf09)
by vgologuz@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 0b6cf095fb1148e3bc59aef5755b26b9abfc2ebd
Author: Valentin Gologuzov <vgologuz(a)redhat.com>
Date: Tue Oct 21 13:53:32 2014 +0200
Automatic commit of package [copr-keygen] release [1.59-1].
>---------------------------------------------------------------
keygen/copr-keygen.spec | 6 +++++-
rel-eng/packages/copr-keygen | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/keygen/copr-keygen.spec b/keygen/copr-keygen.spec
index 75a3204..356fe47 100644
--- a/keygen/copr-keygen.spec
+++ b/keygen/copr-keygen.spec
@@ -7,7 +7,7 @@
# this package doesn't support rhel7- since it doesn't have python3* packages
Name: copr-keygen
-Version: 1.58
+Version: 1.59
Release: 1%{?dist}
Summary: Part of Copr build system. Aux service that generate keys for signd
@@ -180,6 +180,10 @@ service httpd condrestart
%changelog
+* Tue Oct 21 2014 Valentin Gologuzov <vgologuz(a)redhat.com> 1.59-1
+- [keygen] replaced Python RotatedFileHandler with logrotate.d
+- [keygen] [.spec] fixes to follow Fedora packaging guidelines
+
* Wed Oct 01 2014 Valentin Gologuzov <vgologuz(a)redhat.com> 1.58-1
- [keygen] python3 bugfix, added logging
diff --git a/rel-eng/packages/copr-keygen b/rel-eng/packages/copr-keygen
index ceaf238..9367980 100644
--- a/rel-eng/packages/copr-keygen
+++ b/rel-eng/packages/copr-keygen
@@ -1 +1 @@
-1.58-1 keygen/
+1.59-1 keygen/
9 years, 7 months
[copr] master: [keygen] replaced Python RotatedFileHandler with logrotate.d (2e4c72c)
by vgologuz@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 2e4c72cf51bb52f16ff834455f64d55560e52a83
Author: Valentin Gologuzov <vgologuz(a)redhat.com>
Date: Tue Oct 21 12:02:08 2014 +0200
[keygen] replaced Python RotatedFileHandler with logrotate.d
>---------------------------------------------------------------
keygen/configs/logrotate | 12 ++++++++++++
keygen/copr-keygen.spec | 9 ++++++++-
keygen/src/copr_keygen/__init__.py | 6 ++----
3 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/keygen/configs/logrotate b/keygen/configs/logrotate
new file mode 100644
index 0000000..17754dd
--- /dev/null
+++ b/keygen/configs/logrotate
@@ -0,0 +1,12 @@
+/var/log/copr-keygen/*.log {
+ weekly
+ rotate 5
+ copytruncate
+ compress
+ notifempty
+ missingok
+ create 640 copr-signer copr-signer
+ postrotate
+ /bin/systemctl reload httpd.service > /dev/null 2>/dev/null || true
+ endscript
+}
diff --git a/keygen/copr-keygen.spec b/keygen/copr-keygen.spec
index b386b57..75a3204 100644
--- a/keygen/copr-keygen.spec
+++ b/keygen/copr-keygen.spec
@@ -45,6 +45,7 @@ Requires: httpd
Requires: obs-signd
Requires: passwd
+Requires: logrotate
Requires: python3-setuptools
Requires: python3-six
Requires: python3-flask
@@ -119,11 +120,14 @@ install -d %{buildroot}%{_bindir}
install -d -m 500 %{buildroot}%{_sharedstatedir}/copr-keygen/phrases
install -d -m 500 %{buildroot}%{_sharedstatedir}/copr-keygen/gnupg
install -d %{buildroot}%{_localstatedir}/log/copr-keygen
+install -d %{buildroot}%{_sysconfdir}/logrotate.d/
%{__install} -p -m 0755 run/gpg_copr.sh %{buildroot}/%{_bindir}/gpg_copr.sh
%{__install} -p -m 0755 run/application.py %{buildroot}%{_datadir}/copr-keygen/
%{__install} -p -m 0644 configs/httpd/copr-keygen.conf.example %{buildroot}%{_pkgdocdir}/httpd/
+%{__install} -p -m 0644 configs/logrotate %{buildroot}%{_sysconfdir}/logrotate.d/copr-keygen
+
%{__install} -p -m 0644 configs/sign/sign.conf.example %{buildroot}%{_pkgdocdir}/sign/sign.conf.example
cp -a configs/sudoers/copr_signer %{buildroot}%{_sysconfdir}/sudoers.d/copr_signer
@@ -164,7 +168,10 @@ service httpd condrestart
%defattr(600, copr-signer, copr-signer, 700)
%{_sharedstatedir}/copr-keygen
%config(noreplace) %{_sysconfdir}/copr-keygen
-%{_localstatedir}/log/copr-keygen/
+
+%{_sysconfdir}/logrotate.d/copr-keygen
+
+%dir %{_localstatedir}/log/copr-keygen
%ghost %{_localstatedir}/log/copr-keygen/main.log
diff --git a/keygen/src/copr_keygen/__init__.py b/keygen/src/copr_keygen/__init__.py
index 0388d18..33a3b03 100644
--- a/keygen/src/copr_keygen/__init__.py
+++ b/keygen/src/copr_keygen/__init__.py
@@ -7,7 +7,7 @@ from __future__ import absolute_import
import json
import logging
from logging import getLogger
-from logging.handlers import RotatingFileHandler
+from logging import FileHandler
from flask import Flask, request, Response
import os
@@ -23,9 +23,7 @@ app.config.from_envvar("COPR_KEYGEN_CONFIG", silent=True)
if not app.config["DEBUG"] or app.config["DEBUG_WITH_LOG"]:
filename = os.path.join(app.config["LOG_DIR"], "main.log")
if os.path.exists(app.config["LOG_DIR"]):
- handler = RotatingFileHandler(filename,
- maxBytes=50*1024*1024,
- backupCount=5)
+ handler = FileHandler(filename)
handler.setLevel(app.config["LOG_LEVEL"])
handler.setFormatter(logging.Formatter(
'%(asctime)s %(levelname)s'
9 years, 7 months
[copr] master: [backend] refactored a bit Action.py (c5a8d40)
by vgologuz@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit c5a8d40d0f18433ba5d23be9384110f1a6e58bc1
Author: Valentin Gologuzov <vgologuz(a)redhat.com>
Date: Mon Oct 20 18:44:37 2014 +0200
[backend] refactored a bit Action.py
>---------------------------------------------------------------
backend/backend/actions.py | 190 ++++++++++++++++++++++++-------------------
1 files changed, 106 insertions(+), 84 deletions(-)
diff --git a/backend/backend/actions.py b/backend/backend/actions.py
index edcbd78..d9b4f00 100644
--- a/backend/backend/actions.py
+++ b/backend/backend/actions.py
@@ -10,7 +10,16 @@ from mockremote import createrepo
class Action(object):
""" Object to send data back to fronted
- :param multiprocessing.Queue events: ? collects events for logging
+ :param multiprocessing.Queue events: collects events for logging
+ :param multiprocessing.Lock lock: Global lock for backend
+ :param backend.callback.FrontendCallback frontent_callback:
+ object to post data back to frontend
+
+ :param str destdir: filepath with build results
+
+ :param dict action: action job, fields:
+ - action_type: main field determining what action to apply
+ # TODO: describe actions
"""
@@ -25,100 +34,113 @@ class Action(object):
def event(self, what):
self.events.put({"when": time.time(), "who": "action", "what": what})
+ def handle_legal_flag(self):
+ self.event("Action legal-flag: ignoring")
+
+ def handle_rename(self, result):
+ self.event("Action rename")
+ old_path = os.path.normpath(os.path.join(
+ self.destdir, self.data["old_value"]))
+ new_path = os.path.normpath(os.path.join(
+ self.destdir, self.data["new_value"]))
+
+ if os.path.exists(old_path):
+ if not os.path.exists(new_path):
+ shutil.move(old_path, new_path)
+ result.result = 1 # success
+ else:
+ result.message = "Destination directory already exist."
+ result.result = 2 # failure
+ else: # nothing to do, that is success too
+ result.result = 1 # success
+ result.job_ended_on = time.time()
+
+ def handle_delete_copr_project(self):
+ self.event("Action delete copr")
+ project = self.data["old_value"]
+ path = os.path.normpath(self.destdir + '/' + project)
+ if os.path.exists(path):
+ self.event("Removing copr {0}".format(path))
+ shutil.rmtree(path)
+
+ def handle_delete_build(self):
+ self.event("Action delete build")
+ project = self.data["old_value"]
+ packages = [os.path.basename(x).replace(".src.rpm", "") for x in \
+ self.data["data"].split()]
+
+ path = os.path.join(self.destdir, project)
+
+ self.event("Packages to delete {0}".format(' '.join(packages)))
+ self.event("Copr path {0}".format(path))
+
+ try:
+ chroot_list = os.listdir(path)
+ except OSError:
+ # already deleted
+ chroot_list = []
+
+ for chroot in chroot_list:
+ self.event("In chroot {0}".format(chroot))
+ altered = False
+
+ # We need to delete the files only if they belong
+ # to the build. For example if my build fails and I send
+ # fixed pkg with the same version again, it succeeds and
+ # than I delete the failed, it would delete the succeeded
+ # files as well - that would be wrong.
+ for pkg in packages:
+ if self.data["object_type"] == "build-succeeded" or \
+ (self.data["object_type"] == "build-failed" and
+ os.path.exists(os.path.join(path, chroot, pkg, "fail"))
+ ):
+ pkg_path = os.path.join(path, chroot, pkg)
+ if os.path.isdir(pkg_path):
+ self.event("Removing build {0}".format(pkg_path))
+ shutil.rmtree(pkg_path)
+ altered = True
+ else:
+ self.event(
+ "Package {0} dir not found in chroot {1}"
+ .format(pkg, chroot))
+
+ if altered:
+ self.event("Running createrepo")
+ _, _, err = createrepo(os.path.join(path, chroot), self.lock)
+ if err.strip():
+ self.event(
+ "Error making local repo: {0}".format(err))
+
+ log_path = os.path.join(
+ path, chroot,
+ 'build-{0}.log'.format(self.data['object_id']))
+
+ if os.path.isfile(log_path):
+ self.event("Removing log {0}".format(log_path))
+ os.unlink(log_path)
+
def run(self):
""" Handle action (other then builds) - like rename or delete of project """
result = Bunch()
result.id = self.data["id"]
- if self.data["action_type"] == ActionType.DELETE:
+ action_type = self.data["action_type"]
+
+ if action_type == ActionType.DELETE:
if self.data["object_type"] == "copr":
- self.event("Action delete copr")
- project = self.data["old_value"]
- path = os.path.normpath(self.destdir + '/' + project)
- if os.path.exists(path):
- self.event("Removing copr {0}".format(path))
- shutil.rmtree(path)
-
- elif self.data["object_type"] in ["build-succeeded",
- "build-skipped",
- "build-failed"]:
- self.event("Action delete build")
- project = self.data["old_value"]
- packages = [os.path.basename(x).replace(".src.rpm", "") for x in \
- self.data["data"].split()]
-
- path = os.path.join(self.destdir, project)
-
- self.event("Packages to delete {0}".format(' '.join(packages)))
- self.event("Copr path {0}".format(path))
-
- try:
- chroot_list = os.listdir(path)
- except OSError:
- # already deleted
- chroot_list = []
- for chroot in chroot_list:
- self.event("In chroot {0}".format(chroot))
- altered = False
-
- # We need to delete the files only if they belong
- # to the build. For example if my build fails and I send
- # fixed pkg with the same version again, it succeeds and
- # than I delete the failed, it would delete the succeeded
- # files as well - that would be wrong.
- for pkg in packages:
- if self.data["object_type"] == "build-succeeded" or \
- (self.data["object_type"] == "build-failed" and
- os.path.exists(os.path.join(path, chroot, pkg, "fail"))
- ):
- pkg_path = os.path.join(path, chroot, pkg)
- if os.path.isdir(pkg_path):
- self.event("Removing build {0}".format(pkg_path))
- shutil.rmtree(pkg_path)
- altered = True
- else:
- self.event(
- "Package {0} dir not found in chroot {1}"
- .format(pkg, chroot))
-
- if altered:
- self.event("Running createrepo")
- _, _, err = createrepo(os.path.join(path, chroot), self.lock)
- if err.strip():
- self.event(
- "Error making local repo: {0}".format(err))
-
- log_path = os.path.join(
- path, chroot,
- 'build-{0}.log'.format(self.data['object_id']))
-
- if os.path.isfile(log_path):
- self.event("Removing log {0}".format(log_path))
- os.unlink(log_path)
+ self.handle_delete_copr_project()
+ elif self.data["object_type"] in \
+ ["build-succeeded", "build-skipped", "build-failed"]:
+ self.handle_delete_build()
result.job_ended_on = time.time()
result.result = 1 # success
- elif self.data["action_type"] == ActionType.RENAME:
- self.event("Action rename")
- old_path = os.path.normpath(os.path.join(
- self.destdir, self.data["old_value"]))
- new_path = os.path.normpath(os.path.join(
- self.destdir, self.data["new_value"]))
-
- if os.path.exists(old_path):
- if not os.path.exists(new_path):
- shutil.move(old_path, new_path)
- result.result = 1 # success
- else:
- result.message = "Destination directory already exist."
- result.result = 2 # failure
- else: # nothing to do, that is success too
- result.result = 1 # success
- result.job_ended_on = time.time()
+ elif action_type == ActionType.LEGAL_FLAG:
+ self.handle_legal_flag()
- elif self.data["action_type"] == ActionType.LEGAL_FLAG:
- self.event("Action legal-flag: ignoring")
+ elif action_type == ActionType.RENAME:
+ self.handle_rename(result)
if "result" in result:
self.frontend_callback.update({"actions": [result]})
9 years, 7 months
[copr] master: [backend] unittest for Action and minor refactoring (60ccf4c)
by vgologuz@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 60ccf4c6e115309614dbe4652f0659497fb6eb21
Author: Valentin Gologuzov <vgologuz(a)redhat.com>
Date: Mon Oct 20 11:54:27 2014 +0200
[backend] unittest for Action and minor refactoring
>---------------------------------------------------------------
backend/backend/actions.py | 48 +++--
backend/copr-be.py | 5 +-
cli/run_tests.sh => backend/run_test.sh | 2 +-
backend/tests/test_action.py | 448 +++++++++++++++++++++++++++++++
4 files changed, 484 insertions(+), 19 deletions(-)
diff --git a/backend/backend/actions.py b/backend/backend/actions.py
index a16f894..edcbd78 100644
--- a/backend/backend/actions.py
+++ b/backend/backend/actions.py
@@ -1,20 +1,23 @@
-from bunch import Bunch
-from callback import FrontendCallback
import os.path
import shutil
import time
+from bunch import Bunch
+
from mockremote import createrepo
class Action(object):
+ """ Object to send data back to fronted
+
+ :param multiprocessing.Queue events: ? collects events for logging
- """ Object to send data back to fronted """
+ """
- def __init__(self, opts, events, action, lock):
+ def __init__(self, events, action, lock, frontend_callback, destdir):
super(Action, self).__init__()
- self.frontend_callback = FrontendCallback(opts)
- self.destdir = opts.destdir
+ self.frontend_callback = frontend_callback
+ self.destdir = destdir
self.data = action
self.events = events
self.lock = lock
@@ -27,7 +30,7 @@ class Action(object):
result = Bunch()
result.id = self.data["id"]
- if self.data["action_type"] == 0: # delete
+ if self.data["action_type"] == ActionType.DELETE:
if self.data["object_type"] == "copr":
self.event("Action delete copr")
project = self.data["old_value"]
@@ -42,7 +45,7 @@ class Action(object):
self.event("Action delete build")
project = self.data["old_value"]
packages = [os.path.basename(x).replace(".src.rpm", "") for x in \
- self.data["data"].split()]
+ self.data["data"].split()]
path = os.path.join(self.destdir, project)
@@ -65,8 +68,9 @@ class Action(object):
# files as well - that would be wrong.
for pkg in packages:
if self.data["object_type"] == "build-succeeded" or \
- (self.data["object_type"] == "build-failed" and
- os.path.exists(os.path.join(path, chroot, pkg, "fail"))):
+ (self.data["object_type"] == "build-failed" and
+ os.path.exists(os.path.join(path, chroot, pkg, "fail"))
+ ):
pkg_path = os.path.join(path, chroot, pkg)
if os.path.isdir(pkg_path):
self.event("Removing build {0}".format(pkg_path))
@@ -95,12 +99,12 @@ class Action(object):
result.job_ended_on = time.time()
result.result = 1 # success
- elif self.data["action_type"] == 1: # rename
+ elif self.data["action_type"] == ActionType.RENAME:
self.event("Action rename")
- old_path = os.path.normpath(
- self.destdir + '/', self.data["old_value"])
- new_path = os.path.normpath(
- self.destdir + '/', self.data["new_value"])
+ old_path = os.path.normpath(os.path.join(
+ self.destdir, self.data["old_value"]))
+ new_path = os.path.normpath(os.path.join(
+ self.destdir, self.data["new_value"]))
if os.path.exists(old_path):
if not os.path.exists(new_path):
@@ -113,8 +117,20 @@ class Action(object):
result.result = 1 # success
result.job_ended_on = time.time()
- elif self.data["action_type"] == 2: # legal-flag
+ elif self.data["action_type"] == ActionType.LEGAL_FLAG:
self.event("Action legal-flag: ignoring")
if "result" in result:
self.frontend_callback.update({"actions": [result]})
+
+
+class ActionType(object):
+ DELETE = 0
+ RENAME = 1
+ LEGAL_FLAG = 2
+
+
+class ActionResult(object):
+ WAITING = 0
+ SUCCESS = 1
+ FAILURE = 2
diff --git a/backend/copr-be.py b/backend/copr-be.py
index abc5301..c213770 100755
--- a/backend/copr-be.py
+++ b/backend/copr-be.py
@@ -22,7 +22,7 @@ import setproctitle
import signal
import sys
import time
-
+from callback import FrontendCallback
def _get_conf(cp, section, option, default, mode=None):
"""
@@ -111,7 +111,8 @@ class CoprJobGrab(multiprocessing.Process):
len(r_json["actions"])))
for action in r_json["actions"]:
- ao = Action(self.opts, self.events, action, self.lock)
+ ao = Action(self.events, action, self.lock, destdir=self.opts.destdir,
+ frontend_callback=FrontendCallback(self.opts))
ao.run()
def run(self):
diff --git a/cli/run_tests.sh b/backend/run_test.sh
similarity index 52%
copy from cli/run_tests.sh
copy to backend/run_test.sh
index 326c3c4..03aa25a 100755
--- a/cli/run_tests.sh
+++ b/backend/run_test.sh
@@ -1,4 +1,4 @@
#!/bin/sh
-PYTHONPATH=./copr_cli:$PYTHONPATH python -B -m pytest -s --cov-report term-missing --cov ./copr_cli/ tests $@
+PYTHONPATH=.:$PYTHONPATH python -B -m pytest -s --cov-report term-missing --cov ./backend/actions.py ./tests/ $@
#PYTHONPATH=../python/:./copr_cli:$PYTHONPATH python3 -B -m pytest --cov-report term-missing --cov ./copr_cli/ $@
diff --git a/backend/tests/test_action.py b/backend/tests/test_action.py
new file mode 100644
index 0000000..934765d
--- /dev/null
+++ b/backend/tests/test_action.py
@@ -0,0 +1,448 @@
+import os
+import argparse
+from collections import defaultdict
+import json
+from pprint import pprint
+from _pytest.capture import capsys
+import pytest
+import tempfile
+import shutil
+
+import six
+import time
+
+if six.PY3:
+ from unittest import mock
+ from unittest.mock import MagicMock
+else:
+ import mock
+ from mock import MagicMock
+
+import logging
+
+logging.basicConfig(
+ level=logging.INFO,
+ format='[%(asctime)s] {%(pathname)s:%(lineno)d} %(levelname)s - %(message)s',
+ datefmt='%H:%M:%S'
+)
+
+log = logging.getLogger()
+log.info("Logger initiated")
+
+from backend.actions import Action, ActionType, ActionResult
+
+import multiprocessing
+if six.PY3:
+ import queue
+ from queue import Empty as EmptyQueue
+else:
+ import Queue as queue
+ from Queue import Empty as EmptyQueue
+
+(a)mock.patch("backend.actions.time")
+class TestAction(object):
+
+ def setup_method(self, method):
+ self.test_q = queue.Queue()
+ self.tmp_dir_name = None
+
+ self.test_time = time.time()
+
+ self.pkgs = ["foo.src.rpm", "bar.src.rpm"]
+ self.pkgs_stripped = ["foo", "bar"]
+
+ def teardown_method(self, method):
+ self.rm_tmp_dir()
+
+ def rm_tmp_dir(self):
+ if self.tmp_dir_name:
+ shutil.rmtree(self.tmp_dir_name)
+ self.tmp_dir_name = None
+
+ def make_temp_dir(self):
+ root_tmp_dir = tempfile.gettempdir()
+ subdir = "test_action_{}".format(time.time())
+ self.tmp_dir_name = os.path.join(root_tmp_dir, subdir)
+ #print(self.tmp_dir_name)
+ os.mkdir(self.tmp_dir_name)
+ os.mkdir(os.path.join(self.tmp_dir_name, "old_dir"))
+
+ self.test_content = "time: {}\n".format(self.test_time)
+
+
+
+ return self.tmp_dir_name
+
+ def test_action_event(self, mc_time):
+ test_action = Action(events=self.test_q, action={}, lock=None,
+ frontend_callback=None, destdir=None)
+ with pytest.raises(EmptyQueue):
+ test_action.events.get_nowait()
+
+ test_string = "Foo Bar"
+
+ mc_time.time.return_value = self.test_time
+ test_action.event(test_string)
+ result_dict = test_action.events.get()
+ assert result_dict["when"] == self.test_time
+ assert result_dict["who"] == "action"
+ assert result_dict["what"] == test_string
+
+ def test_action_run_legal_flag(self, mc_time):
+ mc_time.time.return_value = self.test_time
+ mc_front_cb = MagicMock()
+ test_action = Action(
+ action={
+ "action_type": ActionType.LEGAL_FLAG,
+ "id": 1
+ },
+ events=self.test_q, lock=None,
+ frontend_callback=mc_front_cb,
+ destdir=None
+ )
+ test_action.run()
+ assert not mc_front_cb.called
+
+ result_dict = self.test_q.get()
+ assert result_dict["when"] == self.test_time
+ assert result_dict["who"] == "action"
+ assert result_dict["what"] == "Action legal-flag: ignoring"
+ with pytest.raises(EmptyQueue):
+ test_action.events.get_nowait()
+
+ def test_action_run_rename(self, mc_time):
+
+ mc_time.time.return_value = self.test_time
+ mc_front_cb = MagicMock()
+
+ tmp_dir = self.make_temp_dir()
+ with open(os.path.join(self.tmp_dir_name, "old_dir", "foobar.txt"), "w") as handle:
+ handle.write(self.test_content)
+
+ test_action = Action(
+ action={
+ "action_type": ActionType.RENAME,
+ "id": 1,
+ "old_value": "old_dir",
+ "new_value": "new_dir"
+ },
+ events=self.test_q, lock=None,
+ frontend_callback=mc_front_cb,
+ destdir=tmp_dir
+ )
+ test_action.run()
+ result_dict = mc_front_cb.update.call_args[0][0]["actions"][0]
+
+ assert result_dict["id"] == 1
+ assert result_dict["result"] == ActionResult.SUCCESS
+ assert result_dict["job_ended_on"] == self.test_time
+
+ assert not os.path.exists(os.path.join(tmp_dir, "old_dir"))
+ assert os.path.exists(os.path.join(tmp_dir, "new_dir"))
+ assert os.path.exists(os.path.join(tmp_dir, "new_dir", "foobar.txt"))
+ with open(os.path.join(tmp_dir, "new_dir", "foobar.txt")) as handle:
+ assert handle.read() == self.test_content
+
+ def test_action_run_rename_success_on_empty_src(self, mc_time):
+ mc_time.time.return_value = self.test_time
+ mc_front_cb = MagicMock()
+
+ tmp_dir = self.make_temp_dir()
+
+ test_action = Action(
+ action={
+ "action_type": ActionType.RENAME,
+ "id": 1,
+ "old_value": "old_dir",
+ "new_value": "new_dir"
+ },
+ events=self.test_q, lock=None,
+ frontend_callback=mc_front_cb,
+ destdir=os.path.join(tmp_dir, "dir-not-exists")
+ )
+ test_action.run()
+ result_dict = mc_front_cb.update.call_args[0][0]["actions"][0]
+
+ assert result_dict["id"] == 1
+ assert result_dict["result"] == ActionResult.SUCCESS
+ assert result_dict["job_ended_on"] == self.test_time
+
+ assert os.path.exists(os.path.join(tmp_dir, "old_dir"))
+
+ def test_action_run_rename_failure_on_destination_exists(self, mc_time):
+ mc_time.time.return_value = self.test_time
+ mc_front_cb = MagicMock()
+
+ tmp_dir = self.make_temp_dir()
+ with open(os.path.join(self.tmp_dir_name, "old_dir", "foobar.txt"), "w") as handle:
+ handle.write(self.test_content)
+ os.mkdir(os.path.join(tmp_dir, "new_dir"))
+
+ test_action = Action(
+ action={
+ "action_type": ActionType.RENAME,
+ "id": 1,
+ "old_value": "old_dir",
+ "new_value": "new_dir"
+ },
+ events=self.test_q, lock=None,
+ frontend_callback=mc_front_cb,
+ destdir=tmp_dir
+ )
+ test_action.run()
+ result_dict = mc_front_cb.update.call_args[0][0]["actions"][0]
+
+ assert result_dict["id"] == 1
+ assert result_dict["result"] == ActionResult.FAILURE
+ assert result_dict["message"] == "Destination directory already exist."
+ assert result_dict["job_ended_on"] == self.test_time
+
+ assert os.path.exists(os.path.join(tmp_dir, "old_dir"))
+ assert os.path.exists(os.path.join(tmp_dir, "new_dir"))
+ assert not os.path.exists(os.path.join(tmp_dir, "new_dir", "foobar.txt"))
+
+ def test_action_run_delete_copr(self, mc_time):
+ mc_time.time.return_value = self.test_time
+ mc_front_cb = MagicMock()
+
+ tmp_dir = self.make_temp_dir()
+
+ test_action = Action(
+ action={
+ "action_type": ActionType.DELETE,
+ "object_type": "copr",
+ "id": 6,
+ "old_value": "old_dir",
+ },
+ events=self.test_q, lock=None,
+ frontend_callback=mc_front_cb,
+ destdir=os.path.join(tmp_dir, "dir-not-exists")
+ )
+ test_action.run()
+
+ result_dict = mc_front_cb.update.call_args[0][0]["actions"][0]
+ assert result_dict["id"] == 6
+ assert result_dict["result"] == ActionResult.SUCCESS
+ assert result_dict["job_ended_on"] == self.test_time
+
+ event_dict = self.test_q.get_nowait()
+
+ assert event_dict["what"] == "Action delete copr"
+ assert event_dict["who"] == "action"
+ assert event_dict["when"] == self.test_time
+ with pytest.raises(EmptyQueue):
+ self.test_q.get_nowait()
+
+ assert os.path.exists(os.path.join(tmp_dir, "old_dir"))
+
+ def test_action_run_delete_copr_remove_folders(self, mc_time):
+ mc_time.time.return_value = self.test_time
+ mc_front_cb = MagicMock()
+
+ tmp_dir = self.make_temp_dir()
+
+ test_action = Action(
+ action={
+ "action_type": ActionType.DELETE,
+ "object_type": "copr",
+ "id": 6,
+ "old_value": "old_dir",
+ },
+ events=self.test_q, lock=None,
+ frontend_callback=mc_front_cb,
+ destdir=tmp_dir
+ )
+ test_action.run()
+
+ result_dict = mc_front_cb.update.call_args[0][0]["actions"][0]
+ assert result_dict["id"] == 6
+ assert result_dict["result"] == ActionResult.SUCCESS
+ assert result_dict["job_ended_on"] == self.test_time
+
+ event_dict = self.test_q.get_nowait()
+
+ assert event_dict["what"] == "Action delete copr"
+ assert event_dict["who"] == "action"
+ assert event_dict["when"] == self.test_time
+
+ event_dict_2 = self.test_q.get_nowait()
+
+ assert "Removing copr" in event_dict_2["what"]
+ assert event_dict["who"] == "action"
+ assert event_dict["when"] == self.test_time
+
+ assert not os.path.exists(os.path.join(tmp_dir, "old_dir"))
+
+ def test_delete_no_chroot_dirs(self, mc_time):
+ mc_time.time.return_value = self.test_time
+ mc_front_cb = MagicMock()
+
+ tmp_dir = self.make_temp_dir()
+
+ for obj_type in ["build-succeeded", "build-skipped", "build-failed"]:
+ test_action = Action(
+ action={
+ "action_type": ActionType.DELETE,
+ "object_type": obj_type,
+ "id": 7,
+ "old_value": "not-existing-project",
+ "data": " ".join(self.pkgs),
+ },
+ events=self.test_q, lock=None,
+ frontend_callback=mc_front_cb,
+ destdir=tmp_dir
+ )
+ with mock.patch("backend.actions.shutil") as mc_shutil:
+ test_action.run()
+ assert not mc_shutil.rmtree.called
+
+ ev_1 = self.test_q.get_nowait()
+ assert "Action delete build" == ev_1["what"]
+ assert ev_1["who"] == "action"
+
+ ev_2 = self.test_q.get_nowait()
+ assert "Packages to delete" in ev_2["what"]
+ assert " ".join(self.pkgs_stripped) in ev_2["what"]
+ assert ev_2["who"] == "action"
+
+ ev_3 = self.test_q.get_nowait()
+ assert "Copr path" in ev_3["what"]
+ assert ev_3["who"] == "action"
+
+ with pytest.raises(EmptyQueue):
+ self.test_q.get_nowait()
+
+ @mock.patch("backend.actions.createrepo")
+ def test_delete_build_succeeded(self, mc_createrepo, mc_time):
+ mc_time.time.return_value = self.test_time
+ mc_front_cb = MagicMock()
+
+ mc_createrepo.return_value = (0, "", "")
+ #mc_createrepo.side_effect = IOError()
+
+ tmp_dir = self.make_temp_dir()
+
+ chroot_1_dir = os.path.join(tmp_dir, "old_dir", "fedora20")
+ os.mkdir(chroot_1_dir)
+ foo_pkg_dir = os.path.join(chroot_1_dir, "foo")
+ os.mkdir(foo_pkg_dir)
+ chroot_2_dir = os.path.join(tmp_dir, "old_dir", "epel7")
+ os.mkdir(chroot_2_dir)
+
+ with open(os.path.join(chroot_1_dir, "foo", "foo.src.rpm"), "w") as fh:
+ fh.write("foo\n")
+
+ log_path = os.path.join(chroot_1_dir, "build-42.log")
+ with open(log_path, "w") as fh:
+ fh.write(self.test_content)
+
+ test_action = Action(
+ action={
+ "action_type": ActionType.DELETE,
+ "object_type": "build-succeeded",
+ "id": 7,
+ "old_value": "old_dir",
+ "data": " ".join(self.pkgs),
+ "object_id": 42
+ },
+ events=self.test_q, lock=None,
+ frontend_callback=mc_front_cb,
+ destdir=tmp_dir
+ )
+
+ assert os.path.exists(foo_pkg_dir)
+ test_action.run()
+ assert not os.path.exists(foo_pkg_dir)
+ assert not os.path.exists(log_path)
+
+ assert_what_from_queue(self.test_q, msg_list=[
+ "Action delete build",
+ "Packages to delete " + " ".join(self.pkgs_stripped),
+ "Copr path",
+ ])
+
+ def assert_epel7():
+ assert_what_from_queue(self.test_q, msg_list=[
+ "Package foo dir not found in chroot epel7",
+ "Package bar dir not found in chroot epel7",
+ ])
+
+
+ def assert_fedora20():
+ assert_what_from_queue(self.test_q, msg_list=[
+ "Removing build ",
+ "Running createrepo",
+ "Package bar dir not found in chroot fedora20",
+ "Running createrepo",
+
+ ])
+
+ ev = self.test_q.get_nowait()
+ assert ev["who"] == "action"
+ assert "In chroot epel7" in ev["what"] or "In chroot fedora20" in ev["what"]
+
+ if "In chroot epel7" in ev["what"]:
+ assert_epel7()
+ assert_what_from_queue(self.test_q, msg_list=["In chroot fedora20"])
+ assert_fedora20()
+ else:
+ assert_fedora20()
+ assert_what_from_queue(self.test_q, msg_list=["In chroot epel7"])
+ assert_epel7()
+
+ assert_what_from_queue(self.test_q, msg_list=["Removing log"])
+
+ with pytest.raises(EmptyQueue):
+ self.test_q.get_nowait()
+
+ @mock.patch("backend.actions.createrepo")
+ def test_delete_build_succeeded_createrepo_error(self, mc_createrepo, mc_time):
+ mc_time.time.return_value = self.test_time
+ mc_front_cb = MagicMock()
+
+ mc_createrepo.return_value = (1, "", "Create repo failed")
+ #mc_createrepo.side_effect = IOError()
+
+ tmp_dir = self.make_temp_dir()
+
+ chroot_1_dir = os.path.join(tmp_dir, "old_dir", "fedora20")
+ os.mkdir(chroot_1_dir)
+ foo_pkg_dir = os.path.join(chroot_1_dir, "foo")
+ os.mkdir(foo_pkg_dir)
+ chroot_2_dir = os.path.join(tmp_dir, "old_dir", "epel7")
+ os.mkdir(chroot_2_dir)
+
+ with open(os.path.join(chroot_1_dir, "foo", "foo.src.rpm"), "w") as fh:
+ fh.write("foo\n")
+
+ test_action = Action(
+ action={
+ "action_type": ActionType.DELETE,
+ "object_type": "build-succeeded",
+ "id": 7,
+ "old_value": "old_dir",
+ "data": " ".join(self.pkgs),
+ "object_id": 42
+ },
+ events=self.test_q, lock=None,
+ frontend_callback=mc_front_cb,
+ destdir=tmp_dir
+ )
+
+ test_action.run()
+ error_event_recorded = False
+
+ while not self.test_q.empty():
+ ev = self.test_q.get_nowait()
+ if "Error making local repo" in ev["what"]:
+ error_event_recorded = True
+
+ assert error_event_recorded
+
+
+
+def assert_what_from_queue(q, msg_list, who="action"):
+ for msg in msg_list:
+ ev = q.get_nowait()
+ assert ev["who"] == who
+ assert msg in ev["what"]
9 years, 7 months
[copr] master: Automatic commit of package [copr-selinux] release [1.34-1]. (1bf57ab)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 1bf57ab6b8d86050c8165c985ae09b56ed291d6f
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Oct 20 13:43:14 2014 +0200
Automatic commit of package [copr-selinux] release [1.34-1].
>---------------------------------------------------------------
rel-eng/packages/copr-selinux | 2 +-
selinux/copr-selinux.spec | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/rel-eng/packages/copr-selinux b/rel-eng/packages/copr-selinux
index 191e4dd..1cdd8d5 100644
--- a/rel-eng/packages/copr-selinux
+++ b/rel-eng/packages/copr-selinux
@@ -1 +1 @@
-1.33-1 selinux/
+1.34-1 selinux/
diff --git a/selinux/copr-selinux.spec b/selinux/copr-selinux.spec
index 84fcbf5..c80b8ba 100644
--- a/selinux/copr-selinux.spec
+++ b/selinux/copr-selinux.spec
@@ -8,7 +8,7 @@
%{!?_selinux_policy_version: %global _selinux_policy_version %(sed -e 's,.*selinux-policy-\\([^/]*\\)/.*,\\1,' %{_datadir}/selinux/devel/policyhelp 2>/dev/null)}
Name: copr-selinux
-Version: 1.33
+Version: 1.34
Release: 1%{?dist}
Summary: SELinux module for COPR
@@ -111,6 +111,9 @@ fi
%dir %{_datadir}/selinux/mls
%changelog
+* Mon Oct 20 2014 Miroslav Suchý <msuchy(a)redhat.com> 1.34-1
+- 1077795 - co-own /usr/share/selinux/mls
+
* Tue Oct 14 2014 Miroslav Suchý <msuchy(a)redhat.com> 1.33-1
- 1077795 - use macro for /usr/share/
9 years, 7 months