Skip to content

feat(workbench): introduce timeline severity bitmask cache and hasSeverity CEL function - #914

Merged
kyasbal merged 2 commits into
GoogleCloudPlatform:mainfrom
kyasbal:push-nqznuopzysvm
Aug 27, 2026
Merged

kyasbal merged 2 commits into
GoogleCloudPlatform:mainfrom
kyasbal:push-nqznuopzysvm

Conversation

@kyasbal

@kyasbal kyasbal commented Aug 27, 2026

Copy link
Copy Markdown
Member

Summary

Previously, timeline filtering by severity in the backend was limited to minSeverity(order), which only checked whether the timeline's maximum severity met a given threshold. Specific severity matching or arbitrary sets of severities could not be filtered efficiently at the timeline level.

This PR introduces:

  • SeverityMask uint8 on cel.TimelineData to record which severity levels are present in each timeline using bitwise operations across events and revisions during indexing.
  • hasSeverity(int) and hasSeverity(list<int>) CEL functions in TimelineEvaluator to evaluate whether a timeline contains logs matching a single severity or any severity in a given list.
  • Comprehensive table-driven tests in cel/env_test.go and workbench/index_test.go.

Testing

  • go test ./pkg/server/workbench/...
  • make build-go
  • make test-go
  • make lint-go
  • make format-go
  • make pre-commit
…erity CEL function

Previously, timeline filtering by severity in the backend was limited to
minSeverity(order), which only checked whether the timeline's maximum
severity met a given threshold. Specific severity matching or arbitrary
sets of severities could not be filtered efficiently at the timeline level.

This commit introduces:
- SeverityMask uint8 on cel.TimelineData to record which severity levels
  are present in each timeline using bitwise operations across events and
  revisions during indexing.
- hasSeverity(int) and hasSeverity(list<int>) CEL functions in
  TimelineEvaluator to evaluate whether a timeline contains logs matching
  a single severity or any severity in a given list.

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request introduces a new hasSeverity CEL function to check if a timeline matches a specific severity or a list of severities. This is supported by adding a SeverityMask to TimelineData and computing it during timeline indexing. The review feedback points out a potential runtime panic in hasSeverityList where list.Size().(types.Int) is type-asserted without the comma-ok idiom, which could crash the application if an error or non-integer type is returned.

Comment thread pkg/server/workbench/cel/env.go Resolved
@kyasbal kyasbal added the type:feature New feature or request label Aug 27, 2026
@kyasbal
kyasbal merged commit 8b3892a into GoogleCloudPlatform:main Aug 27, 2026
16 checks passed
@kyasbal
kyasbal deleted the push-nqznuopzysvm branch August 27, 2026 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature New feature or request

1 participant