-
Notifications
You must be signed in to change notification settings - Fork 42
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
RPM repository content modify base-version expects the wrong type #618
Comments
It does in fact ask for an integer, and that is by design: How else would you refer to version 3 of a repository named "bar"? |
I dont see how For example, I cannot say "copy version 2 of repository B into repository A". In the REST API that would be: http POST ":5001/${repoA_href}/modify/ base_version=${repoB_href}/versions/2/" So in the cli it should be either: # mirroing REST API
pulp rpm repository content modify \
--repository "${repoA_name}" \
--base-version "${repoB_href}/versions/2/" # informs which repo and which version
# assuming base-version is an int
pulp rpm repository content modify \
--repository "${repoA_name}" \
--base-repository "${repoB_name}" \ # which repo to copy from?
--base-version "2" # then an int is enough for the version |
I don't think that the base version could be from a different repository. |
It can be from a different repository. An example: #!/bin/bash
# create and sync fixture repo
pulp rpm remote create --name fixtureRemote --policy on_demand --url "https://fixtures.pulpproject.org/rpm-signed/"
pulp rpm repository create --name fixtureRepository --remote fixtureRemote
pulp rpm repository sync --name fixtureRepository
# create empty repo
other_repo_href=$(pulp rpm repository create --name otherRepository | jq -r .pulp_href)
# copy from fixture to empty
fixture_repover_href=$(pulp rpm repository show --name fixtureRepository | jq -r .latest_version_href)
http POST :5001${other_repo_href}modify/ base_version=${fixture_repover_href}
# assert
pulp rpm repository content list --repository otherRepository | jq .[].location_href |
I dug into the code, and it doesn't look like specifying a base-version-href that doesn't "belong to" the specified repository is "illegal" - which surprised me, like, A Lot. My expectation, and I think the general expectation, was that base-version is used when you want to modify a repo-version other than the latest in "this" repo. But that's not what the REST API enforces/requires. So - is it that my expectation is Just Wrong? (which is very possible) In that case, we need to update docs with better examples, and the CLI needs to allow base-version-href (perhaps with "or integer, for version-in-'this'-repo) . |
Well, this is already two people expectations. But my expectation was quite the opposite, because I related this feature ("modify:copy") as the way of, for example, copying a on-demand Content (and internally it's RA) from a different Repository, making it impossible to say a RA belongs to a Repository (probably there are other reasons we can't say that, but that's one of them). And eventually similar cases pops up where we wanted to be able to say something about some entity and repositories, but we can't because we can copy stuff over (and that's an important thing people do). If we agree on re-opening this, I would advocate for having |
When I the word "copy" I mean the Copy REST API (which is in RPM/Deb/Ansible). That's (for example) https://pulpproject.org/pulp_rpm/restapi/#tag/Rpm:-Copy, and https://pulpproject.org/pulp_rpm/docs/user/guides/modify/#full-repository-copy That API is very much intended to copy "all the content" from one repo to another, and absolutely has the "RemoteArtifact came from where?!?" problem. |
Discussion from the feature inception https://pulp.plan.io/issues/3360 But as of today, do we need these two endpoints for performing copy? |
Given that old discussion, we can at least reopen the issue here. |
Well. Given the commentary in the originating issue, we (or at the very least I!) am Just Wrong about the expectations on modify's base-version. We pretty clearly need to allow base-version-href, and take an int as a 'convenience' for "find the version-href for this repo with version-N" |
Well we should accept |
Summary
When using the following command:
the
--base-version
flag asks for an INTEGER instead of an URL, which is the correct.Steps to reproduce
should trigger an error message.
Also, you could use
and it gonna show that the
--base-version
flag expects an INTEGER instead of an URL.Expected behavior
It's expected that
--base-versions
accepts an URL. Using an API call directly works flawlessly.Stacktrace/Error log
Pulp and pulp-cli version info
pulp3 command line interface, version 0.17.0.dev0
Additonal context
The text was updated successfully, but these errors were encountered: