Skip to content

Conversation

@Dishant1804
Copy link
Collaborator

Resolves #1719

  • created chunks for committee data

@Dishant1804 Dishant1804 requested a review from arkid15r as a code owner July 9, 2025 05:32
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 9, 2025

Summary by CodeRabbit

  • New Features
    • Introduced a new management command to generate text chunks and AI embeddings from committee data, supporting processing by committee key, all committees, or only active committees.
    • Added a Makefile target to easily run the new command for creating committee chunks.

Walkthrough

A new Django management command, ai_create_committee_chunks, was added to automate the creation of text chunks and embeddings from committee data for retrieval-augmented generation. Additionally, a Makefile target was introduced to run this command conveniently. No other existing functionality was modified.

Changes

Files/Paths Change Summary
backend/apps/ai/Makefile Added Makefile target ai-create-committee-chunks to invoke the new management command.
backend/apps/ai/management/commands/ai_create_committee_chunks.py Introduced new Django management command for chunking and embedding committee data for AI retrieval.

Assessment against linked issues

Objective (Issue #) Addressed Explanation
Implement committee context related functionality; create the chunks of committee data for handling the committee related queries (#1719)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes found.

Possibly related PRs

  • Created project chunks #1707: Adds a similar command and Makefile target for project chunks, paralleling the committee chunk creation in this PR.
  • event chunks created #1715: Introduces a management command and Makefile target for event chunk creation, following the same chunking and embedding approach.

Suggested labels

backend, makefile

Suggested reviewers

  • arkid15r
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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.

Documentation and Community

  • 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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a7fceb0 and 36ed52b.

📒 Files selected for processing (2)
  • backend/apps/ai/Makefile (1 hunks)
  • backend/apps/ai/management/commands/ai_create_committee_chunks.py (1 hunks)
🔇 Additional comments (5)
backend/apps/ai/Makefile (1)

5-7: LGTM! Consistent with existing patterns.

The new Makefile target follows the same pattern as existing AI chunk creation targets, maintaining consistency in the codebase.

backend/apps/ai/management/commands/ai_create_committee_chunks.py (4)

66-66: Chunk.bulk_save method confirmed
The bulk_save method exists in the Chunk model at backend/apps/ai/models/chunk.py (around lines 40–42) and delegates to BulkSaveModel.bulk_save. No further action is needed.


81-81: Chunk.split_text method implementation found

The split_text method is defined in backend/apps/ai/models/chunk.py at line 45:

  • def split_text(text: str) -> list[str]:

No further action is needed.


36-36: Walrus operator usage is safe: project requires Python ≥3.13

The backend’s pyproject.toml specifies

python = "^3.13"

which ensures Python 3.13 (and thus ≥3.8) is used. The walrus operator at lines 36, 44, and 51 is fully supported—no change needed.


87-91: Confirmed: create_chunks_and_embeddings is implemented with error handling
The function is defined in backend/apps/ai/common/utils.py (lines 16–64) and wraps the OpenAI call in a try/except Exception block, logging any errors and returning an empty list on failure. No further changes needed.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 9, 2025

@arkid15r arkid15r enabled auto-merge July 9, 2025 17:16
@arkid15r arkid15r added this pull request to the merge queue Jul 9, 2025
Merged via the queue into OWASP:main with commit b7bb4f6 Jul 9, 2025
24 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Aug 18, 2025
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement committee context related functionality

2 participants