Skip to content

feat(errorsx): add database and gRPC error stack hooks - #3736

Merged
migmartri merged 2 commits into
chainloop-dev:mainfrom
migmartri:miguel/pfm-8040-record-error-stacks
Oct 27, 2026
Merged

migmartri merged 2 commits into
chainloop-dev:mainfrom
migmartri:miguel/pfm-8040-record-error-stacks

Conversation

@migmartri

@migmartri migmartri commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Record origin stacks for control plane database errors and provide the gRPC hooks needed to do the same for unary and streaming RPC errors.

  • Add shared error helpers that preserve origin stacks, error messages, and error unwrapping.
  • Wrap Ent query, execution, transaction, and result-row errors while keeping schema loading on a plain driver.
  • Support ping through wrapped Ent drivers.
  • Allow gRPC connections to install unary and stream client interceptors.

Closes #3735

Assisted-by: pi

View guided diff

Add shared origin-stack error helpers and wrap the control plane Ent driver so query, transaction, and row-read errors retain their origin stacks. Keep schema loading on a plain driver and let Ping work through wrapped drivers.

Allow grpcconn clients to install unary and stream interceptors.

Refs PFM-8040
Closes chainloop-dev#3735

Assisted-by: pi
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
@chainloop-platform

chainloop-platform Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

PR validation — ✅ 3 passing

Status Policy Material Messages
✅ Passed pr-min-approvals pr-info -
✅ Passed pr-description-required pr-info -
✅ Passed pr-user-story-linked pr-info -

View attestation ↗

AI Session Checks — ⚠️ no AI session found

Missing AI Coding Sessions

This organization requires every PR to be backed by a Chainloop Trace AI coding session, and none was found for this one.

Please make sure the AI coding session evidence has been sent by the Chainloop CLI, or add the skip-ai-session label to this PR to bypass this check.

Learn more about Chainloop Trace.

Security Checks — ✅ 5 passing

✅ secret-scan

Status Policy Messages
✅ Passed secrets-detection -

✅ sast-scan

Status Policy Messages
✅ Passed owasp-top10-2025 -
✅ Passed sast -
✅ Passed cwe-top25 -
✅ Passed cwe-top26-40-cusp -
Scans not applied (3)
Scan Reason
vulnerability-scan no manifest/lockfile changed
github-actions-scan no workflow files changed
iac-scan no IaC files changed

View attestation ↗

Security context

✅ Nothing this change touches has a recorded security-fix history.

View in Chainloop ↗ · How this works ↗


Powered by Chainloop and Chainloop Trace

@cubic-dev-ai cubic-dev-ai 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.

All reported issues were addressed across 10 files

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

Comment thread pkg/errorsx/errorsxtest/errorsxtest.go Resolved
@migmartri
migmartri requested a review from a team October 27, 2026 17:13
Use the sentry-go default error depth in ErrorExceptions and cover chains longer than ten errors.

Assisted-by: pi
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>

@matiasinsaurralde matiasinsaurralde 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.

LGTM

@migmartri
migmartri merged commit 5baeb3d into chainloop-dev:main Oct 27, 2026
17 of 18 checks passed
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.

Record origin stacks for control plane database and gRPC errors

2 participants