Add custom IDs to rego policies samples

When debugging Rego policies, using sample { ... } is very useful to test previous real inputs. However, sometimes the filtering capability in here (Example: sample { input.stack.id == “<stack_id>“ } ) is not enough to easily identify certain samples across time.

The unique identifier for “Sampled previous inputs” is a timestamp (Example: 2025-05-05 12:00:00), however, it would be very useful if some extra info in here could be set.

  1. I’d suggest adding some extra info in here by default, for instance the input.stack.name, input.push.branch (Push Policy), or others. This would provide some default QoL to quickly identify which sample you’re interested in instead of going one by one until you find the one you’re looking for.

  2. Additionally or alternatively, some sample_name output could be added to allow to the user the sampling name customization. For instance, “sample_name := input.stack.name“ would end up in a title like `2025-05-05 12:00:00 <my-stack-name>`.


Wdyt? This would improve debugging experience ( - frustration, - time consumption for debugging)

Please authenticate to join the conversation.

Upvoters
Status

⬆️ Gathering votes

Board

💡 Feature Requests

Tags

Policies

Date

6 days ago

Subscribe to post

Get notified by email when there are changes.