Project

Profile

Help

Issue #5659

closed

Regression: publishing an empty ISO repo no longer publishes PULP_MANIFEST

Added by rmcgover about 5 years ago. Updated almost 5 years ago.

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

Description

Publishing an ISO repo with no units will no longer publish an (empty) PULP_MANIFEST file.

It seems to be a regression introduced by fast-forward publish support for ISO repos in version 2.20.0.

Steps to reproduce

In dev-env:

1. Create a new, empty repo:

$ pulp-admin iso repo create --repo-id my-test-repo

2. Publish the repo:

$ pulp-admin iso repo publish run --repo-id my-test-repo
+----------------------------------------------------------------------+
                  Publishing Repository [my-test-repo]
+----------------------------------------------------------------------+

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

The repository was successfully published.

Task Succeeded

3. Check for published repo:

$ sudo find /var/lib/pulp/published/ -wholename '*my-test-repo*'

Actual results

Step 3 finds no trace of the repo having been published (no PULP_MANIFEST or even an empty directory).

Expected results

Step 3 finds a repo published with an empty PULP_MANIFEST:

$ sudo find /var/lib/pulp/published/ -wholename '*my-test-repo*'
/var/lib/pulp/published/https/isos/my-test-repo
/var/lib/pulp/published/https/isos/my-test-repo/PULP_MANIFEST

Additional info

Publishing the empty PULP_MANIFEST is important since this is how Pulp/Satellite can know that a repo URL is valid but a repo doesn't include any content yet.

In publish_repo_fast_forward method, we can see that the copytree operation which ultimately performs the publish will never be entered if the repo contains no units:

# In pulp/server/pulp/plugins/file/distributor.py
    def publish_repo_fast_forward(self, repo, publish_conduit, config):
       ...
                if len(unit_absent_set) > 0 or len(unit_over_path_map) > 0:
                    if os.path.exists(metadata_filename):
                        os.remove(metadata_filename)
                    copytree(build_dir, location, symlinks=True)

Can be worked around by publishing empty repos with force_full: True.

Actions #1

Updated by rmcgover about 5 years ago

Note also that if you have an iso_rsync_distributor attached to the same repo, attempting to publish with that distributor will fail as it attempts to rsync a nonexistent PULP_MANIFEST file.

Actions #3

Updated by ttereshc about 5 years ago

  • Tags Pulp 2 added
Actions #4

Updated by ttereshc about 5 years ago

  • Triaged changed from No to Yes

Added by jluza about 5 years ago

Revision 9a7cc54f | View on GitHub

If repository hasn't been published before, publish without fast-foward

If repository hasn't been published before and there's no unit associated with it, no PULP_MANIFEST is published to destination publish directory. With this fix, empty manifest is created in destination directory indicating that published repo is empty

Closes #5659

Actions #5

Updated by ipanova@redhat.com almost 5 years ago

  • Status changed from NEW to POST
  • Sprint set to Sprint 63
Actions #6

Updated by jluza almost 5 years ago

  • Status changed from POST to MODIFIED

Added by Nathan Gillett almost 5 years ago

Revision f93e517d | View on GitHub

Correct last_publish method call in distributor

In a recent commit to limit fast-forward publishing to repositories that have been published before, 'last_published' was mistaken for the publish_conduit's 'last_publish' method. This commit corrects the typo.

Closes #5659

Actions #7

Updated by ipanova@redhat.com almost 5 years ago

  • Platform Release set to 2.21.1
Actions #8

Updated by Anonymous almost 5 years ago

Added by jluza almost 5 years ago

Revision 7cbe4229 | View on GitHub

If repository hasn't been published before, publish without fast-foward

If repository hasn't been published before and there's no unit associated with it, no PULP_MANIFEST is published to destination publish directory. With this fix, empty manifest is created in destination directory indicating that published repo is empty

Closes #5659

(cherry picked from commit 9a7cc54f6fd320c48865824d7dd15735dcc410af)

Added by Nathan Gillett almost 5 years ago

Revision 3771fbe1 | View on GitHub

Correct last_publish method call in distributor

In a recent commit to limit fast-forward publishing to repositories that have been published before, 'last_published' was mistaken for the publish_conduit's 'last_publish' method. This commit corrects the typo.

Closes #5659

(cherry picked from commit f93e517d6abd66cb372c3d2bbbf91e860dd1f93e)

Actions #10

Updated by Anonymous almost 5 years ago

Actions #11

Updated by ipanova@redhat.com almost 5 years ago

  • Status changed from MODIFIED to 5
Actions #12

Updated by ipanova@redhat.com almost 5 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE

Added by yuzheng over 4 years ago

Revision 7fffd6d0 | View on GitHub

Fix last_publish method call

Method last_publish was not called properly so that a bound method was used instead of its return. It made publish always be fast-forward no matter repo has been published or not when force_full=True is not set.

Added new case for testing this and fixed tests added before.

Closes #5659

(cherry picked from commit 8bf831f8533f98512b620d49fdf6cae0f824257d)

Added by yuzheng over 4 years ago

Revision 668d4551 | View on GitHub

Fix last_publish method call

Method last_publish was not called properly so that a bound method was used instead of its return. It made publish always be fast-forward no matter repo has been published or not when force_full=True is not set.

Closes #5659

(cherry picked from commit 2403d7dde0b28d2aab603e3ba70555a69d653df5)

Also available in: Atom PDF