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

Fix manual approve/reject when repository name is different from distribution base_path #3655

Merged
merged 1 commit into from
Apr 27, 2023

Conversation

himdel
Copy link
Collaborator

@himdel himdel commented Apr 26, 2023

when calling the collection version copy/move API, the endpoint accepts source base path and destination base path, those are usually identical to repository name, but not always .. any repo with spaces in the name will have a different base path

This ensures we call the endpoint with actual distribution base paths, not repository names.

(There may be room for improvement, the first thing the API does with the base path is look up the repository (galaxy_ng/app/api/v3/viewsets/collection.py:239), but not sure that would be backportable.)

Cc @MilanPospisil good catch finding this :)

…n base_path

when calling the collection version copy/move API, the endpoint accepts source base path and destination base path,
those are usually identical to repository name, but not always .. any repo with spaces in the name will have a different base path

This ensures we call the endpoint with actual distribution base paths, not repository names.

No-Issue
@github-actions github-actions bot added backport-4.6 This PR should be backported to stable-4.6 (2.3) backport-4.7 This PR should be backported to stable-4.7 (2.4) labels Apr 26, 2023
@himdel himdel requested a review from MilanPospisil April 26, 2023 16:44
@himdel himdel removed the backport-4.6 This PR should be backported to stable-4.6 (2.3) label Apr 26, 2023
@himdel himdel changed the title Fix approve/reject when repository name is different from distribution base_path Fix maual approve/reject when repository name is different from distribution base_path Apr 26, 2023
@himdel himdel changed the title Fix maual approve/reject when repository name is different from distribution base_path Fix manual approve/reject when repository name is different from distribution base_path Apr 26, 2023
himdel added a commit to himdel/ansible-hub-ui that referenced this pull request Apr 26, 2023
Copy link
Contributor

@MilanPospisil MilanPospisil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@MilanPospisil
Copy link
Contributor

Interesting is that error was here for very long time and nobody noticed, because we were working only with default repos :-)

@himdel himdel merged commit d4196c4 into ansible:master Apr 27, 2023
@himdel himdel deleted the copy-move-fix branch April 27, 2023 10:27
@patchback
Copy link

patchback bot commented Apr 27, 2023

Backport to stable-4.7: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-4.7/d4196c4c1ae22a1ef8f2bae4853449b7e4790cb1/pr-3655

Backported as #3656

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Apr 27, 2023
…n base_path (#3655)

when calling the collection version copy/move API, the endpoint accepts source base path and destination base path,
those are usually identical to repository name, but not always .. any repo with spaces in the name will have a different base path

This ensures we call the endpoint with actual distribution base paths, not repository names.

No-Issue

(cherry picked from commit d4196c4)
himdel added a commit that referenced this pull request Apr 27, 2023
* CollectionFilter: change filter names to sentence case

* NamespaceDetail: set repository_name filter from /repo/:repo/my-namespaces/:namespace

and update on route change, but only when matching or unset

* findDistroBasePathByRepo - fall back to first distribution if any, not null[0]

* SignCollectionsAPI - support signing by repository name in addition to pulp_href

* Namespace detail: sign all collections only signs current repo now

make Sign all disabled when a repository is not selected,
don't disable it when no collections are found (other filters may be in place),

Issue: AAH-2308

* sync fail messages with #3655
patchback bot pushed a commit that referenced this pull request Apr 27, 2023
* CollectionFilter: change filter names to sentence case

* NamespaceDetail: set repository_name filter from /repo/:repo/my-namespaces/:namespace

and update on route change, but only when matching or unset

* findDistroBasePathByRepo - fall back to first distribution if any, not null[0]

* SignCollectionsAPI - support signing by repository name in addition to pulp_href

* Namespace detail: sign all collections only signs current repo now

make Sign all disabled when a repository is not selected,
don't disable it when no collections are found (other filters may be in place),

Issue: AAH-2308

* sync fail messages with #3655

(cherry picked from commit 7dd6688)
himdel added a commit that referenced this pull request Apr 27, 2023
…n base_path (#3655) (#3656)

when calling the collection version copy/move API, the endpoint accepts source base path and destination base path,
those are usually identical to repository name, but not always .. any repo with spaces in the name will have a different base path

This ensures we call the endpoint with actual distribution base paths, not repository names.

No-Issue

(cherry picked from commit d4196c4)

Co-authored-by: Martin Hradil <mhradil@redhat.com>
@github-actions github-actions bot added the backported-4.7 This PR has been backported to stable-4.7 (2.4) label Apr 27, 2023
himdel added a commit that referenced this pull request Apr 27, 2023
* CollectionFilter: change filter names to sentence case

* NamespaceDetail: set repository_name filter from /repo/:repo/my-namespaces/:namespace

and update on route change, but only when matching or unset

* findDistroBasePathByRepo - fall back to first distribution if any, not null[0]

* SignCollectionsAPI - support signing by repository name in addition to pulp_href

* Namespace detail: sign all collections only signs current repo now

make Sign all disabled when a repository is not selected,
don't disable it when no collections are found (other filters may be in place),

Issue: AAH-2308

* sync fail messages with #3655

(cherry picked from commit 7dd6688)

Co-authored-by: Martin Hradil <mhradil@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-4.7 This PR should be backported to stable-4.7 (2.4) backported-4.7 This PR has been backported to stable-4.7 (2.4)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants