Skip to content

feat(schema): set LeafSchema/LeafListSchema.Sensitive from sdcio-ext:sensitive#244

Open
steiler wants to merge 1 commit into
mainfrom
feat/sensitive-schema-flag
Open

feat(schema): set LeafSchema/LeafListSchema.Sensitive from sdcio-ext:sensitive#244
steiler wants to merge 1 commit into
mainfrom
feat/sensitive-schema-flag

Conversation

@steiler

@steiler steiler commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds isSensitiveEntry(e *yang.Entry) bool helper that checks e.Exts for the sdcio-ext:sensitive keyword
  • Sets Sensitive: true on LeafSchema (field 22) and LeafListSchema (field 24) when the extension is present — whether annotated directly on the leaf or propagated via deviate add/deviate replace in a device-profile overlay YANG file
  • Pins go.mod to pre-merge commits of the two dependency PRs so CI and collaborators can build without local checkouts

Depends on

Repo PR Status
sdcio/goyang #4fix(ApplyDeviate): replace Exts on deviate replace, not append open
sdcio/sdc-protos #123feat(sensitive): schema.Path + LeafSchema.sensitive + SchemaElem.IsSensitive open

Replace the pseudo-version pins in go.mod with tagged releases once those PRs are merged.

Test plan

  • TestIsSensitiveEntry — unit tests for the detection helper (nil, empty, unrelated, matching, mixed exts)
  • TestLeafSchema_SensitiveFlag — integration test: loads YANG fixture, verifies LeafSchema.Sensitive for direct annotation, plain leaf, and deviate add case (exercises goyang fix end-to-end)
  • TestLeafListSchema_SensitiveFlag — verifies LeafListSchema.Sensitive for direct annotation

Made with Cursor

…sensitive

Reads e.Exts from the goyang Entry and sets the Sensitive field on
LeafSchema (field 22) and LeafListSchema (field 24) when the
sdcio-ext:sensitive extension is present — either annotated directly on
the leaf or propagated via deviate add/replace in a device-profile overlay.

Depends on:
  - sdcio/goyang PR#4 (ApplyDeviate Exts propagation fix)
  - sdcio/sdc-protos PR#123 (sensitive fields + SchemaElem.IsSensitive)

go.mod: pin both deps to specific pre-merge commits; replace with tagged
releases once the PRs are merged.

Co-authored-by: Cursor <cursoragent@cursor.com>
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