fix(genbi): harden non-dict apps.yml entries in list/get/register - #2587
fix(genbi): harden non-dict apps.yml entries in list/get/register#2587Bartok9 wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughGenBI index operations now handle non-mapping app entries safely. The app list command skips malformed entries, normalizes invalid deployment data, and safely reads deployment URLs. Unit tests cover index operations and list behavior. ChangesGenBI malformed data handling
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
core/wren/tests/unit/test_genbi_list_nonduct.py (1)
13-27: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCover malformed
deployvalues.This test verifies invalid app entries but not the new non-dictionary
deployhandling incore/wren/src/wren/genbi/cli.pylines 210-214. Add a valid app whosedeployvalue is a scalar and assert listing succeeds without a URL suffix.Proposed test extension
"apps": { "good": {"data_mode": "snapshot", "status": "ready"}, "bad": "not-a-mapping", + "bad-deploy": { + "data_mode": "snapshot", + "status": "ready", + "deploy": "not-a-mapping", + }, }, ... assert "good" in result.stdout + assert "bad-deploy [snapshot, ready]" in result.stdout assert "invalid entry" in result.stdout🤖 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 `@core/wren/tests/unit/test_genbi_list_nonduct.py` around lines 13 - 27, Extend the test around save_index and the genbi_app list invocation with a valid app whose deploy field is a scalar rather than a mapping. Keep the successful listing assertions, and verify that this app is listed without a URL suffix while the existing malformed app still produces the invalid-entry output.
🤖 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.
Nitpick comments:
In `@core/wren/tests/unit/test_genbi_list_nonduct.py`:
- Around line 13-27: Extend the test around save_index and the genbi_app list
invocation with a valid app whose deploy field is a scalar rather than a
mapping. Keep the successful listing assertions, and verify that this app is
listed without a URL suffix while the existing malformed app still produces the
invalid-entry output.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: c0ae7cda-7e1c-4dd0-8e53-a4f05b649f76
📒 Files selected for processing (2)
core/wren/src/wren/genbi/cli.pycore/wren/tests/unit/test_genbi_list_nonduct.py
- list: report invalid entries; treat non-dict deploy as empty - get_app: non-dict → None (not registered) - register_app: replace truthy non-dict instead of TypeError - update_app: KeyError on missing/non-dict Addresses goldmedal review on Canner#2583/Canner#2587 (single PR).
9921cdd to
0fc97c3
Compare
|
@goldmedal folded the #2583 + #2587 work into this single PR and rebased on current
Closing #2583 as the duplicate against the same files. |
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
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 `@core/wren/tests/unit/test_genbi_list_nonduct.py`:
- Around line 44-46: Update the test around the genbi_app list invocation to
assert that the invalid non-dictionary deploy value, including “https://x”, is
absent from result.stdout while preserving the existing successful exit-code and
app-name assertions.
🪄 Autofix
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: CHILL
Plan: Pro Plus
Run ID: 471b8ba2-d888-4d21-b972-8bbec0268150
📒 Files selected for processing (4)
core/wren/src/wren/genbi/cli.pycore/wren/src/wren/genbi/index.pycore/wren/tests/unit/test_genbi_index.pycore/wren/tests/unit/test_genbi_list_nonduct.py
🚧 Files skipped from review as they are similar to previous changes (1)
- core/wren/src/wren/genbi/cli.py
CodeRabbit: non-dict deploy must not render last_url.
Summary
Single PR for hand-edited
apps.ymlnon-dict entries (folds #2583 + prior #2587 list work):listdeploytreated as emptyget_appNone(CLI "not registered")register_appTypeErroron item assignmentupdate_appKeyErrorwhen missing/non-dictReproduction (base / before)
Verification
Summary by CodeRabbit
Bug Fixes
Tests