Project

Profile

Help

Issue #2688

closed

last_unit_added is not updated when units are copied over from another repo

Added by elyezer about 7 years ago. Updated about 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
2.12.2
Platform Release:
2.12.2
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

Steps to reproduce:

  1. Create a repo with a feed and sync it
  2. Create a second repo without a feed and don't sync it
  3. Copy units from the first repo to the second
  4. Check the last_unit_added field

The output below was generated on Pulp 2.12.2b1:

$ pulp-admin rpm repo create --repo-id destination
Successfully created repository [destination]

$ pulp-admin rpm repo copy rpm --match "name=bear" --from-repo-id source --to-repo-id destination

This command may be exited via ctrl+c without affecting the request.

[\]
Running...

Copied:
  bear-4.1-1-noarch

$ pulp-admin rpm repo list --fields last_unit_added --repo-id destination
+----------------------------------------------------------------------+
                            RPM Repositories
+----------------------------------------------------------------------+

Id:               destination
Last Unit Added:  None

Same happens when trying to do the actions over API, the steps for doing that are:

  1. Create a repo with a feed and sync it
  2. Create a second repo without a feed and don't sync it
  3. Post to actions/associate on the second repo with the following body:
    body = {
    'source_repo_id': source_repo['id'],
    'criteria': {
    'filters': {'unit': {'name': 'unit_name'}},
    'type_ids': ['rpm'],
    },
    }
  1. Publish the second repo
  2. Check the last_unit_added field
Actions #1

Updated by bizhang about 7 years ago

This was fixed as a part of https://pulp.plan.io/issues/2577
The code changes for this landed in 2.12.1: https://github.com/pulp/pulp/commit/0005b1375f02d9cbe29bf23b892fa5ec7af343b8
A later commit reverted the bugfix so it's a regression for 2.12.2: https://github.com/pulp/pulp/commit/c0ea5ee4bf8898d80d72c481fbc116fc548b8eeb

Actions #3

Updated by semyers about 7 years ago

So it looks like we need to partially revert c0ea5ee4bf8898d80d72c481fbc116fc548b8eeb, or attempt to reapply 0005b1375f02d9cbe29bf23b892fa5ec7af343b8, whichever is safer.

Actions #4

Updated by semyers about 7 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to semyers

Going to attempt to cherry-pick 0005b1375f02d9cbe29bf23b892fa5ec7af343b8 back into 2.12-dev, will open a PR if successful.

Added by bizhang about 7 years ago

Revision dda4b23e | View on GitHub

update last_unit_added when units are copied

re #2577 https://pulp.plan.io/issues/2577

(cherry picked from commit 0005b1375f02d9cbe29bf23b892fa5ec7af343b8)

The cherry-picked commit was accidentally reverted on 2.12-dev in commit c0ea5ee4bf8898d80d72c481fbc116fc548b8eeb. The original PR containing this change was https://github.com/pulp/pulp/pull/2949

closes #2688 https://pulp.plan.io/issues/2688

Added by bizhang about 7 years ago

Revision dda4b23e | View on GitHub

update last_unit_added when units are copied

re #2577 https://pulp.plan.io/issues/2577

(cherry picked from commit 0005b1375f02d9cbe29bf23b892fa5ec7af343b8)

The cherry-picked commit was accidentally reverted on 2.12-dev in commit c0ea5ee4bf8898d80d72c481fbc116fc548b8eeb. The original PR containing this change was https://github.com/pulp/pulp/pull/2949

closes #2688 https://pulp.plan.io/issues/2688

Actions #5

Updated by semyers about 7 years ago

  • Status changed from ASSIGNED to POST

The pick applied without error, all tests continue to pass:
https://github.com/pulp/pulp/pull/2983

Actions #6

Updated by bizhang about 7 years ago

  • Status changed from POST to MODIFIED

Added by bizhang about 7 years ago

Revision f52b538f | View on GitHub

update last_unit_added when units are copied

re #2577 https://pulp.plan.io/issues/2577

(cherry picked from commit 0005b1375f02d9cbe29bf23b892fa5ec7af343b8)

The cherry-picked commit was accidentally reverted on 2.12-dev in commit c0ea5ee4bf8898d80d72c481fbc116fc548b8eeb. The original PR containing this change was https://github.com/pulp/pulp/pull/2949

closes #2688 https://pulp.plan.io/issues/2688

(cherry picked from commit dda4b23eb8334fc53a160b104063047c6492493f)

^ And this second cherry-pick happened because I opened the PR against master, not 2.12-dev. A bug so nice, we fixed it thrice and picked it twice.

Added by bizhang about 7 years ago

Revision f52b538f | View on GitHub

update last_unit_added when units are copied

re #2577 https://pulp.plan.io/issues/2577

(cherry picked from commit 0005b1375f02d9cbe29bf23b892fa5ec7af343b8)

The cherry-picked commit was accidentally reverted on 2.12-dev in commit c0ea5ee4bf8898d80d72c481fbc116fc548b8eeb. The original PR containing this change was https://github.com/pulp/pulp/pull/2949

closes #2688 https://pulp.plan.io/issues/2688

(cherry picked from commit dda4b23eb8334fc53a160b104063047c6492493f)

^ And this second cherry-pick happened because I opened the PR against master, not 2.12-dev. A bug so nice, we fixed it thrice and picked it twice.

Actions #8

Updated by bizhang about 7 years ago

  • Platform Release set to 2.12.2
Actions #9

Updated by bizhang about 7 years ago

  • Status changed from MODIFIED to 5
Actions #10

Updated by bizhang about 7 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE
Actions #11

Updated by bmbouter about 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF