Skip to content

Fix filtering by repository on the contributor dependency widget data#121

Merged
borfast merged 1 commit intomainfrom
bugfix/fix-repository-filtering-on-contributor-dependency
Mar 18, 2025
Merged

Fix filtering by repository on the contributor dependency widget data#121
borfast merged 1 commit intomainfrom
bugfix/fix-repository-filtering-on-contributor-dependency

Conversation

@borfast
Copy link
Copy Markdown
Contributor

@borfast borfast commented Mar 18, 2025

Summary by CodeRabbit

  • New Features
    • Enhanced filtering capabilities now offer an option to specify data aggregation levels for more tailored results.
    • Updated parameter naming for improved clarity when configuring queries for project data.

@borfast borfast added the bug Something isn't working label Mar 18, 2025
@borfast borfast requested review from epipav and joanagmaia March 18, 2025 12:03
@borfast borfast self-assigned this Mar 18, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 18, 2025

Walkthrough

The pull request updates the backend API for contributor dependencies and the associated type definitions. In the API handler, it imports the ContributorDependencyFilter type, explicitly types the filter object, and renames the repository property to repo. In the type declarations, an optional granularity property is added to both ContributorDependencyFilter and OrganizationDependencyFilter, enhancing flexibility in data filtering. The overall structure and logic remain unchanged.

Changes

File(s) Change Details
frontend/.../contributors/contributor-dependency.get.ts - Import ContributorDependencyFilter from ~~/server/data/types
- Explicitly type the filter object
- Rename repository to repo
frontend/.../types.ts - Add optional property granularity?: FilterGranularity to ContributorDependencyFilter
- Add optional property granularity?: FilterGranularity to OrganizationDependencyFilter

Possibly related PRs

Suggested reviewers

  • gaspergrom
  • emlimlf
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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

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

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.

Signed-off-by: Raúl Santos <4837+borfast@users.noreply.github.com>
@borfast borfast force-pushed the bugfix/fix-repository-filtering-on-contributor-dependency branch from 0b79239 to ca6f823 Compare March 18, 2025 12:04
@borfast
Copy link
Copy Markdown
Contributor Author

borfast commented Mar 18, 2025

Because it's such a simple change, I'm going to skip review and just merge and deploy directly, since we're really tight on time.

@borfast borfast merged commit 28e5534 into main Mar 18, 2025
2 checks passed
@borfast borfast deleted the bugfix/fix-repository-filtering-on-contributor-dependency branch March 18, 2025 12:05
Copy link
Copy Markdown

@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: 0

🧹 Nitpick comments (1)
frontend/server/api/project/[slug]/contributors/contributor-dependency.get.ts (1)

30-36: Update API documentation comments to match implementation

The API documentation comments mention a query parameter named repository, but in the type definition it's named repo. While the code correctly handles this mapping, updating the documentation would improve clarity for future maintainers.

 /**
  * Query params:
  * - metric: 'all' | 'commits' | (see metrics options)
  * - project: string
- * - repository: string
+ * - repository: string (maps to repo in filter)
  * - time-period: string
+ * - granularity: string (optional)
  */
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between efde9d6 and ca6f823.

📒 Files selected for processing (2)
  • frontend/server/api/project/[slug]/contributors/contributor-dependency.get.ts (2 hunks)
  • frontend/server/data/types.ts (2 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
frontend/server/api/project/[slug]/contributors/contributor-dependency.get.ts (1)
frontend/server/data/types.ts (1) (1)
  • ContributorDependencyFilter (61:69)
🔇 Additional comments (4)
frontend/server/data/types.ts (2)

61-69: Approved: Added granularity option to ContributorDependencyFilter

The addition of the optional granularity property to ContributorDependencyFilter enhances flexibility for data filtering and is consistent with other filter types in the codebase like ActiveContributorsFilter and RetentionFilter.


71-79: Approved: Added granularity option to OrganizationDependencyFilter

Similarly, adding the optional granularity property to OrganizationDependencyFilter maintains consistency across filter types and provides more flexible data aggregation options.

frontend/server/api/project/[slug]/contributors/contributor-dependency.get.ts (2)

3-3: Approved: Added ContributorDependencyFilter type import

Adding this import improves type safety by enabling explicit typing of the filter object.


45-53: Approved: Filter object explicitly typed and property name updated

Explicitly typing the filter object as ContributorDependencyFilter improves type safety. The code correctly maps query.repository to the repo property to maintain backwards compatibility while aligning with the type definition.

@borfast borfast assigned borfast and unassigned borfast May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant