Rank by operational sites; show what each status check probes
All checks were successful
Build and Deploy to Production / test (push) Successful in 16s
Build and Deploy to Production / build (push) Successful in 47s
Build and Deploy to Production / deploy (push) Successful in 32s

The datacenter text said "No. 33 by power" for a site that is 25th
on the default card, because it counted construction projects. Rank
among operational datacenters only, matching the card, and leave the
rank out for sites not yet in service. data.json and status.json gain
an operational_rank next to the list position.

The status page now lists, under each site, the hosts it probes with
their label, last result and the source that ties them to the site,
folded away behind a click; the control hosts in Russia get the same
list, and datacenter pages show it under their reachability block.
status.json carries the same targets.

For search: a keyword title tagline and meta description, WebPage and
Dataset structured data (pointing at status.json), x-default, and the
status pages in the sitemap.

Assisted-by: Claude:opus-5-5
This commit is contained in:
Sergei Poljanski 2026-10-18 11:12:47 +04:00
commit 5e36cc6a95
Signed by: asxpi
GPG key ID: 4F8851660FA4121B
8 changed files with 118 additions and 28 deletions

View file

@ -160,7 +160,8 @@ class BingoTest < Minitest::Test
%w[ru en uk].each { |l| assert_includes last_response.body, "<loc>https://example.org/#{l}</loc>" }
%w[ru en uk].each { |l| assert_includes last_response.body, "<loc>https://example.org/#{l}/dc/dc-25</loc>" }
assert_includes last_response.body, '<xhtml:link rel="alternate" hreflang="uk" href="https://example.org/uk/dc/dc-7"/>'
assert_equal 3, last_response.body.scan('hreflang="x-default"').size # card URLs only
%w[ru en uk].each { |l| assert_includes last_response.body, "<loc>https://example.org/#{l}/status</loc>" }
assert_equal 6, last_response.body.scan('hreflang="x-default"').size # card and status URLs only
assert_includes last_response.body, 'hreflang="x-default"'
refute_includes last_response.body, 'changefreq'
assert_match %r{</loc>\n <lastmod>\d{4}-\d\d-\d\dT\d\d:\d\d:\d\dZ</lastmod>\n <xhtml:link}, last_response.body

View file

@ -16,7 +16,10 @@ class StatusTest < Minitest::Test
Bingo::Datacenter.create(slug: "dc-#{s}", position: i + 1, name_ru: "ЦОД #{s}", city_ru: 'Москва',
operator: 'Op', status: 'operational')
end
[@up, @down, @part].each { |dc| @db[:bingo_monitor_targets].insert(datacenter_id: dc.id, host: "h-#{dc.slug}", port: 443, created_at: B) }
[@up, @down, @part].each do |dc|
@db[:bingo_monitor_targets].insert(datacenter_id: dc.id, host: "h-#{dc.slug}", port: 443, label: "probe #{dc.slug}",
source_url: 'https://example.com/src', last_ok: true, last_rtt_ms: 40, created_at: B)
end
@db[:bingo_monitor_targets].insert(datacenter_id: nil, host: 'ctl', port: 80, created_at: B)
end
@ -86,12 +89,26 @@ class StatusTest < Minitest::Test
data = JSON.parse(last_response.body)
assert_equal %w[dc-up dc-down dc-part], data['datacenters'].map { |d| d['slug'] }
assert_equal ['dc-none'], data['unmonitored']
assert_equal({ 'host' => 'h-dc-up', 'port' => 443, 'label' => 'probe dc-up', 'source_url' => 'https://example.com/src',
'answered' => true, 'rtt_ms' => 40 }, data['datacenters'][0]['targets'][0])
assert_equal ['ctl'], data['control_hosts'].map { |t| t['host'] }
get '/ru/status'
assert_includes last_response.body, 'h-dc-part:443'
assert_includes last_response.body, '"@type":"Dataset"'
get '/en/dc/dc-up'
assert_includes last_response.body, 'Network reachability'
get '/en/dc/dc-none'
refute_includes last_response.body, 'Network reachability'
end
def test_rank_counts_operational_sites_only
@part.update(status: 'building') # position 3 is not in service
get '/en/dc/dc-none' # position 4
assert_includes last_response.body, 'No. 3 by power among'
get '/en/dc/dc-part'
refute_includes last_response.body, 'by power among'
end
def test_status_page_before_any_round
get '/en/status'
assert last_response.ok?