-
-
Notifications
You must be signed in to change notification settings - Fork 3
feat(monitoring): Integrate Sentry SDK + docker security fix #63
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
Conversation
📝 WalkthroughWalkthroughAdds optional Sentry error-reporting to the entrypoint (guarded import, init when SENTRY_DSN set, capture on exception). Adds Changes
Sequence DiagramsequenceDiagram
participant App as Application
participant SDK as Sentry SDK
participant Service as Sentry Service
Note over App: Process startup (__main__)
App->>App: Read SENTRY_DSN env
alt SENTRY_DSN set and SDK available
App->>SDK: Initialize with DSN, tags (repository, actor, run_id) and GitHub context
else
Note over App: Sentry not initialized
end
rect rgba(100,150,200,0.5)
App->>App: try: main()
end
alt Exception in main()
App->>SDK: Capture exception
SDK->>Service: Send error/event
App->>App: Re-raise exception
else
Note over App: Normal exit
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
Dockerfile (1)
59-68:⚠️ Potential issue | 🟡 MinorUpdate the comment to reflect
runuserinstead of gosu.Line 68 still references gosu, which is no longer used after the change on Line 59.
📝 Proposed comment fix
-# in entrypoint.sh, then drop privileges to appuser using gosu. +# in entrypoint.sh, then drop privileges to appuser using runuser.
🤖 Fix all issues with AI agents
In `@action_entrypoint.py`:
- Around line 13-20: There is a duplicate import of the module name "glob" (two
consecutive "import glob" lines); remove the redundant import so "glob" is only
imported once in the top-level imports (leave the single import glob and keep
the existing pathlib and sentry_sdk try/except intact) to resolve the Ruff F811
duplicate-definition error.
- Around line 445-450: The except block catching exceptions from main() should
re-raise the original exception with its full traceback; in the try/except
around main() (referencing main(), sentry_dsn, sentry_sdk and
sentry_sdk.capture_exception), replace the current "raise e" with a bare "raise"
so the original traceback is preserved after optionally calling
sentry_sdk.capture_exception(e).
In `@requirements.txt`:
- Line 105: Pin the sentry-sdk package in requirements.in by adding a version
constraint (e.g., sentry-sdk==X.Y.Z or a compatible specifier) and then
regenerate the lockfile with hashes by running pip-compile --generate-hashes
--output-file=requirements.txt requirements.in so requirements.txt contains the
pinned sentry-sdk entry with hashes; ensure the chosen version is compatible
with the project before committing.
- Around line 7-55: The requirements.txt currently contains a duplicated package
block; remove the entire first requirements block (the earlier header and
packages) so only the authoritative second block remains (the one containing the
corrected sympy hash and typing-extensions==4.15.0). Ensure the top-of-file
autogenerated header appears only once and that sympy==1.12 retains its
corrected third hash. For the unpinned sentry-sdk entry, either remove that line
or pin sentry-sdk to a specific version and include its --hash entries to
satisfy --require-hashes (i.e., add a version and corresponding sha256 hashes),
then run pip-compile to regenerate hashes if needed.
…back, update comments)
🛡️ Security Fixes
gosu(which had 4 Critical + 19 High CVEs) and replaced it with nativerunuser.🔭 Monitoring & Observability
sentry-sdkdependency.SENTRY_DSNsecret is present.traces_sample_rate=1.0) to monitor verification latency.✅ Verification
ZeroDivisionError.Summary by CodeRabbit
New Features
Bug Fixes
Chores