Skip to content

Feat: OLAP Table for CEL Eval Failures #2012

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

mrkaye97
Copy link
Contributor

@mrkaye97 mrkaye97 commented Jul 16, 2025

Description

Adding a table in the OLAP db for temporarily storing CEL evaluation failures + wiring up writes. We can also add this to the debug endpoint + webhooks once it merges

Will need to update the webhooks + debug endpoint PRs once this goes in

Type of change

  • New feature (non-breaking change which adds functionality)

Copy link

vercel bot commented Jul 16, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hatchet-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 25, 2025 9:55pm
hatchet-v0-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 25, 2025 9:55pm

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds a new OLAP table and end‐to‐end plumbing to record CEL (Common Expression Language) evaluation failures.

  • Introduce a new enum and partitioned v1_cel_evaluation_failures table with accompanying migration
  • Extend the trigger repository to collect failures and persist them via a new StoreCELEvaluationFailures method
  • Wire up message payloads and controllers to publish and consume CEL failure events into OLAP

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
sql/schema/v1-olap.sql Define new v1_cel_evaluation_failures enum and table partitions
pkg/repository/v1/trigger.go Capture and return CEL evaluation failures in TriggerFromEvents
pkg/repository/v1/sqlcv1/olap.sql.go Update partition function and add StoreCELEvaluationFailures SQL
pkg/repository/v1/sqlcv1/olap.sql Add SQLC definitions for partitioning and store failures query
pkg/repository/v1/sqlcv1/models.go Add enum, null wrapper, and model struct for CEL failure source
pkg/repository/v1/olap.go Define CELEvaluationFailure type, interface, and implementation
internal/services/shared/tasktypes/v1/olap.go Define CELEvaluationFailures message payload
internal/services/controllers/v1/task/controller.go Publish CEL failures to message queue
internal/services/controllers/v1/olap/controller.go Consume CEL failures messages and persist to OLAP
cmd/hatchet-migrate/migrate/migrations/20250716183217_v1_0_29.sql Goose migration for failure table
Comments suppressed due to low confidence (5)

pkg/repository/v1/sqlcv1/olap.sql.go:2346

  • Field Tenantid should be TenantID to follow Go's convention for initialisms (and update JSON tag to "tenant_id").
	Tenantid pgtype.UUID `json:"tenantid"`

pkg/repository/v1/olap.go:236

  • Exported interface method missing a doc comment; please add a comment explaining what StoreCELEvaluationFailures does and its failure conditions.
	StoreCELEvaluationFailures(ctx context.Context, tenantId string, failures []CELEvaluationFailure) error

pkg/repository/v1/olap.go:1693

  • New persistence logic for CEL failures lacks accompanying unit or integration tests; consider adding tests to validate that failures are correctly stored.
func (r *OLAPRepositoryImpl) StoreCELEvaluationFailures(ctx context.Context, tenantId string, failures []CELEvaluationFailure) error {

internal/services/shared/tasktypes/v1/olap.go:16

  • Unresolved package alias v1; this should reference the actual import alias (e.g., sqlcv1.CELEvaluationFailure) or alias the package correctly.
	Failures []v1.CELEvaluationFailure

internal/services/shared/tasktypes/v1/olap.go:19

  • Function signature uses v1.CELEvaluationFailure but the package is imported as sqlcv1; update to []sqlcv1.CELEvaluationFailure or alias the import as v1.
func CELEvaluationFailureMessage(tenantId string, failures []v1.CELEvaluationFailure) (*msgqueue.Message, error) {

@mrkaye97 mrkaye97 force-pushed the feat--table-for-cel-failures branch from 56fdfda to 3fef74e Compare July 25, 2025 20:48
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