-
Notifications
You must be signed in to change notification settings - Fork 185
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
Support copy of scmsync packages #1625
Conversation
|
||
root = ET.fromstring(meta) | ||
if not root.find("scmsync") is None: | ||
print("Note: package source is managed via SCM") |
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.
so this breaks client side copy.
at least with copypac client side copy should actually remove the scmsync tag, otherwise you can't commit afterwards..
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.
I can add that ...
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.
done
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.
I think this is really dubious. if you "osc copypac" a scmsynced package then imho one should be able to commit afterwards. which you can not with scmsync.
470319f
to
cd8145b
Compare
you can not commit in the source either. In both cases you need to use the SCM tooling. but you can anyway later remove the scmsync tag to allow that. However, you have not exactly the same view as in git, you may need to deal with .obscpio files and you should remove additional scmsync files. But nothing is lost and it would be the same if not copying the scmsync tag. |
cd8145b
to
b991b50
Compare
osc/core.py
Outdated
if meta is None: | ||
meta = show_package_meta(dst_apiurl, dst_project, dst_package) | ||
|
||
root = ET.fromstring(meta) | ||
if root.find("scmsync") is not None: | ||
print("Note: package source is managed via SCM") |
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.
This code is broken. show_package_meta()
returns a list and that doesn't work with ET.fromstring(meta)
.
It should be: root = ET.fromstring(b"".join(meta))
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.
show_files_meta is maybe the more direct way, changed
b991b50
to
02389c8
Compare
src_meta = replace_pkg_meta(src_meta, dst_package, dst_project, keep_maintainers, | ||
dst_userid, keep_develproject) | ||
meta = replace_pkg_meta(src_meta, dst_package, dst_project, keep_maintainers, | ||
dst_userid, keep_develproject, keep_scmsync=(not client_side_copy)) |
Check notice
Code scanning / CodeQL
Empty except Note
There are two ways, either copy the scmsync definition or drop it when creating a new package meta. If we keep it, we must not ask OBS to copy sources, it is syncing it anyway. We could add another option to skip the scmsync tag copy, but we keep it as default, because we don't want to give a different view of the the sources to the user. The client side copy is doing this.
There was only a cosmetic issue - if |
There are two ways, either copy the scmsync definition or drop it when creating a new package meta.
If we keep it, we must not ask OBS to copy sources, it is syncing it anyway.
We could add another option to skip the scmsync tag copy, but we keep it as default, because we don't want to give a different view of the the sources to the user.