Skip to content

Fix syncing cosign signature tags when using remote include_tags field#2328

Open
gerrod3 wants to merge 1 commit into
pulp:mainfrom
gerrod3:sig-tag-sync-fix
Open

Fix syncing cosign signature tags when using remote include_tags field#2328
gerrod3 wants to merge 1 commit into
pulp:mainfrom
gerrod3:sig-tag-sync-fix

Conversation

@gerrod3
Copy link
Copy Markdown
Contributor

@gerrod3 gerrod3 commented Apr 17, 2026

fixes: #2096
Assisted by: claude-opus-4.6

Need to work on tests for this, going to update our local GH packages to include some cosign attachments.

📜 Checklist

  • Commits are cleanly separated with meaningful messages (simple features and bug fixes should be squashed to one commit)
  • A changelog entry or entries has been added for any significant changes
  • Follows the Pulp policy on AI Usage
  • (For new features) - User documentation and test coverage has been added

See: Pull Request Walkthrough

@gerrod3 gerrod3 force-pushed the sig-tag-sync-fix branch 2 times, most recently from 17b7227 to 9f0c946 Compare April 24, 2026 16:03
@gerrod3 gerrod3 force-pushed the sig-tag-sync-fix branch 3 times, most recently from 063cda2 to 2c2c13e Compare May 6, 2026 16:01
@gerrod3 gerrod3 force-pushed the sig-tag-sync-fix branch from 2c2c13e to a1dde1b Compare May 6, 2026 17:10
self._full_tag_list, self.remote.include_tags, exclude_tags_and_cosign
)
else:
tag_list = self._full_tag_list
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.

Could you comment this inline a bit better?

e.g. if the goal was to fix the cosign tags being silently skipped, then why are the cosign tags being added to the exclusion list here?

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.

Is the point just to make a separate call to self._process_tags() w/ a separate log message?

companion_tags, signature_source, msg="Processing Cosign Companion Tags"
)

def _find_cosign_companion_tags(self):
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.

Likewise some comments about the structure of the tags and the transformations going on here would be nice.

return True
return False

def _is_cosign_companion_tag(self, tag_name, media_type, content_data):
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.

Could be unit tested? self isn't actually required.

Copy link
Copy Markdown
Contributor

@dralley dralley May 11, 2026

Choose a reason for hiding this comment

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

Unit testing _has_cosign_signature and _find_cosign_companion_tags is likely possible also, just more difficult.

But in any case you can skip the unit tests if you think they aren't needed.

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.

signatures missing

2 participants