pulp / pulp_deb

Debian repository plugin for Pulp (pulpproject.org)
GNU General Public License v2.0
61 stars 78 forks source link

Fix source package publish error #1054

Closed daviddavis closed 5 months ago

daviddavis commented 6 months ago

Handle a source package publish IntegrityError when a source package belongs to multiple dists.

fixes #1053

quba42 commented 6 months ago

@daviddavis Can you add a regression test for this? Something like:

  1. Upload a binary package to two dists
  2. Publish the repo
daviddavis commented 6 months ago

@quba42 just any binary package or do you mean a source package?

quba42 commented 6 months ago

@quba42 just any binary package or do you mean a source package?

I meant source package of course!

I found for example this one in our current test data set to work with: https://github.com/ATIX-AG/pulp_deb/tree/main/pulp_deb/tests/functional/data/debian/pool/asgard/m/mimir

hstct commented 5 months ago

I reviewed the changes and the test. The test will fail as expected when the changes are not applied. Everything looks good to me. If we can change the test to run in parallel I'm happy to merge it.

patchback[bot] commented 5 months ago

Backport to 3.1: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply 9e2a1967ace4bb4f07ffb99226b24480b86bd7dc on top of patchback/backports/3.1/9e2a1967ace4bb4f07ffb99226b24480b86bd7dc/pr-1054

Backporting merged PR #1054 into main

  1. Ensure you have a local repo clone of your fork. Unless you cloned it from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these instructions you'll refer to it by the name upstream. If you don't have it, here's how you can add it:
    $ git remote add upstream https://github.com/pulp/pulp_deb.git
  3. Ensure you have the latest copy of upstream and prepare a branch that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/3.1/9e2a1967ace4bb4f07ffb99226b24480b86bd7dc/pr-1054 upstream/3.1
  4. Now, cherry-pick PR #1054 contents into that branch:
    $ git cherry-pick -x 9e2a1967ace4bb4f07ffb99226b24480b86bd7dc

    If it'll yell at you with something like fatal: Commit 9e2a1967ace4bb4f07ffb99226b24480b86bd7dc is a merge but no -m option was given., add -m 1 as follows instead:

    $ git cherry-pick -m1 -x 9e2a1967ace4bb4f07ffb99226b24480b86bd7dc
  5. At this point, you'll probably encounter some merge conflicts. You must resolve them in to preserve the patch from PR #1054 as close to the original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/3.1/9e2a1967ace4bb4f07ffb99226b24480b86bd7dc/pr-1054
  7. Create a PR, ensure that the CI is green. If it's not — update it so that the tests and any other checks pass. This is it! Now relax and wait for the maintainers to process your pull request when they have some cycles to do reviews. Don't worry — they'll tell you if any improvements are necessary when the time comes!

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

patchback[bot] commented 5 months ago

Backport to 3.2: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.2/9e2a1967ace4bb4f07ffb99226b24480b86bd7dc/pr-1054

Backported as https://github.com/pulp/pulp_deb/pull/1067

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