Bug 40625

Summary: tags are left out in /srpms/?/*.git after an already built srpm is built to another branch (and the already present commit is not re-used)
Product: Infrastructure Reporter: Ivan Zakharyaschev <imz>
Component: girarAssignee: placeholder <placeholder>
Status: NEW --- QA Contact: Andrey Cherepanov <cas>
Severity: minor    
Priority: P5 CC: glebfm, ldv
Version: unspecified   
Hardware: x86_64   
OS: Linux   
URL: http://git.altlinux.org/tasks/archive/done/_270/277457/logs/events.3.1.log

Description Ivan Zakharyaschev 2021-07-31 16:11:15 MSK
The usual gb-task-* tags don't appear in /srpms/?/*.git after the task is committed with an srpm which has been already built for another branch.

The tag corresponding to the EVR also doesn't appear in the target branch of the task. Well, technically, that's just because such a tag is already present on another branch, where the same srpm has already been built, but that commit is not re-used, a new one with probably the same tree (the same result from gear-srpmimport) is created in the target branch of the task.

Creating a new commit may seem redundant.

Not creating the gb-task-* tag is very unexpected.

Example:

http://git.altlinux.org/tasks/archive/done/_270/277457/logs/events.2.1.log

libgtk+3-3.24.29-alt1.src.rpm from sisyphus was built into c9f2, but there is a separate commit in this branch, and no tags:

]$ git -C /srpms/l/libgtk+3.git/ log --all --oneline --graph --decorate | head -30
* 82f0c4bd (HEAD -> sisyphus, tag: gb-sisyphus-task277720.100, tag: 3.24.30-alt1, p10) 3.24.30-alt1
* f6b2998b (tag: gb-sisyphus-task270517.100, tag: 3.24.29-alt1) 3.24.29-alt1
* 7f713b11 (tag: gb-sisyphus-task268501.600, tag: 3.24.28-alt1) 3.24.28-alt1
* b578de68 (tag: gb-sisyphus-task267704.600, tag: 3.24.27-alt1) 3.24.27-alt1
* 306b2f38 (tag: gb-sisyphus-task266853.200, tag: 3.24.26-alt1) 3.24.26-alt1
* 6d2966e0 (tag: gb-sisyphus-task266253.100, tag: 3.24.25-alt1) 3.24.25-alt1
* e993b52f (tag: gb-sisyphus-task262986.100, tag: 3.24.24-alt1) 3.24.24-alt1
* 7df577ce (tag: gb-sisyphus-task258314.2000, tag: 3.24.23-alt2) 3.24.23-alt2
* d4acf51f (tag: gb-sisyphus-task257438.100, tag: 3.24.23-alt1) 3.24.23-alt1
* 69e38817 (tag: gb-sisyphus-task256493.300, tag: 3.24.22-alt1) 3.24.22-alt1
* 9ae01dc8 (tag: gb-sisyphus-task254255.100, tag: 3.24.21-alt1) 3.24.21-alt1
* 84c2da46 (tag: gb-sisyphus-task250751.100, tag: 3.24.20-alt1) 3.24.20-alt1
* 612aa707 (tag: gb-sisyphus-task249713.100, tag: 3.24.18-alt1) 3.24.18-alt1
* 57f80e9a (tag: gb-sisyphus-task249330.100, tag: 3.24.17-alt1) 3.24.17-alt1
* 6133031a (tag: gb-sisyphus-task249104.300, tag: gb-sisyphus-task248832.100, tag: 3.24.16-alt1) 3.24.16-alt1
* 6db407a5 (tag: gb-sisyphus-task247780.700, tag: 3.24.14-alt1) 3.24.14-alt1
* 1edfe2fc (tag: gb-sisyphus-task241862.100, tag: 3.24.13-alt1) 3.24.13-alt1
* f008c136 (tag: gb-sisyphus-task238952.400, tag: 3.24.12-alt1) 3.24.12-alt1
| * 66c558fe (c9m2, c9f2, c9f1) 3.24.29-alt1
|/  
* 87ef1bda (tag: gb-sisyphus-task237086.240, tag: gb-p9-task260591.300, tag: gb-p9-task237353.1200, tag: 3.24.11-alt1, old/p9-task270534, c9m1) 3.24.11-alt1
* 6541cb70 (tag: gb-sisyphus-task233719.100, tag: gb-p9-task233929.500, tag: 3.24.10-alt1) 3.24.10-alt1
* 92b5fe48 (tag: gb-sisyphus-task232549.100, tag: gb-p9-task232706.600, tag: 3.24.9-alt1) 3.24.9-alt1
* aafbd4ea (tag: gb-sisyphus-task227101.100, tag: 3.24.8-alt1) 3.24.8-alt1
* 6089b986 (tag: gb-sisyphus-task225059.1000, tag: 3.24.7-alt1) 3.24.7-alt1
* 5b6e9832 (tag: gb-sisyphus-task220558.100, tag: 3.24.5-alt1) 3.24.5-alt1
* a47aea04 (tag: gb-sisyphus-task219722.200, tag: 3.24.4-alt1) 3.24.4-alt1
* 48a2b041 (tag: gb-sisyphus-task219367.100, tag: 3.24.3-alt1) 3.24.3-alt1
* c45aaa8c (tag: gb-sisyphus-task218466.100, tag: 3.24.2-alt2) 3.24.2-alt2
* c642cdd8 (tag: gb-sisyphus-task218134.600, tag: 3.24.2-alt1) 3.24.2-alt1

The trees are actually the same:

$ git -C /srpms/l/libgtk+3.git/ rev-parse 3.24.29-alt1^{tree} c9f2^{tree}
66ae303fc37aa6e25a0758e4f37b0a68ac9356ad
66ae303fc37aa6e25a0758e4f37b0a68ac9356ad

One way to fix this could be to reset in the Git repo the target branch of the task (with an already built srpm) to the already present tag (saving the old branch head as "old-*").
Comment 1 Ivan Zakharyaschev 2021-07-31 17:04:56 MSK
http://git.altlinux.org/tasks/archive/done/_270/277457/logs/events.3.1.log -- is the more correct link, because that's where the commit was made:

2021-Jul-14 13:41:08 :: task is ready for commit
2021-Jul-14 13:41:13 :: repo clone OK
2021-Jul-14 13:41:14 :: packages update OK
2021-Jul-14 13:41:24 :: [x86_64 i586 aarch64 ppc64le armh noarch] update OK
2021-Jul-14 13:41:24 :: [x86_64-i586] update OK
2021-Jul-14 13:41:24 :: repo update OK
2021-Jul-14 13:41:38 :: repo save OK
2021-Jul-14 13:41:38 :: src index update OK
fatal: tag '3.24.29-alt1' already exists
2021-Jul-14 13:41:46 :: updated /srpms/l/libgtk+3.git branch `c9f2'
fatal: no tag exactly matches '66c558fe74c135cf3f482ad46223ca17dc5f1370'
2021-Jul-14 13:41:59 :: gears update OK
2021-Jul-14 13:41:59 :: task #277457 for c9f2 DONE