Skip to content

feat: Support non-error reconcile status#9031

Merged
k-anshul merged 14 commits intomainfrom
non_error_reconcile_status
Apr 10, 2026
Merged

feat: Support non-error reconcile status#9031
k-anshul merged 14 commits intomainfrom
non_error_reconcile_status

Conversation

@k-anshul
Copy link
Copy Markdown
Member

@k-anshul k-anshul commented Mar 12, 2026

closes https://linear.app/rilldata/issue/PLAT-130/support-non-error-reconcile-status-info-warning

Disclaimer: The frontend code is vibe coded and not reviewed fully.

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 Mar 12, 2026
Base automatically changed from undefined_props to main March 13, 2026 03:31
@k-anshul k-anshul force-pushed the non_error_reconcile_status branch from eaadd74 to 1fb42b0 Compare March 13, 2026 08:55
@k-anshul k-anshul marked this pull request as ready for review March 13, 2026 12:02
@k-anshul k-anshul requested a review from begelundmuller March 17, 2026 06:37
Comment thread runtime/reconcilers/model.go Outdated
Comment on lines +283 to +287
var testWarnings []string
if model.State.TestHash != testHash {
testErrs, err := r.runModelTests(ctx, self)
var testErrs []string
var err error
testErrs, testWarnings, err = r.runModelTests(ctx, self)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since we have model.State.TestErrors, I think it might be cleaner to also keep model.State.TestWarnings. The reason we added TestErrors was so it could return the same errors even after another reconcile (e.g. a restart) without re-running the tests. I think that problem may also apply here if we don't add TestWarnings to the state?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actually, as I think about this, I would probably keep it simple and just output warnings as part of testErrs (i.e. not return two different slices here). Tests are a rarely used feature, so I think it's okay to have strict enforcement on them (i.e. to treat any warning as a test error), especially given you can configure whether test results become errors or warnings.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I ended up storing TestWarnings. This is to ensure that test runs on non-triggers do not duplicate same warnings.

Comment thread runtime/drivers/registry.go
Comment thread runtime/reconcilers/model.go Outdated
Comment thread runtime/reconcilers/model.go Outdated
Comment thread runtime/reconcilers/model.go Outdated
Comment thread runtime/reconcilers/model.go Outdated
// Surface partition and test failures as warnings or errors based on instance config
var warnings []string
warnings = append(warnings, testWarnings...)
if model.State.PartitionsHaveErrors {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A related problem is that the some partitions have errors error is not very useful. It would be nice if we could return Partition <id> failed with error: %w, and if multiple partitions failed, return such an error for the first, and return e.g. 9 other partitions also failed with errors.

Would that be easy to fit in here? Warnings might make it easier to return such lists.

Anyway, it's probably better to do this in a separate PR.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sure. Will do it separately.

Comment thread runtime/reconcilers/report.go Outdated
Comment thread runtime/catalog_cache.go
Comment thread runtime/reconcilers/model.go Dismissed
Comment thread runtime/reconcilers/model.go Dismissed
Comment thread proto/rill/runtime/v1/resources.proto Outdated
Comment thread runtime/reconcilers/alert.go Outdated
Comment thread runtime/reconcilers/alert.go Outdated
Comment thread runtime/reconcilers/model.go Outdated
Comment thread runtime/reconcilers/model.go Outdated

// We have continuously updated prevResult with new partition results, so we complete and return it here
prevResult.ExecDuration = time.Duration(totalExecDuration.Load())
prevResult.Warnings = append(prevResult.Warnings, syncWarnings...)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Isn't prevResult is re-used from previous runs? Worried this might cause it to grow infinitely.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The prevResult is manually constructed.

prevResult = &drivers.ModelResult{
	Connector:  model.State.ResultConnector,
	Properties: model.State.ResultProperties.AsMap(),
	Table:      model.State.ResultTable,
}

I added warnings: nil to be explicit.

Comment thread runtime/reconcilers/model.go Outdated
Comment thread runtime/reconcilers/model.go Outdated
Comment thread runtime/reconcilers/model.go Outdated
Comment thread runtime/reconcilers/model.go Outdated
Comment thread runtime/reconcilers/alert.go
Comment thread runtime/reconcilers/model.go Outdated
Comment thread runtime/reconcilers/model.go Outdated
Comment thread runtime/reconcilers/model.go Outdated
Comment thread runtime/reconcilers/model.go Outdated
Comment thread runtime/reconcilers/model.go Outdated

// We have continuously updated prevResult with new partition results, so we complete and return it here
prevResult.ExecDuration = time.Duration(totalExecDuration.Load())
prevResult.Warnings = append(prevResult.Warnings, syncWarnings...)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So if the warnings are not persisted, and not handled by drivers.ModelManager, then isn't it a little weird to pass the warnings as part of drivers.ModelResult? Should they perhaps be returned separately then?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The godoc on ModelResult says:

// ModelResult contains metadata about the result of a model execution.

Since warnings is also a metadata so can be added here. We also pass ExecDuration as part of Result which is also not peristed.

But if you prefer this can be returned separately as well.

Comment thread runtime/reconcilers/model.go Outdated
Comment thread runtime/reconcilers/model.go Outdated
k-anshul and others added 2 commits April 8, 2026 15:12
Co-authored-by: Benjamin Egelund-Müller <b@egelund-muller.com>
@k-anshul k-anshul merged commit 1ac7070 into main Apr 10, 2026
26 of 32 checks passed
@k-anshul k-anshul deleted the non_error_reconcile_status branch April 10, 2026 05:49
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.

3 participants