-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for %ci, %h and @TAG_OFFSET@ to obsinfo files #138
base: master
Are you sure you want to change the base?
Conversation
This is done by repeated calls to detect_version, so this part may be up for optimizations. Tests still pass (except bzr, but because it's broken locally for me). This should fix issue #137. Notice: I didn't find anything in the test suite for testing obsinfo files.
Rebased on top of latest master. Please review when you can. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lbeltrame Thanks a lot - any chance you could add the corresponding test?
Oh, I just noticed you said there are no tests for obsinfo yet. That's not good ... Well, this is a good excuse to add them ;-) |
Good point about tests. I'll see if I can do something about it. Where is a good point to check for existing tests, and where should they best put in? |
Firstly, you should read Next, it'll be a question of adding tests under the |
@lbeltrame I think we have at least one obsinfo test now, thanks to all the great work from @M0ses: obs-service-tar_scm/tests/unittestcases.py Line 208 in 42fa499
However I'm not sure exactly what that test is supposed to be testing, and currently it's broken anyway. Maybe you can liase with @M0ses to figure out the best way to write the test for the new functionality in this PR? |
fake_args = args.copy() | ||
fake_args["versionformat"] = field | ||
value = str(scm_object.detect_version(fake_args)) | ||
metafile.write(names[field] + value + "\n") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks very specific to git to me. Maybe this should be handled in a SCM specific method and TarSCM.scm.base should have a generic method which simply 'pass'. Otherwise I guess it could break e.g. svn/bzr/...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I agree, git-specific stuff should remain in the Git
class.
fake_args = args.copy() | ||
fake_args["versionformat"] = field | ||
value = str(scm_object.detect_version(fake_args)) | ||
metafile.write(names[field] + value + "\n") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I agree, git-specific stuff should remain in the Git
class.
This is done by repeated calls to get_version, so this part may be up
for optimizations.
Tests still pass (except bzr, but because it's broken locally for me).
This should fix issue #137. Notice: I didn't find anything in the test suite for testing
obsinfo
files.