Skip to content

feat: undefined resolver props and model props to trigger warning logs#8914

Open
k-anshul wants to merge 3 commits intomainfrom
undefined_props
Open

feat: undefined resolver props and model props to trigger warning logs#8914
k-anshul wants to merge 3 commits intomainfrom
undefined_props

Conversation

@k-anshul
Copy link
Member

@k-anshul k-anshul commented Feb 23, 2026

closes https://linear.app/rilldata/issue/PLAT-367/return-errors-for-unsupported-properties-in-resolvers-and-model

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

@k-anshul k-anshul self-assigned this Feb 23, 2026
@k-anshul k-anshul marked this pull request as ready for review February 24, 2026 07:41
Copy link
Contributor

@begelundmuller begelundmuller left a comment

Choose a reason for hiding this comment

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

As a reflection on my comments below, I would probably expect a more structured and less log-centric approach to this issue. Some ideas on my mind:

  1. For parser warnings, change parser.Parser to gather warnings as state on the Parser object - similar to the current Parser.Errors field. Maybe even change Errors to Issues and have a level or bool warning on the runtimev1.ParseError type? This would keep the parser package as a stateless library that returns issues instead of producing secondary output.
  2. For resolver args, it would be nicer to validate them during reconciliation of the alert/report/API/model resources; for now, it could log validation errors as warnings, but when Naman's PR lands we could change it to return the warnings as part of the reconcile result so they show up in the status page.
  3. Lastly, what about supporting new settings like rill.strict_resolver_properties and rill.strict_model_properties, which if true, will cause it to error instead of warn for broken properties? We could maybe set this to false for all existing projects, and then make it default to true so new projects have strict checks.

Comment on lines +215 to +221
// make a minimal struct to only parse partitions properties for validation
// it should not contain any extra fields
minimal := struct {
Partitions *DataYAML `yaml:"partitions"`
}{}
// extract partitions field from the original YAML to validate it
tmpMap := make(map[string]any)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why can't this be done as part of parseDataYAML?


// Parse creates a new parser and parses the entire project.
func Parse(ctx context.Context, repo drivers.RepoStore, instanceID, environment, defaultOLAPConnector string) (*Parser, error) {
func Parse(ctx context.Context, repo drivers.RepoStore, instanceID, environment, defaultOLAPConnector string, logger *zap.Logger) (*Parser, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The parser is a stateless library, so logging inside of it feels like an anti-pattern. Logging should ideally only happen from long-running or stateful code (like the server, reconciler, etc.).

}
if len(unused) > 0 {
e.c.logger.Warn("Undefined fields in input properties. Will be ignored", zap.String("model", opts.ModelName), zap.Strings("fields", unused), observability.ZapCtx(ctx))
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Logging in the executor is okay, but I'm not sure it's sufficient. It would be nice to be able to bubble up redundant properties as reconcile errors or warnings (when Naman's PR for that lands).

For example, logs are not visible to AI and won't be easy to view in cloud editing, so they are easily missed.

if err != nil {
return nil, err
}
logUnusedProperties(ctx, opts, "ai", unused)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think logging warnings in each resolver call is excessive. Resolvers are also used in API calls, so it can generate tons of warning logs (which will show up in our internal dashboards, but which are easily missed by the user since they don't usually see server logs).

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