Fix/sp 4207 cancel pending policy checks on workflow failure#138
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (6)
💤 Files with no reviewable changes (1)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdded release v1.6.1 and implemented cancellation of policy checks when the workflow fails before policy execution by introducing PolicyCheck.cancel(...) and invoking it from the main run() error handler. Changes
Sequence Diagram(s)sequenceDiagram
participant Runner as run()
participant PolicyMgr as PolicyCheck[]
participant GH as GitHub CheckRun API
Runner->>PolicyMgr: getPolicies()
Runner->>PolicyMgr: create and start checks
Runner->>PolicyMgr: execute workflow steps
alt workflow fails before policy execution
Runner->>PolicyMgr: for each policy -> cancel(summary)
PolicyMgr->>GH: finish check run with conclusion=Cancelled
GH-->>PolicyMgr: ack
Runner->>Runner: core.setFailed(error)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔍 SCANOSS Code Similarity Detected📄 2 snippet matches found 🔗 View detailed findings on commit 1b47863 65 files contain code similarities 💡 Click the commit link above to see detailed annotations for each match. |
SCANOSS SCAN Completed 🚀
View more details on SCANOSS Action Summary |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/main.ts`:
- Around line 42-43: The call to policyManager.getPolicies() can throw and must
be moved inside the existing try so errors are caught and reported via
core.setFailed(); initialize a local variable policies: PolicyCheck[] = [] (or
[] if you prefer) before the try, then assign policies =
policyManager.getPolicies() inside the try block, and add the required import
for PolicyCheck from './policies/policy-check' so the type compiles; ensure any
code that uses policies still reads the variable defined outside the try.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 1faf5933-08f5-478d-b0e7-8999147e0a5e
⛔ Files ignored due to path filters (1)
dist/index.jsis excluded by!**/dist/**
📒 Files selected for processing (4)
CHANGELOG.mdpackage.jsonsrc/main.tssrc/policies/policy-check.ts
1b47863 to
5d62c4c
Compare
🔍 SCANOSS Code Similarity Detected📄 2 snippet matches found 🔗 View detailed findings on commit 5d62c4c 65 files contain code similarities 💡 Click the commit link above to see detailed annotations for each match. |
SCANOSS SCAN Completed 🚀
View more details on SCANOSS Action Summary |
SCANOSS SCAN Completed 🚀
View more details on SCANOSS Action Summary |
Summary by CodeRabbit
Bug Fixes
Documentation
Chores