Skip to content

Improvement/development types#91

Merged
emlimlf merged 9 commits intomainfrom
improvement/development-types
Mar 11, 2025
Merged

Improvement/development types#91
emlimlf merged 9 commits intomainfrom
improvement/development-types

Conversation

@emlimlf
Copy link
Copy Markdown
Collaborator

@emlimlf emlimlf commented Mar 11, 2025

In this PR

Moved all the development chart widget types to the common shared type folder

Ticket

INS-155

Summary by CodeRabbit

Summary by CodeRabbit

  • Refactor
    • Improved the underlying data handling across various metric and chart components for a more consistent display.
    • Streamlined the retention analysis view by simplifying chart controls for clearer data visualization.
    • Standardized naming and consolidation of data interfaces to ensure reliable and predictable metric presentations.
    • Updated import paths for type definitions across multiple components to enhance organization and clarity.
    • Removed obsolete type definitions and interfaces to simplify the codebase and improve maintainability.
    • Enhanced the date range picker and menu components for better user interaction and responsiveness.

emlimlf added 6 commits March 11, 2025 09:31
Signed-off-by: Efren Lim <elim@linuxfoundation.org>
Signed-off-by: Efren Lim <elim@linuxfoundation.org>
Signed-off-by: Efren Lim <elim@linuxfoundation.org>
Signed-off-by: Efren Lim <elim@linuxfoundation.org>
Signed-off-by: Efren Lim <elim@linuxfoundation.org>
Signed-off-by: Efren Lim <elim@linuxfoundation.org>
@emlimlf emlimlf requested review from borfast and gaspergrom March 11, 2025 02:31
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 11, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request standardizes the type imports and definitions across the project. Import statement paths have been updated in many Vue components—from relative and legacy paths to new alias paths (e.g. using ~~/types/...). Several constants (such as granularity values) have been reformatted to uppercase, and redundant or legacy type definitions have been removed in favor of new centralized type files. Minor refactoring of computed properties has been applied in some dependency components, and documentation/issues in mock and API-related files have been updated.

Changes

File(s) Change Summary
Contributors & Organizations Components
frontend/app/components/modules/project/components/contributors/active-contributors.vue
frontend/app/components/modules/project/components/contributors/active-organizations.vue
frontend/app/components/modules/project/components/contributors/contributor-dependency.vue
frontend/app/components/modules/project/components/contributors/contributors-leaderboard.vue
frontend/app/components/modules/project/components/contributors/organization-dependency.vue
frontend/app/components/modules/project/components/contributors/organizations-leaderboard.vue
Updated type import paths from local files (e.g. ./types/contributors.types and ~/components/shared/types/summary.types) to new alias paths (~~/types/contributors/responses.types and ~~/types/shared/summary.types). Refactored computed properties in dependency components to centralize type casting.
Development Components
frontend/app/components/modules/project/components/development/active-days.vue
frontend/app/components/modules/project/components/development/average-time-to-merge.vue
frontend/app/components/modules/project/components/development/code-review-engagement.vue
frontend/app/components/modules/project/components/development/contributions-outside-work-hours.vue
frontend/app/components/modules/project/components/development/issues-resolution.vue
frontend/app/components/modules/project/components/development/merge-lead-time.vue
frontend/app/components/modules/project/components/development/pull-requests.vue
frontend/app/components/modules/project/components/development/wait-time-first-review.vue
frontend/app/components/modules/project/components/development/review-time-by-pull-request-size.vue
frontend/app/components/modules/project/components/development/fragments/pull-request-legend-item.vue
Updated type imports from local paths to ~~/types/development/responses.types and standardized imports for Summary via ~~/types/shared/summary.types. Reformatted several import statements and ensured constant naming consistency.
Popularity Components
frontend/app/components/modules/project/components/popularity/forks.vue
frontend/app/components/modules/project/components/popularity/github-mentions.vue
frontend/app/components/modules/project/components/popularity/press-mentions.vue
frontend/app/components/modules/project/components/popularity/social-mentions.vue
frontend/app/components/modules/project/components/popularity/stars.vue
Updated type imports from relative paths (e.g. ./types/popularity.types or ./types/mentions.types) to use the new alias path ~~/types/popularity/responses.types, and updated the Summary import to ~~/types/shared/summary.types.
UI Config & Helpers
frontend/app/components/modules/project/components/contributors/config/granularity-tabs.ts
frontend/app/components/modules/project/components/contributors/retention.vue
frontend/app/components/uikit/chart/helpers/formatters.ts
frontend/app/components/uikit/delta-display/types/delta-display.types.ts
Updated import paths for Granularity and Summary to new alias sources. In granularity-tabs.ts, granularity values were changed from camelCase to uppercase constants. In retention.vue, the chart type selection UI was removed (commented out) and a computed property using the Retention type was introduced.
Type Definitions & Removals
frontend/app/components/modules/project/components/contributors/types/contributors.types.ts
frontend/app/components/modules/project/components/development/types/* (e.g. active-days.types.ts, average-time-merge.types.ts, etc.)
frontend/app/components/modules/project/components/popularity/types/popularity.types.ts
New files under frontend/types/ (contributors, development, popularity responses; shared/granularity; shared/summary)
Removed numerous legacy TypeScript interfaces and local type files. Introduced new centralized type definition files under frontend/types/ that define unified interfaces (e.g. ActiveContributors, AverageTimeMerge, StarsData, etc.) and added a new shared Granularity enum and a Meta interface for Summary. Import paths in components were updated accordingly.
Server & Mocks
frontend/server/api/project/[slug]/contributors/retention.get.ts
frontend/server/mocks/retention.mock.ts
In the API file, comments were updated to change the expected date keys from dateFrom/dateTo to startDate/endDate. In the mock data, property names were uniformly renamed from dateFrom/dateTo to startDate/endDate.

Possibly related PRs

  • Stars and forks widgets #46: Updates type import paths for contributors and organizations, referencing the new centralized type definitions.
  • Improvement/average time merge #57: Modifies import statements for type definitions, aligning with the new paths for contributor response types.
  • Improvement/review time pr #56: Aligns type import updates in active-contributors.vue with similar changes in development components, reflecting a project-wide restructuring of type definitions.

Suggested reviewers

  • gaspergrom

📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between e7e2421 and 00b0e80.

⛔ Files ignored due to path filters (1)
  • frontend/public/favicon.ico is excluded by !**/*.ico
📒 Files selected for processing (106)
  • frontend/app/components/modules/project/components/contributors/config/granularity-tabs.ts (4 hunks)
  • frontend/app/components/shared/types/granularity.ts (1 hunks)
  • frontend/app/components/uikit/chart/helpers/formatters.ts (4 hunks)
  • frontend/types/shared/granularity.ts (1 hunks)
  • frontend/app/components/modules/project/components/contributors/active-contributors.vue (2 hunks)
  • frontend/app/components/modules/project/components/contributors/active-organizations.vue (2 hunks)
  • frontend/app/components/modules/project/components/contributors/types/contributors.types.ts (1 hunks)
  • frontend/app/components/modules/project/components/development/active-days.vue (3 hunks)
  • frontend/app/components/modules/project/components/development/average-time-to-merge.vue (2 hunks)
  • frontend/app/components/modules/project/components/development/code-review-engagement.vue (2 hunks)
  • frontend/app/components/modules/project/components/development/contributions-outside-work-hours.vue (3 hunks)
  • frontend/app/components/modules/project/components/development/fragments/pull-request-legend-item.vue (1 hunks)
  • frontend/app/components/modules/project/components/development/merge-lead-time.vue (2 hunks)
  • frontend/app/components/modules/project/components/development/pull-requests.vue (2 hunks)
  • frontend/app/components/modules/project/components/development/types/active-days.types.ts (1 hunks)
  • frontend/app/components/modules/project/components/development/types/average-time-merge.types.ts (1 hunks)
  • frontend/app/components/modules/project/components/development/types/code-review-engagement.types.ts (1 hunks)
  • frontend/app/components/modules/project/components/development/types/contribution-outside-hours.types.ts (1 hunks)
  • frontend/app/components/modules/project/components/development/types/issues-resolution.types.ts (1 hunks)
  • frontend/app/components/modules/project/components/development/types/merge-lead-time.types.ts (1 hunks)
  • frontend/app/components/modules/project/components/development/types/pull-requests.types.ts (1 hunks)
  • frontend/app/components/modules/project/components/development/types/wait-time-1st-review.types.ts (1 hunks)
  • frontend/app/components/modules/project/components/development/wait-time-first-review.vue (2 hunks)
  • frontend/app/components/modules/project/components/popularity/forks.vue (2 hunks)
  • frontend/app/components/modules/project/components/popularity/github-mentions.vue (2 hunks)
  • frontend/app/components/modules/project/components/popularity/press-mentions.vue (2 hunks)
  • frontend/app/components/modules/project/components/popularity/social-mentions.vue (2 hunks)
  • frontend/app/components/modules/project/components/popularity/stars.vue (2 hunks)
  • frontend/app/components/modules/project/components/popularity/types/mentions.types.ts (1 hunks)
  • frontend/app/components/modules/project/components/popularity/types/popularity.types.ts (1 hunks)
  • frontend/app/components/uikit/delta-display/types/delta-display.types.ts (1 hunks)
  • frontend/app/components/modules/project/components/contributors/active-contributors.vue (1 hunks)
  • frontend/app/components/modules/project/components/contributors/active-organizations.vue (1 hunks)
  • frontend/app/components/modules/project/components/contributors/types/contributors.types.ts (1 hunks)
  • frontend/app/components/modules/project/components/development/active-days.vue (2 hunks)
  • frontend/app/components/modules/project/components/development/average-time-to-merge.vue (1 hunks)
  • frontend/app/components/modules/project/components/development/code-review-engagement.vue (1 hunks)
  • frontend/app/components/modules/project/components/development/contributions-outside-work-hours.vue (2 hunks)
  • frontend/app/components/modules/project/components/development/fragments/pull-request-legend-item.vue (1 hunks)
  • frontend/app/components/modules/project/components/development/merge-lead-time.vue (1 hunks)
  • frontend/app/components/modules/project/components/development/pull-requests.vue (1 hunks)
  • frontend/app/components/modules/project/components/development/wait-time-first-review.vue (1 hunks)
  • frontend/app/components/modules/project/components/popularity/forks.vue (1 hunks)
  • frontend/app/components/modules/project/components/popularity/github-mentions.vue (1 hunks)
  • frontend/app/components/modules/project/components/popularity/press-mentions.vue (1 hunks)
  • frontend/app/components/modules/project/components/popularity/social-mentions.vue (1 hunks)
  • frontend/app/components/modules/project/components/popularity/stars.vue (1 hunks)
  • frontend/app/components/uikit/chart/helpers/formatters.ts (3 hunks)
  • frontend/types/shared/summary.types.ts (1 hunks)
  • frontend/app/components/modules/project/components/contributors/active-contributors.vue (1 hunks)
  • frontend/app/components/modules/project/components/contributors/active-organizations.vue (1 hunks)
  • frontend/app/components/modules/project/components/contributors/contributor-dependency.vue (2 hunks)
  • frontend/app/components/modules/project/components/contributors/contributors-leaderboard.vue (1 hunks)
  • frontend/app/components/modules/project/components/contributors/organization-dependency.vue (2 hunks)
  • frontend/app/components/modules/project/components/contributors/organizations-leaderboard.vue (1 hunks)
  • frontend/app/components/modules/project/components/contributors/retention.vue (5 hunks)
  • frontend/app/components/modules/project/components/contributors/types/contributors.types.ts (0 hunks)
  • frontend/server/api/project/[slug]/contributors/retention.get.ts (1 hunks)
  • frontend/server/mocks/retention.mock.ts (1 hunks)
  • frontend/types/contributors/responses.types.ts (1 hunks)
  • frontend/app/components/modules/project/components/popularity/forks.vue (1 hunks)
  • frontend/app/components/modules/project/components/popularity/github-mentions.vue (1 hunks)
  • frontend/app/components/modules/project/components/popularity/press-mentions.vue (1 hunks)
  • frontend/app/components/modules/project/components/popularity/social-mentions.vue (1 hunks)
  • frontend/app/components/modules/project/components/popularity/stars.vue (1 hunks)
  • frontend/app/components/modules/project/components/popularity/types/popularity.types.ts (0 hunks)
  • frontend/types/popularity/responses.types.ts (1 hunks)
  • frontend/app/components/modules/project/components/development/active-days.vue (1 hunks)
  • frontend/app/components/modules/project/components/development/average-time-to-merge.vue (1 hunks)
  • frontend/app/components/modules/project/components/development/code-review-engagement.vue (1 hunks)
  • frontend/app/components/modules/project/components/development/contributions-outside-work-hours.vue (1 hunks)
  • frontend/app/components/modules/project/components/development/merge-lead-time.vue (1 hunks)
  • frontend/app/components/modules/project/components/development/pull-requests.vue (1 hunks)
  • frontend/app/components/modules/project/components/development/types/active-days.types.ts (0 hunks)
  • frontend/app/components/modules/project/components/development/types/average-time-merge.types.ts (0 hunks)
  • frontend/app/components/modules/project/components/development/types/code-review-engagement.types.ts (0 hunks)
  • frontend/app/components/modules/project/components/development/types/contribution-outside-hours.types.ts (0 hunks)
  • frontend/app/components/modules/project/components/development/types/issues-resolution.types.ts (0 hunks)
  • frontend/app/components/modules/project/components/development/types/merge-lead-time.types.ts (0 hunks)
  • frontend/app/components/modules/project/components/development/types/pull-requests.types.ts (0 hunks)
  • frontend/app/components/modules/project/components/development/types/wait-time-1st-review.types.ts (0 hunks)
  • frontend/app/components/modules/project/components/development/wait-time-first-review.vue (1 hunks)
  • frontend/app/components/modules/project/components/contributors/contributor-dependency.vue (1 hunks)
  • frontend/app/components/modules/collection/components/details/filters.vue (2 hunks)
  • frontend/app/components/modules/collection/components/details/header.vue (5 hunks)
  • frontend/app/components/uikit/button/button.scss (2 hunks)
  • frontend/app/pages/charts.vue (0 hunks)
  • frontend/app/pages/collection/[slug].vue (1 hunks)
  • frontend/app/pages/collection/index.vue (1 hunks)
  • frontend/app/pages/project/[slug]/contributors.vue (1 hunks)
  • frontend/app/pages/project/[slug]/development.vue (1 hunks)
  • frontend/app/pages/project/[slug]/popularity.vue (1 hunks)
  • frontend/app/pages/project/[slug]/repository/[name]/contributors.vue (1 hunks)
  • frontend/app/pages/project/[slug]/repository/[name]/development.vue (1 hunks)
  • frontend/app/pages/project/[slug]/repository/[name]/popularity.vue (1 hunks)
  • frontend/setup/head.ts (1 hunks)
  • frontend/tailwind.config.js (1 hunks)
  • frontend/app/components/modules/project/components/shared/header/date-range-picker.vue (3 hunks)
  • frontend/app/components/shared/layout/menu/menu-tablet.vue (2 hunks)
  • frontend/app/components/shared/layout/tools.vue (1 hunks)
  • frontend/app/components/uikit/popover/popover.scss (1 hunks)
  • frontend/app/components/uikit/popover/popover.stories.ts (1 hunks)
  • frontend/app/components/uikit/popover/popover.vue (1 hunks)
  • frontend/app/components/uikit/popover/types/PopoverPlacement.ts (1 hunks)
  • frontend/app/components/uikit/popover/types/PopoverTrigger.ts (1 hunks)
  • frontend/setup/primevue.ts (0 hunks)
✨ 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.

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: 2

🧹 Nitpick comments (1)
frontend/app/components/modules/project/components/contributors/organization-dependency.vue (1)

84-87: Good refactoring of computed properties.

Creating the explicit type-cast through organizationDependency computed property and then deriving other computed properties from it improves type safety and code readability.

Consider adding optional chaining for the list property similar to what you've done for topOrganizations and otherOrganizations to prevent potential errors if organizationDependency.value is undefined.

-const organizations = computed(() => organizationDependency.value?.list);
+const organizations = computed(() => organizationDependency.value?.list);
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d95e9bb and 1522c4b.

📒 Files selected for processing (44)
  • frontend/app/components/modules/project/components/contributors/active-contributors.vue (1 hunks)
  • frontend/app/components/modules/project/components/contributors/active-organizations.vue (1 hunks)
  • frontend/app/components/modules/project/components/contributors/config/granularity-tabs.ts (4 hunks)
  • frontend/app/components/modules/project/components/contributors/contributor-dependency.vue (2 hunks)
  • frontend/app/components/modules/project/components/contributors/contributors-leaderboard.vue (1 hunks)
  • frontend/app/components/modules/project/components/contributors/organization-dependency.vue (2 hunks)
  • frontend/app/components/modules/project/components/contributors/organizations-leaderboard.vue (1 hunks)
  • frontend/app/components/modules/project/components/contributors/retention.vue (5 hunks)
  • frontend/app/components/modules/project/components/contributors/types/contributors.types.ts (0 hunks)
  • frontend/app/components/modules/project/components/development/active-days.vue (1 hunks)
  • frontend/app/components/modules/project/components/development/average-time-to-merge.vue (1 hunks)
  • frontend/app/components/modules/project/components/development/code-review-engagement.vue (1 hunks)
  • frontend/app/components/modules/project/components/development/contributions-outside-work-hours.vue (1 hunks)
  • frontend/app/components/modules/project/components/development/fragments/pull-request-legend-item.vue (1 hunks)
  • frontend/app/components/modules/project/components/development/issues-resolution.vue (1 hunks)
  • frontend/app/components/modules/project/components/development/merge-lead-time.vue (1 hunks)
  • frontend/app/components/modules/project/components/development/pull-requests.vue (1 hunks)
  • frontend/app/components/modules/project/components/development/review-time-by-pull-request-size.vue (1 hunks)
  • frontend/app/components/modules/project/components/development/types/active-days.types.ts (0 hunks)
  • frontend/app/components/modules/project/components/development/types/average-time-merge.types.ts (0 hunks)
  • frontend/app/components/modules/project/components/development/types/code-review-engagement.types.ts (0 hunks)
  • frontend/app/components/modules/project/components/development/types/contribution-outside-hours.types.ts (0 hunks)
  • frontend/app/components/modules/project/components/development/types/issues-resolution.types.ts (0 hunks)
  • frontend/app/components/modules/project/components/development/types/merge-lead-time.types.ts (0 hunks)
  • frontend/app/components/modules/project/components/development/types/pull-requests.types.ts (0 hunks)
  • frontend/app/components/modules/project/components/development/types/review-time-by-pr.types.ts (0 hunks)
  • frontend/app/components/modules/project/components/development/types/wait-time-1st-review.types.ts (0 hunks)
  • frontend/app/components/modules/project/components/development/wait-time-first-review.vue (1 hunks)
  • frontend/app/components/modules/project/components/popularity/forks.vue (1 hunks)
  • frontend/app/components/modules/project/components/popularity/github-mentions.vue (1 hunks)
  • frontend/app/components/modules/project/components/popularity/press-mentions.vue (1 hunks)
  • frontend/app/components/modules/project/components/popularity/social-mentions.vue (1 hunks)
  • frontend/app/components/modules/project/components/popularity/stars.vue (1 hunks)
  • frontend/app/components/modules/project/components/popularity/types/popularity.types.ts (0 hunks)
  • frontend/app/components/shared/types/granularity.ts (1 hunks)
  • frontend/app/components/uikit/chart/helpers/formatters.ts (2 hunks)
  • frontend/app/components/uikit/delta-display/types/delta-display.types.ts (1 hunks)
  • frontend/server/api/project/[slug]/contributors/retention.get.ts (1 hunks)
  • frontend/server/mocks/retention.mock.ts (1 hunks)
  • frontend/types/contributors/responses.types.ts (1 hunks)
  • frontend/types/development/responses.types.ts (1 hunks)
  • frontend/types/popularity/responses.types.ts (1 hunks)
  • frontend/types/shared/granularity.ts (1 hunks)
  • frontend/types/shared/summary.types.ts (1 hunks)
💤 Files with no reviewable changes (11)
  • frontend/app/components/modules/project/components/development/types/contribution-outside-hours.types.ts
  • frontend/app/components/modules/project/components/development/types/average-time-merge.types.ts
  • frontend/app/components/modules/project/components/development/types/active-days.types.ts
  • frontend/app/components/modules/project/components/development/types/issues-resolution.types.ts
  • frontend/app/components/modules/project/components/development/types/code-review-engagement.types.ts
  • frontend/app/components/modules/project/components/development/types/review-time-by-pr.types.ts
  • frontend/app/components/modules/project/components/contributors/types/contributors.types.ts
  • frontend/app/components/modules/project/components/development/types/wait-time-1st-review.types.ts
  • frontend/app/components/modules/project/components/development/types/merge-lead-time.types.ts
  • frontend/app/components/modules/project/components/development/types/pull-requests.types.ts
  • frontend/app/components/modules/project/components/popularity/types/popularity.types.ts
🔇 Additional comments (56)
frontend/types/shared/summary.types.ts (1)

10-14: Good addition of a standardized Meta interface

The new Meta interface provides a clear structure for pagination metadata with properly typed numeric properties for offset, limit, and total. This follows standard pagination patterns and will be useful for API responses that return paginated data.

frontend/types/shared/granularity.ts (1)

1-8: Well-structured granularity enum

This enumeration provides a standardized set of time interval constants using uppercase naming conventions (per TypeScript best practices) while maintaining lowercase string values (likely for API compatibility). This will improve type safety and code consistency across the application.

frontend/app/components/modules/project/components/contributors/organizations-leaderboard.vue (1)

37-37: Good import path standardization

Updating the import path from a relative path to the new centralized types directory aligns with the PR's objective of improving type organization. This change improves maintainability and promotes consistency across the codebase.

frontend/app/components/uikit/delta-display/types/delta-display.types.ts (1)

2-2: Good import path standardization

Updating the Summary type import to use the new centralized type location improves consistency across the codebase and aligns with the project's type organization objectives.

frontend/server/api/project/[slug]/contributors/retention.get.ts (1)

1-4: Improved import formatting looks good.

The reformatted import statement improves readability by placing each import on its own line.

frontend/app/components/modules/project/components/development/fragments/pull-request-legend-item.vue (1)

26-26: Import path standardization looks good.

Updated import path for Summary type from a relative path to the new standardized path using the ~~ alias. This follows the project's new type organization structure and improves maintainability.

frontend/app/components/modules/project/components/contributors/contributors-leaderboard.vue (1)

37-37: Import path standardization looks good.

Updated import path for ContributorLeaderboard type from a relative path to the new standardized path using the ~~ alias. This change is consistent with the PR objective of relocating types to a common shared folder structure.

frontend/app/components/modules/project/components/development/pull-requests.vue (2)

91-92: Import path standardization looks good.

Updated import paths for PullRequests and Summary types to use the new standardized paths with the ~~ alias. This aligns with the PR's objective to improve type organization.


135-139:

Details

❓ Verification inconclusive

Verify field name consistency with updated type definitions.

I notice that convertToChartData is still using dateFrom and dateTo as field names, but the comments in retention.get.ts have been updated to use startDate and endDate. Ensure that the field names are consistent across both the code and documentation.


🏁 Script executed:

#!/bin/bash
# Check if there are any inconsistencies between field names in type definitions and usage
echo "Checking for field name usage in type definitions:"
rg --type ts "interface.*\{" -A 15 -B 2 "startDate|endDate|dateFrom|dateTo"

echo -e "\nChecking for convertToChartData usage with these fields:"
rg --type ts "convertToChartData" -A 10 -B 2

Length of output: 1637


Action Required: Ensure Consistent Date Field Naming

In the file at frontend/app/components/modules/project/components/development/pull-requests.vue (lines 135–139), the convertToChartData function is invoked using "dateFrom" and "dateTo" as the key field names. However, recent updates in the documentation (e.g. in retention.get.ts) indicate that the preferred field names are "startDate" and "endDate". Please verify the latest type definitions and related documentation to ensure that these names are consistent across the codebase. Depending on the intended design, update either the parameter names in the conversion call or adjust the type definitions/documentation accordingly.

  • Location to verify/update:
    • File: frontend/app/modules/project/components/development/pull-requests.vue (lines 135–139)
    • Related Reference: Documentation or type definitions in retention.get.ts
frontend/app/components/modules/project/components/development/issues-resolution.vue (1)

86-86: Import path update improves type organization

The import path has been changed from a local path to a centralized type definition, which aligns with the project's effort to standardize type imports across components.

frontend/app/components/modules/project/components/popularity/github-mentions.vue (1)

44-45: Centralized type imports improve maintainability

The import paths have been updated to use the new centralized type definitions instead of local or component-specific paths. This change supports better type organization and reusability across components.

frontend/app/components/modules/project/components/popularity/press-mentions.vue (1)

42-43: Standardized type import paths

The import statements now use the centralized type definitions from dedicated type folders, which improves consistency and makes types more discoverable across the project.

frontend/app/components/modules/project/components/popularity/social-mentions.vue (1)

44-45: Type imports refactored for better organization

The import paths now reference centralized type definitions, which aligns with the PR objective to relocate development chart widget types to a common shared type folder.

frontend/app/components/modules/project/components/development/contributions-outside-work-hours.vue (1)

88-89: Import paths successfully updated to use centralized type definitions.

The import paths have been properly updated to use the new centralized type structure with the ~~ path alias, which aligns with the PR objective of relocating widget types to a common shared folder.

frontend/app/components/modules/project/components/contributors/active-organizations.vue (1)

52-53: Import paths successfully standardized.

The import paths have been properly updated to use the new centralized type structure with the ~~ path alias, consistent with the changes across other components.

frontend/types/popularity/responses.types.ts (1)

1-19: Well-structured type definitions for popularity metrics.

The newly added interfaces for StarsData and ForksData follow TypeScript best practices and maintain consistency with other interfaces in this file. The import path for Summary correctly uses a relative path within the types directory structure.

frontend/app/components/modules/project/components/development/average-time-to-merge.vue (1)

52-53: Import paths standardized correctly.

The import paths have been properly updated to use the new centralized type structure, consistent with the project's standardization efforts.

frontend/server/mocks/retention.mock.ts (1)

3-4: Property naming standardization looks good

The consistent replacement of dateFrom with startDate and dateTo with endDate across all data objects aligns well with the type standardization goals of this PR.

Also applies to: 8-9, 13-14, 18-19, 23-24, 28-29, 33-34, 38-39, 43-44, 48-49, 56-57, 61-62, 66-67, 71-72, 76-77, 81-82, 86-87, 91-92, 96-97, 101-102

frontend/app/components/modules/project/components/popularity/stars.vue (2)

59-59: Updated import paths align with type standardization

The import paths now correctly reference the centralized type definitions.

Also applies to: 61-61


108-110:

Details

✅ Verification successful

Check property name consistency in convertToChartData call

While import paths have been updated, this function call still references dateFrom and dateTo properties. If these properties have been renamed in the source data structure (as seen in other files like retention.mock.ts), this might need to be updated to use startDate and endDate instead.


🏁 Script executed:

#!/bin/bash
# Check if the StarsData type uses dateFrom/dateTo or startDate/endDate
rg -A 10 "interface StarsData" --type=typescript

Length of output: 85


I'll generate new verification shell scripts to re-check the property naming for the data structure. In particular, we need to verify if the StarsData interface (or similar) uses dateFrom/dateTo or startDate/endDate, and also check the corresponding properties in files like retention.mock.ts.


🏁 Script executed:

#!/bin/bash
# 1. Search for the StarsData interface definition without file type restriction
rg -A 10 "interface StarsData"

# 2. Check for the use of startDate and endDate in retention.mock.ts to see if a renaming has occurred
rg -A 3 -w "startDate" retention.mock.ts
rg -A 3 -w "endDate" retention.mock.ts

Length of output: 902


Property name consistency verified – no changes needed

After verifying, the StarsData interface in frontend/types/popularity/responses.types.ts uses dateFrom and dateTo as properties. Additionally, references to properties in retention.mock.ts were not found, indicating that the outdated suggestion does not apply. Please confirm that the current naming convention is intentional.

frontend/app/components/modules/project/components/contributors/active-contributors.vue (2)

52-53: Updated type import paths look good

The import paths now correctly reference the centralized type definitions, aligning with the project-wide type standardization effort.


94-97: Correctly using standardized date property names

This component already uses the standardized startDate and endDate properties in the convertToChartData call, which is consistent with the type standardization being implemented across the project.

frontend/app/components/modules/project/components/development/active-days.vue (1)

72-73: Type import path standardization looks good

The updated import paths properly reference the centralized type definitions, which aligns with the PR's objective of improving type organization.

frontend/app/components/modules/project/components/development/review-time-by-pull-request-size.vue (1)

49-55: Import paths standardization looks good

The changes to the import statements are consistent with the PR objective of relocating development chart widget types to a common shared type folder. The use of absolute paths with the ~~ prefix for types improves maintainability by centralizing type definitions.

frontend/app/components/uikit/chart/helpers/formatters.ts (2)

11-11: Import path standardization looks good

Updating the import path for the Granularity type to use the absolute path with the ~~ prefix aligns with the project's standardization efforts.


74-84: Granularity constants updated to uppercase convention

The switch case statements have been correctly updated to use the uppercase constants (WEEKLY, QUARTERLY, MONTHLY, YEARLY) which aligns with the standardization of naming conventions across the project.

frontend/app/components/modules/project/components/development/wait-time-first-review.vue (1)

52-53: Type import paths standardized correctly

The changes to import WaitTime1stReview and Summary from centralized type definition files using absolute paths with the ~~ prefix is consistent with the project's standardization efforts.

frontend/app/components/modules/project/components/popularity/forks.vue (1)

59-61: Type import paths standardized correctly

The changes to import ForksData and Summary from centralized type definition files using absolute paths with the ~~ prefix is consistent with the project's standardization efforts.

frontend/app/components/shared/types/granularity.ts (4)

2-2: Improved type organization with centralized imports

The change to import Granularity from a centralized types folder (~~/types/shared/granularity) improves code organization and follows better TypeScript architecture practices.


5-9: Well-structured enum value standardization

Converting granularity values to uppercase constants (e.g., Granularity.DAILY instead of camel case) follows TypeScript best practices for constant/enum values and improves consistency.


13-21: Consistent naming convention applied to lineGranularities

The consistent application of uppercase constants for granularity values in the lineGranularities object maintains proper type safety while improving readability and maintainability.


25-33: Consistent naming convention applied to barGranularities

The granularity constants have been properly updated in barGranularities to match the centralized type definition, maintaining consistency throughout the codebase.

frontend/app/components/modules/project/components/development/code-review-engagement.vue (1)

64-65: Improved type imports with centralized paths

The change from relative imports to centralized type paths (~~/types/development/responses.types and ~~/types/shared/summary.types) improves code organization and maintainability, making it easier to locate and update type definitions.

frontend/app/components/modules/project/components/contributors/config/granularity-tabs.ts (2)

3-3: Standardized type import path

The updated import path for Granularity follows the centralized type organization pattern, improving consistency across the codebase.


8-8: Consistent use of uppercase constants for granularity values

The granularity values in all tab definitions have been properly updated to use uppercase constants (WEEKLY, MONTHLY, QUARTERLY, YEARLY), aligning with TypeScript best practices for constant values and maintaining consistency with other files.

Also applies to: 20-20, 35-35, 48-48

frontend/app/components/modules/project/components/development/merge-lead-time.vue (1)

78-78: Improved type organization with centralized type imports

Updated import paths for MergeLeadTime and Summary types to use centralized type definitions, which improves code organization and maintainability by ensuring consistent type usage across components.

Also applies to: 82-82

frontend/app/components/modules/project/components/contributors/organization-dependency.vue (1)

60-60: Type import path standardization looks good.

Updating the import path to use the centralized types location improves code organization and maintainability.

frontend/app/components/modules/project/components/contributors/retention.vue (4)

19-21: Temporarily commented out chart type selector.

The comment clearly explains that this UI element is temporarily hidden due to pending design decisions. This makes the code easier to understand and maintain until the final design is determined.


60-60: Type import path standardization looks good.

Updating the import path to use the centralized types location improves code organization and maintainability.


85-95: Good refactoring of computed properties.

Creating an explicit type-cast through the retention computed property and then updating the chartData computation to use it improves type safety. The parameter updates in convertToChartData correctly reflect the new structure.


110-121: Commented out chart type options consistently.

The chart type options have been commented out consistently with the removal of the chart type selector from the UI. This ensures that unused code is not left active while the feature is disabled.

frontend/app/components/modules/project/components/contributors/contributor-dependency.vue (1)

60-60: Type import path standardization looks good.

Updating the import path to use the centralized types location improves code organization and maintainability.

frontend/types/contributors/responses.types.ts (1)

1-68: Well-structured type definitions.

The new type definitions file is well-organized with logically grouped interfaces. The imports and exports follow a consistent pattern, and the interfaces provide comprehensive type definitions for the contributors module.

The interfaces align well with the data structures used in the components, which will improve type safety throughout the application.

frontend/types/development/responses.types.ts (13)

1-2: Well-structured import and organization.

Good choice using the absolute path with type import. This ensures consistent imports throughout the project and aligns with the PR objective of standardizing type definitions.


3-11: LGTM! The ActiveDays interface is well-defined.

The interface provides a clear structure for active days metrics with appropriate types for the summary, average contributions, and time-series data.


13-20: Clean definition for AverageTimeMerge interface.

The structure follows a consistent pattern with other time-series data interfaces, which helps maintain uniformity across the codebase.


22-28: Good use of optional property for percentage.

The CodeReviewItem interface properly marks the percentage field as optional with the ? syntax, which is the correct TypeScript approach.


30-33: Concise and well-structured interface.

The CodeReviewEngagement interface reuses the CodeReviewItem type, demonstrating good composition practices.


35-44: Clear definition for ContributionOutsideHours metrics.

This interface effectively captures all the necessary data points for tracking contributions outside normal working hours.


46-48: Good use of interface extension.

Extending the Summary interface to create a specialized ResolutionSummary is a clean approach to add the velocity property while maintaining the base structure.


50-58: Well-structured IssuesResolution interface.

The interface properly incorporates the ResolutionSummary and provides a clear structure for tracking closed versus total issues over time.


60-73: Good organization of lead time metrics.

Breaking down MergeLeadTime into stages (pickup, review, accepted, prMerged) with a consistent structure is an effective approach for tracking the PR lifecycle.


75-88: Comprehensive PullRequests interface.

The interface effectively captures all necessary metrics for pull requests with separate summaries for different states (open, merged, closed).


90-96: Clear definition for ReviewTimeByPrItem.

The interface provides all necessary fields for tracking review time by PR size, including the sortId for ordering.


98-105: Well-structured WaitTime1stReview interface.

The interface provides a clean structure for tracking wait time metrics for first reviews over time.


1-106: Excellent centralization of type definitions.

This file successfully centralizes all development-related response types, which aligns perfectly with the PR objective to relocate development chart widget types to a common shared type folder. The interfaces follow consistent patterns and naming conventions, making them easy to understand and use throughout the project.

Comment on lines +9 to +10
* startDate: string; // ISO 8601 date string - start of the bucket. Based on the interval
* endDate: string; // ISO 8601 date string - end of the bucket. Based on the interval
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify property name consistency between comments and implementation.

The comment has been updated to use startDate and endDate, which is more intuitive than the previous dateFrom and dateTo. However, I notice that other parts of the codebase (like in pull-requests.vue) still use dateFrom and dateTo when converting data for charts.


🏁 Script executed:

#!/bin/bash
# Check if there are any inconsistencies between startDate/endDate and dateFrom/dateTo usage
echo "Checking for dateFrom/dateTo usage in code:"
rg --type ts "dateFrom|dateTo" -A 2 -B 2

echo -e "\nChecking for startDate/endDate usage in code:"
rg --type ts "startDate|endDate" -A 2 -B 2

Length of output: 70110


Action Required: Address Inconsistency in Date Property Naming

  • In frontend/server/api/project/[slug]/contributors/retention.get.ts, the documentation and (presumably) the implementation now use startDate and endDate which improves clarity.
  • However, our search shows that many parts of the codebase—such as files in frontend/types/popularity/responses.types.ts, frontend/types/development/responses.types.ts, and various mock data files (e.g., in frontend/server/mocks/)—continues to use the legacy dateFrom and dateTo.
  • Please either update these other parts to use the new naming convention or ensure that any required data conversion is clearly handled to avoid integration issues (for example, in components like pull-requests.vue which still use the old fields).

Comment on lines +84 to +88
const contributorDependency = computed<ContributorDependency>(() => data.value as ContributorDependency);

const topContributors = computed(() => contributorDependency.value.topContributors);
const otherContributors = computed(() => contributorDependency.value.otherContributors);
const contributors = computed(() => contributorDependency.value.list);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add null checking for contributorDependency.value.

Unlike the organization-dependency.vue file, there's no optional chaining when accessing properties of contributorDependency.value, which could cause errors if the value is null or undefined.

Apply this diff to add optional chaining for type safety:

-const topContributors = computed(() => contributorDependency.value.topContributors);
-const otherContributors = computed(() => contributorDependency.value.otherContributors);
-const contributors = computed(() => contributorDependency.value.list);
+const topContributors = computed(() => contributorDependency.value?.topContributors);
+const otherContributors = computed(() => contributorDependency.value?.otherContributors);
+const contributors = computed(() => contributorDependency.value?.list);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const contributorDependency = computed<ContributorDependency>(() => data.value as ContributorDependency);
const topContributors = computed(() => contributorDependency.value.topContributors);
const otherContributors = computed(() => contributorDependency.value.otherContributors);
const contributors = computed(() => contributorDependency.value.list);
const contributorDependency = computed<ContributorDependency>(() => data.value as ContributorDependency);
const topContributors = computed(() => contributorDependency.value?.topContributors);
const otherContributors = computed(() => contributorDependency.value?.otherContributors);
const contributors = computed(() => contributorDependency.value?.list);

Signed-off-by: Efren Lim <elim@linuxfoundation.org>
emlimlf and others added 2 commits March 11, 2025 18:40
Signed-off-by: Efren Lim <elim@linuxfoundation.org>
@emlimlf emlimlf merged commit b74f314 into main Mar 11, 2025
1 check passed
@emlimlf emlimlf deleted the improvement/development-types branch March 11, 2025 10:41
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