Skip to content

Commit

Permalink
Merge pull request #12261 from adrianschroeter/fix_consistency_checker
Browse files Browse the repository at this point in the history
[api] consistencychecker: fix wrong reports of scmsync projects
  • Loading branch information
adrianschroeter committed Apr 28, 2022
2 parents a8581bc + 7852825 commit f493d66
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/api/app/jobs/old/consistency_check_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,19 @@ def package_existence_consistency_check(project, fix = nil)
return ''
end

if project.scmsync.present?
if project.packages.count > 0
if fix
project.packages.each do |pkg|
pkg.commit_opts = { no_backend_write: 1 }
pkg.destroy
end
end
return "SCM SYNC project #{project.name} contains packages in api!"
end
return ''
end

# valid package names?
package_list_api = project.packages.pluck(:name)
package_list_api.each do |name|
Expand Down

0 comments on commit f493d66

Please sign in to comment.