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

Fixes 4926: job to create latest dist for existing repos #903

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

rverdile
Copy link
Contributor

Summary

A job to create the latest snapshot distribution for existing repos, because existing ones would have been missed by this PR: #844 (comment)

Testing steps

  1. Apply this patch git apply mypatch.patch to prevent the latest snapshot distribution being created in the snapshot task.
diff --git a/pkg/tasks/snapshot_helper.go b/pkg/tasks/snapshot_helper.go
index 1c0e812..75e9bc6 100644
--- a/pkg/tasks/snapshot_helper.go
+++ b/pkg/tasks/snapshot_helper.go
@@ -63,12 +63,12 @@ func (sh *SnapshotHelper) Run(versionHref string) error {
                return err
        }
 
-       latestPathIdent := helpers.GetLatestRepoDistPath(*sh.payload.GetSnapshotIdent())
-
-       _, _, err = helper.CreateOrUpdateDistribution(sh.orgId, sh.repo.UUID, latestPathIdent, publicationHref)
-       if err != nil {
-               return err
-       }
+       //latestPathIdent := helpers.GetLatestRepoDistPath(*sh.payload.GetSnapshotIdent())
+       //
+       //_, _, err = helper.CreateOrUpdateDistribution(sh.orgId, sh.repo.UUID, latestPathIdent, publicationHref)
+       //if err != nil {
+       //      return err
+       //}
        version, err := sh.pulpClient.GetRpmRepositoryVersion(sh.ctx, versionHref)
        if err != nil {
                return err
  1. Create multiple repos for multiple orgs, some with and without snapshotting
  2. Notice that the for the "latest_snapshot_url" returned by those repos, the URL gives 404.
  3. Run the job: go run cmd/create_latest_distributions/main.go
  4. Those URLs that were giving 404s should now serve the latest snapshot

@rverdile rverdile changed the title Fixes 4926: job to create latest snap dist for existing repos Fixes 4926: job to create latest dist for existing repos Nov 22, 2024
@jlsherrill
Copy link
Member

@rverdile rverdile force-pushed the latest_config_job branch 2 times, most recently from 944913a to c3d9488 Compare November 27, 2024 15:57
Copy link
Contributor

@xbhouse xbhouse left a comment

Choose a reason for hiding this comment

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

looks good!

@rverdile rverdile merged commit 3e54176 into content-services:main Dec 3, 2024
10 checks passed
@rverdile rverdile deleted the latest_config_job branch December 3, 2024 19:33
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.

3 participants