feat:[NEXT-563] Added PolicyType filter#2373
Conversation
WalkthroughAdds two UI options entries for policy-related filters (filterId 16 and 17) in DB.sql and makes a minor quoting/formatting tweak to an existing Asset ID mapping for filterId 8. No schema or API changes. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
installer/resources/pacbot_app/files/DB.sql (2)
3413-3414: Switch to _resourceid for “Asset ID” filter (AssetListing) — verify backend and remove conflicting earlier override.Good move to align on _resourceid.keyword. However:
- Earlier in this script, the procedure update_filter_options_based_on_flag updates Asset ID to _docid.keyword (optionId 31 for filterId=8), then the new statement here flips it back to _resourceid. This churn is brittle and order-dependent.
- Please either update that procedure to use _resourceid as well, or delete the earlier override to keep a single source of truth.
Also, please verify the attribute=_resourceid path is supported by /compliance/v1/filters/attribute for type=asset in all environments.
Would you like me to produce a follow-up patch that updates the earlier update_filter_options_based_on_flag procedure to set _resourceid instead of _docid for consistency?
3415-3416: Adding “Policy Type” looks good; confirm field availability and consider fixing a nearby typo (“resourcetType”).
- The new options for filterId 16 (policyknowledgebase) and 17 (admin-policy) are consistent with existing patterns (optionType "String", endpoints under compliance).
- Please confirm the backend filter endpoints return policyType (and whether policyType or policyType.keyword is the expected field for aggregation/terms) to avoid empty lists.
Small cleanup adjacent to this change:
- There’s an earlier typo for filterId=16 where optionValue was set to resourcetType. Recommend normalizing that to resourceType to avoid downstream breakage.
You can run this corrective SQL once:
UPDATE pac_v2_ui_options SET optionValue = 'resourceType' WHERE filterId = 16 AND optionValue = 'resourcetType';
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
installer/resources/pacbot_app/files/DB.sql(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: SonarCloud-Build
- GitHub Check: Analyze (javascript)
- GitHub Check: Analyze (java)
Added PolicyType filter for Admin Policy Screen and User Policy Screen.
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also
list any relevant details for your test configuration
Checklist:
Other Information:
List any documentation updates that are needed for the Wiki
Summary by CodeRabbit