Skip to content

feat(properties): expose typed defaults - #341

Merged
moshloop merged 1 commit into
masterfrom
feat/property-metadata
Sep 6, 2026
Merged

feat(properties): expose typed defaults#341
moshloop merged 1 commit into
masterfrom
feat/property-metadata

Conversation

@moshloop

@moshloop moshloop commented Sep 6, 2026

Copy link
Copy Markdown
Member

What

  • Expose typed property defaults and value metadata.
  • Add coverage for the new metadata behavior.

Summary by CodeRabbit

  • New Features
    • Added a property metadata listing that shows available settings, values, types, defaults, options, and value sources.
    • Property listings now distinguish defaults, runtime values, command-line overrides, and unset values.
    • Command-line-provided properties are identified as read-only.
    • Added support for bytes, choices, and log-level properties through the public property access API.
    • Typed property accessors now apply declared defaults and allowed options consistently.

Claude-Session-Id: 01a072b8-f5ce-7073-8936-34c7d67e92d0
@moshloop
moshloop enabled auto-merge (rebase) September 6, 2026 03:13
@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: fd87464b-a378-4c5f-a45c-f4db29d8794c

📥 Commits

Reviewing files that changed from the base of the PR and between 3ee4af7 and 0d94b5b.

⛔ Files ignored due to path filters (1)
  • cmd/hx/go.sum is excluded by !**/*.sum
📒 Files selected for processing (4)
  • properties/metadata.go
  • properties/metadata_test.go
  • properties/properties.go
  • properties/properties_suite_test.go

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

Changes

The properties package now records typed accessor metadata and exposes APIs to list property values with types, defaults, sources, options, and read-only status. Typed getters register metadata, and tests cover default, runtime, command-line, and untyped values.

Property metadata

Layer / File(s) Summary
Metadata definitions and listing
properties/metadata.go
Defines property types, sources, metadata records, registration helpers, and sorted listing with runtime, default, and command-line precedence.
Typed accessor registration
properties/properties.go
Stores accessor metadata and adds Bytes, Choice, and LogLevel APIs. Existing typed getters register defaults and types.
Metadata behavior validation
properties/metadata_test.go, properties/properties_suite_test.go
Tests default metadata, runtime values, command-line overrides, read-only flags, untyped strings, and suite execution.

Sequence Diagram(s)

sequenceDiagram
  participant A as TypedAccessor
  participant B as Properties
  participant C as PropertiesList
  participant D as CommandLine
  A->>B: register metadata
  C->>B: collect values and metadata
  C->>D: read overrides
  D-->>C: return override values
  C-->>A: return Property records
Loading

Merge Risk: ⚪ Minimal · up to 0d94b

This change adds typed property metadata and listing while preserving property-value precedence behavior. Default, runtime, command-line, and untyped property cases are covered, with no current merge-blocking risk identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: exposing typed property defaults. It is concise and directly related to the pull request objectives, although it does not mention the additional value meta…
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/property-metadata
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feat/property-metadata

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.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

Gavel summary

Source Pass Fail Skip Duration
collections 60 0 0 3.1s
files 41 0 0 64ms
github.com/flanksource/commons/certs 4 0 0 320ms
github.com/flanksource/commons/cmd/hx 8 0 0 -
github.com/flanksource/commons/cmd/hx/parse 26 0 0 -
github.com/flanksource/commons/collections/syncmap 10 0 0 -
github.com/flanksource/commons/context 1 0 0 -
github.com/flanksource/commons/duration 2 0 0 -
github.com/flanksource/commons/files 16 0 0 -
github.com/flanksource/commons/har 58 0 0 10ms
github.com/flanksource/commons/hash 13 0 0 -
github.com/flanksource/commons/http 95 0 2 11.4s
github.com/flanksource/commons/logger 50 0 0 10ms
github.com/flanksource/commons/logger/httpretty/internal/color 15 0 0 -
github.com/flanksource/commons/logger/httpretty/internal/header 1 0 0 -
github.com/flanksource/commons/lookup 7 0 0 -
github.com/flanksource/commons/merge 28 0 0 -
github.com/flanksource/commons/test 5 0 1 30ms
github.com/flanksource/commons/text 1 0 0 -
github.com/flanksource/commons/tokenizer 3 0 0 -
help 11 0 0 19ms
http 4 0 0 101ms
logger 41 0 0 1ms
properties 3 0 0 343.093µs
set 7 0 0 1ms

Totals: 510 passed · 0 failed · 3 skipped · 15.0s

View full results

@moshloop
moshloop merged commit 51f41fc into master Sep 6, 2026
11 checks passed
@moshloop
moshloop deleted the feat/property-metadata branch September 6, 2026 03:16
@flankbot

flankbot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.58.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants