Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/whimsy/sitestandards.rb
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def analyze(sites, checks)
return [
counts, {
SITE_PASS => '# Sites with links to primary ASF page',
SITE_WARN => '# Sites with link, but not an expected ASF one',
SITE_WARN => '# Sites with link, but not an expected ASF one, or not expected to publish downloads',
SITE_FAIL => '# Sites with no link for this topic'
}, success
]
Expand Down
31 changes: 31 additions & 0 deletions lib/whimsy/sitewebsite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
require 'wunderbar/bootstrap'
require_relative '../whimsy/asf/themes'

# Full PMCs that intentionally don't publish releases, so an empty downloads
# list is expected rather than a failure. Non-PMC committees (Brand
# Management, Data Privacy, Diversity, etc.) are detected automatically via
# the 'nonpmc' flag recorded by site-scan.rb. This small list is needed
# because "makes releases" is not a field in committee_info; revisit if that
# data becomes available.
NO_RELEASES = %w(attic comdev gump whimsy).freeze

# Display data for a single project's checks
# @param project id of project
# @param links site data for that specific project
Expand Down Expand Up @@ -189,6 +197,10 @@ def display_overview(sites, analysis, checks, tlp = true)
end
end
end
# 'downloads' is collected by the crawler rather than via the
# standard checks. We only care whether any were found, so it is
# treated as a pass/fail column (no downloads -> flagged red).
_th! 'Downloads', data_sort: 'string'
end
end
sort_order = {
Expand All @@ -206,6 +218,25 @@ def display_overview(sites, analysis, checks, tlp = true)
cls = SiteStandards.label(analysis, links, c, n)
_td '', class: cls, data_sort_value: sort_order[cls]
end
downloads = links['downloads'] || {}
# A project is expected to publish downloads unless it is a
# non-PMC committee or one of the few PMCs that don't release.
expected = !links['nonpmc'] && !NO_RELEASES.include?(n.downcase)
if !downloads.empty?
cls = SiteStandards::SITE_PASS
# Expose the discovered download URLs in a hover tooltip
_td '', class: cls, data_sort_value: sort_order[cls],
title: downloads.keys.join("\n")
elsif expected
# Expected downloads but none found: flag red like other fails
cls = SiteStandards::SITE_FAIL
_td '', class: cls, data_sort_value: sort_order[cls]
else
# Not expected to publish downloads: warn (amber), not a
# failure. See the amber data key above the table.
cls = SiteStandards::SITE_WARN
_td '', class: cls, data_sort_value: sort_order[cls]
end
end
end
end
Expand Down