Skip to content

feat(sync): add SyncLegacyCosignTags config to skip syncing legacy cosign/SBOM tags when disabled#3842

Merged
andaaron merged 4 commits into
project-zot:mainfrom
andaaron:sync6
Mar 6, 2026
Merged

feat(sync): add SyncLegacyCosignTags config to skip syncing legacy cosign/SBOM tags when disabled#3842
andaaron merged 4 commits into
project-zot:mainfrom
andaaron:sync6

Conversation

@andaaron

@andaaron andaaron commented Mar 5, 2026

Copy link
Copy Markdown
Contributor
  1. Add SyncLegacyCosignTags config to skip syncing legacy cosign/SBOM tags when disabled
  2. Sync on demand with referrers API should not use recursion to sync referrers of referrers
  3. Add tests SyncLegacyCosignTags and changes in /referrers on demand sync.

Credit for the tests goes to @jzhn see, https://github.com/project-zot/zot/pull/3840/changes

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

…sign/SBOM tags when disabled

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
@codecov

codecov Bot commented Mar 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.63636% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.46%. Comparing base (bb121c3) to head (6eb02a9).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/extensions/sync/service.go 88.09% 3 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3842   +/-   ##
=======================================
  Coverage   91.45%   91.46%           
=======================================
  Files         193      194    +1     
  Lines       27456    27464    +8     
=======================================
+ Hits        25111    25121   +10     
+ Misses       1521     1520    -1     
+ Partials      824      823    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…nc referrers of referrers

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
@andaaron
andaaron marked this pull request as ready for review March 5, 2026 19:31
@andaaron
andaaron requested a review from rchincha as a code owner March 5, 2026 19:31
@rchincha
rchincha requested a review from Copilot March 6, 2026 03:02

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

This PR adds a SyncLegacyCosignTags sync configuration flag to optionally skip syncing legacy cosign/SBOM digest-encoded tags, and adjusts on-demand referrer syncing so it does not recursively sync referrers-of-referrers. It also introduces tests covering the new flag and the updated /referrers on-demand behavior.

Changes:

  • Add SyncLegacyCosignTags to sync config (defaulting to true) and thread it into sync logic to skip legacy tag syncing when disabled.
  • Change on-demand SyncReferrers to call referrer syncing in non-recursive mode.
  • Add/extend tests for legacy-tag syncing and non-recursive on-demand referrer syncing.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pkg/extensions/sync/service.go Gates legacy tag listing/sync behind SyncLegacyCosignTags and adds a recursive flag to referrer syncing so on-demand can be non-recursive.
pkg/extensions/sync/sync_test.go Adds end-to-end tests for SyncLegacyCosignTags and on-demand /referrers non-recursive behavior.
pkg/extensions/sync/sync_internal_test.go Updates internal tests for new syncReferrers signature and adds unit tests asserting legacy-tag behavior and non-recursive on-demand behavior.
pkg/extensions/config/sync/config.go Adds SyncLegacyCosignTags config field and helper ShouldSyncLegacyCosignTags() defaulting to true when unset.
pkg/extensions/config/sync/config_test.go Adds tests for ShouldSyncLegacyCosignTags() default/true/false behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread pkg/extensions/sync/service.go Outdated
Comment thread pkg/extensions/sync/sync_test.go Outdated
Comment thread pkg/extensions/sync/sync_test.go Outdated
Comment thread pkg/extensions/sync/sync_internal_test.go Outdated
andaaron added 2 commits March 6, 2026 07:38
…nd sync

Credit for the tests goes to @jzhn see:
https://github.com/project-zot/zot/pull/3840/changes

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>
…the zot inner() implementation and with regctl native implementation

Signed-off-by: Andrei Aaron <andreifdaaron@gmail.com>

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/extensions/sync/service.go
@andaaron
andaaron merged commit 6f67fcd into project-zot:main Mar 6, 2026
48 of 49 checks passed
@andaaron
andaaron deleted the sync6 branch March 6, 2026 17:12
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.

3 participants