Skip to content

feat(gts): make store logging opt-in - #14

Open
thegodzila1 wants to merge 1 commit into
GlobalTypeSystem:mainfrom
thegodzila1:feature/verbose-store-logging
Open

feat(gts): make store logging opt-in#14
thegodzila1 wants to merge 1 commit into
GlobalTypeSystem:mainfrom
thegodzila1:feature/verbose-store-logging

Conversation

@thegodzila1

@thegodzila1 thegodzila1 commented Jul 28, 2026

Copy link
Copy Markdown

Before this change, GtsStore always wrote a log line for every entity registration and validation. This polluted the logs of any application that uses the library. Now these logs are off by default. You can turn them on with the new Verbose flag in RegistryConfig.

The gts CLI works as before: -v turns on store logging. The server prints store logs at -verbose 1 and above, so -verbose 0 is now really silent.

Summary by CodeRabbit

  • New Features

    • Added optional verbose logging for store creation, entity registration, and schema or instance validation.
    • Command-line and helper tooling now honors the verbose setting when initializing the store.
  • Bug Fixes

    • Improved consistency of verbosity configuration across store initialization paths.
  • Tests

    • Added coverage verifying default quiet behavior and verbose log output.

Before this change, GtsStore always wrote a log line for every
entity registration and validation. This polluted the logs of any
application that uses the library. Now these logs are off by
default. You can turn them on with the new Verbose flag in
RegistryConfig.

The gts CLI works as before: -v turns on store logging. The server
prints store logs at -verbose 1 and above, so -verbose 0 is now
really silent.
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The GTS store adds a Verbose registry configuration flag, emits conditional lifecycle and validation logs, and wires command verbosity flags into store construction. Tests cover default configuration, silent behavior, and verbose log output.

Changes

Verbose registry logging

Layer / File(s) Summary
Registry verbosity and lifecycle logging
gts/store.go
RegistryConfig.Verbose defaults to false and controls logging during store creation, entity registration, schema validation, and instance validation.
Command wiring and logging coverage
cmd/gts-server/main.go, cmd/gts/helpers.go, gts/registry_test.go
Command verbose flags configure store logging, while tests verify default silence and expected verbose log messages.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: aviator5

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: GtsStore logging is now opt-in via verbose configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
gts/registry_test.go (1)

30-66: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cover the new validation log branches.

This test verifies creation and registration only. Add focused silent and verbose cases for ValidateSchema and ValidateInstanceWithXGtsRef so every new logging path is covered.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@gts/registry_test.go` around lines 30 - 66, The TestVerboseLogging test
currently covers only store creation and entity registration. Extend it with
focused silent-by-default and verbose subtests that invoke ValidateSchema and
ValidateInstanceWithXGtsRef, asserting no validation logs with default
configuration and the expected validation log messages when
RegistryConfig.Verbose is true.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@gts/registry_test.go`:
- Around line 30-66: The TestVerboseLogging test currently covers only store
creation and entity registration. Extend it with focused silent-by-default and
verbose subtests that invoke ValidateSchema and ValidateInstanceWithXGtsRef,
asserting no validation logs with default configuration and the expected
validation log messages when RegistryConfig.Verbose is true.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6fa3fdd7-295b-4374-a84b-06ecf574b240

📥 Commits

Reviewing files that changed from the base of the PR and between 055ecee and 5ff5717.

📒 Files selected for processing (4)
  • cmd/gts-server/main.go
  • cmd/gts/helpers.go
  • gts/registry_test.go
  • gts/store.go

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