Skip to content

fix: registry and test related logic#175

Merged
MihalyToth20 merged 4 commits intomainfrom
dev
Nov 23, 2025
Merged

fix: registry and test related logic#175
MihalyToth20 merged 4 commits intomainfrom
dev

Conversation

@MihalyToth20
Copy link
Copy Markdown
Collaborator

@MihalyToth20 MihalyToth20 commented Nov 23, 2025

Summary by CodeRabbit

  • New Features

    • Test results now display in a formatted, aligned table layout for improved readability
    • Added warnings section to test output showing details of flagged tests
  • Improvements

    • Registry schema standardized for consistency
    • Test configuration schema structure refined

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Nov 23, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This PR refactors registry and test schemas, standardizes property naming conventions (e.g., api-group-name to apiGroupName), removes file target properties in favor of path, and redesigns test result output as a dynamically-rendered table with test warnings support. Schema properties are reorganized with metadata fields moved or restructured across item and root levels.

Changes

Cohort / File(s) Summary
Versioning & Release Notes
.changeset/busy-pianos-stop.md, .changeset/fluffy-carpets-check.md
Added changeset entries documenting patch bump for registry schema cleanup and minor version bumps for core/cli with test runner improvements.
Registry Schema Refactoring
schemas/registry/registry-item.json, schemas/registry/registry.json
Reorganized schema: moved metadata fields (description, title, author, etc.) to root level; renamed api-group-name to apiGroupName; removed target field; added conditional handling for query-based files; updated required properties.
Registry Implementation Updates
packages/cli/src/commands/registry/implementation/registry.ts, packages/cli/src/utils/feature-focused/registry/scaffold.ts
Standardized file path resolution to use file.path directly; renamed property access to file.apiGroupName; removed target property from scaffold sample descriptor.
Test Output Rendering Redesign
packages/cli/src/commands/test/implementation/test.ts
Replaced simple summary with dynamic table rendering using computed column widths; added test warnings section; updated output to display header, aligned rows, and summary line.
Test Config Schema Updates
schemas/testing/config.json
Removed headers/queryParams from required fields; converted queryParams from object to array of name-value pairs; restricted customAsserts level enum to ["error", "warn", "off"]; added additionalProperties: false.
Documentation Comment Cleanup
packages/core/src/features/testing/index.ts
Removed inline comments; no behavioral changes.

Sequence Diagram(s)

sequenceDiagram
    participant Test as Test Runner
    participant Render as Output Renderer
    participant Output as Console

    Test->>Render: test results (status, method, path, duration)
    
    rect rgb(230, 245, 245)
    Note over Render: Build Table
    Render->>Render: compute column widths<br/>(including header)
    Render->>Render: pad cells to align
    end
    
    rect rgb(245, 235, 255)
    Note over Render: Render Output
    Render->>Output: header row
    Render->>Output: separator line
    Render->>Output: aligned table rows
    Render->>Output: summary (Total/Passed/Failed)
    end
    
    rect rgb(245, 245, 230)
    Note over Render: Warnings Section
    Render->>Output: warnings header
    Render->>Output: warning list (key, message)
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Schema reorganization complexity: Registry schema has significant structural changes including property moves (from item to root level), renamed properties, and conditional logic simplification—requires careful verification of backward compatibility and conditional logic correctness.
  • Property renaming impact: api-group-nameapiGroupName affects multiple files; verify all call sites are updated consistently across registry implementation and schema references.
  • Test output rendering logic: Table width computation and cell padding logic is dense; verify alignment correctness across varying content lengths and edge cases (long paths, high duration values).
  • Schema interdependencies: Changes to registry-item.json schema affect registry implementation behavior; ensure implementation correctly uses new property names and schema constraints.

Possibly related PRs

Poem

🐰 Paths now unified, names camelCased with care,
Tables of tests bloom with columns so fair,
Warnings whisper below in orderly rows,
Schemas reshuffled—where the structure now flows!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'fix: registry and test related logic' is vague and overly broad, failing to communicate the specific changes made across multiple files and schema modifications. Consider a more specific title that highlights the primary change, such as 'fix: unify registry schema casing and restructure test output formatting' or similar to better convey the scope.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Nov 23, 2025

Note

Docstrings generation - SUCCESS
Generated docstrings for this pull request at #176

Docstrings generation was requested by @MihalyToth20.

* #175 (comment)

The following files were modified:

* `packages/cli/src/commands/registry/implementation/registry.ts`
* `packages/cli/src/commands/test/implementation/test.ts`
* `packages/cli/src/utils/feature-focused/registry/scaffold.ts`
* `packages/core/src/features/testing/index.ts`
@MihalyToth20 MihalyToth20 merged commit 4b8da6e into main Nov 23, 2025
1 check passed
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/cli/src/commands/registry/implementation/registry.ts (1)

175-175: Inconsistent property reference in error logging.

Line 175 still references file.target || file.path, but the target property was removed from the registry schema. This is inconsistent with the changes on lines 64, 71, and 78.

Apply this diff to fix the inconsistency:

-      console.error(`Failed to install ${file.target || file.path}:`, error);
+      console.error(`Failed to install ${file.path}:`, error);
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ada9ba2 and 6260409.

📒 Files selected for processing (9)
  • .changeset/busy-pianos-stop.md (1 hunks)
  • .changeset/fluffy-carpets-check.md (1 hunks)
  • packages/cli/src/commands/registry/implementation/registry.ts (2 hunks)
  • packages/cli/src/commands/test/implementation/test.ts (2 hunks)
  • packages/cli/src/utils/feature-focused/registry/scaffold.ts (0 hunks)
  • packages/core/src/features/testing/index.ts (0 hunks)
  • schemas/registry/registry-item.json (4 hunks)
  • schemas/registry/registry.json (2 hunks)
  • schemas/testing/config.json (3 hunks)
💤 Files with no reviewable changes (2)
  • packages/cli/src/utils/feature-focused/registry/scaffold.ts
  • packages/core/src/features/testing/index.ts
🧰 Additional context used
🧬 Code graph analysis (1)
packages/cli/src/commands/test/implementation/test.ts (1)
packages/core/src/implementations/run-tests.ts (1)
  • runTestsImplementation (5-39)
🔍 Remote MCP DeepWiki

Summary of Relevant Context Found

Based on the repository documentation, here are the key insights for reviewing PR #175:

Registry Schema Changes Context

The registry schema defines the structure for sharing and reusing prebuilt Xano components (functions, tables, API endpoints), and the apiGroupName property represents the name of an API group within a Xano workspace. When installing a registry:query type component, the CLI uses apiGroupName to dynamically resolve the target API group in Xano where the API endpoint should be installed.

Significance of Changes:

  • The removal of the target property and the registry-file type simplifies the registry schema and centralizes the logic for determining installation paths within the CLI itself. Instead of relying on a target property defined in the registry file, the CLI now uses a urlMapping based on the file.type to construct the appropriate API endpoint for installation.
  • The rename from file['api-group-name'] to file.apiGroupName aligns with camelCase property naming conventions in the codebase.

Test Output Rendering Changes Context

Test results are displayed to users in two formats: a timestamped JSON file containing detailed outcomes, and a formatted ASCII table in the terminal providing a summary of test statuses and durations. The summary table includes status (✅/❌), HTTP method, API endpoint path, and duration (ms), with a summary line providing overall metrics (Total, Passed, Failed, Total Duration).

Warnings Feature:
Assertions can be configured with severity levels ('off', 'error', or 'warn'). Failed assertions configured with 'warn' level are recorded as warnings, which do not prevent the test from being marked as successful but still warrant attention.

Related PR #167 Context

PR #167 introduced custom asserts support in test configurations and fixed a critical bug related to URL construction affecting test execution. PR #175 introduces a test configuration schema and fixes test runner issues concerning dynamic data population and header settings. These PRs are complementary, with #167 focusing on custom assertions and URL handling, while #175 adds schema validation and test runner improvements.

Test Configuration Schema Updates

The schema changes to schemas/testing/config.json reflect a focus on:

  • Making headers and queryParams optional (removed from required fields)
  • Restructuring queryParams from object-based to array-based format (more explicit key-value pairs)
  • Constraining the level property in customAsserts to an enum of ['error', 'warn', 'off']
  • Adding validation stricter with additionalProperties: false
🔇 Additional comments (22)
.changeset/busy-pianos-stop.md (1)

1-5: LGTM!

The changeset correctly documents a patch release for the registry schema cleanup and casing unification.

.changeset/fluffy-carpets-check.md (1)

1-6: LGTM!

The changeset appropriately documents a minor version bump for the test runner improvements and enhanced test summary output with warning counts.

schemas/registry/registry.json (2)

10-12: Good addition of URI format validation.

The format: "uri" constraint on the homepage field provides proper validation for the registry's homepage URL.


13-29: Schema structure improved with clearer required fields.

The addition of root-level description as an optional field and tightening of the items array constraints (minItems: 1, uniqueItems: true) improve the schema's clarity and prevent invalid registry configurations.

schemas/testing/config.json (4)

7-7: Making headers and queryParams optional improves schema flexibility.

Removing these from the required fields allows simpler test configurations when headers or query parameters aren't needed.


49-52: Enum constraint aligns with documented severity levels.

The level enum constraint to ["error", "warn", "off"] provides proper validation and matches the warnings feature described in the external context.


56-57: Strict validation prevents configuration errors.

Adding additionalProperties: false helps catch typos and invalid properties in test configurations early.


19-29: The review comment is based on incorrect assumptions—no breaking change exists.

The schema change at lines 19-29 of schemas/testing/config.json documents the existing format, not a new one. Verification shows:

  • test-config.json already uses array format: "queryParams": [{"name": "language", "in": "query", "value": "en-US"}]
  • Code already handles arrays: testing/index.ts (line 159) and prepare-request.ts both process queryParams as arrays
  • No old-style object format found: Zero matches for object-style queryParams (e.g., {"key": "value"})

No test configuration migration or code updates are required.

Likely an incorrect or invalid review comment.

packages/cli/src/commands/registry/implementation/registry.ts (4)

64-64: Correct usage of file.path property.

The change from file.target || file.path to file.path aligns with the registry schema update that removed the target property.


71-71: Correct usage of file.path property.

Consistent with the schema changes removing the target property.


78-78: Correct usage of file.path property.

Properly aligned with the updated registry-item schema.


110-110: Property name updated to camelCase convention.

The change from file['api-group-name'] to file.apiGroupName aligns with the schema update and follows JavaScript/TypeScript naming conventions.

packages/cli/src/commands/test/implementation/test.ts (6)

23-32: Well-structured data preparation for dynamic table rendering.

The row data preparation correctly extracts status, method, path, warnings count, and duration with appropriate fallbacks for missing values.


34-61: Robust dynamic column width calculation.

The implementation properly calculates maximum column widths by comparing header lengths with all row content, ensuring proper alignment regardless of content length.


63-81: Clean table rendering with dynamic padding.

The header and row rendering logic correctly applies padding to each column for proper alignment, creating a professional-looking table output.


83-93: Accurate summary calculations.

The summary correctly calculates total tests, passed/failed counts, and aggregate duration with clear formatting.


95-105: Helpful warnings details section.

The warnings section provides clear visibility into which tests have warnings and what those warnings are, improving debuggability. This aligns with the warning severity level support added to the test config schema.


224-224: LGTM!

The export statement correctly exposes the runTest function with no signature changes to the public API.

schemas/registry/registry-item.json (4)

37-47: Updated file structure description aligns with schema changes.

The description correctly reflects the simplified file structure focusing on path, content, and type properties.


74-82: Property naming standardized to camelCase.

The rename from api-group-name to apiGroupName follows JavaScript/TypeScript conventions and improves consistency. The addition of the meta object provides useful extensibility for file-level metadata.


84-105: Conditional validation correctly enforces apiGroupName requirement.

The schema properly requires apiGroupName only for registry:query type files, while other types only require path and type. The removal of registry:file from the type enum simplifies the schema.


108-146: Metadata reorganization improves schema semantics.

Moving description, title, author, registryDependencies, and adding new fields like docs, postInstallHint, categories, and meta to the root level makes semantic sense—these are properties of the registry item itself, not individual files. This restructuring improves clarity and usability.

Comment on lines 148 to 152
"required": [
"name",
"type"
"type",
"files"
]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify all registry consumers updated for new schema structure.

The significant restructuring of metadata from file-level to root-level and the removal of the target property require corresponding updates across all registry consumers.

Run the following script to verify all code has been updated to match the new schema structure:


🏁 Script executed:

#!/bin/bash
# Description: Verify registry schema usage is updated throughout the codebase

# Check for any remaining references to old property names
rg -n "api-group-name|file\.target" --type ts --type js

# Check for access to removed item-level metadata properties
rg -n "registryItem\.files\[\d+\]\.(description|title|author)" --type ts --type js

# Verify apiGroupName usage is consistent
rg -n "apiGroupName" --type ts --type js -C 2

Length of output: 3671


I found a critical issue during verification. Let me examine the context around the identified problem:


🏁 Script executed:

#!/bin/bash
# Check the full context around line 175 in registry.ts
sed -n '165,185p' packages/cli/src/commands/registry/implementation/registry.ts

# Also search for all references to file.target in the registry command
rg -n "file\.target" packages/cli/src/commands/registry/ --type ts --type js -B 2 -A 2

# Check the type definition for the file object to understand available properties
fd -e ts -e d.ts | xargs grep -l "type.*File\|interface.*File" | head -5

Length of output: 1059


🏁 Script executed:

#!/bin/bash
# Check the full context around line 175 in registry.ts
sed -n '165,185p' packages/cli/src/commands/registry/implementation/registry.ts

# Also search for all references to file.target in the registry command
rg -n "file\.target" packages/cli/src/commands/registry/ --type ts --type js -B 2 -A 2

# Check the type definition for the file object to understand available properties
rg -n "\.path" packages/cli/src/commands/registry/implementation/registry.ts -B 1 -A 1 | head -20

Length of output: 1777


Update registry.ts line 175 to remove reference to removed file.target property.

The schema restructuring removed the target property, but packages/cli/src/commands/registry/implementation/registry.ts:175 still references it in the error message. Replace file.target || file.path with just file.path, which is the correct property available after the schema changes and is already used correctly elsewhere in the same file.

🤖 Prompt for AI Agents
In packages/cli/src/commands/registry/implementation/registry.ts around line
175, the error message still references the removed file.target property; update
the message to use file.path only (replace any occurrence of file.target ||
file.path with file.path) so it matches the new schema and existing usage in the
file.

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