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

Fixed PRC not getting removed when modifying repositories #1185

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

hstct
Copy link
Contributor

@hstct hstct commented Nov 14, 2024

closes #1190

@hstct hstct force-pushed the fix_repo_modify_with_structured_content branch 2 times, most recently from d01e1af to 2b6fc72 Compare November 19, 2024 10:09
@hstct hstct marked this pull request as ready for review November 19, 2024 10:10
@hstct hstct force-pushed the fix_repo_modify_with_structured_content branch from 2b6fc72 to 338bdbc Compare November 20, 2024 09:26
@hstct hstct force-pushed the fix_repo_modify_with_structured_content branch from 338bdbc to 1b584f9 Compare November 20, 2024 09:29
Copy link
Collaborator

@quba42 quba42 left a comment

Choose a reason for hiding this comment

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

I only have some small suggestions. Even without the everything appears to work.

I manually tested the following:

workon pulp_cli
alias pulp='pulp -p oci-env'
NAME='package_removal_test'

alias http='http --auth admin:password '
PULP_URL='http://localhost:5001'

pulp status
http get ${PULP_URL}/pulp/api/v3/status/


pulp deb repository create --name="${NAME}"
pulp deb content upload --file='../neovim_0.3.4-3_amd64.deb' --distribution='my-dist' --component='my-component' --repository="${NAME}"
pulp deb content upload --file='../odin_1.0_ppc64.deb' --distribution='my-dist' --component='my-component' --repository="${NAME}"

pulp deb repository create --name="${NAME}2"
pulp deb content upload --file='../neovim_0.3.4-3_amd64.deb' --distribution='my-dist2' --component='my-component2' --repository="${NAME}2"

pulp deb publication create --repository=${NAME}
pulp deb distribution create --name=${NAME} --base-path=${NAME} --repository=${NAME}


REPOSITORY_HREF=$(pulp deb repository show --name=${NAME} | jq -r .pulp_href)
PACKAGE_HREF=$(pulp deb content show --sha256='e36dccccd1fd8e38086b15d81d9aef049bc0586dd9b540b171d6917e41268f61' | jq -r .pulp_href)
TASK_HREF=$(http post ${PULP_URL}${REPOSITORY_HREF}modify/ remove_content_units:=[\"${PACKAGE_HREF}\"] | jq -r .task)
pulp show --href=${TASK_HREF}

This ensures that PRCs that point to the same package, but are not part of the repo we are removing from are not a problem.

I also tested removing multiple packages in a single API call, which worked fine.

CHANGES/1190.bugfix Outdated Show resolved Hide resolved
pulp_deb/app/viewsets/repository.py Outdated Show resolved Hide resolved
pulp_deb/tests/functional/api/test_publish.py Show resolved Hide resolved
pulp_deb/tests/functional/api/test_publish.py Outdated Show resolved Hide resolved
@hstct hstct force-pushed the fix_repo_modify_with_structured_content branch from 1b584f9 to 630c38b Compare November 20, 2024 15:35
@hstct hstct requested a review from quba42 November 20, 2024 15:37
Copy link
Collaborator

@quba42 quba42 left a comment

Choose a reason for hiding this comment

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

LGTM.

@hstct hstct merged commit 5551dfe into pulp:main Nov 21, 2024
12 checks passed
@hstct hstct deleted the fix_repo_modify_with_structured_content branch November 21, 2024 08:02
Copy link

patchback bot commented Nov 21, 2024

Backport to 3.2: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.2/5551dfef757ed204438fe9375080adc47280abdc/pr-1185

Backported as #1192

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

Copy link

patchback bot commented Nov 21, 2024

Backport to 3.3: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.3/5551dfef757ed204438fe9375080adc47280abdc/pr-1185

Backported as #1193

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

Copy link

patchback bot commented Nov 21, 2024

Backport to 3.4: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.4/5551dfef757ed204438fe9375080adc47280abdc/pr-1185

Backported as #1194

🤖 @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 Nov 21, 2024
…_content

Fixed PRC not getting removed when modifying repositories

(cherry picked from commit 5551dfe)
patchback bot pushed a commit that referenced this pull request Nov 21, 2024
…_content

Fixed PRC not getting removed when modifying repositories

(cherry picked from commit 5551dfe)
patchback bot pushed a commit that referenced this pull request Nov 21, 2024
…_content

Fixed PRC not getting removed when modifying repositories

(cherry picked from commit 5551dfe)
quba42 added a commit that referenced this pull request Nov 25, 2024
…7ed204438fe9375080adc47280abdc/pr-1185

[PR #1185/5551dfef backport][3.2] Fixed PRC not getting removed when modifying repositories
quba42 added a commit that referenced this pull request Nov 25, 2024
…7ed204438fe9375080adc47280abdc/pr-1185

[PR #1185/5551dfef backport][3.3] Fixed PRC not getting removed when modifying repositories
quba42 added a commit that referenced this pull request Nov 25, 2024
…7ed204438fe9375080adc47280abdc/pr-1185

[PR #1185/5551dfef backport][3.4] Fixed PRC not getting removed when modifying repositories
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Removing packages from structured publications leaves dangling PRCs
2 participants