Skip to content

feat:[NEXT-563] Added PolicyType filter#2373

Open
arunpaladin wants to merge 1 commit into
masterfrom
feat/policy-fiter
Open

feat:[NEXT-563] Added PolicyType filter#2373
arunpaladin wants to merge 1 commit into
masterfrom
feat/policy-fiter

Conversation

@arunpaladin

@arunpaladin arunpaladin commented Aug 18, 2025

Copy link
Copy Markdown
Collaborator

Added PolicyType filter for Admin Policy Screen and User Policy Screen.

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Chore (no code changes)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

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

  • Test A
  • Test B

Checklist:

  • My code follows the style guidelines of this project
  • My commit message/PR follows the contribution guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Other Information:

List any documentation updates that are needed for the Wiki

Summary by CodeRabbit

  • New Features
    • Added “Policy Type” as a selectable option for policy-related compliance filters, enabling users to refine results by policy type across applicable views.
  • Style
    • Minor formatting/quoting cleanup in an existing Asset ID mapping entry with no functional impact.

@coderabbitai

coderabbitai Bot commented Aug 18, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Adds 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

Cohort / File(s) Summary
Database seed/config data
installer/resources/pacbot_app/files/DB.sql
- Added UI option rows: filterId 16 (Policy Type → policyType, /compliance/v1/filters/policyCompliance, String) and filterId 17 (Policy Type → policyType, /compliance/v1/filters/policy, String).
- Minor quoting/formatting adjustment on Asset ID mapping for filterId 8.
- Duplicate insertions appear in patch, net effect is two new Policy Type rows.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I thump my paws on fertile ground,
Two policy seeds now neatly found;
A quote aligned, a tidy tweak—
The filters speak the data’s speak.
In rows we hop, precise and light,
Compliance carrots set just right. 🥕

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

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • JIRA integration encountered authorization issues. Please disconnect and reconnect the integration in the CodeRabbit UI.
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/policy-fiter

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between cb4f2bb and 6c62bf3.

📒 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)

@kevin-paladin kevin-paladin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@arunpaladin arunpaladin enabled auto-merge (squash) August 18, 2025 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants