Add Sunbird KBI flow and registry to postman collection#2213
Add Sunbird KBI flow and registry to postman collection#2213nandhu-kumar wants to merge 1 commit into
Conversation
Signed-off-by: Nandhukumar <nandhukumare@gmail.com>
WalkthroughThe PR adds Sunbird Registry policy CRUD and Sunbird KBI PKCE authentication flows to the Postman collection, introduces related environment variables, and restricts chart publishing workflow inputs to YES/NO choices. ChangesSunbird testing flows
Workflow input controls
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Checkov (3.3.8).github/workflows/chart-lint-publish.ymlTraceback (most recent call last): postman-collection/Go-eSignet.postman_collection.jsonTraceback (most recent call last): postman-collection/Go-eSignet.postman_environment.jsonTraceback (most recent call last): 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@postman-collection/Go-eSignet.postman_collection.json`:
- Around line 1339-1358: Update the prerequest script for “Delete Policy” to
enable deletion only when the `sunbird_cleanup` environment value equals the
string `"true"`; treat unset, empty, and `"false"` values as disabled and
preserve the existing skip message and `pm.execution.skipRequest()` behavior.
🪄 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: Repository UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: e7799106-4290-4382-ac77-79816c981dd9
📒 Files selected for processing (3)
.github/workflows/chart-lint-publish.ymlpostman-collection/Go-eSignet.postman_collection.jsonpostman-collection/Go-eSignet.postman_environment.json
| { | ||
| "name": "Delete Policy", | ||
| "event": [ | ||
| { | ||
| "listen": "prerequest", | ||
| "script": { | ||
| "exec": [ | ||
| "// Opt-in cleanup: skipped by default so a top-to-bottom 'Run collection' does", | ||
| "// not delete the seeded record before '5 — Sunbird KBI' consumes it. Set", | ||
| "// sunbird_cleanup=true (and run this request manually, after KBI) to enable.", | ||
| "if (!pm.environment.get('sunbird_cleanup')) {", | ||
| " console.log('Skipping Delete Policy — set sunbird_cleanup=true to enable.');", | ||
| " pm.execution.skipRequest();", | ||
| "}" | ||
| ], | ||
| "type": "text/javascript", | ||
| "packages": {} | ||
| } | ||
| } | ||
| ], |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Cleanup guard uses truthiness, not value equality — sunbird_cleanup="false" still runs the delete.
!pm.environment.get('sunbird_cleanup') is only falsy for an empty/unset string. If a user sets sunbird_cleanup to "false" (a natural way to "disable" it), the string is non-empty and truthy, so the guard is bypassed and the delete request executes — the opposite of the documented intent ("Set to 'true' to enable ... left unset so it is skipped by default").
🐛 Proposed fix
- "if (!pm.environment.get('sunbird_cleanup')) {",
+ "if (pm.environment.get('sunbird_cleanup') !== 'true') {",
" console.log('Skipping Delete Policy — set sunbird_cleanup=true to enable.');",
" pm.execution.skipRequest();",
"}"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| { | |
| "name": "Delete Policy", | |
| "event": [ | |
| { | |
| "listen": "prerequest", | |
| "script": { | |
| "exec": [ | |
| "// Opt-in cleanup: skipped by default so a top-to-bottom 'Run collection' does", | |
| "// not delete the seeded record before '5 — Sunbird KBI' consumes it. Set", | |
| "// sunbird_cleanup=true (and run this request manually, after KBI) to enable.", | |
| "if (!pm.environment.get('sunbird_cleanup')) {", | |
| " console.log('Skipping Delete Policy — set sunbird_cleanup=true to enable.');", | |
| " pm.execution.skipRequest();", | |
| "}" | |
| ], | |
| "type": "text/javascript", | |
| "packages": {} | |
| } | |
| } | |
| ], | |
| { | |
| "name": "Delete Policy", | |
| "event": [ | |
| { | |
| "listen": "prerequest", | |
| "script": { | |
| "exec": [ | |
| "// Opt-in cleanup: skipped by default so a top-to-bottom 'Run collection' does", | |
| "// not delete the seeded record before '5 — Sunbird KBI' consumes it. Set", | |
| "// sunbird_cleanup=true (and run this request manually, after KBI) to enable.", | |
| "if (pm.environment.get('sunbird_cleanup') !== 'true') {", | |
| " console.log('Skipping Delete Policy — set sunbird_cleanup=true to enable.');", | |
| " pm.execution.skipRequest();", | |
| "}" | |
| ], | |
| "type": "text/javascript", | |
| "packages": {} | |
| } | |
| } | |
| ], |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@postman-collection/Go-eSignet.postman_collection.json` around lines 1339 -
1358, Update the prerequest script for “Delete Policy” to enable deletion only
when the `sunbird_cleanup` environment value equals the string `"true"`; treat
unset, empty, and `"false"` values as disabled and preserve the existing skip
message and `pm.execution.skipRequest()` behavior.
Summary by CodeRabbit
New Features
Improvements