Bug 869311 - [BUG] rhts-mk-get-current-tag returns tag for wrong test
Summary: [BUG] rhts-mk-get-current-tag returns tag for wrong test
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: beah
Version: 0.9
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 0.10.0
Assignee: Dan Callaghan
QA Contact: Qixiang Wan
URL:
Whiteboard: Misc
: 884331 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-10-23 14:47 UTC by Bill Peck
Modified: 2018-02-06 00:41 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-11-22 06:44:22 UTC
Embargoed:


Attachments (Terms of Use)

Description Bill Peck 2012-10-23 14:47:00 UTC
Description of problem:
The current rhts-mk-get-current-tag code can return the tag for the wrong test if the following test cases are created in the same git repo:

testa

testa-different

If testa-different is updated after testa then when the user attempts to tag a newer version of testa it will pick up the tag from testa-different.

All of the CURRENT_TAG code in the git section is too eager in its regex matching.

CURRENT_TAG=$(git for-each-ref --count=1 --sort=-taggerdate --format="%(refname)" "refs/tags/${PACKAGE_NAME}*" | cut -c 11-)

adding a -[0-9] may fix the issue, but if a developer writes a test with a -2 at the end it would get confused again.  We should have a separator that can't be used in a test name.

CURRENT_TAG=$(git for-each-ref --count=1 --sort=-taggerdate --format="%(refname)" "refs/tags/${PACKAGE_NAME}-[0-9]*" | cut -c 11-)

Version-Release number of selected component (if applicable):
rhts-devel-4.52-3

Comment 1 Dan Callaghan 2012-10-23 21:45:26 UTC
Patch was already supplied by Chao Wang <chaowang> back in April.

http://gerrit.beaker-project.org/1427

Comment 4 Qixiang Wan 2012-11-19 09:16:57 UTC
Verified with rhts 4.53-1.el6eng. The fix works well.

Reproduce steps:

# mkdir bz869311
# cd bz869311/
# beaker-wizard testa
...
# beaker-wizard testa2
...
# find
.
./Sanity
./Sanity/testa
./Sanity/testa/PURPOSE
./Sanity/testa/Makefile
./Sanity/testa/runtest.sh
./Sanity/testa2
./Sanity/testa2/PURPOSE
./Sanity/testa2/Makefile
./Sanity/testa2/runtest.sh
# git init .
# git add .
# git commit -m "Initial"
# cd Sanity/testa
# make tag
Tagging release as tmp-CoreOS-bz869311-Sanity-testa-1_0-1
# make tag
Tagging release as tmp-CoreOS-bz869311-Sanity-testa-1_0-2
# cd ../testa2
# make tag
Tagging release as tmp-CoreOS-bz869311-Sanity-testa2-1_0-1
# cd ../testa
# make tag
Tagging release as tmp-CoreOS-bz869311-Sanity-testa-1_0-2
fatal: tag 'tmp-CoreOS-bz869311-Sanity-testa-1_0-2' already exists
make: *** [tag] Error 128

Comment 5 Raymond Mancy 2012-11-22 06:44:22 UTC
This has now been released

Comment 6 Dan Callaghan 2012-12-06 04:09:11 UTC
*** Bug 884331 has been marked as a duplicate of this bug. ***

Comment 7 John Brier 2013-01-22 00:40:10 UTC
Hi, I described an issue on #beaker and Dan Callaghan said it might be this BZ and to upgrade to 4.53 of rhts-devel but I'm on Fedora and there doesn't seem to be one for fedora here

Comment 8 John Brier 2013-01-22 00:41:16 UTC
i didn't mean to post comment 7. rmancy is working on creating an rpm for Fedora. please disregard


Note You need to log in before you can comment on or make changes to this bug.