Skip to content

Commit

Permalink
Fixes #36859 - Fix inconsistent repo publication
Browse files Browse the repository at this point in the history
  • Loading branch information
m-bucher committed Oct 25, 2023
1 parent ed38597 commit d9c75c3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion app/lib/actions/pulp3/repository/save_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ def run
repo.update(:version_href => version_href)
end
else
output[:contents_changed] = false
# get publication and check if repo-version and publication match. Otherwise, contents_changed: false
if fetch_current_published_version_href(repo) != repo.version_href
output[:contents_changed] = true
else
output[:contents_changed] = false
end
end
end

Expand All @@ -44,6 +49,12 @@ def fetch_version_href(repo)
repo_href = repo_backend_service.repository_reference.repository_href
repo_backend_service.api.repositories_api.read(repo_href).latest_version_href
end

def fetch_current_published_version_href(repo)
# Fetch latest Pulp 3 repo version
repo_backend_service = repo.backend_service(SmartProxy.pulp_primary)
repo_backend_service.api.publications_api.read(repo.publication_href).repository_version
end
end
end
end
Expand Down

0 comments on commit d9c75c3

Please sign in to comment.