Skip to content
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

osc commands with revision ignore revision setting #1457

Open
ggardet opened this issue Dec 7, 2023 · 2 comments
Open

osc commands with revision ignore revision setting #1457

ggardet opened this issue Dec 7, 2023 · 2 comments
Labels

Comments

@ggardet
Copy link
Member

ggardet commented Dec 7, 2023

Describe the bug
osc commands with revision are broken since it ignores revision setting.
For example:

osc copypac -r 110 hardware:boot raspberrypi-firmware-dt home:Guillaume_G:test

returns a copy of the current revision instead of revision 110.
Another one is submitting an older revision:

 osc sr -r 110 "hardware:boot"  raspberrypi-firmware-dt "hardware:boot" -m"revert to rev110 - boo#1217512"

which returns:

Server returned an error: HTTP Error 400: Bad Request
The request contains no actions. Submit requests without source changes may have skipped!

Versions

  • Operating system: openSUSE Tumbleweed
  • Packages: osc-1.5.0-2.1.noarch

To Reproduce
Try one of the commands above, or similar.

Expected behavior
We should be able to checkout, copy or submit older revisions.

Screenshots, console outputs
N/A

Additional context
N/A

@ggardet ggardet added the Bug label Dec 7, 2023
@dmach
Copy link
Contributor

dmach commented Jan 11, 2024

I'm afraid I'm unable to reproduce the behavior.
I used the latest osc from master, but that shouldn't be that far from 1.5.0.

Here's what I tried:

git clone https://github.com/openSUSE/osc.git
cd osc/behave
./container-pull.sh
./container-run.sh

# username is Admin
# password is opensuse

copypac -r 1 test:factory test-pkgA home:Admin
>>> Sending meta data...
>>> Copying files...
>>> <revision rev="1" vrev="1">
>>> ...
>>>  <comment>osc copypac from project:test:factory package:test-pkgA revision:1</comment>
>>> ...

osc -A https://localhost:1443 cat test:factory test-pkgA test-pkgA.spec
>>> Version: 1  - corresponds with revision 1

osc -A https://localhost:1443 sr -r 1 test:factory test-pkgA test:factory -m "revert to rev 1" --nodevelproject
# --nodevelproject is important, otherwise osc attempts to submit the request from the devel project instead
>>> created request id 1

osc -A https://localhost:1443 rq show 1 --diff
>>> -Version:        3
>>> +Version:        1

@adrianschroeter
Copy link
Member

The behaviour is most likely correct, but surprising. The reason is that the old revision of the unexpanded source contains a link to latest source revision of the package in openSUSE:Factory.

However, we should make it possible at least to copy the old sources merged as they were on commit time.

So we may add an option like

osc copypac --expand-rev=110 ...

which then would make the api call with

..&expand&orev=110&olinkrev=base

It would result in an expanded copy without a link. So the user would need to specify the target on "osc sr".

The alternative would be to do the copy like we do today, but modifing the _link file afterwards to reference to the link target old revision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants