We would like a small script to run weekly to generate a list of all packages in the koji infra* tags.
Those tags allow us to build packages that are not in Fedora/EPEL for whatever reasons and use them safely. However, we (usually) don't want packages to stay in those tags forever. Most packages should move on to being reviewed and get added to Fedora/EPEL and we should use them from there.
This report will allow us to see what packages are in there and make us aware of any that should be removed now.
The tags can be listed with the koji command line tool:
% koji list-tags | grep infra$ dist-5E-epel-infra epel6-infra epel7-infra f23-infra f24-infra f25-infra
(These will change as we go, so the script should look up the current active list).
Packages in each tag can be listed with:
koji list-pkgs --tag=f24-infra --noinherit
Script can be in shell or python.
I like to work on it
I write it in bash script
<img alt="koji_tags.sh" src="/fedora-infrastructure/issue/raw/files/707a2f6cb606a7e49b8f9f6e0ed69274ff2c55490d932a0a903d1ffcc03e2164-koji_tags.sh" />
update script <img alt="koji_tags.sh" src="/fedora-infrastructure/issue/raw/files/abdd56d274b8ed8c9aeebd4753ed6647b5153265d96dfa062a5f9e1ed3b499b3-koji_tags.sh" />
ok, a good first stab. :smile:
But some more reqirements/requests:
Can you have it just use a tmp file with mktemp ? We don't need to keep logs around on it.
Can you have it then just email the complete output to the infrastructure list.
Thanks again for working on this...
i run the script and it post output to the infrastructure list: https://lists.fedoraproject.org/archives/list/infrastructure@lists.fedoraproject.org/thread/LT4W7IS7UTLS5VNTK254W7T4XHUNWPFI/
If it looks good you can close this ticket
updated script sending email to infrastructure-owner@lists.fedoraproject.org by accident but change back to: infrastructure@lists.fedoraproject.org <img alt="koji-infra-tags.sh" src="/fedora-infrastructure/issue/raw/files/e0d322f95ea4afb20439d16e3805b409ac06cb8ae5fdb78ea3b64bd750e97465-koji-infra-tags.sh" />
run new update script and post output result: https://lists.fedoraproject.org/archives/list/infrastructure@lists.fedoraproject.org/thread/VIV5Y7HOMTAUHQAJV5LYBY33M26ZJLCR/
Great. Thanks for working on this.
First, this shows us that we had an old dist-5E-epel-infra tag that we need to get rid of. ;) That tag isn't actually one we need to care about, you can remove it from the script.
Also, can you use mktemp instead of using hard coded temp names?
See: https://www.mktemp.org/manual.html something like:
TMPFILE=‘mktemp‘ || exit 1 each command >> $TMPFILE
That way we arent using predicable temp files that someone could put in place before us.
Also, at the end make sure to 'rm -f $TMPFILE' so it's removed and we don't leave one laying around every week.
Feel free to ask for more info on any of those suggestions.
updated <img alt="koji-infra-tags.sh" src="/fedora-infrastructure/issue/raw/files/6cd1574d408444c6f39f4ab56d6b2467235dd1c1418c1ffdf346781eb5aec44b-koji-infra-tags.sh" />
This looks pretty good, but its got some odd output:
cat: mktemp: input file is output file cat: mktemp: input file is output file cat: mktemp: input file is output file cat: mktemp: input file is output file
Can you fix that up and then I think we will be done here. ;) Thanks again for working on this.
fixed <img alt="koji-infra-tags.sh" src="/fedora-infrastructure/issue/raw/files/f11770772823ed716cbf5ac89de75c7952593845899d16feb19728c65c2df556-koji-infra-tags.sh" />
I would like to offer a few changes to your script <img alt="koji-infra-tags.sh" src="/fedora-infrastructure/issue/raw/files/cebfe76ad0d91302bc7dd39ed15f2baeff53628c0198f996307241ae16d895b8-koji-infra-tags.sh" />
fix list-pkgs TAG <img alt="koji-infra-tags.sh" src="/fedora-infrastructure/issue/raw/files/c005cfa9feeaf76f1db5852d8ee5e3e8225544412b17cd80f20d2d853dc368b0-koji-infra-tags.sh" />
alda: i run that script and it works. It produce the same output since you make your bash script way simple than mine atleast it shows the same result
marc84: I used your well coded script and only add loop which itterate over tags, so they dont need to be staticaly defined. So thanks for your good work.
Pushed out to batcave01 in ansible commit 616489674176809bae3b97a2b543bb2007ce30f3
Thanks!
@kevin changed the status to Fixed
Fixed
Log in to comment on this ticket.