Skip to content

Expose the recursive count of schemas in the directory API#772

Merged
jviotti merged 2 commits intomainfrom
directory-schema-counts
Mar 23, 2026
Merged

Expose the recursive count of schemas in the directory API#772
jviotti merged 2 commits intomainfrom
directory-schema-counts

Conversation

@jviotti
Copy link
Member

@jviotti jviotti commented Mar 23, 2026

Signed-off-by: Juan Cruz Viotti jv@jviotti.com

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti jviotti marked this pull request as ready for review March 23, 2026 14:21
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 7 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/index/explorer.h">

<violation number="1" location="src/index/explorer.h:636">
P1: Do not early-return to cached directory entries when the cached entry lacks `schemas`; this causes persistent undercounting of recursive schema totals.</violation>

<violation number="2" location="src/index/explorer.h:737">
P1: Handle missing legacy `schemas` in directory JSON instead of asserting/throwing.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@augmentcode
Copy link

augmentcode bot commented Mar 23, 2026

🤖 Augment PR Summary

Summary: This PR exposes a recursive schema count (schemas) in the directory listing API.

Changes:

  • Extends the list API response schema to include a top-level schemas count and per-directory entry counts
  • Updates API documentation to describe the new fields
  • Computes and persists the recursive count in the index generator (including in the directory metapack extension)
  • Adds a “Schemas” column to the HTML directory listing UI
  • Updates e2e hurl tests to validate the new JSON response fields

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark Index (community)

Details
Benchmark suite Current: 3e63507 Previous: 3d8fcfa Ratio
Add one schema (0 existing) 21 ms 20 ms 1.05
Add one schema (100 existing) 30 ms 26 ms 1.15
Add one schema (1000 existing) 76 ms 74 ms 1.03
Add one schema (10000 existing) 636 ms 717 ms 0.89
Update one schema (1 existing) 19 ms 19 ms 1
Update one schema (101 existing) 28 ms 25 ms 1.12
Update one schema (1001 existing) 81 ms 76 ms 1.07
Update one schema (10001 existing) 643 ms 636 ms 1.01
Cached rebuild (1 existing) 11 ms 10 ms 1.10
Cached rebuild (101 existing) 12 ms 12 ms 1
Cached rebuild (1001 existing) 28 ms 26 ms 1.08
Cached rebuild (10001 existing) 195 ms 200 ms 0.97
Index 100 schemas 123 ms 127 ms 0.97
Index 1000 schemas 1047 ms 965 ms 1.08
Index 10000 schemas 14008 ms 13701 ms 1.02

This comment was automatically generated by workflow using github-action-benchmark.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark Index (enterprise)

Details
Benchmark suite Current: 3e63507 Previous: 3d8fcfa Ratio
Add one schema (0 existing) 25 ms 27 ms 0.93
Add one schema (100 existing) 30 ms 28 ms 1.07
Add one schema (1000 existing) 85 ms 76 ms 1.12
Add one schema (10000 existing) 675 ms 651 ms 1.04
Update one schema (1 existing) 25 ms 22 ms 1.14
Update one schema (101 existing) 28 ms 27 ms 1.04
Update one schema (1001 existing) 85 ms 76 ms 1.12
Update one schema (10001 existing) 687 ms 612 ms 1.12
Cached rebuild (1 existing) 13 ms 16 ms 0.81
Cached rebuild (101 existing) 14 ms 14 ms 1
Cached rebuild (1001 existing) 34 ms 30 ms 1.13
Cached rebuild (10001 existing) 223 ms 199 ms 1.12
Index 100 schemas 130 ms 128 ms 1.02
Index 1000 schemas 1102 ms 1125 ms 0.98
Index 10000 schemas 15446 ms 14736 ms 1.05

This comment was automatically generated by workflow using github-action-benchmark.

@jviotti jviotti merged commit 3ee82fc into main Mar 23, 2026
6 checks passed
@jviotti jviotti deleted the directory-schema-counts branch March 23, 2026 14:43
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.

1 participant