Skip to content

Conversation

rudransh-shrivastava
Copy link
Collaborator

Resolves #1431

Copy link
Contributor

coderabbitai bot commented Jul 22, 2025

Summary by CodeRabbit

  • New Features

    • Introduced a dedicated leaders list block on chapter and project details pages, displaying leader profiles with user information and profile navigation.
    • Added a new component for rendering leaders, improving clarity and consistency across the site.
  • Bug Fixes

    • Simplified and unified the way leaders are displayed, reducing redundant data fetching and potential inconsistencies.
  • Tests

    • Added new end-to-end and unit tests to verify the presence and correct rendering of the leaders list block and user interaction.
  • Chores

    • Updated mock data to include leader login information for improved test coverage.

Walkthrough

This change refactors the display of leaders across the application. The leader presentation logic is extracted into a new reusable LeadersListBlock component. This component is now used on both the About page and project details pages. Supporting types and GraphQL queries are updated to provide the necessary leader login data.

Changes

Cohort / File(s) Change Summary
About and Details Pages
frontend/src/app/about/page.tsx, frontend/src/app/projects/[projectKey]/page.tsx, frontend/src/app/chapters/[chapterKey]/page.tsx
Removed inline leader rendering in About page; added leadersLogins prop to DetailsCard usage in project and chapter pages.
DetailsCard Component
frontend/src/components/CardDetailsPage.tsx
Extended DetailsCard to accept leadersLogins prop and render LeadersListBlock above contributors list.
LeadersListBlock Component
frontend/src/components/LeadersListBlock.tsx
Added new reusable component to display leaders list with data fetching, loading, error handling, and navigation.
GraphQL Queries
frontend/src/server/queries/projectQueries.ts, frontend/src/server/queries/chapterQueries.ts
Added leadersLogins field to GET_PROJECT_DATA and GET_CHAPTER_DATA GraphQL queries.
Type Definitions
frontend/src/types/card.ts, frontend/src/types/project.ts, frontend/src/types/chapter.ts, frontend/src/types/leaders.ts
Added leadersLogins property to relevant types and defined new LeadersListBlockProps type alias.
Backend Resolver
backend/apps/owasp/api/internal/nodes/common.py
Added leaders_logins resolver method to GenericEntityNode returning leader login strings.
Tests and Mock Data
frontend/__tests__/e2e/pages/ChapterDetails.spec.ts, frontend/__tests__/e2e/pages/ProjectDetails.spec.ts, frontend/__tests__/unit/components/LeadersListBlock.test.tsx, frontend/__tests__/unit/data/mockChapterDetailsData.ts, frontend/__tests__/unit/data/mockProjectDetailsData.ts
Added e2e tests for leaders list presence, unit tests for LeadersListBlock functionality, and updated mock data with leader logins.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Complexity label: Moderate
Rationale: The review involves a new reusable component, updates to data flow from backend to frontend, and type/interface changes across several files. The logic is straightforward but touches multiple layers (backend, GraphQL, frontend, and types).

Assessment against linked issues

Objective Addressed Explanation
Extract leader display code into a reusable component and reuse on About page (#1431)
Add Leaders block on chapters and projects details pages above Top Contributors (#1431)

Assessment against linked issues: Out-of-scope changes

No out-of-scope or unrelated code changes detected.

Suggested reviewers

  • kasya
  • arkid15r

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between a0edae1 and 734be3f.

📒 Files selected for processing (1)
  • frontend/src/types/card.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/src/types/card.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Run frontend e2e tests
  • GitHub Check: Run backend tests
  • GitHub Check: Run frontend unit tests
  • GitHub Check: CodeQL (javascript-typescript)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

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

Support

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

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

CodeRabbit Commands (Invoked using PR comments)

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

Other keywords and placeholders

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

Documentation and Community

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 22231d4 and b40862a.

📒 Files selected for processing (9)
  • backend/apps/owasp/graphql/nodes/common.py (1 hunks)
  • frontend/src/app/about/page.tsx (2 hunks)
  • frontend/src/app/projects/[projectKey]/page.tsx (1 hunks)
  • frontend/src/components/CardDetailsPage.tsx (4 hunks)
  • frontend/src/components/LeadersListBlock.tsx (1 hunks)
  • frontend/src/server/queries/projectQueries.ts (1 hunks)
  • frontend/src/types/card.ts (1 hunks)
  • frontend/src/types/leaders.ts (1 hunks)
  • frontend/src/types/project.ts (1 hunks)
🧠 Learnings (7)
frontend/src/types/card.ts (2)

Learnt from: ahmedxgouda
PR: #1633
File: frontend/src/components/HealthMetrics.tsx:30-30
Timestamp: 2025-06-20T16:12:59.256Z
Learning: In the DetailsCard component (frontend/src/components/CardDetailsPage.tsx), there's a length check before rendering HealthMetrics: healthMetricsData.length > 0. This ensures that when HealthMetrics is rendered, the data array has at least one element, making accessing data[0] safe within the HealthMetrics component.

Learnt from: ahmedxgouda
PR: #1633
File: frontend/src/components/HealthMetrics.tsx:30-30
Timestamp: 2025-06-20T16:12:59.256Z
Learning: In the DetailsCard component (frontend/src/components/CardDetailsPage.tsx), there's a safety check that ensures HealthMetrics component is only rendered when healthMetricsData exists and has at least one element: healthMetricsData && healthMetricsData.length > 0. This makes accessing data[0] safe within the HealthMetrics component.

backend/apps/owasp/graphql/nodes/common.py (2)

Learnt from: Rajgupta36
PR: #1717
File: backend/apps/mentorship/graphql/queries/module.py:39-50
Timestamp: 2025-07-11T15:57:56.648Z
Learning: In the OWASP Nest mentorship GraphQL queries, Strawberry GraphQL automatically converts between Django Module instances and ModuleNode types, so methods can return Module instances directly without manual conversion even when typed as ModuleNode.

Learnt from: Rajgupta36
PR: #1717
File: backend/apps/mentorship/graphql/mutations/program.py:166-166
Timestamp: 2025-07-13T05:55:46.436Z
Learning: In the OWASP Nest mentorship GraphQL mutations, Strawberry GraphQL automatically converts between Django Program instances and ProgramNode types, so mutations can return Program instances directly without manual conversion even when typed as ProgramNode, similar to the Module/ModuleNode pattern.

frontend/src/app/projects/[projectKey]/page.tsx (2)

Learnt from: ahmedxgouda
PR: #1633
File: frontend/src/components/HealthMetrics.tsx:30-30
Timestamp: 2025-06-20T16:12:59.256Z
Learning: In the DetailsCard component (frontend/src/components/CardDetailsPage.tsx), there's a length check before rendering HealthMetrics: healthMetricsData.length > 0. This ensures that when HealthMetrics is rendered, the data array has at least one element, making accessing data[0] safe within the HealthMetrics component.

Learnt from: ahmedxgouda
PR: #1633
File: frontend/src/components/HealthMetrics.tsx:30-30
Timestamp: 2025-06-20T16:12:59.256Z
Learning: In the DetailsCard component (frontend/src/components/CardDetailsPage.tsx), there's a safety check that ensures HealthMetrics component is only rendered when healthMetricsData exists and has at least one element: healthMetricsData && healthMetricsData.length > 0. This makes accessing data[0] safe within the HealthMetrics component.

frontend/src/types/leaders.ts (1)

Learnt from: ahmedxgouda
PR: #1714
File: frontend/src/components/ProjectTypeDashboardCard.tsx:8-12
Timestamp: 2025-07-08T17:07:50.988Z
Learning: In the OWASP/Nest project, union types for component props are not necessary when they would require creating separate type definitions. The project prefers inline prop type definitions even for props with specific string values, maintaining consistency with the single-use component prop pattern.

frontend/src/components/CardDetailsPage.tsx (2)

Learnt from: ahmedxgouda
PR: #1633
File: frontend/src/components/HealthMetrics.tsx:30-30
Timestamp: 2025-06-20T16:12:59.256Z
Learning: In the DetailsCard component (frontend/src/components/CardDetailsPage.tsx), there's a length check before rendering HealthMetrics: healthMetricsData.length > 0. This ensures that when HealthMetrics is rendered, the data array has at least one element, making accessing data[0] safe within the HealthMetrics component.

Learnt from: ahmedxgouda
PR: #1633
File: frontend/src/components/HealthMetrics.tsx:30-30
Timestamp: 2025-06-20T16:12:59.256Z
Learning: In the DetailsCard component (frontend/src/components/CardDetailsPage.tsx), there's a safety check that ensures HealthMetrics component is only rendered when healthMetricsData exists and has at least one element: healthMetricsData && healthMetricsData.length > 0. This makes accessing data[0] safe within the HealthMetrics component.

frontend/src/components/LeadersListBlock.tsx (1)

Learnt from: Rajgupta36
PR: #1717
File: frontend/src/app/mentorship/programs/page.tsx:59-61
Timestamp: 2025-07-13T11:29:25.245Z
Learning: In Next.js 13+ app router, components with the 'use client' directive run entirely on the client side and don't require window object existence checks or SSR hydration considerations. Direct access to window.location and other browser APIs is safe in client components.

frontend/src/app/about/page.tsx (3)

Learnt from: Rajgupta36
PR: #1717
File: frontend/src/app/mentorship/programs/page.tsx:59-61
Timestamp: 2025-07-13T11:29:25.245Z
Learning: In Next.js 13+ app router, components with the 'use client' directive run entirely on the client side and don't require window object existence checks or SSR hydration considerations. Direct access to window.location and other browser APIs is safe in client components.

Learnt from: Rajgupta36
PR: #1717
File: frontend/src/components/ModuleCard.tsx:53-55
Timestamp: 2025-07-13T07:31:06.511Z
Learning: In Next.js 13+ app router, useRouter from 'next/navigation' does not provide asPath or query properties. Use useParams to extract route parameters and usePathname to get the current pathname instead.

Learnt from: Rajgupta36
PR: #1717
File: frontend/src/app/mentorship/programs/page.tsx:14-14
Timestamp: 2025-07-13T11:34:31.823Z
Learning: In the Next.js frontend mentorship application, there are two distinct types for authentication-related data: ExtendedSession for useSession hook (containing accessToken and user.login properties) and UserRolesData for useUserRoles hook (containing currentUserRoles.roles array). The correct access pattern for GitHub username is (session as ExtendedSession)?.user?.login.

🧰 Additional context used
🧠 Learnings (7)
frontend/src/types/card.ts (2)

Learnt from: ahmedxgouda
PR: #1633
File: frontend/src/components/HealthMetrics.tsx:30-30
Timestamp: 2025-06-20T16:12:59.256Z
Learning: In the DetailsCard component (frontend/src/components/CardDetailsPage.tsx), there's a length check before rendering HealthMetrics: healthMetricsData.length > 0. This ensures that when HealthMetrics is rendered, the data array has at least one element, making accessing data[0] safe within the HealthMetrics component.

Learnt from: ahmedxgouda
PR: #1633
File: frontend/src/components/HealthMetrics.tsx:30-30
Timestamp: 2025-06-20T16:12:59.256Z
Learning: In the DetailsCard component (frontend/src/components/CardDetailsPage.tsx), there's a safety check that ensures HealthMetrics component is only rendered when healthMetricsData exists and has at least one element: healthMetricsData && healthMetricsData.length > 0. This makes accessing data[0] safe within the HealthMetrics component.

backend/apps/owasp/graphql/nodes/common.py (2)

Learnt from: Rajgupta36
PR: #1717
File: backend/apps/mentorship/graphql/queries/module.py:39-50
Timestamp: 2025-07-11T15:57:56.648Z
Learning: In the OWASP Nest mentorship GraphQL queries, Strawberry GraphQL automatically converts between Django Module instances and ModuleNode types, so methods can return Module instances directly without manual conversion even when typed as ModuleNode.

Learnt from: Rajgupta36
PR: #1717
File: backend/apps/mentorship/graphql/mutations/program.py:166-166
Timestamp: 2025-07-13T05:55:46.436Z
Learning: In the OWASP Nest mentorship GraphQL mutations, Strawberry GraphQL automatically converts between Django Program instances and ProgramNode types, so mutations can return Program instances directly without manual conversion even when typed as ProgramNode, similar to the Module/ModuleNode pattern.

frontend/src/app/projects/[projectKey]/page.tsx (2)

Learnt from: ahmedxgouda
PR: #1633
File: frontend/src/components/HealthMetrics.tsx:30-30
Timestamp: 2025-06-20T16:12:59.256Z
Learning: In the DetailsCard component (frontend/src/components/CardDetailsPage.tsx), there's a length check before rendering HealthMetrics: healthMetricsData.length > 0. This ensures that when HealthMetrics is rendered, the data array has at least one element, making accessing data[0] safe within the HealthMetrics component.

Learnt from: ahmedxgouda
PR: #1633
File: frontend/src/components/HealthMetrics.tsx:30-30
Timestamp: 2025-06-20T16:12:59.256Z
Learning: In the DetailsCard component (frontend/src/components/CardDetailsPage.tsx), there's a safety check that ensures HealthMetrics component is only rendered when healthMetricsData exists and has at least one element: healthMetricsData && healthMetricsData.length > 0. This makes accessing data[0] safe within the HealthMetrics component.

frontend/src/types/leaders.ts (1)

Learnt from: ahmedxgouda
PR: #1714
File: frontend/src/components/ProjectTypeDashboardCard.tsx:8-12
Timestamp: 2025-07-08T17:07:50.988Z
Learning: In the OWASP/Nest project, union types for component props are not necessary when they would require creating separate type definitions. The project prefers inline prop type definitions even for props with specific string values, maintaining consistency with the single-use component prop pattern.

frontend/src/components/CardDetailsPage.tsx (2)

Learnt from: ahmedxgouda
PR: #1633
File: frontend/src/components/HealthMetrics.tsx:30-30
Timestamp: 2025-06-20T16:12:59.256Z
Learning: In the DetailsCard component (frontend/src/components/CardDetailsPage.tsx), there's a length check before rendering HealthMetrics: healthMetricsData.length > 0. This ensures that when HealthMetrics is rendered, the data array has at least one element, making accessing data[0] safe within the HealthMetrics component.

Learnt from: ahmedxgouda
PR: #1633
File: frontend/src/components/HealthMetrics.tsx:30-30
Timestamp: 2025-06-20T16:12:59.256Z
Learning: In the DetailsCard component (frontend/src/components/CardDetailsPage.tsx), there's a safety check that ensures HealthMetrics component is only rendered when healthMetricsData exists and has at least one element: healthMetricsData && healthMetricsData.length > 0. This makes accessing data[0] safe within the HealthMetrics component.

frontend/src/components/LeadersListBlock.tsx (1)

Learnt from: Rajgupta36
PR: #1717
File: frontend/src/app/mentorship/programs/page.tsx:59-61
Timestamp: 2025-07-13T11:29:25.245Z
Learning: In Next.js 13+ app router, components with the 'use client' directive run entirely on the client side and don't require window object existence checks or SSR hydration considerations. Direct access to window.location and other browser APIs is safe in client components.

frontend/src/app/about/page.tsx (3)

Learnt from: Rajgupta36
PR: #1717
File: frontend/src/app/mentorship/programs/page.tsx:59-61
Timestamp: 2025-07-13T11:29:25.245Z
Learning: In Next.js 13+ app router, components with the 'use client' directive run entirely on the client side and don't require window object existence checks or SSR hydration considerations. Direct access to window.location and other browser APIs is safe in client components.

Learnt from: Rajgupta36
PR: #1717
File: frontend/src/components/ModuleCard.tsx:53-55
Timestamp: 2025-07-13T07:31:06.511Z
Learning: In Next.js 13+ app router, useRouter from 'next/navigation' does not provide asPath or query properties. Use useParams to extract route parameters and usePathname to get the current pathname instead.

Learnt from: Rajgupta36
PR: #1717
File: frontend/src/app/mentorship/programs/page.tsx:14-14
Timestamp: 2025-07-13T11:34:31.823Z
Learning: In the Next.js frontend mentorship application, there are two distinct types for authentication-related data: ExtendedSession for useSession hook (containing accessToken and user.login properties) and UserRolesData for useUserRoles hook (containing currentUserRoles.roles array). The correct access pattern for GitHub username is (session as ExtendedSession)?.user?.login.

🔇 Additional comments (16)
backend/apps/owasp/graphql/nodes/common.py (2)

15-15: Consider consistency between data sources for leaders.

The new leaders_logins method uses self.leaders.all() while the existing leaders method uses self.idx_leaders. Ensure this difference in data sources is intentional and that both provide consistent leader information.


12-15: leaders_logins resolver: login attribute confirmed
The login field is defined on all leader models in backend/apps/github/models/common.py, so each object returned by self.leaders.all() will always have a .login. No additional error handling for missing login is necessary.

frontend/src/types/card.ts (1)

56-56: LGTM - Type definition is correct and consistent.

The addition of the optional leadersLogins property with string[] type aligns perfectly with the backend GraphQL resolver and maintains backward compatibility.

frontend/src/app/projects/[projectKey]/page.tsx (1)

106-106: ✅ GraphQL query includes leadersLogins

I’ve verified that GET_PROJECT_DATA in server/queries/projectQueries.ts includes the leadersLogins field, so project.leadersLogins will be populated correctly. No further action required.

frontend/src/types/leaders.ts (1)

5-8: Ensure mapping from leadersLogins array to LeadersListBlockProps

I wasn’t able to find where the backend’s leadersLogins: string[] is transformed into the Record<string, string> that LeadersListBlock expects. Please verify that:

  • In the data-loading layer (page/component or hook that fetches leadersLogins), you convert the array into an object mapping each username to its certification string.
  • The parent component always passes a correctly shaped leaders: LeadersListBlockProps into LeadersListBlock.
frontend/src/server/queries/projectQueries.ts (1)

13-13: LGTM! Clean addition of leadersLogins field.

The new leadersLogins field is appropriately placed in the GraphQL query and aligns with the backend changes to support the enhanced leaders presentation.

frontend/src/components/CardDetailsPage.tsx (3)

14-14: LGTM! Clean imports for the new LeadersListBlock functionality.

The imports are correctly added to support the new leaders presentation feature.

Also applies to: 23-23


54-54: LGTM! Optional prop maintains backward compatibility.

The leadersLogins prop is correctly typed as optional, ensuring existing usage of DetailsCard continues to work.


203-211: LGTM! Clean conditional rendering with proper data transformation.

The conditional rendering follows the existing pattern in the component, and the reduce function correctly transforms the leadersLogins array into the expected object structure for the LeadersListBlock component.

frontend/src/app/about/page.tsx (2)

26-26: LGTM! Clean import for the reusable LeadersListBlock component.

The import supports the refactoring to centralize leader display logic.


111-113: LGTM! Excellent refactoring to use the reusable LeadersListBlock.

This change simplifies the code by removing the inline LeaderData component logic and consolidating it into the reusable LeadersListBlock component. The props are correctly passed and the conditional rendering pattern is maintained.

frontend/src/components/LeadersListBlock.tsx (5)

1-12: LGTM! Clean imports and proper client-side directive.

All necessary imports are included and the 'use client' directive is correctly placed for this interactive component.


13-21: LGTM! Well-defined component interface with proper typing.

The component props are clearly typed with appropriate defaults. The optional icon and label parameters provide good flexibility.


22-56: LGTM! Robust LeaderData component with proper error handling.

The nested LeaderData component correctly handles:

  • Loading states with user-friendly messages
  • Error states with descriptive feedback
  • Missing data scenarios
  • Proper navigation using Next.js router
  • Clean UserCard integration

The implementation follows React best practices and provides a good user experience.


58-69: LGTM! Clean responsive layout and component structure.

The SecondaryCard wrapper with AnchorTitle provides consistent styling, and the responsive flexbox layout (column on mobile, row on desktop) ensures good user experience across devices.


51-51: Leader Username Mapping Verified

The leaders object in frontend/src/app/about/page.tsx defines keys arkid15r, kasya, and mamicidal, which correspond exactly to the user.login values used in LeadersListBlock.tsx (line 51). No mismatches were found—no further changes needed.

@rudransh-shrivastava
Copy link
Collaborator Author

almost done with the PR, just need to add tests and fix some sonar issues.

@rudransh-shrivastava
Copy link
Collaborator Author

adding tests.

@rudransh-shrivastava rudransh-shrivastava marked this pull request as ready for review July 25, 2025 04:36
@rudransh-shrivastava
Copy link
Collaborator Author

rudransh-shrivastava commented Jul 25, 2025

I kept the UI Layout exactly the same as stated in the parent issue. However I think I can improve this by changing the Button width from w-40 to w-42

2025-July-25-10;10

@kasya
Copy link
Collaborator

kasya commented Jul 26, 2025

@rudransh-shrivastava of course! Feel free to update the width to accommodate longer titles/names.

@strawberry.field
def leaders_logins(self) -> list[str]:
"""Resolve leaders logins."""
return [leader.login for leader in self.leaders.all()]
Copy link
Collaborator

@kasya kasya Jul 26, 2025

Choose a reason for hiding this comment

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

@rudransh-shrivastava were you able to see any Leaders data on the frontend? Checking this, and I don't think this resolver returns anything - it's just an empty list all the time. And that's because there's no self.leaders.all()

Copy link
Collaborator

@kasya kasya Jul 26, 2025

Choose a reason for hiding this comment

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

Also, feel free to use http://localhost:8000/graphql/ to see data that is returned by graphQL request while working on updating queries - this is super helpful!
Screenshot 2025-07-25 at 6 42 18 PM

Copy link
Collaborator Author

@rudransh-shrivastava rudransh-shrivastava Jul 26, 2025

Choose a reason for hiding this comment

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

Yes @kasya , you're right that there are no leaders.
There are two fields in the OWASP database model

  1. leaders_raw
  2. leaders

since leaders maps to github.User, I was using this field to access leader's logins/usernames.
The leaders_raw field is a list of strings like ["Rudransh Shrivastava"].

leaders for projects or chapters do not have any data in the database -- but for leaders_raw there is.

If i take a random project for example:
This is the leaders_raw field.
image

This is the leaders field - which is empty.
image

I'm not sure why leaders is empty. Initially I assumed it was an issue locally. I was able to set leaders manually and test out things.

@rudransh-shrivastava rudransh-shrivastava force-pushed the feature/improve-leaders-presentation branch from ae244d5 to a561310 Compare July 31, 2025 09:32
@rudransh-shrivastava rudransh-shrivastava force-pushed the feature/improve-leaders-presentation branch from a561310 to a0edae1 Compare July 31, 2025 09:36
Copy link

sonarqubecloud bot commented Aug 2, 2025

@kasya
Copy link
Collaborator

kasya commented Aug 30, 2025

Hey @rudransh-shrivastava ! Thank you for working on this!
I know this PR has been sitting here for some time, and that's because it relies on some changes we need to implement first. Sorry we did not consider this initially.

I think we should move it to DRAFT state until it's ready to get back to. 👌🏼

@kasya kasya marked this pull request as draft August 30, 2025 23:13
@rudransh-shrivastava
Copy link
Collaborator Author

Hey, that's okay, please let me know when the changes are done, I'll work on this again and fix things that may have broken

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Impove chapter/project leaders presentation
2 participants