Skip to content

Added Print for Policy Outcome#1330

Open
ctrombley wants to merge 3 commits intomainfrom
straubt1/add-outcome-output-field
Open

Added Print for Policy Outcome#1330
ctrombley wants to merge 3 commits intomainfrom
straubt1/add-outcome-output-field

Conversation

@ctrombley
Copy link
Copy Markdown
Collaborator

Description

The policy-set-outcomes API response includes an output array on each outcome object containing print entries emitted by Sentinel policies. The Outcome struct does not expose this field.

There are additional fields that can be added, but "print" is the output of the the policy logs.

Continued from #1287.

Changes

  • Added OutcomeOutput struct with a Print string field (jsonapi:"attr,print")
  • Added Output []OutcomeOutput field to Outcome struct (jsonapi:"attr,output,omitempty")
  • Added unit tests in policy_evaluation_test.go covering field present and field absent cases
  • Updated policy_evaluation_beta_test.go with an assertion and comment for the Output field
  • Added CHANGELOG entry under Enhancements

Testing

  • go build ./... passes
  • go vet ./... passes (pre-existing warning in examples/backing_data/main.go unrelated to this change)
  • Unit tests TestPolicySetOutcomes_OutcomeOutputDeserialization and TestPolicySetOutcomes_OutcomeOutputEmpty pass

@ctrombley ctrombley self-assigned this May 6, 2026
@ctrombley ctrombley requested a review from a team as a code owner May 6, 2026 05:37
@datadog-terraform-cloud-hashicorp
Copy link
Copy Markdown

datadog-terraform-cloud-hashicorp Bot commented May 6, 2026

Tests

Fix all issues with Cursor

⚠️ Warnings

❄️ 2 New flaky tests detected

TestPolicySetOutcomes_OutcomeOutputDeserialization from policy_evaluation_test.go   View in Datadog   (Fix with Cursor)
testing: t.Parallel called multiple times
TestPolicySetOutcomes_OutcomeOutputEmpty from policy_evaluation_test.go   View in Datadog   (Fix with Cursor)
testing: t.Parallel called multiple times

ℹ️ Info

No other issues found (see more)

🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 9619cae | Docs | Give us feedback!

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