Skip to content

Add self healing to ValidateExistingBlob and validateManifest - #772

Draft
SuperSandro2000 wants to merge 1 commit into
masterfrom
self-heal-replicate
Draft

Add self healing to ValidateExistingBlob and validateManifest#772
SuperSandro2000 wants to merge 1 commit into
masterfrom
self-heal-replicate

Conversation

@SuperSandro2000

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds self-healing during validation for replica manifests and blobs missing from storage.

Changes:

  • Re-replicates missing manifests from upstream.
  • Attempts recovery of missing blobs.
  • Supplies tag policies and audit context for manifest replication.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
internal/tasks/manifests.go Provides replication context during validation.
internal/processor/manifests.go Adds missing-manifest recovery.
internal/processor/blobs.go Adds missing-blob recovery logic.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread internal/processor/blobs.go Outdated
Comment on lines +54 to +58
blob, err = p.FindBlobOrInsertUnbackedBlob(ctx, layerInfo, account.Name)
if err != nil {
return fmt.Errorf("blob could not be found while validating and replication failed: %w", err)
}
readCloser, _, err = p.sd.ReadBlobForValidation(ctx, account, blob.StorageID)
Comment on lines +182 to +184
// If we cannot find the manifest and the account is a replication from somewhere else try to get it from there
if errors.Is(err, keppel.NotFoundInStorageError{}) && (account.ExternalPeerURL != "" || account.UpstreamPeerHostName != "") {
manifest, manifestBytes, err = p.ReplicateManifest(ctx, account, repo, models.ManifestReference{Digest: manifest.Digest}, tagPolicies, actx)
@github-actions

Copy link
Copy Markdown

Merging this branch will decrease overall coverage

Impacted Packages Coverage Δ 🤖
github.com/sapcc/keppel/internal/processor 82.55% (-1.17%) 👎
github.com/sapcc/keppel/internal/tasks 81.64% (-0.03%) 👎

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/sapcc/keppel/internal/processor/blobs.go 66.20% (-4.26%) 852 (+60) 564 (+6) 288 (+54) 👎
github.com/sapcc/keppel/internal/processor/manifests.go 83.45% (-0.57%) 2466 (+24) 2058 (+6) 408 (+18) 👎
github.com/sapcc/keppel/internal/tasks/manifests.go 81.58% (-0.08%) 3762 (+44) 3069 (+33) 693 (+11) 👎

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants