Add project support to unsigned_commit_shas for SSH commit signatures
The following discussion from !214739 (merged) should be addressed:
-
@vyaklushin started a discussion:
issue: I found this code that only supports commit shas without projects.
# Find commits that are lacking a signature in the database at present def unsigned_commit_shas(commit_shas) return [] if commit_shas.empty? signed = by_commit_sha(commit_shas).pluck(:commit_sha) commit_shas - signed endIt's used in
BranchHooksServiceto create commit signatures after the git push.signature_types .map { |signature| signature.unsigned_commit_shas(commit_shas) } .reduce(&:&)It shouldn't be a problem right now, since
CreateCommitSignatureWorkerdoesn't supportSsh::Commits.# Instantiate commits first to lazily load the signatures commits.map! do |commit| case commit.signature_type when :PGP Gitlab::Gpg::Commit.new(commit) when :X509 Gitlab::X509::Commit.new(commit) end endBut it sounds like a follow up issue. WDYT?
🤔
Edited by 🤖 GitLab Bot 🤖