-
Notifications
You must be signed in to change notification settings - Fork 186
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
fix branch -N #1527
fix branch -N #1527
Conversation
Branching with missingok must not ask for existing package, it will lead to an error
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1527 +/- ##
==========================================
- Coverage 31.48% 31.47% -0.01%
==========================================
Files 103 103
Lines 19072 19074 +2
==========================================
Hits 6004 6004
- Misses 13068 13070 +2 ☔ View full report in Codecov by Sentry. |
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 the change needs rework or further explanation (maybe add comments to the code so it's more obvious at the first sight?)
Could you also propose several test cases? I can write them, I only need to know where to start.
@@ -6106,27 +6106,28 @@ def branch_pkg( | |||
# BEGIN: Error out on branching scmsync packages; this should be properly handled in the API | |||
|
|||
# read src_package 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.
The comment should be moved with the code.
if devel_project: | ||
raise oscerr.PackageError(devel_project, devel_package, msg) | ||
raise oscerr.PackageError(src_project, src_package, msg) | ||
if not missingok: |
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.
Could you explain why we don't want to read devel project/package when missingok
is on?
Don't we want to resolve the source project/package every time?
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.
-N is to prepare a new package for submission. It flags the _link file that the target is actually not there. So reading the meta from the target will always fail.
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 condition should be if not newinstance:
Also, shouldn't we explicitly turn off branching from the devel package when newinstance
is set?
query = {'cmd': 'branch'}
- if nodevelproject:
+ if nodevelproject or newinstance:
+ # osc branch -N/--new-package should ignore devel project and always branch from the given package
query['ignoredevel'] = '1'
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.
well, it does not really matter as there could be no package definining a devel area. I would have kept the api call simple and not added that parameter in that situation.
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.
after some more discussion with Daniel I actually agree that ignoredevel makes sense when -Nis used in the situation when a new instance of a package is wanted in a hierachial project connected via project links (like SUSE:SLE-SP?: setups)
I assume this explains why |
@glaubitz yes, indeed. |
Closing in favor of #1535 |
Branching with missingok must not ask for existing package, it will lead to an error