Commit graph

438 commits

Author SHA1 Message Date
Tomas Kopecek
9d568cb828 kojira: don't call listTags more than once
Fixes: https://pagure.io/koji/issue/3258
2022-03-28 13:46:37 +02:00
Tomas Kopecek
6b64222ab7 kojira: don't fail on deleted items
py2 relict - dict.values() is now iterator, so
RuntimeError: dictionary changed size during iteration
can be raised when needed repo was deleted during the iteration.

Simple fix to use copy instead of iterator will fix this.
2021-12-15 15:23:56 +01:00
Mike McLean
5b32d76865 rework a bit 2021-11-15 09:07:01 +01:00
Mike McLean
623131c96f we should still track repos that the hub tells us about 2021-11-15 09:07:01 +01:00
Joe Simmons-Talbott
a58ce6bb38 Fix for case where 'info' is None. 2021-11-15 09:07:01 +01:00
Joe Simmons-Talbott
61645c6cd9 kojira: make 'ignore_other_volumes' a config only option.
* pull 'DEFAULT' repo handling out of the loop.
* Add 'ignore_other_volumes' to kojira.conf
2021-11-15 09:07:01 +01:00
Joe Talbott
b5bf4f9a3f Prevent kojira from attempting to remove repos on other volumes.
* Adds '--ignore-other-volumes' flag and configuration option.
2021-11-15 09:07:01 +01:00
Jana Cupova
2118a24e7a Kojira throw exception when auth failed
Fixes: https://pagure.io/koji/issue/2852
2021-11-07 11:06:27 +00:00
Jana Cupova
32b5377392 Remove translation stub functions
Fixes: https://pagure.io/koji/issue/3072
2021-10-21 13:25:16 +02:00
Vasil Velichkov
c21f102114 Restart kojid and kojira services automatically
Wait 60sec before restarting the service
2021-10-20 16:14:20 +02:00
Tomas Kopecek
a3ea37b173 remove unused imports 2021-10-20 15:20:14 +02:00
Tomas Kopecek
3ec6e87d5b replace urlopen with requests.get 2021-10-20 15:20:14 +02:00
Tomas Kopecek
ba2e1e520b basic security checks with bandit
Fixes: https://pagure.io/koji/issue/3042
2021-10-20 15:20:14 +02:00
Tomas Kopecek
dfce69f6bf PR#2958: DBConnectionString/dsn option for db connection
Merges #2958
https://pagure.io/koji/pull-request/2958

Fixes: #2838
https://pagure.io/koji/issue/2838
Option for using SSL is missing, when the pgsql server is an network one.
2021-08-06 09:57:05 +02:00
Tomas Kopecek
79b7eb36f2 add debug message 2021-08-06 09:50:51 +02:00
Igor Raits
c972415dec kojira: Do not ever clean up repositories where 'latest' points to
We don't want to leave symlink broken… Ideally we would find out stuff
where we should even remove "latest" but it is not straightforward and I
believe this simple check is good enough for the time being.

Fixes: https://pagure.io/koji/issue/2832
Signed-off-by: Igor Raits <igor.raits@gmail.com>
2021-08-03 14:56:52 +02:00
Tomas Kopecek
a5f4bd736e fix flake8 line length 2021-07-21 09:52:29 +02:00
Tomas Kopecek
44c89e3516 DBConnectionString/dsn option for db connection
Alternative DSN connection string fro connecting to postgres. Allow us
to specify e.g. sslmode without adding separate DB* options.

Fixes: https://pagure.io/koji/issue/2838
2021-07-20 11:49:06 +02:00
Tomas Kopecek
60aabf82b7 kojira: don't fail on deleted needed tag
Fixes: https://pagure.io/koji/issue/2935
2021-07-20 10:38:20 +02:00
Joe Talbott
912a34a8c8 Fix flake8 warnings. 2021-06-14 13:27:21 +02:00
Joe Talbott
e68166b29d koji-gc: Allow admins to force untagging builds.
* Add check for needed permsission and skip the tag if the user doesn't
  have the needed permission.

Fixes: https://pagure.io/koji/issue/2189
2021-06-14 13:27:21 +02:00
Jana Cupova
ee44d136e9 Read config options from main hub config and hub config dir
Fixes: https://pagure.io/koji/issue/2839
2021-06-08 15:49:48 +02:00
Tomas Kopecek
562b325c8c kojira: use thread-local session object
Fixes: https://pagure.io/koji/issue/2854
2021-05-17 08:58:56 +02:00
Tomas Kopecek
11e71e867a kojira: don't fail on already deleted repo
Related: https://pagure.io/koji/issue/2851
2021-05-17 08:58:09 +02:00
Tomas Kopecek
3849e07ecf kojira: skip unlocking of child locks
Related: https://pagure.io/koji/issue/2851
2021-05-17 08:57:24 +02:00
Tomas Kopecek
1bd62ab607 kojira: faster startup
caching tags in the start + caching property for getting inheritance

Fixes: https://pagure.io/koji/issue/2612
2021-05-10 09:49:55 +02:00
Igor Raits
4cbffb322d koji-gc: Allow specifying all CLI options in config
Fixes: https://pagure.io/koji/issue/2814
Signed-off-by: Igor Raits <igor.raits@gmail.com>
2021-04-28 13:09:23 +02:00
Igor Raits
e0d770d10a koji-gc: Implement hastag policy for koji-gc
Fixes: https://pagure.io/koji/issue/2813
Signed-off-by: Igor Raits <igor.raits@gmail.com>
2021-04-28 12:41:21 +02:00
Alex Iribarren
2b83d458c6 Tolerate floats in metadata timestamps 2021-03-30 14:49:22 +02:00
Tomas Kopecek
1a76030707 kojira: check repo.json before deleting
Fixes: https://pagure.io/koji/issue/1321
2021-03-23 13:47:48 +01:00
Tomas Kopecek
e83dd2757e kojira: check rm queue before adding new path
It is a remnant of previsou unification of rmtree paths. Instead of
deleting tree directly while deleting repo it is put into queue now. So,
other thread looking for expired/deleted repos can find it also and add
it twice. Internal rmtree can check the queue before adding duplicate
path. As a side-effect manager.rmtree can also never fail, so try/except
can be removed from there.

Fixes: https://pagure.io/koji/issue/2716
2021-03-18 15:33:31 +01:00
Mike McLean
3c9dc70832 acquire logging locks before forking
Fixes https://pagure.io/koji/issue/2714
2021-03-11 13:31:35 +01:00
Tomas Kopecek
912ee6f12b remove unused variable 2021-02-04 16:16:31 +01:00
Tomas Kopecek
3f82779581 allow other thread to remove tag 2021-02-04 16:16:31 +01:00
Tomas Kopecek
2d867fa730 remove recent tasks behaviour 2021-02-04 16:16:31 +01:00
Tomas Kopecek
d44af4cbb7 move checkTasks near its usage
Related: https://pagure.io/koji/issue/2119
Fixes: https://pagure.io/koji/issue/2581
2021-02-04 16:16:31 +01:00
Tomas Kopecek
96ae0ecef5 explicit encoding for text file operations
Fixes: https://pagure.io/koji/issue/2641
2021-01-26 13:36:25 +01:00
Tomas Kopecek
fddfe0a1e9 lower multicall batches in koji-gc 2021-01-13 16:09:18 +01:00
Tomas Kopecek
0f56d39487 remove deprecated --ca option
Fixes: https://pagure.io/koji/issue/2192
2020-11-23 11:03:38 +01:00
Mike McLean
267eff9636 handle arches=None case
Should handle all these "empty" cases: missing, None, blank string, only whitespace
2020-11-05 10:31:04 +01:00
Mike McLean
28d07c11ba make cache key consistent 2020-11-05 10:31:04 +01:00
Mike McLean
49e54eb7d2 minor logging adjustment 2020-11-05 10:31:04 +01:00
Mike McLean
efd5e3f48a kojira: cache external repo timestamps by arch_url
Fixes: https://pagure.io/koji/issue/2532
2020-11-05 10:31:04 +01:00
Tomas Kopecek
6a21354006 remove instance variables 2020-10-29 15:11:57 +01:00
Tomas Kopecek
412a29bb88 kojira: don't expire ignored tags with targets
Fixes: https://pagure.io/koji/issue/2542
2020-10-29 15:11:57 +01:00
Tomas Kopecek
5a4efd6d07 fix merge problems 2020-10-06 15:10:22 +02:00
Tomas Kopecek
0c833c1236 remove sysv from Makefiles 2020-10-06 15:00:23 +02:00
Tomas Kopecek
e711e7dbe5 utils in py3 2020-10-06 15:00:23 +02:00
Tomas Kopecek
566a1de1e0 koji-gc: log error if build can't be deleted
Fixes: https://pagure.io/koji/issue/2469
2020-09-08 14:22:13 +02:00
Tomas Kopecek
2e042db3af kojira: parallelize rmtree
Fixes: https://pagure.io/koji/issue/2398
2020-08-26 09:32:50 +02:00