Skip to content

restapi: include inactiveShards in the homepage total count#2797

Merged
bobcallaway merged 1 commit into
sigstore:mainfrom
alliasgher:fix-homepage-inactive-shards-count
Apr 17, 2026
Merged

restapi: include inactiveShards in the homepage total count#2797
bobcallaway merged 1 commit into
sigstore:mainfrom
alliasgher:fix-homepage-inactive-shards-count

Conversation

@alliasgher
Copy link
Copy Markdown
Contributor

Summary

The HTML homepage at / reads j.treeSize from /api/v1/log/ to display "Currently storing N items" but ignores j.inactiveShards. After a shard rotation the total count is the sum of the active tree plus every inactive shard, so the page under-reports by the size of all previous shards.

Sum the inactive shards' treeSize values into the displayed count, defensively guarding against a missing or non-array inactiveShards field.

Fixes #2281

Signed-off-by: Ali alliasgher123@gmail.com

@bobcallaway
Copy link
Copy Markdown
Member

it looks like you combined #2796 and this fix - can you please separate them?

@alliasgher
Copy link
Copy Markdown
Contributor Author

alliasgher commented Apr 14, 2026

Separated — updated this PR to only contain the homepage inactiveShards fix. The retry error handler change is in #2796 alone @bobcallaway

The HTML homepage served at / displays the log's total entry count but
only reads j.treeSize from the /api/v1/log/ response, ignoring
j.inactiveShards. After a shard rotation the total entry count is the
sum of the active tree plus every inactive shard, so the page under-
reports by the size of all previous shards.

Sum the inactiveShards tree sizes into the displayed count, guarding
against a missing or non-array inactiveShards field with a defensive
Array.isArray check and Number() coercion.

Fixes sigstore#2281

Signed-off-by: Ali <alliasgher123@gmail.com>
@alliasgher alliasgher force-pushed the fix-homepage-inactive-shards-count branch from 2edebf1 to 968fe21 Compare April 14, 2026 11:56
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 26.17%. Comparing base (488eb97) to head (968fe21).
⚠️ Report is 665 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2797       +/-   ##
===========================================
- Coverage   66.46%   26.17%   -40.29%     
===========================================
  Files          92      191       +99     
  Lines        9258    20122    +10864     
===========================================
- Hits         6153     5267      -886     
- Misses       2359    14027    +11668     
- Partials      746      828       +82     
Flag Coverage Δ
e2etests 49.56% <ø> (+2.00%) ⬆️
unittests 16.71% <ø> (-30.97%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bobcallaway bobcallaway merged commit 656c832 into sigstore:main Apr 17, 2026
16 checks passed
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.

Info page count does not account for inactive shards

2 participants