Skip to content

Project endpoints#71

Merged
gaspergrom merged 4 commits intomainfrom
improvement/project-endpoints
Mar 5, 2025
Merged

Project endpoints#71
gaspergrom merged 4 commits intomainfrom
improvement/project-endpoints

Conversation

@gaspergrom
Copy link
Copy Markdown
Collaborator

@gaspergrom gaspergrom commented Mar 5, 2025

Summary by CodeRabbit

  • New Features

    • Introduced dynamic project data retrieval via enhanced API endpoints, delivering real-time project details with improved sorting, pagination, and error handling.
    • Upgraded global state management for consistent project page rendering.
    • Added a new computed property for dynamic route context in search results.
  • Refactor

    • Simplified the interface by removing legacy tab management and the "Software value" display.
    • Updated repository presentation and naming conventions for improved clarity.
  • Documentation

    • Expanded API documentation for search with detailed parameter descriptions and error guidelines.

Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
@gaspergrom gaspergrom requested review from borfast and epipav March 5, 2025 09:14
@gaspergrom gaspergrom self-assigned this Mar 5, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 5, 2025

Walkthrough

This pull request refactors several frontend components and API endpoints. In the frontend, code related to tab management in filters, a parameter renaming, and the removal of software value display in a project list item have been addressed. The repository switch component now integrates with Pinia for state management. The project store gains new reactive state and computed properties while type definitions are updated. On the API side, endpoints for fetching project details and lists now use an external fetch function with improved error handling and clearer response structures. Documentation for the search API has also been enhanced.

Changes

Files Change Summary
frontend/.../details/filters.vue
frontend/.../views/collection-details.vue
frontend/.../list/project-list-item.vue
frontend/.../shared/header/repository-switch.vue
Removed commented-out tab management and software value sections; renamed parameter (isLfxisLf); updated repository-switch to use Pinia (storeToRefs) for accessing project repositories.
frontend/.../store/project.store.ts
frontend/.../types/project.ts
Added new reactive state and computed properties (project, projectRepos, selectedRepository) in the store; updated type definitions by modifying interfaces and property types.
frontend/.../[slug].vue Integrated store state assignment with fetched project data using storeToRefs(useProjectStore()).
frontend/.../api/project/[slug]/index.ts
frontend/.../api/project/index.ts
frontend/.../api/search.ts
Refactored API endpoints to fetch project details and project lists dynamically using fetchTinybird, added new interfaces for response structures, and improved error handling and documentation.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant PD as Project Details Page
    participant API as API Endpoint (/project/[slug])
    participant Tinybird as External API

    U->>PD: Request project page
    PD->>API: Fetch project details (useFetch)
    API->>Tinybird: Call fetchTinybird with project slug
    Tinybird-->>API: Return project data
    API->>PD: Send project details or error response
    PD->>Store: Update project state via storeToRefs
Loading

Possibly related PRs

  • Collection endpoints #70: The changes in the main PR, which involve commenting out code related to the lfx-tabs component and its associated logic, are related to the retrieved PR that also comments out sections displaying the software value in the header.vue and collection-list-item.vue components, indicating a shared focus on reducing UI elements and functionality.
  • Collection details #52: The changes in the main PR involve commenting out significant portions of the lfx-tabs component and related logic in filters.vue, while the retrieved PR introduces a new component LfxCollectionFilters in the same file that utilizes a tabbed interface, indicating a direct modification to the same functionality.
  • Collection details mobile #67: The changes in the main PR involve commenting out significant portions of the lfx-tabs component and related logic in filters.vue, while the retrieved PR modifies the layout and functionality of the same filters.vue component, specifically adjusting the lfx-tabs component's properties and rendering logic, indicating a direct relationship at the code level.

Suggested reviewers

  • emlimlf

Poem

I'm a rabbit hopping through the code field,
Leaving commented trails where old tabs once healed.
With Pinia magic and API calls so bright,
I nibble on changes both day and night.
Code carrots crisp in each refactor delight—
A joyful hop in our coding burrow's light!


📜 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 2b565fb and 56b3083.

📒 Files selected for processing (1)
  • frontend/app/components/shared/layout/search/search-result.vue (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/app/components/shared/layout/search/search-result.vue

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

🔭 Outside diff range comments (1)
frontend/app/components/modules/project/components/shared/header/repository-switch.vue (1)

84-88: 🛠️ Refactor suggestion

Project prop is still required but not used - consider refactoring.

The component still requires a project prop (line 87) but now uses projectRepos from the store instead. This creates a potential synchronization issue where the prop and store may contain different data.

Consider one of the following approaches:

  1. Remove the project prop if it's no longer needed
  2. Use the prop to update the store's project state
  3. Document the relationship between the prop and store state
const props = defineProps<{
  modelValue: boolean;
  repo: string;
-  project: Project;
}>();

// If you need to keep the prop for backward compatibility but want to ensure store sync:
+import { watch } from 'vue';
+const projectStore = useProjectStore();
+watch(() => props.project, (newProject) => {
+  if (newProject) {
+    projectStore.project = newProject;
+  }
+}, { immediate: true });

Also applies to: 101-104

🧹 Nitpick comments (7)
frontend/server/api/search.ts (1)

54-55: Consider making the limit configurable

The code uses a hardcoded limit of 10, but line 27 mentions it's an optional parameter with a default value of 10. Consider using the limit from the query parameters if provided.

- limit: 10,
+ limit: query?.limit || 10,
frontend/server/api/project/[slug]/index.ts (2)

19-46: Comprehensive API documentation.
The JSDoc-style annotations provide a clear overview of path parameters, response body, and possible error codes, enhancing maintainability. Consider adding usage examples or linking to relevant documentation to further assist consumers of this endpoint.


58-59: Log sensitive data carefully.
While logging errors is useful for debugging, avoid dumping sensitive request details (like private tokens or credentials) when scaling to production. Here it appears minimal, but it's a good practice to confirm no PII or secrets can appear.

frontend/server/api/project/index.ts (1)

42-49: Robust query handling with type casting.
Casting string-valued query parameters to numeric types for pagination and toggling booleans is correct. Consider adding bounds checks for page < 0 or extremely large pageSize to prevent potential misuse.

Also applies to: 50-58

frontend/app/components/modules/collection/components/details/filters.vue (2)

8-40: Large commented-out block.
This entire tab-related code block is commented-out. Consider removing it if it’s no longer needed or move it to a separate experimental file if you plan to restore it later. Reducing clutter will keep your codebase maintainable.


58-59: Commented-out imports, variables, and tabs.
The commented-out imports (LfxTabs, useResponsive) and variables (pageWidth, tabs, tab) might introduce confusion. If these features are truly deprecated, remove them for a cleaner codebase. If they’re temporarily disabled, leave a comment explaining the reason for future devs.

Also applies to: 68-69, 71-74, 81-84

frontend/app/components/modules/project/store/project.store.ts (1)

13-19: Consider adding state validation in the computed properties.

The computed properties rely on non-null values, but there's no explicit handling if project.value is null. While the optional chaining in project.value?.repositories helps, adding validation or default fallbacks for other potential edge cases would improve robustness.

const projectRepos = computed<ProjectRepository[]>(() => (project.value?.repositories || []).map((repo) => ({
    ...repo,
    name: getRepoNameFromUrl(repo.repo),
})));
const selectedRepository = computed<string>(() => {
-    return projectRepos.value
+    if (!projectRepos.value.length) return '';
+    return projectRepos.value
        .find((repo: ProjectRepository) => route.params.name === repo.name)?.repo || '';
});
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 45fbf93 and 158456d.

📒 Files selected for processing (10)
  • frontend/app/components/modules/collection/components/details/filters.vue (4 hunks)
  • frontend/app/components/modules/collection/views/collection-details.vue (1 hunks)
  • frontend/app/components/modules/project/components/list/project-list-item.vue (1 hunks)
  • frontend/app/components/modules/project/components/shared/header/repository-switch.vue (3 hunks)
  • frontend/app/components/modules/project/store/project.store.ts (1 hunks)
  • frontend/app/components/modules/project/types/project.ts (1 hunks)
  • frontend/app/pages/project/[slug].vue (2 hunks)
  • frontend/server/api/project/[slug]/index.ts (1 hunks)
  • frontend/server/api/project/index.ts (1 hunks)
  • frontend/server/api/search.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • frontend/app/components/modules/project/components/list/project-list-item.vue
🔇 Additional comments (22)
frontend/app/components/modules/collection/views/collection-details.vue (1)

90-90:

Details

❓ Verification inconclusive

Parameter name has been updated from isLfx to isLf

This parameter rename aligns with API endpoint changes. Make sure all instances of this parameter have been consistently updated across the codebase.


🏁 Script executed:

#!/bin/bash
# Description: Check if there are any remaining 'isLfx' parameters in API calls or params objects

# Look for any remaining 'isLfx' references in vue or ts files
rg "isLfx" --type=vue --type=typescript --type=javascript

Length of output: 85


Updated Parameter Naming Verification:
The parameter isLf in frontend/app/components/modules/collection/views/collection-details.vue now aligns with the recent API changes. However, the initial verification command produced an error due to the unrecognized file type vue. To ensure that all instances of isLfx have been updated consistently, please run the following updated script that explicitly searches .vue, .ts, and .js files:

#!/bin/bash
# Search for any remaining 'isLfx' occurrences in .vue, .ts, and .js files
rg "isLfx" -g "*.vue" -g "*.ts" -g "*.js"

If this search returns no results, the parameter rename is likely applied correctly across the codebase.

frontend/app/pages/project/[slug].vue (2)

18-18: Project store integration looks good

The integration with Pinia store improves state management for project data.

Also applies to: 21-21, 24-24


43-45: Good addition for state synchronization

This ensures that the project data is properly synchronized with the central store, making it accessible to other components.

frontend/app/components/modules/project/types/project.ts (2)

2-5: Enhanced repository data model with project context

Adding project-related fields to the ProjectRepository interface improves the relationship between projects and repositories, which should make repository switching and filtering easier.


9-14:

Details

❓ Verification inconclusive

Verify data model changes across the application

Several significant changes have been made to the Project interface:

  1. Added id field and repositioned slug
  2. Made description and logo non-nullable
  3. Removed softwareValueCount

Ensure that all components using this interface have been updated to accommodate these changes, especially where they might expect nullable fields or the now-removed property.

Also applies to: 16-16


🏁 Script executed:

#!/bin/bash
# Description: Check for components that might be affected by the Project interface changes

# Check for components that expect the removed softwareValueCount
rg "softwareValueCount" --type=vue --type=typescript

# Check for components that might be handling null logo or description values
rg "(logo\s*\?\?\s*|logo\s*===\s*null|description\s*\?\?\s*|description\s*===\s*null)" --type=vue

Length of output: 208


I've prepared a revised verification script since the initial commands failed due to the unrecognized file type "vue." Please run the following shell script to re-check for any lingering references to the removed softwareValueCount property and to detect potential null checks against the now non-nullable logo and description fields:

Once you verify these checks, please ensure that all parts of the application using the Project interface are updated accordingly. For clarity:

  • Added changes: The id field has been introduced and the slug field has been repositioned.
  • Non-nullable fields: description and logo are now required.
  • Removed field: softwareValueCount has been removed.

Double-check that no component relies on the removed property or anticipates nullable values for logo/description.

Action: Please verify the above results manually and ensure all components have been updated.


🏁 Script executed:

#!/bin/bash
# Re-run search for the removed 'softwareValueCount' property
echo "Searching for 'softwareValueCount' usage:"
rg "softwareValueCount" -g "*.ts" -g "*.tsx" -g "*.vue"

# Re-run search for null-check usage for non-nullable 'logo' and 'description'
echo "Searching for potential null-checks on 'logo' and 'description':"
rg -n "(logo\s*\?\?\s*|logo\s*===\s*null|description\s*\?\?\s*|description\s*===\s*null)" -g "*.ts" -g "*.tsx" -g "*.vue"

Length of output: 1649


Action Required: Verify Consistency of Data Model Changes Across Modules

The updated Project interface now includes the new id field, repositions slug, makes description and logo non-nullable, and removes softwareValueCount. However, our recent search revealed that:

  • Several files (mostly within the collection module and API endpoints) still reference softwareValueCount. In one case, the reference in the project module is commented out.
  • No null-checks for logo or description were found, suggesting that these fields are treated as non-nullable throughout.

Next Steps:

  • Project Interface Usage: Confirm that all components depending on the Project interface are now using the updated field definitions.
  • Collection Module Concerns: Determine whether the remaining references to softwareValueCount in collection-related files are intentional (e.g., belonging to a separate Collection interface) or if they require similar updates.
  • Manual Verification: Please manually verify that the removal of softwareValueCount in the Project interface doesn’t cause unintended side effects elsewhere in the application.
frontend/server/api/search.ts (1)

21-43: Documentation improvements are valuable

The enhanced API documentation is clear, comprehensive, and follows a consistent format. It provides valuable information about:

  • Endpoint path and method
  • Query parameters with types and default values
  • Response structure
  • Possible error scenarios

This will make the API more accessible to other developers.

frontend/server/api/project/[slug]/index.ts (3)

1-16: Well-defined data structures for project and repository details.
These new interfaces (ProjectRepository & ProjectDetailsResponse) nicely consolidate shape definitions, making it clearer how the project and its repositories are structured. Ensure alignment with the data source so optional fields are safely handled, and consider marking any truly optional fields as such in the interfaces to prevent possible runtime errors.


49-52: Validate the slug before making the fetch.
Even though the slug should be defined from route params, adding a quick check (e.g., if it's empty or malformed) or error response can guard against edge cases and provide clearer error handling.


53-56: Appropriate 404 handling.
Returning a 404 in case of no matching data helps clients distinguish between “not found” and other errors. This approach is solid.

frontend/server/api/project/index.ts (2)

1-9: Interface for project listing is clear.
ProjectResponse covers all fields for the project overview. Just ensure any fields that might be absent in real data are marked optional to avoid runtime issues.


67-69: Well-structured error handling.
Catching and logging the error, then returning a standardized 500 helps maintain consistent error responses. Keep an eye on API-level instrumentation or monitoring to ensure you catch repeated errors early.

frontend/app/components/modules/collection/components/details/filters.vue (1)

46-46: Dropdown positioning changed to left.
Switching from right to left is presumably an intentional UI change. Verify that there’s no overlapping or viewport cutoff issues on smaller screens when the dropdown appears on the left side.

frontend/app/components/modules/project/store/project.store.ts (4)

2-3: LGTM! Proper Vue and Nuxt imports.

The addition of ref and computed from Vue, along with useRoute from Nuxt/app, provides the necessary composables for reactive state and route access.


5-6: LGTM! Good type importing and utility function usage.

Importing the correct types and helper functions enhances type safety and code reusability.


9-10: LGTM! Accessing route within the store.

Creating a route reference provides access to route parameters, which is necessary for the computed property that depends on the route.


24-26: LGTM! Proper store exports.

Exposing the necessary reactive state and computed properties in the store's return object makes them accessible to components.

frontend/app/components/modules/project/components/shared/header/repository-switch.vue (6)

75-75: LGTM! Added Pinia store tools.

Importing storeToRefs from Pinia is the correct approach for extracting reactive state from stores while maintaining reactivity.


78-78: LGTM! Proper type imports and store usage.

Importing the necessary types and the project store provides type safety and access to centralized state management.

Also applies to: 82-82


101-102: Good use of storeToRefs for reactivity.

Using storeToRefs to extract store state ensures that reactivity is maintained. This is the recommended approach when accessing Pinia store state in components.


103-104: LGTM! Refactored result computation using store data.

The result computation now correctly uses projectRepos from the store instead of directly using the project prop, which aligns with the centralized state management approach.


44-44:

Details

❓ Verification inconclusive

Key change from repository.name to repository.repo - verify uniqueness.

Changing the v-for key from repository.name to repository.repo suggests that repo is a more unique identifier than name. This is generally a good practice if repo values are guaranteed to be unique across all repositories.


🏁 Script executed:

#!/bin/bash
# Check if repository.repo values are unique in ProjectRepository objects

# Search for the Project or ProjectRepository type definition to verify the repo field
rg -t typescript "interface (Project|ProjectRepository)" -A 10

Length of output: 99


Repository Repo Uniqueness Verification Required

The change to use repository.repo as the v‑for key is acceptable provided that these values are indeed unique across all repository entries. However, our previous automated check encountered an error due to the unsupported file type flag (i.e. -t typescript). This means we couldn’t automatically verify that the uniqueness holds.

Please take one of the following actions:

  • Manually verify that repository.repo is defined and guaranteed to be unique in your data model (e.g. in the ProjectRepository interface or related sections).
  • Alternatively, re-run a corrected shell script (for example, using -t ts for TypeScript files) to search for interface definitions that might validate the uniqueness.

Once you confirm that the repo field is unique, this change can be approved.


47-51:

Details

❓ Verification inconclusive

Verify consistency between key and selected property.

There's a potential inconsistency in the component:

  • Line 44 now uses repository.repo as the key
  • Line 50 uses props.repo === repository.name for selection

Ensure these are consistent with how repositories are identified across the application.


🏁 Script executed:

#!/bin/bash
# Examine how repository selection is handled elsewhere in the codebase

# Look for other instances of selection based on repository properties
rg -t typescript -t vue "selected.*repo" --context=2

Length of output: 89


I'll re-run the investigation using a slightly modified script that only targets Vue files and directly shows the code excerpt in the file in question to better understand the repository identifier usage:

Based on the code snippet from this file, the component uses repository.repo as the key (at line 44) while checking selection with props.repo === repository.name (line 50). This raises a consistency concern: the application may be using two different repository properties (repo vs. name) to identify the repository.

Action Item:
Please verify throughout the codebase how repositories are identified:

  • If repository.repo is meant to be the unique identifier (e.g., an ID), then the selection comparison should likely use it.
  • If repository.name is correct for selection, the unique key should be updated accordingly.

This change could prevent potential mismatches when determining which repository is selected.


🏁 Script executed:

#!/bin/bash
echo "Searching for occurrences of 'selected' properties in Vue files..."
rg -t vue "selected.*repo" --context=2 || echo "No matching lines found in Vue files."

echo -e "\nDisplaying repository-switch.vue lines 40 to 60 for full context..."
sed -n '40,60p' frontend/app/components/modules/project/components/shared/header/repository-switch.vue

Length of output: 1252


Consistency Check: Repository Identifier Mismatch

We've verified that in frontend/app/components/modules/project/components/shared/header/repository-switch.vue the unique key is set using repository.repo (line 44) while the repository selection comparison is performed with props.repo === repository.name (line 50). This inconsistency in using repo versus name as the repository identifier could lead to unexpected behavior elsewhere in the application.

Action Items:

  • Verify Identifier Consistency: Confirm whether the unique identifier for repositories should be repo or name across the codebase.
  • Adjust Accordingly: If the unique identifier is repo, update the selection logic to use props.repo === repository.repo; otherwise, change the key to repository.name if name is the intended identifier.

Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
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: 1

🧹 Nitpick comments (2)
frontend/app/components/shared/types/routes.ts (1)

7-12: Consider updating commented-out route definitions to match the new pattern

While you've updated the active routes to include -contributors suffix, there are several commented-out routes that may need similar updates for consistency if they're reintroduced later.

Review the commented-out route definitions to ensure they align with the new naming pattern. Consider removing redundant routes like PROJECT_CONTRIBUTORS since it's now covered by the main PROJECT route.

frontend/app/components/shared/layout/search/search-result.vue (1)

153-167: Route dependency added but lacks error handling

The component now depends on route information but doesn't handle potential edge cases where the route might not be defined yet or during SSR.

Consider adding appropriate null checks or default values when accessing route properties:

const routeName = computed(() => (route.name as string || ''));
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 158456d and 2b565fb.

📒 Files selected for processing (4)
  • frontend/app/components/modules/project/components/shared/header/repository-switch.vue (3 hunks)
  • frontend/app/components/shared/layout/search/search-result.vue (3 hunks)
  • frontend/app/components/shared/types/routes.ts (1 hunks)
  • frontend/app/pages/project/[slug].vue (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/app/pages/project/[slug].vue
🔇 Additional comments (8)
frontend/app/components/shared/types/routes.ts (2)

7-7:

Details

❓ Verification inconclusive

Route path format has been updated - verify route implementation

The PROJECT route path has been changed to include -contributors suffix. This appears to be part of a broader refactoring to standardize routes related to contributor views.


🏁 Script executed:

#!/bin/bash
# Check if there are any hardcoded references to the old route format that might break
rg -t ts -t vue "'project-slug'" --no-filename

Length of output: 82


Action Required: Verify Correct File Search for Route References

The change to use 'project-slug-contributors' for the PROJECT route in frontend/app/components/shared/types/routes.ts appears to be intentional as part of the refactoring. However, the test command used to detect possible hardcoded references to the old format ('project-slug') failed because ripgrep did not recognize the vue file type.

  • Instead of using -t vue, re-run the check using an explicit glob pattern, e.g.:
    rg "project-slug" --glob "*.ts" --glob "*.vue"
    This will correctly target both TypeScript and Vue files.
  • Please verify manually that no occurrences of the old route format remain in the codebase.

12-12:

Details

❓ Verification inconclusive

Route path format has been updated - ensure consistent URL patterns

The REPOSITORY route path now includes -contributors suffix, similar to the updated PROJECT route. This creates a consistent pattern for contributor-related views.


🏁 Script executed:

#!/bin/bash
# Check if any components are still using the old repository route format
rg -t ts -t vue "'project-slug-repository-name'" --no-filename

Length of output: 98


Route Path Update Verified – Please Confirm No Legacy References

The REPOSITORY constant in frontend/app/components/shared/types/routes.ts now properly appends the -contributors suffix, aligning with the updated URL pattern for contributor views. However, the original verification command produced an error due to the unrecognized file type "vue". To ensure full coverage, please verify using a more general search (for example, rg "project-slug-repository-name" --no-filename) to confirm that no legacy references (i.e., those missing the -contributors suffix) remain in the codebase.

frontend/app/components/shared/layout/search/search-result.vue (1)

29-29: Verify external link behavior for repository routes

The :external attribute is now conditionally set based on whether the current route name includes 'repository'. This might change how links are opened (potentially in a new tab/window) when the user is viewing a repository-related page.

Make sure this change aligns with the intended user experience. Typically, links within the same application don't need to be external unless they're directing to a completely different part of the application or a third-party site.

frontend/app/components/modules/project/components/shared/header/repository-switch.vue (5)

75-82: Migrated to Pinia store for repository data management

The component now uses the Pinia store to access project repositories instead of directly using props. This is a good architectural improvement for centralized state management.

Using Pinia for state management is a positive change that should improve reusability and maintainability across components.


102-103: Added explicit type annotation to computed property

The result computed property now includes a specific type annotation ProjectRepository[], which improves type safety and code documentation.

Using explicit type annotations for computed properties is a good practice that enhances code maintainability and helps prevent type-related bugs.


45-51: Potential mismatch between key and selected property

While the :key is now using repository.repo, the :selected prop still uses props.repo === repository.name. This inconsistency could lead to unexpected behavior.

Ensure that the comparison in :selected="props.repo === repository.name" is using the correct property that matches what's being passed in the props. If repository.repo is now the primary identifier, consider updating the selection logic accordingly.


100-103:

Details

❓ Verification inconclusive

Repository data source changed to store

The component now retrieves repositories from the Pinia store rather than from props. This enhances the separation of concerns and allows multiple components to share the same state.


🏁 Script executed:

#!/bin/bash
# Check how projectRepos is defined in the store
rg -t ts "projectRepos\s*=" --include="*project.store.ts" -A 5

Length of output: 506


Repository data now fetched from Pinia store – please verify setup

  • The component now uses the Pinia store (via projectRepos) instead of props, which is in line with our separation of concerns strategy.
  • The filtering logic in the computed property (lines 100–103 in frontend/app/components/modules/project/components/shared/header/repository-switch.vue) appears correct.
  • Action Required: Please ensure that projectRepos is properly defined in the store (likely within a file matching *project.store.ts). The previous verification command using rg did not return output due to incorrect flag usage. A re-verification with a corrected command (e.g., using the -g flag) or manual inspection is recommended.

44-44:

Details

✅ Verification successful

Key attribute changed from 'name' to 'repo' property

The :key binding for the repository list items has been changed from repository.name to repository.repo. This is good if repo is a more stable/unique identifier than name.


🏁 Script executed:

#!/bin/bash
# Check that the ProjectRepository type includes a 'repo' property
rg -t ts "interface\s+ProjectRepository" -A 15

Length of output: 2394


Key attribute change verified

The change to use repository.repo as the key is appropriate given the current definition of ProjectRepository. Both the type verification and existing code confirm that the repo property exists and can serve as a unique, stable identifier. No further modifications seem necessary.

Signed-off-by: Gašper Grom <gasper.grom@gmail.com>
@gaspergrom gaspergrom requested review from emlimlf and removed request for epipav March 5, 2025 10:41
Copy link
Copy Markdown
Contributor

@borfast borfast left a comment

Choose a reason for hiding this comment

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

👍

@gaspergrom gaspergrom merged commit 233c3f5 into main Mar 5, 2025
2 checks passed
@gaspergrom gaspergrom deleted the improvement/project-endpoints branch March 5, 2025 10:54
@coderabbitai coderabbitai bot mentioned this pull request Apr 9, 2025
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