Skip to content

feat(lint): add structural, schema, and reference-location validation#67

Merged
ghaskins merged 1 commit intomanetu:mainfrom
ghaskins:lint-enhancements
Apr 9, 2026
Merged

feat(lint): add structural, schema, and reference-location validation#67
ghaskins merged 1 commit intomanetu:mainfrom
ghaskins:lint-enhancements

Conversation

@ghaskins
Copy link
Copy Markdown
Contributor

@ghaskins ghaskins commented Apr 9, 2026

  • Gap 1: validate Resource.Group → resource-group references (previously unvalidated). Adds ResourceEntity interface and validateResources to the validation layer; wires ResourceAdapter into the registry.

  • Gap 2: enrich Phase 2 reference diagnostics with YAML line/column by walking the raw node tree post-conversion (references.go). Covers all entity types: role, group, resource-group, scope, operation, resource, policy, and library.

  • Gaps 3+4: add Phase 1.75 structural validation (structure.go) that detects missing metadata.name, empty/absent mrn fields, duplicate MRNs within a section, missing rego on policies/libraries/mappers, and missing selector on operations/mappers/resources. Two new source constants: SourceDuplicate and SourceSchema.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@ghaskins ghaskins force-pushed the lint-enhancements branch from 14756dd to 71171dc Compare April 9, 2026 01:34
- Gap 1: validate Resource.Group → resource-group references (previously
  unvalidated). Adds ResourceEntity interface and validateResources to
  the validation layer; wires ResourceAdapter into the registry.

- Gap 2: enrich Phase 2 reference diagnostics with YAML line/column by
  walking the raw node tree post-conversion (references.go). Covers
  all entity types: role, group, resource-group, scope, operation,
  resource, policy, and library.

- Gaps 3+4: add Phase 1.75 structural validation (structure.go) that
  detects missing metadata.name, empty/absent mrn fields, duplicate MRNs
  within a section, missing rego on policies/libraries/mappers, and
  missing selector on operations/mappers/resources. Two new source
  constants: SourceDuplicate and SourceSchema.

Signed-off-by: Greg Haskins <greg@manetu.com>
@ghaskins ghaskins force-pushed the lint-enhancements branch from 71171dc to ae2c400 Compare April 9, 2026 01:39
Copy link
Copy Markdown
Contributor

@muralisrini muralisrini left a comment

Choose a reason for hiding this comment

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

lgtm

@ghaskins ghaskins merged commit 069393c into manetu:main Apr 9, 2026
17 checks passed
@ghaskins ghaskins deleted the lint-enhancements branch April 9, 2026 12:21
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.

2 participants